Hi ,
How can I change the output JSON file format on a Sparkfun Datalogger IoT?
There are some spaces in the names that Amazon AWS doesn’t like. For example, Voltage (V) should be changed to Voltage(V) or simply Voltage . Is there a way to tell datalogger to output based on the format user specifies?
Currently, the datalogger outputs as:
{
“state”: {
“reported”: {
“MAX17048”: {
“Voltage (V)”: 4.28000021,
“State Of Charge (%)”: 111.5820313,
“Change Rate (%/hr)”: 0
},
“ISM330”: {
“Accel X (milli-g)”: -96.5019989,
“Accel Y (milli-g)”: -21.59399986,
“Accel Z (milli-g)”: 1006.5,
“Gyro X (milli-dps)”: 105,
“Gyro Y (milli-dps)”: -262.5,
“Gyro Z (milli-dps)”: -350,
“Temperature (C)”: 28.5859375
},
“MMC5983”: {
“X Field (Gauss)”: 0.233825684,
“Y Field (Gauss)”: 0.608032227,
“Z Field (Gauss)”: -0.121826172,
“Temperature (C)”: 31
}
}
},
It doesn’t look like it Configuration - SparkFun DataLogger IoT Hookup Guide, although the AWS example does show the same spacing/format AWS - SparkFun DataLogger IoT Hookup Guide
There is a somewhat similar issue posted DataLogger IoT upload format · Issue #20 · sparkfun/SparkFun_DataLogger · GitHub; might be worth submitting a new one for this
Thanks for the response.
The AWS example only has it up to reading activity in AWS. After that, when you try to send data to a timestream database and grafana to plot it, the formatting is raising issues.
I am hoping to be able to customize how the JSON file is written on the Sparkfun Datalogger IoT side. This way I can rule out the possibility of the message formatting as the source of the issue.
Is there a way to modify the firmware?
We do have source posted Releases · sparkfun/SparkFun_DataLogger · GitHub if you are comfortable with such Updating Firmware - SparkFun DataLogger IoT Hookup Guide has some pertinent info
You might be able to have a small scripting program being fed the data, reformat it and push it if that’s feasible for you
by source code I mean firmware source before compiling. For example in the form of arduino files (.ino) or C++ file
That product only has the files above available :-/