I will apologize first, and take any critique!
I am trying to pull API data from a mobile router, that gives me plenty of JSON formatted output on what I need. Of this data, I am parsing to capture only specific info pertaining to the devices SystemID, gps data, and 6 cell RF values. Output and saved to a csv file on my machine.
Below is node flow, and that works but nothing gets written to file. I've confirmed permissions in the directory and on the file as well.
systemid = msg.payload.data.config.system.system_id + ","
lat = msg.payload.data.status.gps.lastpos.latitude + ","
long = msg.payload.data.status.gps.lastpos.longitude + ","
carr1 = msg.payload.data.status.wan.devices["mdm-6073fa91"].diagnostics.CARRID + ","
rssi1 = msg.payload.data.status.wan.devices["mdm-6073fa91"].diagnostics.DBM + ","
carr2 = msg.payload.data.status.wan.devices["mdm-7bd7f9ac"].diagnostics.CARRID + ","
rssi2 = msg.payload.data.status.wan.devices["mdm-7bd7f9ac"].diagnostics.DBM + ","
carr3 = msg.payload.data.status.wan.devices["mdm-755dc037"].diagnostics.CARRID + ","
rssi3 = msg.payload.data.status.wan.devices["mdm-755dc037"].diagnostics.DBM + ","
return { systemid,lat,long,carr1,rssi1,carr2,rssi2,carr3,rssi3 };
Debug output of the above:
10/22/2018, 2:20:46 PM node: 867c1577.f24f7
msg : Object
object
systemid: "IBR1700-190,"
lat: "43.580831333333336,"
long: "-116.6106175,"
carr1: "Verizon,"
rssi1: "-73,"
carr2: "AT&T,"
rssi2: "-59,"
carr3: "Sprint,"
rssi3: "-67,"
_msgid: "cd5f9480.610958"
Any pointers I'm all ears, this is driving me nuts.