Strange Template Issue **solved**
Posted: Thu Apr 02, 2020 6:51 am
Hi,
On my MR3020 I have a template which outputs using FTP a series of variables every 5 minutes in a JSON format file with the date and time embedded in the file name. A background program picks these up and feeds them to a web site. This has been working fine for 2 weeks.
Then suddenly the background program that parses the JSON file created by the template every 5 minutes fails because it can't convert what should be a numeric value.
Inspecting the file in question reveals the issue. The template token has not been substituted. Just one item in the middle of others than have been converted fine. See following...
"thb0press":1020.0,
"thb0seapress":1021.1,
"rain0rate":0.0,
"rain0ratezero":"20200327140938",
"rain0sum5":[rain0total-sum5],
"rain0total":0.0,
"uv0index":0.0,
"sol0rad":77.0
The template generated files both 5 minutes before and after show the correct value of 0 (for rain0total-sum5).
Yes, there isn't a default value in token but there shouldn't need to be one because the sum will always be zero or greater.
As far as I can tell this has happened only once in 2 weeks. I manually edited the one problematic file, and then it and every other subsequent file was processed without error (implying no other file had this issue), and everything has run fine again for the last two days.
The template has run fine 14 days x 24 hours x 12 times/hour fine = 4032 times fine and then this.
Any ideas...
On my MR3020 I have a template which outputs using FTP a series of variables every 5 minutes in a JSON format file with the date and time embedded in the file name. A background program picks these up and feeds them to a web site. This has been working fine for 2 weeks.
Then suddenly the background program that parses the JSON file created by the template every 5 minutes fails because it can't convert what should be a numeric value.
Inspecting the file in question reveals the issue. The template token has not been substituted. Just one item in the middle of others than have been converted fine. See following...
"thb0press":1020.0,
"thb0seapress":1021.1,
"rain0rate":0.0,
"rain0ratezero":"20200327140938",
"rain0sum5":[rain0total-sum5],
"rain0total":0.0,
"uv0index":0.0,
"sol0rad":77.0
The template generated files both 5 minutes before and after show the correct value of 0 (for rain0total-sum5).
Yes, there isn't a default value in token but there shouldn't need to be one because the sum will always be zero or greater.
As far as I can tell this has happened only once in 2 weeks. I manually edited the one problematic file, and then it and every other subsequent file was processed without error (implying no other file had this issue), and everything has run fine again for the last two days.
The template has run fine 14 days x 24 hours x 12 times/hour fine = 4032 times fine and then this.
Any ideas...