Newbie: Sensors do not connect



  • Hi
    I have a RFNano as a serial gateway and a Nano with NRF24L01+ as a distance sensor.
    The gateway is connected to the rpi running Homeassistant via /dev/ttyUSB0. I get these errors from the sensor and no dat on the gateway. I have no idea what the messages mean.

    6 MCO:BGN:INIT NODE,CP=RNNNA---,FQ=16,REL=255,VER=2.3.2
    26 TSM:INIT
    28 TSF:WUR:MS=0
    34 TSM:INIT:TSP OK
    36 TSM:FPAR
    38 ?TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    2048 !TSM:FPAR:NO REPLY
    2050 TSM:FPAR
    2052 ?TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    4060 !TSM:FPAR:NO REPLY
    4062 TSM:FPAR
    4064 ?TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    6072 !TSM:FPAR:NO REPLY
    6074 TSM:FPAR
    6076 ?TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    8084 !TSM:FPAR:FAIL
    8085 TSM:FAIL:CNT=1
    8087 TSM:FAIL:DIS
    8089 TSF:TDI:TSL
    

    Can anyone suggest where I must look please?


  • Mod

    Welcome to the forum @mariusl

    If you haven't already, https://forum.mysensors.org/topic/666/read-this-first-it-could-save-you-a-lot-of-time is a good place to start.



  • Thanks for the welcome. I did read that post and it helped already. I went back to basics and tries the pingpong sketch to see what is happening. I am getting nothing through the radios. I bought ten NFR24's and found that most don't work out of the box. I am using a Nano V3 wireless shield that has capacitors and level shifters built in already but that seems to be of little use. I cannot get the simple comms to work. I have tried them once before and shelved the project due the bad performance of the radios. I even went as far as wrapping the radios in foil as someone suggested, Out of the ten units I did get two that almost communicated reliably. I have not given up yet so I am trying again.



  • So I tried a simple sketch and could not get the radios to work. Then I found another RF24 library over here. Low and behold the radios work flawlessly. The one that was on my system is this one.
    What is required by MySensors as far as the RF24 library is concerned?



  • @mariusl You don't need a separate nrf library - it is all built into the mysensors library. Remove the other libraries from your code, clear eeprom and re-flash using just mysensors.



  • I found that the biggest culprit of FPAR failing is the quality of NRF24L01s modules (especially the cheap ones you find on AliExpress). I've never gotten the ones with the PCB antenna to work reliably at ranges any greater than 10m and had to use the LNA modules with the IPX connector for an external antenna.

    You can try swapping out the NRF24L01 with another board or try the LNA ones with an antenna. Those have worked decently well for me.



  • @mariusl
    Whenever I suspect radio problems, I run the "GettingStarted" sketch example from the RF24 Library by TMRh20. (two Arduinos with radios)

    I agree with @skywatch. I'm having good results with the MySensors library. But I must say I have a configuration (RPi and 4 nano+RF24) running the TMRh20 libraries that has been running for three years in my backyard. I'd stick with those libraries, but it's a lot of work integrating with my home automation devices.

    I've had pretty good luck with the radios, whether the RFnano or a separate board. I solder a male connector and 10uF cap on the radio board and soldered very short leads from the nano to a female connector. I am amazed that I have had success with a 30cm length of cat5 cable, soldered to the Arduino on one end and the connector on the other. (note: do not use cat5 cable that is aluminum anodized with copper! The copper comes off and the aluminum oxidizes into a powder... not immediately but soon.)

    I agree that the maximum range is around 10m. If you need more, as previously noted, use an LNA (or repeaters, which introduce their own problems)

    I have tried connecting the radio to an expansion board. This did not work, getting the results that are seen here.

    Sometimes I have let the magic smoke out, but, annoyingly, not all of the smoke comes out. The device seems to be working (but not with the example). On the flip side, I have repaired a broken trace on the radio board and that radio is still working just fine! This has been my experience more than the source being the problem as @Ethan-Chua describes. But, I recommend that you take @Ethan-Chua's experience and mine with a grain of salt. Probably a combination of the two.

    Swapping radios is why I use a connector. (It would be ill advised to do swap while energized. 🙂 see note on magic smoke)



  • Maybe try E01-ML01DP5 Long Range SPI nRF24L01P 2.4Ghz 100mW SMA Antenna IoT Wireless Transceiver Transmitter Receiver RF Module

    In my experience with an antenna it provided far better results.

    Anymay, i have swiched my sensors to RFM69, which works better, if not perfect



  • @mariusl
    I found changing my gateway nrf24l01 to one with a big external antenna got me going more reliably. I mean I had a sensor that just kept failing (monitoring serial at the sensor)to transmit, swapped the gateway and from then on no fails (can now reliably measure the weight of my cats poo). I’ve got other rfnano sensors that I have had success using carefully cut lengths of cat5 wire to extend the range. I’ve had good success testing basic unmodified rfnanos range so it’s sometime hard to work out what is going on. I do like the el’cheapo rfnano.



  • @Ethan-Chua thanks for the reply. I am using the LNA version with the antenna. But they are the cheap ones I am afraid. I don't have a source locally for decent radios. Someone mentioned RFM69. I am going to try the system one more time with those radios.



  • @skywatch I don't have NRF24 included in the code. I am using the sample code as supplied. I just reverted to the NRF24 basic sketch to test the radios. I found that the basic examples did not work reliably but that I blame the radios for. Then I tried the original RF24 Library (10 years old) and the basic example worked first time. I am now starting to look at SPI speed as a possible culprit for bad radio behavior. IF I can get the basic sketch to work reliably then I can try the MySensors again.



  • @OldSurferDude that's what I did but I could not get the GetStarted sketch to work on my radios. Not even one message. So I used the original library (10 years old) and I got some results. Not good but some. So now I am trying to get the radios to run a very basic sketch reliably over some distance before I attempt using MySensors again.
    I am using the LNA version with antenna radios. My verdict at the moment is that these radios are not up to standard at all.



  • @hlehoux I just looked at that option. It looks like a much better radio. The NRF24 chip is a good one but the clones seem to be rubbish. I am going to look at the RFM69 as well.



  • @mariusl

    I have really abused these radios and use the ones from AliExpress. They all have worked out of the bag and only 1 now PXL_20220609_041817917.jpg just does not Rx nor Tx, but looks like it's working. I have a few with the missing magic smoke when I really, really f'd up.

    If your radios are close to one another you should set PA_LEVEL to MIN. If they are at MAX and close (1m) then you could be overdriving them resulting in lost data.
    for TMRh20 libraries (RF24 examples):
    radio.setPALevel(RF24_PA_MIN);

    for MySensors:
    #define MY_RF24_PA_LEVEL (RF24_PA_MIN)

    I assume you've done this, but I've gotten wrong so many times I have to add, make sure your code for CE and CSN match your wiring. The RFnano is:

    for TMRh20 libraries (RF24 examples):
    rf24 radio(10,9)

    MySensors:
    #define MY_RF24_CS_PIN 9
    #define MY_RF24_CE_PIN 10

    And you have a 10uF electrolytic capacitor soldered to the the nRF24 across VCC and GND (ensure polarity).

    Take a picture of your wiring and let us look at it.

    OSD



  • @mariusl i use the pcb from @sundberg84 EasyPCB RFM69 version and it works very well



  • @OldSurferDude I have since looked at various modules that are sold on the internet. My conclusion is that they are not all the same. Some seem to be much better than others. The price also shows that.
    I use this shield for the radio comms NANO V3 Wireless Shield. It has the caps already built in as well as some level shifting for the signal pins.

    alt text


Log in to reply
 

Suggested Topics

18
Online

11.2k
Users

11.1k
Topics

112.5k
Posts