MoteinoMega bluetooth bridge; SPI or UART?

Started by joffers, December 01, 2015, 01:22:49 PM

joffers

Hi -
I've seen this topic elsewhere but wanted to resurrect it here briefly. I have two MoteinoMega boards with LoRa radios. (Felix - wonderful boards. thank you). I'm looking to move ascii text in the following way (see From/To below). I know this has been done before. My question has to do with the Bluetooth LE module. I can purchase either Adafruit BluetoothLE friend UART or a SPI versions. The MoteinoMega pin-out diagram easily supports either (UART or SPI) I'm just looking for a recommendation of one over the other and why.  thanks!

From: iphone > bluetooth > moteinomega > antenna
To:    antenna > moteinomega > bluetooth > iphone

Felix

Interesting bluetooth bridge via long range LoRa. Just a side note - you will certainly not get the throughput of bluetooth, since the bottleneck is the LoRa link, which is much much lower bitrate than bluetooth.
I think the advantage of serial is that it's so simple, requires only 2 wires, and it's really easy to read and parse. With SPI you will need a library to talk to your bluetooths, keep track of that, and ensure the SPI modes are always kept track of if they are ever different between all SPI devices attached to the Moteino (this is usually not an issues since most SPI devices I've ever worked with use MODE0, for instance both RFM69/LoRa radios and FLASH MEM chips that come with all Moteinos are all MODE0). But just thought I'd mention that since I'm not familiar with the bluetooth LE modules. If they support serial I would just use that. SPI would have an advantage of throughput over serial, but since the LoRa link is so low bitrate compared to bluetooth, you are limited by that anyway so serial at 115200 for instance will be way more than you can squeeze through the LoRas.

joffers

Thanks for the quick reply and great point regarding throughput. Indeed I might have to chop up the data from bluetooth and then put it back together on the other side; just a small matter of some code :) [not to mention RH library doesn't have a queue like mechanism due to memory(?) ] But you said the magic words with "read and parse" especially while I'm prototyping in the early stages.  By the way, the RH library with your boards are a great combination. Thanks again.

TomWS

Quote from: Felix on December 01, 2015, 02:54:10 PM
Interesting bluetooth bridge via long range LoRa. Just a side note - you will certainly not get the throughput of bluetooth, since the bottleneck is the LoRa link, which is much much lower bitrate than bluetooth.
I think the advantage of serial is that it's so simple, requires only 2 wires, and it's really easy to read and parse. With SPI you will need a library to talk to your bluetooths, keep track of that, and ensure the SPI modes are always kept track of if they are ever different between all SPI devices attached to the Moteino (this is usually not an issues since most SPI devices I've ever worked with use MODE0, for instance both RFM69/LoRa radios and FLASH MEM chips that come with all Moteinos are all MODE0). But just thought I'd mention that since I'm not familiar with the bluetooth LE modules. If they support serial I would just use that. SPI would have an advantage of throughput over serial, but since the LoRa link is so low bitrate compared to bluetooth, you are limited by that anyway so serial at 115200 for instance will be way more than you can squeeze through the LoRas.
I have to agree with Felix.  Data rate makes the choice easy.  If you had high BW source then I'd have to think about it.  However, being 'forced' into UART gives you one overwhelming advantage and that is independent Asynchronous RX & TX at the interface.  Makes the job a WHOLE lot easier.

Tom