@ejlane @Yveaux @skywatch So, I have found exactly what was going on, and had nothing to do with the hardware... Basically, one of my nodes was jamming the radio channel
How I discovered the issue:
There are 2 more flags, besides MY_DEBUG
which are MY_DEBUG_VERBOSE_RFM69
and MY_DEBUG_VERBOSE_TRANSPORT_HAL
which I couldn't find a way to add, so I did it by editing the configure
script and where it says
if [[ ${debug} == "enable" ]]; then
CPPFLAGS="-DMY_DEBUG $CPPFLAGS"
fi
I changed it for
if [[ ${debug} == "enable" ]]; then
CPPFLAGS="-DMY_DEBUG -DMY_DEBUG_VERBOSE_RFM69 -DMY_DEBUG_VERBOSE_TRANSPORT_HAL $CPPFLAGS"
fi
Then re-ran the script and recompiled the mysgw
binary. The important flag in my case was MY_DEBUG_VERBOSE_RFM69
.
When mysgw
was running, and everything was working fine, I was seeing lines with DEBUG RFM69:CSMA:RSSI=-102
popping in once or twice (with different values for RSSI
) and everything continued normally. Then, when the whole thing was wedged and nothing worked, I noticed that message pretty much going on forever
Sep 09 18:37:11 DEBUG RFM69:CSMA:RSSI=-52
Sep 09 18:37:11 DEBUG RFM69:CSMA:RSSI=-52
Sep 09 18:37:11 DEBUG RFM69:CSMA:RSSI=-53
Sep 09 18:37:11 DEBUG RFM69:CSMA:RSSI=-52
Sep 09 18:37:11 DEBUG RFM69:CSMA:RSSI=-52
Sep 09 18:37:11 DEBUG RFM69:CSMA:RSSI=-53
And on and on and on.... forever... Clearly there was a loop somewhere for whatever reason printing this message. As it turns out, there's a function that the RFM69 driver calls before sending a message https://github.com/mysensors/MySensors/blob/2e00bf6a10f76d6aaa1999e12313237bc3edabd3/hal/transport/RFM69/driver/new/RFM69_new.cpp#L369-L375 that pretty much checks if there is noise in the RF channel, before actually sending anything...
I was doing some modifications to one node I have, where I replaced the arduino with another one, which I thought was a 3.3v one, burned it as so, but it was a 5v. For whatever reason (maybe the different clock speed? dunno...) when doing that, the node will send garbage through the radio... I have no idea how it manages to init the radio... doesn't really matter, the thing was sending something in the same channel constantly...
And that is why the gateway was receiving data from other nodes, but was never able to send back... this other node was preventing it because it would never shut up... I have now replaced the arduino with a 3.3v one, checked in the serial monitor after burning and re-installed, and everything is back to normal and working...
Thank you all for your help and suggestions, I will nevertheless build the new PCB with the suggested changes and replace the ones I am currently using.