• Hi,

    It's really good news that the other remote control works... The 433Mhz frequency is a bit of a free-for-all. Anyone can transmit whatever they want to, so there's no guarantee that the existing code will work with another model of mains socket.

    By the way, I updated the tutorial with a bit more info about how the receiver works.

    For your weather station, it looks like there are at least 3 different versions of the protocol, from 1.0 to 3.0 - and it would be much easier if we knew which one the station uses. There's a table in the PDF you gave but it doesn't list the THR188. Does the receiver or transmitter have a different model number that might be in the table, or does it say in the manual?

    The main difference between the remote controls on the website and your weather station is that your weather station uses Manchester Coding whereas the remote controls use a binary pulse width modulation (I'm not sure what the correct name is).

    Basically you can't easily just send the raw data wirelessly, because if you sent a lot of '0's, there would be a big gap with no radio signal and interference might get picked up. So you need a way to make sure that there is always going to be a pulse every so often - which leaves you two main ways to encode data:

    • Manchester coding : A 0 is represented by a transition from 0 to 1, and a 1 is represented by a transition from 1 to 0
    • Pulse width modulation: A 0 is represented by a short pulse, and a 1 is represented by a long pulse.

    I don't believe Pulse width modulation is as efficient, but (at least for me!) it seems easier to decode.

    The other difference is inn the speed of transmission, which might be the reason you're not getting any data at all (even garbage). You could try the following decoder functions instead which has different numbers, and could see which works:

    // Protocol 1.0
    function sigOff(e) {
      var d = e.time-t;
      t = e.time;
      if (d>0.001 && d<0.004)
        n = (n<<1) | ((d>=0.0025)?1:0);
      else
        n=0;
    }
    
    // Protocol 2.1 and 3.0 
    function sigOff(e) {
      var d = e.time-t;
      t = e.time;
      if (d>0.0002 && d<0.0011)
        n = (n<<1) | ((d>=0.00085)?1:0);
      else
        n=0;
    }
    

    But it's not guaranteed...

    It'd help if you could force the weather station to transmit. Is there a button, or does taking out the battery and putting it back in force it?

    So I think the next step is to find out what protocol version you have... If you can't google it or find it in the manual, do you have a digital storage oscilloscope?

    If not, we can get Espruino to measure the pulse lengths, but it's tricky as there will almost certainly be loads of interference that will get in the way.

About

Avatar for Gordon @Gordon started