Photon LoRaWAN node?


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 :slight_smile:



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 :slight_smile:

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


I only did what was in the example code which at this point I don’t remember exactly.

I’m just looking for your example if your willing to share so I can learn from it.


On the client, I got some sensor data (humidity, temperature, ambient light, battery charge), and made a String to send. Something like this:

String radiopacketS = battery+ "," + humidity+ "," +temperature+ "," +light;
radiopacketS.toCharArray(radiopacket, 20);

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 :stuck_out_tongue:. 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.


Sweet! Thanks for sharing this, it’s helpful.

I’ve done parsing before with incoming data from webhooks but never had to set it up from scratch with the RF95w Radios.

@ScruffR Do you have any advice or warnings as far as parsing like this?


I would - as always - stay away from String and rather use sscanf() for conciseness and readability.


Quick Update: after around 5 days of having the client server system online, this is the resulting data shown on the web app!



Did you ever get this working?




@chipmc @kazi93

You guys might want to take a look at this I ran across the other day on Adafruits Blog about getting LoraWAN running on these RFM95W radios.

Let me know if you get this working.



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:

  1. Get one Photon to be the client and one to be the Server and show that they can communicate.
  2. Using LoraWAN, connect them to a MachineQ gateway in my house
  3. Collect simple sensor data and transmit it through the gateway to the Interwebs
  4. 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?

Thanks, Chip


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.




OK, now I have to figure out the LoraWAN part. If I can get MachineQ working, I will post an update.

Thank you again,



Do you have a local LoraWAN network in your area?


@RWB, Better than that, I have a MachineQ hub. Just need to figure out the process of registering and sending data through it,




OH, that’s new to me. I just looked into that and it’s very interesting. It’s kinda like Mesh but with much longer range.

Tell me more about how you plan on using this. Also what kind of cost are the Hub and monthly service?

I’ve always seen the 915mhz LoRa Radios as powerful, low-cost, long range transceivers but so far I’ve not had an application that needed them yet.



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.




Thank you for that library. I was trying to get particle library add RadioHead to work, with no success.

Is there any chance you could update that one with your version, or maybe publish it with a new name?