RFLink and Node-Red

RFLink Board and MegaA couple of weeks ago I went to stay with my pal Jonathan and he had some Byron doorbell pushes to play with.

This article updated 22/03/2017

He showed me a universal RF 433Mhz receiver board he purchased which could look at the signals from the various kids of 433Mhz standard transmitting units.

This was interesting as I have an Acurite weather station with the most appalling interface which requires a PC to be on constantly in order to remotely access the information.

I don’t know what planet the designers were on – but it was a gift from my wife, solar powered and including rain level, wind speed and direction etc.. a nice job other than the software. It has been sitting outside the wall on my office for months doing nothing.  I thought it might be interesting to get that going.

RFLink

The unit my friend was using was rather expensive but he suggested I try the RFLink software along with a DIY unit comprising an Arduino Mega2560, a little board called an RFLink V1.1.4 (now updated) and an antenna – you see the lot here.

tmpC75DThe kit arrived days ago and I put it together with a soldering iron easily enough but had to wait for a Mega board to arrive which it did this week. I downloaded the software – very simply install program for the PC – couple of button presses really – and that was that. I plugged the little RF board into the MEGA, plugged the Mega into my PC and… out of the blue, information from my Acurite board appeared out of no-where, as did  more one-liners from my Byron button presses and even our doorbell. It took no time at all with help from a fellow enthusiast who’s used this stuff before to figure out how to send a signal back to the doorbell to make it work.

All very nice but I needed this into Node-Red.

I took my latest Raspberry Pi using DietPi and after adjusting comms permissions, simply plugged the USB device into the Pi and set up a serial node for both transmit and receive.

From there on it was easy. Far from complete - but thought you might be interested – the combination of the two boards and that software seems to work really well up to now for receiving from 433Mhz sensors and for sending out commands to 433Mhz boards.

I had a slight concern about how long you have to leave the Byron SX35 pushbuttons before pressing again (3 seconds). But I  mentioned this to the author and within an hour he came back with an update which made the delay much more practical.

Valid input instructions from the various sensors is in this link along with the Arduino software download….

http://www.nemcon.nl/blog2/protref

I bought a bog-standard Arduino 2560 (cheap Chinese version)

I bought this board… the RFLink 433 kit – requires a little soldering…

https://www.nodo-shop.nl/en/21-rflink-gateway

10 minute soldering (take note of version numbers – important), 10 minutes max to blow the software. Test the board (56k baud) to ensure when nearby sensors are sending results – they are coming in and then I wrote this test… it isn’t very elegant yet.

My SERIAL node is set to split input on character “\n” so the code has to get rid of return characters as you’ll see in the “replace” line below. Note also that when you send out serial (to actually control something) it should be followed by both “\r\n”.

RF433

// So firstly a generic means of getting incoming items into an object

var the433 = {};
msg.payload = msg.payload.replace(/(\r\n|\n|\r)/gm,"");
node.warn(msg.payload);
var parts433 = msg.payload.split(";");

the433.p1 = parts433[0];
the433.p2 = parts433[1];
the433.name = parts433[2];

var a = 3;
while (a < parts433.length) {
    var bits433 = parts433[a].split("=");
    switch (bits433[0]) {
        case "ID": the433.id = bits433[1]; break;
        case "SWITCH": the433.switch = bits433[1]; break;
        case "CMD": the433.cmd = bits433[1]; break;
        case "SET_LEVEL": the433.set_level = parseInt(bits433[1], 10); break;
        case "TEMP": the433.temp = parseInt(bits433[1], 16) / 10; break;
        case "HUM": the433.hum = parseInt(bits433[1], 10); break;
        case "BARO": the433.baro = parseInt(bits433[1], 16); break;
        case "HSTATUS": the433.hstatus = parseInt(bits433[1], 10); break;
        case "BFORECAST": the433.bforecast = parseInt(bits433[1], 10); break;
        case "UV": the433.uv = parseInt(bits433[1], 16); break;
        case "LUX": the433.lux = parseInt(bits433[1], 16); break;
        case "BAT": the433.bat = bits433[1]; break;
        case "RAIN": the433.rain = parseInt(bits433[1], 16) / 10; break;
        case "RAIN": the433.rainrate = parseInt(bits433[1], 16) / 10; break;
        case "WINSP": the433.winsp = parseInt(bits433[1], 16) / 10; break;
        case "AWINSP": the433.awinsp = parseInt(bits433[1], 16) / 10; break;
        case "WINGS": the433.wings = parseInt(bits433[1], 16); break;
        case "WINDIR": the433.windir = parseInt(bits433[1], 10); break;
        case "WINCHL": the433.winchl = parseInt(bits433[1], 16); break;
        case "WINTMP": the433.wintmp = parseInt(bits433[1], 16); break;
        case "CHIME": the433.chime = parseInt(bits433[1], 10); break;
        case "SMOKEALERT": the433.smokealert = bits433[1]; break;
        case "PIR": the433.pir = bits433[1]; break;
        case "CO2": the433.co2 = parseInt(bits433[1], 10); break;
        case "SOUND": the433.sound = parseInt(bits433[1], 10); break;
        case "KWATT": the433.kwatt = parseInt(bits433[1], 16); break;
        case "WATT": the433.watt = parseInt(bits433[1], 16); break;
        case "CURRENT": the433.current = parseInt(bits433[1], 10); break;
        case "CURRENT2": the433.current2 = parseInt(bits433[1], 10); break;
        case "CURRENT3": the433.current3 = parseInt(bits433[1], 10); break;
        case "DIST": the433.dist = parseInt(bits433[1], 10); break;
        case "METER": the433.meter = parseInt(bits433[1], 10); break;
        case "VOLT": the433.volt = parseInt(bits433[1], 10); break;
        case "RGBW": the433.rgbc = parseInt(bits433[1].substring(0, 2), 16);
            the433.rgbw = parseInt(bits433[1].substring(2, 4), 16); break;
    }
    a++;
}

