Environmental Sensors using LoraWan
First off I purchased two of these units:
Wio-E5 units are very low power with a range of several miles. In fact they say it can reach 500 miles given the right environment say like the Spy Ballon for example.
Just like my previous cellular project it uses serial at 9600 to communicate with the unit. The Grove connector it came with is not very nice in that it's big and just a ribbon cable. Not very flexible.
I ended up cutting one end off and putting a 4 pin connector in its place. Plugs in very nicely.
The unit uses the AT command set to configure it and I was hoping to just do a Point to Point Lora network but that turned out to be more complicated than I thought. The units want to setup a Wan network and so you need a Gateway for it to relay the messages to the cloud. Well, that's not that much different than my Cellular project and the cost of Gateway is from $90 to $1000.
The cloud network that I can use is called The Things Network.
It's free to sign up just like the Blues network and they will collect your data for up to 24hours.
The data for Lora is in hex and the data must be less than 51 bytes in length. So no JSON data should be passed between the device and the network. The examples I saw just encode the hex values of the data and have it in the correct order so it can be decoded once it is received.
This turned out to be ok. I have Temperature, Humidity, Pressure, Voltage, and Current.
Float values are stored as 4 bytes just like integer values so I just converted those binary values to hex and sent them which takes only 20 bytes.
Now I have everything ready except for a Gateway. Most of the Gateways are out of stock or expensive.
I will have to wait to get one since there are no local gateways running near my location that I could hop onto. The LoraWan network is more of European thing at this point.
I was able to dummy up the two devices to do Point-to-Point. This at least allowed me to test sending and receiving the data. With LoraWan the data is encrypted from end to end and the Gateway just receive the packet of data and forewords it on to the cloud where it is decrypted using 128 bit AES. When you register the device it gives you a key that is entered into the device. The data is encrypted/decrypted with this key.
So just like the Blues network the data is encrypted but not guaranteed to make it.