Two radios on same moteino?

Started by gert, May 21, 2017, 12:23:05 AM

gert

Hi All,

I am building a sensor network for our garden patch via moteinos sending data to a central moteino / arduino in our shed. Distance in the garden is ~20m. From the shed I need to further transmit the data to our home about 1.5km through urban environment. I've heard 'LoRa' can do that. Now what confused me is if it is even possible to have two radios on the same motein / arduino. (It seems both are even the same RFM69 ?) One used 'plain' the other 'LoRa' ? Is that possible? How would I prevent interference ? What solutions do the experts recommend ?

Thanks,
Gert

WhiteHare

You can switch back and forth between them, but you can't operate them both simultaneously.

gert

@WhiteHare,

Thanks! I think it's OK to first poll the local sensors, collect the data and then switch to the other radio and transmit them.

Now how would this work mechanically? How would I put two radios (one 'plain' the other 'LoRa') on a moteino / arduino ? And what would be the software implications? How would the software configuration look like?

Thanks & a great weekend to all,
Gert

ChemE

#3
Each radio communicates with the 328p over an SPI bus so at the wire level, the uC would be tied to each radio by the MOSI, MISO, and CLK lines and then each radio would have its own CS line.  Felix's library is event driven, so each radio would need to be wired up to the INT0 pin on the 328p as well.  If you want to talk to a radio #1, you pull its CS line low and then hold your normal SPI conversation.  To talk to radio #2, drive radio #1's CS line high (it should be pulled high honestly), pull #2's CS line low and have that SPI conversation.  This would be pretty easy to breadboard with a Moteino and a full-sized breadboard.  I believe you might need extra pullup resistors on the MOSI and MISO lines if you have multiple slaves on the SPI bus.  Google around for that concept, I'm no expert at that.

WhiteHare

Quote from: ChemE on May 21, 2017, 04:16:49 PM
Each radio communicates with the 328p over an SPI bus so at the wire level, the uC would be tied to each radio by the MOSI, MISO, and CLK lines and then each radio would have its own CS line.  Felix's library is event driven, so each radio would need to be wired up to the INT0 pin on the 328p as well.  If you want to talk to a radio #1, you pull its CS line low and then hold your normal SPI conversation.  To talk to radio #2, drive radio #1's CS line high (it should be pulled high honestly), pull #2's CS line low and have that SPI conversation.  This would be pretty easy to breadboard with a Moteino and a full-sized breadboard.  I believe you might need extra pullup resistors on the MOSI and MISO lines if you have multiple slaves on the SPI bus.  Google around for that concept, I'm no expert at that.

I don't believe this is right.  I see only one NSS pin on the chip.  Rather, I think choosing between LoRa or FSK is handled the same as choosing between FSK and ASK on the RFM69 chip. i.e. through a register setting.

perky

ChemE is talking about two physical modules with their own chip select. Of course you can use LORA modules in FSK or LORA modes, and given you can't use both modes at the same time a software approach using just one LORA module is going to be somewhat easier to implement in hardware.

Mark.

WhiteHare

Ah yes, re-reading it now I see that's what was meant.  Thanks for clearing that up.

ChemE

Yeah, my mind went to using two different radio modules I thought that's what the question was.  It would of course be easier and cheaper to just toggle one radio between two different modes/networks.  Thanks gents.

gert

@ChemE & All,

Thanks for the detailed explanation. I agree that 1 radio should be OK if it can be configured between the 'plain' and 'LoRa' operating modes. I understand 'LoRa' is the 'higher-valued' licensed functionality so I would have to buy a 'LoRa' radio. Then 'tone it down' for 'plain' connection to the local sensor nodes and then use 'at full bore' for LoRa communication. Is there a tutorial or sample code that the experts can point me to on how to do that?

Thanks,
Gert

WhiteHare

#9
I think the argument can be made that the Lora Radio's FSK is actually the next generation FSK that was built both on and after Semtech's experience with the SX1231h(i.e. the primary chip in the RFM69).  Its FSK implementation is similar enough to the RFM69's to be recognizable as such, and fancier--but, ahem, it looks even more complicated.  I think maybe for that last reason, and also until recently its much higher cost, no one has been eager to exploit its incremental advantages.  Because of the differences, I have doubts that the RFM69 code will run directly on it.  I can't say that I've tried but then neither have I read anything suggesting backward comparability.  If someone can add some color to that impression, please do post.

Rawze

#10
Quote from: gert on May 21, 2017, 12:23:05 AM
Hi All,

I am building a sensor network for our garden patch via moteinos sending data to a central moteino / arduino in our shed. Distance in the garden is ~20m. From the shed I need to further transmit the data to our home about 1.5km through urban environment. I've heard 'LoRa' can do that. Now what confused me is if it is even possible to have two radios on the same motein / arduino. (It seems both are even the same RFM69 ?) One used 'plain' the other 'LoRa' ? Is that possible? How would I prevent interference ? What solutions do the experts recommend ?

Thanks,
Gert

I have a similar situation. I simply set all the devices up half-duplex (rx=915 mhz, tx=909mhz) and use a centralized repeater. The repeater is a Moteino mega (set rx=909mhz, tx=915mhz) with an antenna on a 12-foot pole fed by coax cable. All it does is re-broadcast everything at max power that it hears. It sends everything back out almost completely unaltered. All the sensors and other devices can now hear each other over a very long distance using the very strong signal that has been repeated. For each of the sensors, etc. after sending, they simply listen for their own packet back as an ack (with auto retries). Works really well and is super reliable. No need for 2 radios in one device to extend range long distances.

I say the data is almost completely unaltered because the repeater modifies the packet from each device with that devices RSSI as it sends it back out. When that particular device hears its own packet back, it is verified for correctness, and the RSSI it gets back is used to re-adjust its power level. The power level for all devices end up being set so that they are all equal strength inputs to the repeater, and to minimize power consumption for them. The repeater is on a small usb charger plugged into 120volts wall outlet.