// SO - the above is general... here is my specific setup for temporarily displaying
// the Acurite info
if ((the433.p1 == "20") && (the433.name == "Acurite") && (the433.id == "c826")) {
    if (typeof the433.temp !== 'undefined') temp = the433.temp;
    if (typeof the433.hum !== 'undefined') hum = the433.hum;
    if (typeof the433.bat !== 'undefined') bat = the433.bat;
    if (typeof the433.rain !== 'undefined') rain = the433.rain;
    if (typeof the433.winsp !== 'undefined') winsp = the433.winsp;
    if (typeof the433.windir !== 'undefined') windir = the433.windir;

    node.warn("Temperature: " + temp + "c");
    node.warn("Humidity: " + hum + "%");
    node.warn("Battery: " + bat);
    node.warn("Rain: " + rain + "mm");
    node.warn("Wind Speed: " + winsp + "km/h");
    node.warn("Wind Dir: " + (windir * 22.5) + " degrees");
}

Put that in a Node-Red template – attach a Node-Red serial Node set to take serial input from USB0 at 56k – character /r as a separator and deliver ascii strings…and that – is just the beginning…  note also that the designer of this free software has also added GPIO control both input and output – on several pins (recently expanded so check his docs).

Tests: Right now for my tests  - I have the K10000 phone acting as a server running Debian and running Tasker and the MQTT client Tasker plugin with the same phone running as a resource…. and I can now fire an MQTT message at the latter to get a doorbell message out! Meanwhile a Raspberry Pi is running that RFLink unit and when one of the Byron doorbell pushes is pressed – a message is sent out to the phone to play the doorbell – yes, I know, somewhat over the top – but I’m just experimenting for now… and sure enough – press the button and pretty much in real time the doorbell sound appears.

433Mhz to MQTT GatewayIn the comments below you’ll see reference to an ESP8266 to MQTT Gateway – and this would be ideal as it would be all in one little box – whereas I need to stick something like a Pi on the end to generate a wireless MQTT signal…. so – I grabbed the software and (disregarding several wasted hours due to a duff FTDI) put together one of these – as you’ll see in the photo on the right-  the antenna is due to kind feedback below – and as you can see, it is a precision job (it is accurate however).

Well, I have a 4-way remote control for a cheap Chinese remote and indeed this little system does pick it up and sends a unique number for each key off as MQTT – lovely – however – even with a decent little aerial the unit does not pick up (or recognise) my weather station of any of my BYRON pushbuttons – and the data coming back is crude compared to the RFLink software so at first glance, not impressed.

Costs:  Ok of course the hardware for the little ESP board is DIRT CHEAP compared to what I’ve put together – which in turn is cheap compared to one of these all in one boxes – but you pay your money – I’m sticking with https://www.nodo-shop.nl/en/21-rflink-gateway – at under £20 plus £9 for the aerial plus a Mega2560 (cheap from China) I think it is worth it (no I don’t know the company and no I didn’t get samples etc).

The transceiver they supplied costs  £16.51 on Ebay so the board with connectors and the transceiver really is a good deal.  You can of course use cheaper receivers – but the software writer suggests these might be naff. I’d like to hear back from someone who had had GOOD results just using the Mega board (they’re only a fiver from China) and other boards. There is information here on that subject. RXB6 board seems cheap but don’t buy from the UK as they seem to be a rip here – on guy wants nearly £8 inc postage – China for same board – under £2 all in. I’m kind of stuck for testing one of these as I’m off to Spain in a few weeks and chances are it won’t get to the UK in time for me leaving!! Shame as I’d like to have given one a shot on my spare MEGA board.

Summary: Already the RFLINK setup has made my day by turning my otherwise useless weather station into another working part of my home control – and I’ll soon have buttons all over the place. It also has good range though I think aerial design and positioning could be improved.  I can’t do a range comparison with the ESP project as it only recognises one my my 433Mhz devices and even then gives out a number, no proper ID and name… still – worth keeping an eye on for future developments.


If you like this post – please share a link to it by social media, by email with friends or on your website.
More readers means more feedback means more answers for all of us. Thank you!

Facebooktwittergoogle_pluspinterestlinkedin

