LowPowerLab Forum

Hardware support => Moteino => Topic started by: dom67911 on July 31, 2017, 09:23:55 AM

Title: Inconsistent data received by gateway using example code
Post by: dom67911 on July 31, 2017, 09:23:55 AM
Problem: Newly made Gateway is not always receiving expected data using example code: https://lowpowerlab.com/2013/06/20/rfm69-library/ (Using the Gateway and Node links on the second line).
1. Meaning, there are times the gateway does temporarily receive the alphabet text from the "Sender" Moteino, but just for about 30 messages. After that, the example gateway.py throws exception stating incorrect data format.
2. After rebooting the Raspberry Pi, because I wondered if re-imaging the Gateway Mote may help, it showed the same problem. But this time I restarted the Gateway.py and the messages it was receiving were blank lines. Just a carriage return. No text whatsoever.
3. To help validate this, I used minicom and confirmed blank text being received.
4. I confirmed the Sender Moteino was still sending the same alphabet using Arduino IDE Serial Console.

I'm not sure how to further troubleshoot this. I have high confidence the example source works since its been battle tested, and I have also used it in the past, so I'm not sure what the problem could be. Any help would be appreciated.

SETUP
Raspberry Pi 3
Moteino R4 (no USB) as Gateway wired directly to RasPi's GPIOs
Moteino R4 (no USB) as the Sender
Raspberry Pi running Hypriot OS (since it can run Kubernetes clusters)
Arduino IDE 1.8.x
Title: Re: Inconsistent data received by gateway using example code
Post by: Felix on July 31, 2017, 10:50:50 AM
2013 posts are very very outdated so no surprise things might not work.
Please make sure you use the latest library and examples therein (https://github.com/LowPowerLab/RFM69). The guide (https://lowpowerlab.com/guide/) is probably another good place to look for examples of hardware that use the examples in the library.

The gateway.py is deprecated and replaced by this project (https://lowpowerlab.com/guide/gateway/). However you don't need that to do what you want.
If all you want is a receiving sketch use this one instead (https://github.com/LowPowerLab/RFM69/tree/master/Examples/PiGateway).
To get started from a working point you can use the Gateway and Node examples as a quick sender-receiver setup - make sure you set the settings to match your RFM radios on the Moteinos.

When you use minicom make sure you don't use another program that uses the same port. Serial is between 2 (two) end points.
Also always check the baud rate at both ends is the same.
Title: Re: Inconsistent data received by gateway using example code
Post by: dom67911 on July 31, 2017, 11:05:41 AM
Awesome! Thanks for the prompt response. I will try tonight.
Title: Re: Inconsistent data received by gateway using example code
Post by: dom67911 on July 31, 2017, 11:10:12 AM
FYI, I had setup a WaterMote back in 2013. The SD card on my RasPi died and havent had time to look fix things until 4 years later (became a dad). BUT, the first time I started the gateway last night it started getting messages from the lonely WaterMote running since 2013! Plugged into wall outlet of course, but it was awesome watching those messages being received. Almost felt like the lonely Voyager probe in outer space, which has been "phoning home" the entire time. I should probably put that Moteino in some glass case is the "Moteino that could" and since it was my first project. Thanks again for making this possible for the rest of us!
Title: Re: Inconsistent data received by gateway using example code
Post by: Felix on August 01, 2017, 09:10:09 AM
Nice to hear that, I also have my original watermote with unchanged code since that time, one of the very first projects as well, still works without a problem :)