The client is in deep sleep most of the time, waking every 30 minutes to take measurements (temperature, humidity, ambient light, LPG, TVOCs), which it then sends to the sever. Since the data is just a bunch of numbers I think the radio transceiver should have no problem communicating it. I am managing power for the client with Photon Battery Shield, which is connected to a 400mAh LiPo and a 3.5W solar panel. So far power doesn’t seem to be an issue, although I will need to see if the sleep cycle has to be tweaked to accommodate the power the transceiver uses.
Server photon receives data and passes it onto some cloud service (haven’t decided which one). Recently I’ve been working with Ionic, so it could be interesting coming up with some mobile UI for displaying the data.
It is a work in progress, any thoughts are appreciated
I was needing help with the code on the receivers end where it breaks apart the different sensor readings it receives and then saves that data as a variable. I had not figured out how to break the received payload apart save the different data points to seperate variables like for Temp, Humidity, Light, LPG, VOC, ect…
So if you get that working please do share your code
For power management, I have some code that will put your transmitter into sleep mode if the battery SOC hits 20% and will allow time for the solar panel to recharge the battery above 20% before it starts sending data again to prevent the battery from ever going completely dead.
Can I ask what you are sending from the client to the server? I did some testing today and I’m able to get sensor readings on the client and send them to the server as a concatenated message. On the server side I am deconstructing the message with string functions and then sending a JSON object through particle cloud. Everything seems to work okay
And on the server side I just parsed the CSV like this:
String receivedString((char*)buf);
int firstCommaIndex = receivedString.indexOf(',');
int secondCommaIndex = receivedString.indexOf(',', firstCommaIndex+1);
int thirdCommaIndex = receivedString.indexOf(',', secondCommaIndex+1);
batteryLevel = receivedString.substring(0, firstCommaIndex);
humidity = receivedString.substring(firstCommaIndex+1, secondCommaIndex);
temperature = receivedString.substring(secondCommaIndex+1, thirdCommaIndex);
light = receivedString.substring(thirdCommaIndex+1);
There’s definitely a generalized way of parsing the received message but since I know how many values I expect I just parsed the lazy way . After this I sent published it to Particle Cloud, used IFTTT to relay the data to permanent storage, and from there I’m pulling the latest 50 values for a real-time graph.
Thank you as always for your help. It seems that we often pursue the same projects.
I am new to LoRA and want to start out simply with two Photons and two RFM95W modules (have the same Adafruit ones you do). My plan is this:
Get one Photon to be the client and one to be the Server and show that they can communicate.
Using LoraWAN, connect them to a MachineQ gateway in my house
Collect simple sensor data and transmit it through the gateway to the Interwebs
Build a carrier for either the Photon or one of the new hotness Mesh boards for a small scale test
Here is my first (of hopefully not too many) question, in your example the client is a .INO file for the Photon but your Server is an Adafruit Feather. Can I use a Photon for the server as well? If so, what would I need to change?
Yes, you can accomplish what you’re wanting with the code I have above.
You can switch the server and client around you just need to keep the top of the photon sketch where the pin settings/definitions are tweaked specifically for the Photon&Electron.
Try it the way I have it first to verify its working and then do the code switch is my advice. You may just need to switch the code in the main loop to accomplish your goal of having the Photon receive sensor readings from a sensor node.
I came across these 1-watt RFM95 radios the other day which I didn’t know existed to get longer ranges.
Sparkfun has a customized RFM95 library they created which you can look over to see how it compares to the radio head library that I modified to get working on the Photon.
MachineQ is a LoRA service provider who provides a hub for development outside of their coverage area.
The idea is to use MachineQ for applications where:
sensors are too distributed for WiFi or Particle Mesh
High enough density to make better economic sense than Cellular.
The idea is to use the inexpensive Mesh Particle device with a RFM95W radio and either use the Particle’s WifI or Bluetooth connection to configure the node. Then, monitor and maintain the network using the Particle platform. Initial sensors will be for industrial Contol monitoring and people counting - an extension of what I am doing in the parks today.
I will have to do some more homework on cost. Need to get it working first and see how much traffic my use cases drive. Will keep you posted.