Python Forum

Full Version: RF Node sensor data to ThingSpeak Fields
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm very inexperienced with python. I'm currently experimenting with rf69 and LoRa sensor nodes sending multiple sensor data values to an OpenWRT gateway with python 2.7. the data from all nodes is dumped to a csv file on the linux filesystem. An example set would look like this:
001,24.00,60.00,0.000000,0.000000,0,03/09/18-03:03:14,-117,7.25
002,24.00,60.00,0.000000,0.000000,0,03/09/18-08:33:34,-113,7.25
001,21.00,73.00,-24.50561,142.464630,1,03/09/18-10:53:40,-118,8.75
The data is arranged as follows:
node_id,temperature,humidity,latitude,longitude,button_state,date/time,rssi,s/nr
I want to send different data from different nodes extracted to variable, string, list, or array; whatever I can use to send it off via mqtt or ReST on ThingSpeak. For instance the temperature at node 002 to field 4 on my thingspeak channel, latitude coordinate of node 001 to field 1. Once all the data I want is extracted from each line and sent on I want to delete the line.

I've read a bit about the built in csv module and pandas, but really don't know enough to have a starting point.