radio.receiveDone() never true, can't receive on Moteino [SOLVED]

Started by farrenh, January 31, 2017, 06:42:01 AM

farrenh

Hi, hope someone can help

First a bit of context, illustrated by the attached picture:

I'm using a combination of Moteinos and Raspberry Pis for a tracking system that uses the RSSI values of pong messages from mobile nodes to distributed relays to determine the position of the person carrying the node. I know triangulation based on signal strength is messy because of all the things that affect it, but we've found a way to make it work using software magic. 

In any event we actually had this working using Jeenodes with RFM12 radio, but switched to Moteinos to solve intermittent issues caused by the limitations of RFM12.

I pulled down LowPowerLab's RFM69 library and used the Node Sketch as the basis for my base transmitter and mobile node code (Moteinos). On the Relays (Raspberry Pis), we have an RFM69 wired to the SPI pins and I'm using the C library port for the Pi from Raul de Pablos.

My issue is this: When I send a ping from the server, the base transmitter Moteino definitely broadcasts it. And the Raspberry Pi relays definitely pick it up (intended) and accurately reflect the contents of the message in console prints. So I know that the desired message is being transmitted and that my encryption and other settings are all correct.

But the mobile Moteino nodes, which have the correct network ID, encryption key, etc configured, don't seem to get the message. From doing serial prints via USB, I've determined that radio.receiveDone() never returns true:

Serial.println("0"); <--- this comes down the wire
if (radio.receiveDone())
  {
    Serial.println("1"); <---- this never reached


Note: I am NOT using a node-gateway type arrangement and I want all elements (nodes and relays) to get all broadcasted messages. The code on each element decides if the message is for it or not based on the contents of the message. So all of them are configured with the same NodeID (0). I discovered that radio.promiscuous(true) will do this for me but looking at the receiving code in RFM69.cpp I see that all of them having the same NodeID and sending to the same NodeID effectively does the same thing.

The sketch for the transmitter/mobile nodes which I've attached below (Tag.ino) is pretty long, because it includes code for configuring nodes via serial communication with a server program and storing and retreiving all of the relevant settings from EEPROM (Node type, Network ID, Encryption Key, Custom Node ID, et al), in addition to message processing code. But I know that it is successfully broadcasting encrypted messages from the transmitter node, because the Raspberry Pi relays are picking up those messages and accurately reflecting their contents.

In trying to debug why the other moteinos are not picking them up I loaded a much simpler sketch onto one of them that simply listens and prints what it receives to serial, but has the same encryption key and network ID, et al. This sketch is also attached (BasicRFMReceiveTest.ino)

Can anyone help?

farrenh

Changed title to say "SOLVED" because it turns out this was neither a Moteino problem nor an RFM69 code library problem. In any case thanks to the 30+ people who at least took a look at my question :)

I've been using USB BUBs to upload code and power the nodes during testing and it turns out that there is a problem with the BUB I was using to power the mobile nodes during testing. When I use that BUB, code uploads to the Moteino without problems, but the radio range drops to around 1cm and even then I get a low RSSI on receipt.

Out of interest though, is it possible this is a power issue? Could the BUB be supplying just enough power to upload code consistently but not enough for the radio to work properly?

joelucid

Happens to me all the time. Running a Moteino of a USB/ftdi bridge seriously impairs sensitivity. Not as drastically as in your case but still it does. Usually not a power issue, but noise coming in through the adapter.