97 thoughts on “RFLink and Node-Red

  1. Hey Pete - Seems your posts are always bang on timing for me. Im awaiting my RFLink board I ordered a month ago to arrive to hopefully control my rollerblind motors.
    Id be interested to see how you progress further with this and especially how you can send commands ( "ring your doorbell" ).

    1. Hah, excellent to hear my intuition is working Greg.

      Commands.. well, I've only just touched that... doorbell: once I could see an incoming command from the door push, the solution was little more than changing the incoming 20 to 10..

      So when pressing the REAL doorpush - this was coming in.

      20;78;TriState;ID=828205;SWITCH=10;CMD=OFF;

      Thanks to some feedback from a friend I sent this - change the start and miss off the titles...

      10;TriState;828205;10;OFF;

      Send that out in my case - and the doorbell rings!

  2. Opportune for me too Pete - You must be psychic!

    A while ago I bought some 433MHz RF mains switches from ALDI that the wife LIKES and USES. I've been looking for a way to control them with Node-Red and here's the answer - cheers.

    1. I just noted an issue whereby Byron doorbell pushes would take some reset time before you could re-press the button. I asked Frank Zirrone (the RF433 software for Arduino) about it and he suggested that an improvement could be made. Within half an our an upgrade was made available which did the trick!

  3. I've been using a cheap DVB tv usb dongle with RTL-SDR and RTL-433 software to receive my La Crosse and Acurite weather station and effergy power usage into node-red. It is receive only but at 15 to 20 USD it's cheap.

        1. I like these SDR dongles. I have one here exactly like the one you've linked to that I used to sniff the 433Mhz signals sent from my RF thermostat to my combi-boiler.

          Armed with this captured waveform I was able to reverse engineer and re-implement this weird proprietary protocol in C++ code to get control of my boiler via an ESP12F and a 433Mhz transmitter. Voila - one node-red internet enabled heating system 😉

        2. Thanks for the rtl_433 link, Paul. You've killed two birds with one stone for me.
          I bought one of those black, generic dongles from Fbay a while back, hoping to use it for ADS-B logging (aircraft flight data), but the advertisement was bogus and what was sold as an "R820T" tuner-equipped dongle actually came with a 0012 tuner chip, which doesn't even cover the 1090Mhz ADS-B band. It got thrown straight into the junk drawer, as I had no other use for it.
          It took me about ten minutes after seeing your post to retrieve it, compile rtl_433 and have it successfully publishing the data from my Oregon Scientific weather station sensors to MQTT.
          Winner! 🙂

        3. Nice! I'm able to see one set of my LaCrosse sensors (the weather station). It doesn't see the other but I may need to find out if those are 433MHz or something else.

        4. Am I right in thinking, that using the SDR dongle from Walmart and the RTL_433 software, I can make use of the Acurite sensor I found on the roof of my house?

          1. Yes Brent that should work fine. Depending on how long its been on the roof the sensor might need a new set of batteries.

    1. I just installed the above OpenMQTTGateway software on to a wemos mini board - works well for 433 and for IR. Isn't reading my 433mhz doorbell however since it appears to have some strange encoding which is a little frustrating. (made by Oneby1)

    2. Totally unaware - I would never again go down the route of using Arduinos and those awful Ethernet boards - however - IF the ESP8266 version works RELIABLY - then I think you may have come across an absolute winner because the 433Mhz boards are dirt cheap. It just so happens that I have the right receiver - the right transmitter AND an ESP8266 handy....

    3. I'm not ignoring you - it has taken me this long to get my Arduino environment working and compiling the code which is now happily sitting on an ESP8266. I have the relevant receiver module - which has all of a HOLE in the corner- any idea what the exact length of wire is for the aerial - and what the next step would be - just take the connector off a normal 433 aerial and solder the lead onto the board? I'm not an aerial whizz...

    1. When you say the only thing not supported...

      Let me relate my first experience. I have attached ONLY the 433 receiver (0, signal, 5v) - I saw somewhere that if you don't connect the IR it just does radio which is what I want - - did I need to put a pullup for IR if not used?

      The reason I say that is starting up is a bit IFFY - sometimes it reboots or has trouble starting - sometimes I get a lot of info in a big package then it says something about STACK....

      When it DOES connect to my MQTT - I can take the little handset I have with 4 buttons and it picks it up no problem - but it does absolutely NOTHING with the BYRON SX35 doorbell pushes (which I know work as they work with the software which is the subject of my article.

      Nope - not having the Byron at all... Ideas?

      Anyone know what I'm doing wrong here? Clearly transmitters don't need fitting to test.

      1. What i mean is that that all the stuff i have on 433 except receiving klikaan klikuit new model is working .it is using the rc-switch library and you don't need a pull up if you are not using the ir.
        I am using the setup for 433 only and don't have issues with the stability .
        I am using the wemos d1 mini just as peter balwin and that is stable. Maybe you will find some clues in the home assistant forum where all the extra stuff is meantioned that is working.

        1. i read somewhere in some teardown that the wemos d1 mini has a better LDO 3v3 voltage regulator than other boards (which use some kind of LD1117V33), and seen many that takes similar LDO to replace the ones on nodemcu and other boards... seems more stable, if i find the original blog post i'll put a link...

  4. A bit off topic but since your on the topic of doorbells I have been working on making my bog standard 9V battery powered ding-dong doorbell a simple IOT doorbell using your excellent home control code. With a new baby in the house and a bunch of unsolicited sales calls to the door that wake the baby in the middle of vital nap time it was time for this project to be actioned.

    Doorbell push switch feeds into a wemos relay NC input. Relay can be toggled via GPIO4 to disable bell output via smartphone. Switch state is monitored with a optoisolator on GPIO14 and this allows triggering an alternative and less disturbing sound output to a piezo for a shorter beep-beep as well as sending an email or maybe also feeding into a database (future work). Green/Red LED indicator on front panel shows bell enable/disable state.
    Since GPIO2 is free I hooked up a DS18b20 to measure temperature in the hall (sure why not).
    Thanks a million for the excellent code Pete. I still need to optimise the node-red flows and also figure out how to add in a time delay that automatically re-enables the bell after say a naptime of 2 hours. It has been very educational learning about this and putting it all together.

  5. Right I'm back at my keyboard... thanks for all the feedback yesterday guys - clearly this is a topic of interest as I had over 2,200 visitors to the blog yesterday, somewhat higher than normal. Hoping to get some clarity on that cheap ESP8266 solution - as right now it is ignoring both my Accurite and Byron 433Mhz kit - which you'd think would be fairly standard stuff... be nice if such a cheap solution turned out to be ok!

  6. Thanks for the write-up Peter. I have been going round in circles trying to get the TX to work, you came up with the solution. I have been putting in the ID,SWITCH and CMD in the TX string and it didn't work.

    No-where was it documented to leave these out, only here.

    Many Thanks, I think your write-ups are brilliant.

    Cheers

    Nick

  7. Well, haven't I just wasted half the day. Someone came on to say they were having problems with my ESP code. Having had reset issues with that ESP 433Mhz code I thought I'd put that to one side and tackle my own code - well, didn't it fail miserably - time and time again it too would have reset issues.. I even went back a generation of the code - no difference - which seemed odd.

    I got so frustrated I went back to blowing the ESP 433Mhz code referred to above and... THAT was still resetting... not TWO bits of software. I dug out another FTDI and lo and behold - both packages work perfectly.

    So - now I can say with perfectly working 433-to-MQTT Gateway code - rock solid in terms of resetting etc.... that despite claims elsewhere that it has a massive base... it will neither take any notice of my Acurite weather station NOR the Byron door button units. I have a little cheap Chinese no-brand handset I have with 4 buttons - it works with that, but the results are not consistent at all. The RFLink software on the other hand is ROCK SOLID on all (strangely except my little Chinese no-brand 4-button handset).

    I would be OVERJOYED if I'm doing something wrong - but right now - there does not seem to be any remote comparison between the RFLink and the ESP software.

  8. As usual, I implement a solution and get it mostly working only to fall at the Node Red hurdle.... I can get my Mega and 433 Xmitter to receive and transmit by using the supplied windows app but in Node red I can receive but not send, did you do something special, I've tried a function to send exactly the same command as the windows app.

    msg.payload="10;Eurodomest;0f2719;00;ON;"
    return msg;

    and a trigger node sending the same but I cannot get to board to send anything, the RX LED flashes so something's being sent, am I missing something obvious?

  9. I've just updated the blog - in light of new info - and sorry to anyone who got a dead site this morning - the ISP has put the site on a newer, faster machine but this caused an unexpected outage (new IP address).

    All seems well now and it is definitely faster. Note the added comments about GPIO on the RF Link device and I understand that R47 version with added IO should be available in a few days - up to now I am well impressed by the response rates from this designer.

    1. Just to let you know Peter that as of 13:30 on 23/3/17 I am still getting page not available if I try to access your home page. I tried flushing the dns cache but no difference. I can only get to this page via a link in an email and if I hit the Home button from here I still get page not found.

  10. Mine seems to pick up Byron Signals, and others.

    Running on an Arduino Mega and tried two receivers, an RXB6, crystal controlled and a cheap XY-MK-5V chinese coil based with no crystal.

    Transmission via an FS1000A, seems to work flawlessly with temp senders and my two OWL Electric meters.

    Also controls my LightwaveRF and HomeEasy setup as well.

    20;00;Nodo RadioFrequencyLink - RFLink Gateway V1.1 - R46;
    20;01;Byron;ID=0076;SWITCH=01;CMD=ON;CHIME=01;
    20;02;OWL_CM119;ID=00A2;WATT=0314;KWATT=000920c3;
    20;03;AB400D;ID=48;SWITCH=1;CMD=ON;
    20;04;Cresta;ID=8001;RAIN=2307;BAT=OK;
    20;05;Cresta;ID=9701;WINDIR=0003;WINSP=0000;WINGS=0000;WINTMP=0098;WINCHL=0098;BAT=OK;
    20;06;NewKaku;ID=0020c8ba;SWITCH=a;CMD=ON;
    20;07;Xiron;ID=5402;TEMP=00a0;HUM=61;BAT=OK;

    20;1E;Tunex;ID=D402;TEMP=00a0;HUM=61;BAT=OK;
    20;1F;OWL_CM119;ID=00A2;WATT=0324;KWATT=00092105;
    20;20;Cresta;ID=9701;WINDIR=0003;WINSP=0000;WINGS=0000;WINTMP=0098;WINCHL=0098;BAT=OK;
    20;21;OWL_CM119;ID=00EC;WATT=0020;KWATT=000bf170;
    20;22;Xiron;ID=5402;TEMP=00a0;HUM=61;BAT=OK;

    1. Nick - when you say "mine" - are you talking about the little ESP project or the RFLINK project and if the former - do I assume this is not MQTT but via serial? More info please. It has to be said, when I tried, I used the cheap Chinese receiver they say is rubbish - I guess I'd better send off for an RXB6.

    2. Oh this just answered my question - yes, you are talking about the RFLINK - yes, Byron works a treat with that - but nice to know you've had success with the RXB6 as I have another Mega2560 board... right - I'll order one of those receivers.

      1. I actually thought the RXB6 was better as it "seemed" to have a better bandwidth and was more sensitive. However , using both, they seem to be the same.

        I have an RFX433 usb module as the main transmitter in my home automation system but thought I would try the RFLink stuff with the spare bits I have lying about.

        I would like to use the ESP's I have but not had any luck as yet, for some reason it doesnt receive anything at all so I am doing something wrong.

        Mainly me being impatient.

        1. As you'll see in the updated write-up - I wasn't impressed by the ESP version at all - which is a shame as it would be all in one little box. It would only work with ONE of my little keypads and ignored everything else. Anyway I'll program my other MEGA which I didn't think I had (does anyone make a smaller 2560 version?) and try that receiver - I have something to compare with, having the RFLINK board. I need to get an RXB6 but as I'm off to Spain on the 13th I have a choice of having it delivered there - or getting the UK version and paying 5 times as much.

          Thanks for the feedback. As you can probably see a bag of goodies has arrived for me and so I have some write-ups to do! Busy installing my script on a NanoPi M1+ which up to now looks to be WAY faster than the previous effort. More on that in the blog soon.

  11. Pete, do you think the Sonoff Basic with RF would be able to handle the decode of 433 for things like a couple of Lacrosse sensors? In addition to everything else?

      1. It appears that the Sonoff-Tasmota has some support for the RF. I've already used the software in a presentation I did last Saturday at TCF (Trenton Computer Festival). SO I'll set that up with the RF I have and see what I get. I already have a SDR decoding the LaCrosse WS so I might be able to figure it out. I might need to get an RF remote to play with (okay I want to get one ... 😉 ).

        Thanks

  12. BTW, I am not using an RFLINK Board, you don't need one. Just connect eveything up to the arduino, about 6 wires and your away, I like to do things on the cheap if I can.

  13. Here's an update for you. I took the cheap Chinese receiver (the ones you see on Ebay for £1) and put it on the Atmega. While I could of course read my Byron handset, proving the thing works - it could not get a signal from my weather station outside - a mere 8ft away - despite very carefully putting the aerial together. So it is possible that's why the ESP version does not pick up the weather station (though it definitely does not do the Byron. So really what this needs is more work with a decent radio receiver and aerial. I'll pass comment on this again when I have an RXB6 and a decent aerial so I can compare like for like.

    1. I have a Byron controller for some sockets and I have to put it within 6 inches of the antenna to get a signal from it and then it doesn't see it every time, I think I'll get a RXB6 as well.

      1. on the RFLINK version, my Byron can be 30 ft away. The pre-built units you see on the market - this is what started me off - around £85 they are - my friend has one - placed on the middle floor of a large old hour with 4 floors - the Byron works ANYWHERE within the building - that's what we should be aiming for.

  14. Peter, do you run the receiver off 3.3 or 5V ?

    I just tried my cheapy mk 5v on 3.3v and got nothing.

    I thought the ESP was not 5v tolerant, Where are you powering it from ?

    Maybe this is where I never got a signal when I tried it.!
    Maybe yours just about works to a point but the sensitivity is reduced and can only receive close signals ?

    The RXB6 can go to 3.3V so this should be better for the ESP project.

    I also have another one, a H5V4D, not even sure what that is, but it also works in my system.

    Just a thought.

    1. I got a reply from the author of the ESP project this morning...

      "Yes I understood that your bell works with RFlink seeing you first serial extract nevertheless I can't integrate it as it is not anymore open source."

      I don't understand the logic here but it seems he's not looking into decoding anything that isn't open source - which puts some severe limits on the repertoire of devices. I think at this point I'm going to concentrate on the RFLink software even though that means a separate board to get the information into MQTT.

      1. Hello,

        First thanks for talking about the OpenMQTTGateway, I saw some traffic coming from this site and I found these comments.
        Here is the explanation, currently the signals decoding is made by libraries:
        -IRremote for infrared
        -rcswitch for RF

        Both of them are open source libraries that can be integrated easily into another code like the OpenMQTTGateway code.
        If there is a need to add a protocol decoding there is several possibilities:
        -find a library that decoded already this signal and integrate it into the gateway (what we've tried to find together without success unfortunately)
        -add the protocol to rcswitch, to do this the best thing is to listen the RF signal and reverse engineer the protocol. Difficult to do and test without the device.

        You could say at this point why not adding RFlink code/library, well RFLink is not anymore opensource, you can only find some old source code of the project on the web. In consequence I'm not able to integrate is to the OpenMQTTGateway, added to that the code has to be ported to ESP8266.
        RFlink is so far the code that support most of the RF protocols.
        I made a comparison about the different gateways:
        https://1technophile.blogspot.fr/2017/01/making-your-rf-433mhz-sensors-and.html
        You can find also on the web projects with ESP8266 connected to arduino mega with rflink, to make RFlink compatible with MQTT through a wifi connection.
        https://github.com/enc-X/mqtt-rflink-bridge

        Where the OpenMQTTGateway project stand is more as a cheap, multi platform and easy to integrate alternative by the MQTT support, the compatible devices are also cheap and enable to setup an home automation system without spending 30€ for each sensor.
        https://docs.google.com/spreadsheets/d/1DdtVtSsN25nwP6BZI5q6C9yDGz37tUWjw2SQ1RGwBxU/edit

        Hope to be clear

  15. Can you not still use your NodeRed system ?

    Use the serial output from RFLink and parse the results as you would with the ESP.

    I do this with an RS485 converter, into a python script, then distribute to MQTT Server on my PI.

    Not only that, RFLink works, and there is a lot of support out there.

    Even though, the ESP's are the way to go, I have loads of 'em somewhere, Even an ESP32 lying about that I have not even wired up yet.

    1. I am using Node-Red Nick - the output from the Mega goes into Node-Red and is processed... sending commands via MQTT to Debian on the phone - which then sends commands via MQTT to Android on the phone and plays doorbells or speech or whatever I need. As soon as I figure out how to share usb serial between the Android phone and the Debian running underneath it - I'll cut out the middle man.

  16. Ok Peter, sounds confusing.
    I have a dedicated Pi B+ for my MQTT Server , USB's are available on there.
    Also a dedicated Pi3 for my home automation, PiFaces on both systems.

    I thought you was running PI's, I always assume that I use the same as everyone else.

    1. Nick - not everyone is using Raspberry Pi by any means - trust me. Up to now a few of us have been developing my script - which currently off the top of my head will install a fairly standard Node-Red setup along with SQLITE, MQTT and other tools on - Raspberrry Pi 1,2,3, Zero, Zero WIFI, Orange Pi Zero, FriendlyArm Nano Pi M1, M1+, M3, M3, T2, T3, LeGuitar, Odroid C2 and others on Raspbian, Debian, Ubuntu and even the likes of Mint on a laptop and various emulators. The only advantage the Pi usually has is support for GPIO and even then, the Orange Pi is starting to get that support, the GPIO utility works on most of the H3 boards - and now of course as the script runs on Debian on some old phones - I'm thinking my K10000 might just make a decent home server because of the battery backup which blows away anything you could do with a Pi - it is also faster.. the only caviat being controlling IO - but that might be something that's not important for the central controller depending on what you are doing.

      1. don't forget that that phone cannot be leaved unattended remotly, as if it will go down to 0 power, even if recharged, nobody can press the buttons to put that back on... unless, a separated device with a transistor or relay connected to the power on contacts of phone, and so, hw hacking the phone...

        1. I did see a YouTube video of a guy who used a micro servo with a cam to operate a light switch, maybe that could be used to operate the phones on/off switch when required.

          1. Phil - good idea and we have a link. What does the panel think of this - 2mm travel which seems IDEAL for the job... I'm thinking - turn power on after failure- Jay suggested 20 second hard boot to be sure.... and this afternoon we've been playing with:

            /sys/class/power_supply/battery - and despite this being Debian on the K10000 phone and not the native operating system it is indeed correct so that for example...

            cat /sys/class/power_supply/battery/ChargerVoltage

            gives out an integer value as to the charge voltage so you can easily see if it is on charge, off charge or full - there are many more variables in there to look at.

            I can see a very sophisticated system coming out of this eventually...

            What do you think - solenoid do the job?

            1. there's a lot of cool stuff we can check in /sys virtual fs... this, on a raspberry, will give you the cpu temperature:

              echo $((`cat /sys/class/thermal/thermal_zone0/temp|cut -c1-2`)).$((`cat /sys/class/thermal/thermal_zone0/temp|cut -c3-5`))

              1. That's a good idea Phil - a REALLY good one - but we may have something simpler. There are a number of small, cheap solenoids out there, SOME of which PUSH when operated..

                Some feedback from readers here would be good.

                http://www.ebay.co.uk/itm/DC-5V-6V-Miniature-Solenoid-Push-Pull-Type-Inhaled-Micro-Electromagnet-/272597654964?var=&hash=item3f78161db4:m:myQNIqHFkMvgsGV2vKO7_2Q

                What we're looking for should be cheap - a couple of quid or so - but when power is applied - the plunger should come OUT to reset the phone - not retract back in and I'm not 100% sure about these terms push pull - anyone already familiar with this ?

  17. I think I might have found an issue, for me at least, when I got the RS receiver "QAM-RX4" I found I couldn't get any signal so I put a scope on the output of the receiver and found that there seems to be a non-stop data stream going on and my signals don't get a look in !!
    Going back to the cheaper, less sensitive (maybe) I can see there is data on there but there is less of it any my "wanted" signal gets through.
    I might have to try 868MHz or try to find the source but I don't think it's from me!

    1. @Phil Just feedback re stray signals. I've found that this seems to be normal behavior, all the receivers appear "noisy" by design.

      If you power the Cheaper Chinese receiver using 3.3V (no aerial), the noise problem disappears, but the downside of reduced sensitivity is that to get a signal being seen, the transmitter has to be less than a few cm away.
      This link works well for me but remember to power with 3.3V and that its use is for sniffing. After the code has been found, then switch to using an RB6 with full power etc.
      Unfortunately this power down technique doesn't work with the RB6, perversely because it is a much better receiver!
      http://arduinobasics.blogspot.co.uk/2014/06/433-mhz-rf-module-with-arduino-tutorial_27.html

      Its just that when no RF signal is present, the auto gain of the receiver is maxed to the point where annoying background noise/sporadic weak signals are demodulated. However, as soon as a strong RF signal is received, the auto gain whacks down and this filters out background crap, leaving only the strong signal to be demodulated, with its desired OOK (On Off Keying) waveform being seen at the receiver output.

      From a system POV, the constant noise isn't a problem because validity is checked AFTER the receiver (pulse length and pattern is checked etc).
      Consider a receiver as being a telephone and the "pattern recognition" bit being you listening to the telephone, where you work out who is speaking (is this a valid signal?) after hearing a few words being spoken.

      Also, I've found that if you use the other sniffing sketches out there (which use a digital pin as an interrupt) , then be aware this power down technique doesn't work in combination with 5V arduinos because the "hi" signal from the 3.3V receiver is not enough to trip the interrupt (could try with a 3.3V arduino I suppose?) .

      1. Thanks for the info. I tried the Chinese one at 3.3V and, as you said, it was a lot quieter but still as insensitive as before, I've borrowed a spectrum analyser/antenna analyser from work and have been playing around with different antenna designs to see what gets a good VSWR at what frequency (nothing scientific). It's not easy to get a good antenna dead on 433.92.

        I've also been comparing the different frequencies and levels of the different transmitters I have, the Friedland door contacts are much more powerful than the remote switch controllers I have and bang on 433.92MHz but still don't get received more than 6 feet from the receiver.

        I've ordered another couple of receivers from China so let's see how they perform.

        1. Hi Phil,
          Had a lot of fun today deciphering the Maplin mains switch
          http://www.maplin.co.uk/p/remote-controlled-mains-sockets-set-3-pack-n79ka?cmpid=ppc%3Abest_sellers%3Apla%3Agoogle&gclid=CPz6xNDug9MCFeop0wodCDAHjw
          (cheaper on fleabay)
          and the driveway alarm
          http://www.ebay.co.uk/itm/1byone-Wireless-Driveway-Alert-Alarm-Shed-PIR-Home-Security-Easy-Match-4-sensors-/142332255268?hash=item2123a9dc24:g:U8kAAOSwIgNXrCQt

          Using 5V to power a cheap Chinese receiver, I connected this to analyze the waveform (kept my finger on the "transmit" button to get sample a nice clean signal)
          http://www.ebay.co.uk/itm/24MHz-8-Channel-USB-Logic-Analyzer-Saleae-8-CH-Logic-Analyzer-for-MCU-ARM-FPGA-/291193504688?hash=item43cc7c43b0:g:0gUAAOSwxKtYBDpC

          I've posted the rough Arduino code in the next post to show how I coded the pulses - hope its useful

          1. Those logic analysers are great I used one at work to decode some wireless transmissions that a supplier wanted to charge us £6,000 for the equipment to do the same thing.

            I also used it to sniff the I2C password for the RFID on my 3D printer spool.

        2. /*
          Maplin On Off and 1BYONE Driveway alarm (Remember to press "learn" !!)
          POC by Curly Wurly

          */

          #define ldPin 13 //Onboard LED = digital pin 13
          #define txPin 4 //Output to RF TX module

          #define map_F 575 //Pulse Frequency
          #define map_W 7 //No of pulses before repetition
          #define map_R 10 //repeat

          #define onebyone_F 688 //Pulse Frequency
          #define onebyone_W 4 //No of pulses before repetition
          #define onebyone_R 35 //repeat

          int freq;
          int wait;
          int repeat;
          void maplin_1_1_on(void);
          void maplin_1_1_off(void);
          void onebyone_on(void);

          void H(void);
          void L(void);
          void U(void);
          void W(void);

          void setup() {
          pinMode(ldPin, OUTPUT);
          pinMode(txPin, OUTPUT);
          }
          void L() {
          digitalWrite(ldPin, HIGH); // turn the LED on (HIGH is the voltage level)
          digitalWrite(txPin, HIGH);
          delayMicroseconds(250000/freq);
          digitalWrite(ldPin, LOW ); // turn the LED on (HIGH is the voltage level)
          digitalWrite(txPin, LOW );
          delayMicroseconds(750000/freq);
          };

          void H() {
          digitalWrite(ldPin, HIGH); // turn the LED on (HIGH is the voltage level)
          digitalWrite(txPin, HIGH);
          delayMicroseconds(750000/freq);
          digitalWrite(ldPin, LOW ); // turn the LED on (HIGH is the voltage level)
          digitalWrite(txPin, LOW );
          delayMicroseconds(250000/freq);
          };

          void U() {
          digitalWrite(ldPin, HIGH); // turn the LED on (HIGH is the voltage level)
          digitalWrite(txPin, HIGH);
          delayMicroseconds(250000/freq);
          digitalWrite(ldPin, LOW ); // turn the LED on (HIGH is the voltage level)
          digitalWrite(txPin, LOW );
          delayMicroseconds(250000/freq);
          digitalWrite(ldPin, HIGH); // turn the LED on (HIGH is the voltage level)
          digitalWrite(txPin, HIGH);
          delayMicroseconds(500000/freq);
          };

          void W(){
          delayMicroseconds(500000/freq);
          delayMicroseconds(500000/freq);
          };

          // the loop function runs over and over again forever
          void loop() {

          maplin_1_1_on();
          delay(1000);

          maplin_1_1_off();
          delay(1000);

          onebyone_on();
          delay(4000);

          }

          void maplin_1_1_on(){
          freq = map_F;
          for(int i=0; i<map_R; i=i+1){
          L(); L(); L(); H(); L(); H(); L(); H(); L(); L(); L(); H(); L(); H(); L(); H(); L();
          H(); L(); H(); L(); H(); L(); H(); L();
          digitalWrite(ldPin, LOW); // turn the LED off
          digitalWrite(txPin, LOW);
          for(int j=0; j<map_W; j=j+1){
          W();
          };
          };
          }

          void maplin_1_1_off(){
          freq = map_F;
          for(int i=0; i<map_R; i=i+1){
          L(); L(); L(); H(); L(); H(); L(); H(); L(); L(); L(); H(); L(); H(); L(); H(); L();
          H(); L(); H(); L(); H(); L(); L(); L();
          digitalWrite(ldPin, LOW); // turn the LED off
          digitalWrite(txPin, LOW);
          for(int j=0; j<map_W; j=j+1){
          W();
          };
          };
          }

          void onebyone_on(){
          freq = onebyone_F;
          for(int i=0; i<onebyone_R; i=i+1){
          L(); L(); U(); U(); U(); L(); U(); U(); L(); U(); L(); L();
          U(); U(); U(); U(); U();
          digitalWrite(ldPin, LOW); // turn the LED off
          digitalWrite(txPin, LOW);
          for(int j=0; j<onebyone_W; j=j+1){
          W();
          };
          };
          }

  18. Right, using the antenna analyser I found that a straight piece of enameled 0.7mm copper wire 180mm long gave a very good VSWR (relatively speaking) and this proved true when I quadrupled the range I could detect the friedland door transmitters from but still not as far as I need.

      1. Hmmm, you know in an earlier post when I said it wasn't very scientific, well all I did was to insert the lengths of antenna wires into the centre connector of the antenna analyser, no co-ax etc. so when the antenna's "in circuit" I can't measure the VSWR. I realise this isn't the best way to do this, if I had the PCB with the SMA connector then I would use a connector and co-ax etc. but hey I'm using what I've got to hand and the results matched my findings so it can't be too far off.
        Before, when I used the 17.3cm antenna I had to be 12 inches or so away from the receiver to get the signal, with the 18cm antenna I get get 12 - 15 feet away.

    1. That looks like an awesome bit of kit Phil. I wish I had one.

      If anyone wants to make a simple straight antenna then it's fairly easy to calculate the length. It's all to do with the wavelength and frequency of the radio wave. The antenna must be tuned (cut to length) so that it resonates with the frequency of the transmitter.

      We should aim for a length of wire that is one quarter of the wavelength of the transmitter. Radio waves travel at the speed of light and for this purpose, we'll use 300,000 km/S. Simply divide this by the frequency in megahertz (MHz) to get the wavelength. Then divide the answer by 4 to get a quarter-wave.

      300,000 / 433.92 = 691mm. Then divide by 4 = 172mm. That's pretty close to your 180mm Phil.

      1. Yes, I tried 17.2cm but for some reason the 18mm antenna worked better ??

        With the new receiver an pre-formed coil antenna I'm even picking up the transmissions from a weather station 3 houses away and another one from somewhere else!

  19. Hi I'd like to let you that I created a nodered node for rflink with the codes that you shared here - node-red-contrib-rflink. Thanks.

  20. Had a lot of fun creating these 2 POC sketchs and hopefully others find them fun too. (They both run on a UNO).
    The "RX" sketch outputs a "code" when a 433 Mhz transmission is received and if you program this code into the "TX" sketch, the "TX" sketch can then spoof the original transmission.
    Possible enhancements could be
    - MQTT transmission of the code to the "TX" sketch"
    - Adapting the "RX" sketch to recognize particular codes .
    https://github.com/CurlyWurly-1/uno_433_sniffer_rx_tx

    One thing is for sure, security is shocking!

  21. Hey Pete, I have been using my Acurite 01036 Pro weather station last 1 year. Till date, the device predicts the weather correctly. But, after reading your article I ordered the RFLink board. Let's hope I successfully implement it. If any query related to this I will definitely, touch with you.

    1. Don't count on me being an expert on it - but it does work - with one issue I've reported, the latest software (independently developed) occasionally repeats on some door sensors I use... this is new so no doubt it'll get fixed.. the guy who does the software, Frank, is generally quite responsive. I have it listening to my Accurite weather station (otherwise useless as it demands a PC be left on!!!) and doorbell and window monitors and a 433Mhz keyring switch. It is working with a dirt cheap Chinese Arduino Mega2560 board and talking via serial to my Raspberry Pi.

Leave a Reply

Your email address will not be published. Required fields are marked *