💬 Connecting the Radio
@mfalkvidd Many thanks again... I learn new things every day.
gvorster last edited by gvorster
I have one question regarding the length of the 868MHz antenna. According to the theory, a the wavelength of a 868Mhz signal is 300/868 = 34.6 mm, so a quarter wave antenna should be 8.6mm long. The table above indicates 8.2mm. May someone confirm the correct figure, and also indicate how critical is that difference in terms of range?
I tried 3 types of antennas with RFM69HCW 868mhz.
Just a 8.6 cm wire
- sma antenna
Indoor in my appartement (one floor) it doesn't matter which one I use. All is working fine.
I tried 2 nodes in my metal mailbox 10 meters below which has 2 tiny holes.
One with helical antenna, one with sma antenna.
Gateway (using sma antenna) receives no data.
Testing two repeater nodes (1 helical, 1 sma antenna) near a window I receive data via both repeaters. Sometimes the repeater with sma antenna is not relaying messages for the node with the sma antenna.
In my situation, the helical antenna works better for me. I just buy them on ebay.
Maybe the sma antenna is for the wrong frequency and it's giving poor results.
krisha last edited by
There is a mini module of the NRF 24L01+. Unfortunately some pinouts on the web were not correct. Not sure if many people use that, but here is a pinout that worked for me: http://s2.electrodragon.com/wp-content/uploads/2014/12/NRF24-Mini-02.jpg
manul last edited by
First of all, thank you for your amazing work! It does help a lot to sea a dream become true
I was wondering, it seems that I can't receive messages from NRF24 radio while arduino node is sleeping... I've read several testimonies in this way as well on forums. I did connect the IRQ of the transceiver to the PIN 2 of my arduino, and took this as event for exiting sleep mode, but it seems not to work.
Is there anything in the roadmap regarding this? It could be really amazing to be able to sleep the battery-powered arduino, and wake it up as soon a message is received by the radio.
Or maybe there is something I did not correctly. Is there a feature for this?
@manul it would indeed be amazing, but the radios consume so much power when listening that it is no use to sleep the mcu.
The smartsleep feature is the best alternative so far. documentation: https://www.mysensors.org/download/sensor_api_20#sleeping
ricorico94 last edited by ricorico94
I'm interested in using long range sensors based on LoRa and I saw on this forum that LORA radios should be supported with the RFM95. But I did not see any explanation or advice on hardware, pins, etc.
Could anyone confirm that the type of radio to attach on the gateway and the sensor is like:
link to aliexpress RFM95 radio
I see the chip mentioned is "RF96", but I did not see that name on the forum..(it was SX1276 I think), so I don't know.
Regarding frequency, I uderstood from other websites that in France, the frequency should be 868MHz, correct ? No risk to interfere with EnOcean/Zwave devices ?
I see also that these RFM95 radios have many more pins than the NRF24L01 : should I use the same pins than for NRF24 and leave the others unused ?
and then in the sketch, use the #define RFM95 statement ? Is it all that simple ?
And then I install the RFM95 as a second MySensors gateway on my network (for instance as an ethernet gateway) ?
peerv last edited by
If you are interested in LoRa and how to connect the radio have a look at www.thethingsnetwork.org
MattiMan last edited by
I would like to use NRF24+PA radio, but when I try to use it instead normal NRF24 radio in MQTT-gateway it just dont work. I cant make connection between sensors and gateway.
Normal radio works just fine, but the range is a bit short for me.
I tried the low power setting also, but no help.
What should I do to make it work?
I use Domoticz as my controller.
Welcome to the MySensors community @mattiman !
Could you post the debug logs of the node and the gateway? That's usually the quickest way to get a hint on what is wrong.
If you haven't already, you can also look at https://forum.mysensors.org/topic/666/debug-faq-and-how-ask-for-help/ which has recommendations on the most common problems and how to troubleshoot them.
People have also been helped by this: http://blog.blackoise.de/2016/02/fixing-your-cheap-nrf24l01-palna-module/
pepson last edited by
I use Arduino Pro Mini 5V and i want user radio RFM69HW. I must use logic level converter from 5V to 3.3V to connect radio or i can only reduce power from 5V to 3.3V to VCC ?
On this page is nothing describe that i must use logic level converter,...but some users on this page write that i must use:
Now i have connected only with reduce power to 3.3V but my Arduino not working still time. Only some minutes to test...
It was already answered to you in another topic and if you read in the openhardware project it is clearly stated that it is meant for pro mini 3.3v. If you connected it to a 5v pro mini you most likely fried the RFM69 module.
pepson last edited by pepson
I connect to 5V Arduino but i use AMS1117 to step down power 5v to 3.3V and radio still working.
I have two of my nodes using rfm69hw and mini pro 5v 17mhz. I only step down the power line to 3.3v, the comms lines work just fine with 5v. I also remember reading somewhere that this is actually the case, even though the datasheet says the opposite.
I'd follow the datasheet and don't take the risk of frying the radio.
They've been working for more than 6 months now as part of a test run and are not yet fried.
There is other people around reporting the same with at least the rfm69HW. I remember someone stating that the new models are more robust in this regard than older models, in spite of the manufacturer not yet stating 5v tolerance in the data pins.
In fact the datasheet never mentions 5v intolerance, and it does never actually mention a max voltage for the data pins, only for Vdd.
It seems like the board does something with the voltages in the data pins anyways, since if it was using the definitions of the logic levels (as a percent of Vdd) as they appear in the datasheet, it should not be able to communicate at all with a 5v arduino when powered at 3.3v and no logic level shifter on the data pins - but it does.
This doesn't mean this is good practice, directions in the datasheet are there for some reason and my nodes will eventually get a logic level shifter when they finally go into their final case. But reality is it seems at least RFM69HW can tolerate 5v for months without being fried.
still I would not advise someone to go ahead and use them without a level shifter as I would not take responsibility to damage someone else hardware 3.3V is still able to talk to 5V, depends on how large is the tolerance zone around the 2.5V grey zone of the arduino
I would not expect anyone to put or take responsability on anyone for a piece of advice. I think we are here to help each other by sharing information and our own experiences.
The full picture should be more than clear at this point for anyone reading this and other threads, but I will clarify once more. Best practice is using the rfm69 family with a logic level converter when connected with a 5v arduino, given that as of today the manufacturer's datasheet is not 100% clear on this area. From a problem solving perspective, keep in mind, however, that should a converter not be in place for any reason, the setup might or might not work, so if it doesn't don't discard it as a cause but don't take it for granted at 100%. And even if it works, do plan for adding a converter.
Is it possible to change any of the radio pins 9, 10, 11 to something else? The reason is that I'd like to use 4 PWM pins and currently I only have pins 3,5,6 available on my Pro Mini.
@maghac yes. Redefining for example the nss/cs pin is possible as described on the connecting the radio page.
For more exact i structions we'd need to know which radio you are using.
Thanks - I use NRF24 radios.
I found MY_RF24_CE_PIN which I redefined to pin 8 which worked absolutely fine.
The problem I have now is that now cannot use the Newbie PCB anymore
@maghac cut the trace with a small knife and re-attach it with a wire.
@mfalkvidd Maybe I'll give that a try.
I think FOTA will fail as the bootloader will try to initialise the radio with the default pin, right? Then I'll need software pwm or recompile my own bootloader.
@maghac or go for dual optiboot
@gohan But then I would need additional hardware to use DualOptiBoot?
Anyone have any quick instructions on how to build a new custom version of MySensorsBootLoader using MY_RF24_CE_PIN = 8
I have access to ArduinoIDE on Windows or a Ubuntu 16.04 box.
@maghac yes, an spi flash chip. It is not a bad solution since the firmware is transferred during normal node operation and if it fails nothing bad happens.
@maghac - EasyPCB rev 10 will probably include spi flash
It might be an idea for the "connecting the radio" page on MySensors to point to these handy boards:
Then people have to just plug in the NRF24 boards. And it also makes it much easier to connect lots of sensors. I wish I had known about these boards earlier, it would have saved me a lot of time.
It depends if you want to go with the nano or the pro mini like many nodes use
KimmoHop last edited by KimmoHop
Just noticed, that MySensors 2.2 changed default RF24 CS pin on Mega2560 from pin 10 to pin 53 (SS) I could not find any reference to the change from 2.2 change log nor from pull request (722)... No wonder RF24 worked with 2.1.1 but not with 2.2 on M2560.
Contrary to instruction above, I wanted to continue with old pins (same as on Uno) and set the pins explicitly to MY_RF24_CE_PIN=9 & MY_RF24_CS_PIN=10. Now transport seems quite good (with combined HW and SW ack, static GW address, no routers)
@gohan perhaps it can be added to the buying advice page? There the Nano is advised.
@mfalkvidd: Yes that's the page I'm referring to.
@alowhum I'm confused. Could you clarify what you want us to change on that page?
While you're at it: maybe tell people about the NRF52 option?
@alowhum thanks. That does indeed look lika nifty solution. I'll add it.
For the nrf5x, I don't know which boards are user-friendly, and I haven't understood if MySensors nrf5x support is "production ready" yet or if it requires people to tweak or otherwise do special stuff to get a node working. I don't think I have seen anyone building nrf5x MySensors nodes yet.
Lots of people have I think, check the NRF5 thread. I built my own first one this week (BME280 sensor). It rocks.
- Arduino with built in NRF24 for $3.
- The size of a postage stamp.
- Powerful enough to use the simple encryption functionality.
- Antenna socket: just plug in antenna for more range.
skywatch last edited by
Maybe it's just me, but in the first image of a pro mini the top row of pins seem to be reversed to what I normally see.....
My first post at mysensors.org. Sounds like a great tool. Tried to set up an MQTT Gateway with Hardware as described above, ESP8266 and RFM69W with 868 MHz, to connect some Technoline TX29DTH-IT temperature and humidity sensors, without success. ES8266 is working , connects with my wifi network and also connects to my mosquitto server. But I do not get any connection from RFM to technoline. Is there anyone out there who was able to get this running?
@42isjustanumber welcome to the forum!
MySensors uses its own protocol and is therefore not compatible with the TX29DTH-IT.
You can however build your own temperature and humidity sensors from examples on this website and start expanding your network from there!
@Yveaux: thanks for the information. I thought it's much easier. I heard about LaCrosse Gateway which seems to be able to connect to Technoline temperature and humidity sensors with Nodemcu and RFM69 hardware and connect it to FHEM. I wanted to have a more general approach and just forward data from technoline sensors via MQTT. But if this is a totally different protocol I'll have to look for another solution.
Mysensors is just taking care of transporting the data, if you have a sketch that can read data from any sensors, you can then send those values via mysensors to any controller supported.
That was my misunderstanding. I thought with the hardware and settings mentioned above, I would be able to read the data from any Technoline sensor. There's a YouTube video from Miika Kurkela explaining how to interpret the data from these sensors. But to be honest, I only unterstand half of it.
If you have a working code that works on esp8266, you can use it as a node or as a gateway with sensors and no radio module.
joaoabs last edited by
Hi, just to warn navigation that the above code for RFM69 seems to have a glitch:
#define MY_RFM69_FREQUENCY RF69_433MHZ doesn't compile but changing it to #define MY_RFM69_FREQUENCY RFM69_433MHZ it does. (missing the "M" in RF69_433MHZ).
@joaoabs thanks for noticing. I have updated the page.
dmonty last edited by dmonty
After running NRF24L01+ for a few years I recently decided to upgrade to several NRF24L01+PA+LNA (Antenna version) using the link from this page. Initially the performance was worse. Fail to find gateway, fail to send data and lots of NACKs. However eventually I was able to get them working. Below is a summary of tweaks and suggestions from various Mysensor Forum posts that helped stabilize my sensor network.
Add 47uf capacitor between 3v and ground pin on the transceiver.
Add plastic-wrap then a tinfoil shield as per other threads. Tinfoil needs to to touch the base of the antenna (ground).
My 5V switching power supply to the Arduino Nano was causing problems. Some sort of noise on the wire? When I disconnected the transformer and powered the arduino by laptop usb, the signal was much more reliable. So I added a 1000uf capacitor between ground and 5V coming from the transformer which filtered out the noise coming from the power supply. This is probably not applicable to battery powered devices.
Use static node addressing for each node - automatic addressing sometimes randomly make bad routing decisions bypassing repeater nodes and choosing far away nodes.
// Far-from-gateway sensor node
#define MY_NODE_ID 2
// Parent is a repeater node
#define MY_PARENT_NODE_ID 1
Lower the power on the transceiver. Try each power level reboot the node and pay attention to: Setup speed, how many NACKs.
// RF24_PA_MIN = -18dBm;
// RF24_PA_LOW = -12dBm;
// RF24_PA_HIGH = -6dBm;
// RF24_PA_MAX = 0dBm
#define MY_RF24_PA_LEVEL (RF24_PA_LOW)
Run the RF24 scanner example for a long time to find a channel that is free from noise. I ran it for a day to pick up neighbourhood noise and loaded the results into a spreadsheet to graph. Set the clearest channel on all my nodes. e.g.
#define MY_RF24_CHANNEL (105)
In domoticz I lowered the ACK time from 1200 to 400 to avoid broadcast storms/collisions. On the nodes after each send or receive add a "wait(LONG_WAIT);" to allow ACKs to settle between transmissions ( e.g. 500ms).
Run a ping-pong test between two battery powered mobile nodes to find optimal locations for your gateway, repeaters and sensors. Find the outer limits and keep the nodes well within those limits. Try not to place a node at the outer range limit, add repeaters. Sometimes moving a few feet in one direction can have a big difference.
@dmonty which hardware did you use? It sounds like you tried the old cheap model without shielding.
There are way better modules out there now which will give you far less trouble.
Agreed, the shielded modules can run at full power without any problem
dmonty last edited by
The Connecting the Radio page get's you up and running. Would be nice if the "Shopping Guide" - grouped optimal matching components into a plug-n-play style "Shopping Cart". e.g. Optimal recommended component groups for:
- Gateway node.
- Repeater node.
- Sensor node.
a) usb powered.
b) transformer powered.
c) battery powered.
d) solar powered.
I think my next experiment may be to pick up the 3v regulated power sockets to see if they will help in increasing the power and range as I've read the 3.3v regulator on the Arduino Nano is not very good at powering the radio.
That shopping guide (heck, most examples on the site) is often out of date.
I'd recommend checking out this thread:
For your nodes I'd highly recommend getting the "nano wireless board" from places like aliexpress. The radios just plug right into it.
For the Raspberry Pi there is also a really easy to use 'hat' that allows you to plug the NRF24 directly into it: