Sensebenders Gateway Weird Behavior
ejlane last edited by ejlane
I'm a bit stuck here. I hope that someone else can see what I've missed.
I have a Sensebender Gateway: https://www.mysensors.org/hardware/sensebender-gateway that I purchased from itead: https://itead.cc/product/mysensors-gateway/?acc=eccbc87e4b5ce2fe28308fd9f2a7baf3
I've been battling it for a while now, and have finally narrowed down my problem to one weird combination of settings. First off, it's connected to a NRF24 radio with PA and it is set as a serial gateway and connected directly to the USB port of a HomeAssistant server. Though for the testing I have it connected to a regular computer and watch the serial port. Behavior is the same whether connected to HomeAssistant or my computer.
If I program it to not use any encryption/password then everything works fine, and I'm very happy with it. If I program it to use MY_SECURITY_SIMPLE_PASSWD with the same password as the sensor and have MY_DEBUG enabled, then it also works fine. However, if I then disable the MY_DEBUG, since otherwise it will confuse HomeAssistant, it no longer receives any messages from the sensor. (At least it doesn't report anything.)
It makes no difference whether I enable the high power amplifier of the radio or not.
When it is not working, it will only write a little bit to the serial (USB) port on startup, and then nothing else ever. I have let it sit there for hours overnight and never got anything out of it. This is the only thing it will send to the serial port when it has debug disabled and password/encryption set:
0;255;3;0;14;Gateway startup complete.
So does this tell anyone else what might be going on? When the debug is turned on it will recieve the messages from my sensor just fine, or when security is disabled (or both debug and security are disabled) but it only fails in the actual configuration that I need. (Of course. ) So I know the hardware works, and that the security/signing works. I figure it must be some weird bug/conflict, but that's as far as I've been able to get so far.
I've dug through the source code a bit, but I haven't been able to track down what might be causing this. Of course there are so many files that I'm also not quite sure where to even suspect.
Edited to add: I'm using the example Gateway Serial sketch from https://www.mysensors.org/hardware/sensebender-gateway with the only changes adding the simple signing define and removing the inclusion mode stuff, since I don't have a button on the board and don't plan to use it that way.
ejlane last edited by
Well, I've narrowed it down.
I got rid of all the testing code that was in that sketch, along with its associated uses of the serial port. (And for some reason at points it used Serial, but others used SerialUSB.) I don't need to have it test the AtSHA204 or the SD card every time it boots - I don't even plan to use those. I guess my plans can change, but at least for now, they just aren't needed.
But getting rid of those took care of the problem! So now I have a working gateway working just like I want it to, and I'm probably not going to do any further work on figuring this out unless someone else has questions and I can help them with it. For my own needs it's now done.
Well done @ejlane, thanks for reporting back.