Page 1 of 2
CU v7.3.2 Upgrade Problems with Extra Sensors
Posted: Sat 04 Jan 2025 11:30 pm
by lse-cumulus
Hi Hans,
1) I made an upgrade from CMX build 3282 (v3.28.5) to build 4067 (v4.3.2). And after seeing no problem with CMX, I continued with CumulusUtils upgrade from CU v6.23.6 to v7.3.2.
2) Also the CU upgrade was basically succesfull. All is working fine, except the Extra Sensors.
I get the following two errors in utils\bin\cumulusutils.exe UserAskedData:
- Failing in GenerateExtraSensorDataJson - i.e. ExtraSensors (incl External) data).
Message - Object reference not set to an instance of an object.)
- Uploading => extrasensorsdata.json from utils/extrasensorsdata.json
No valid JSON data in the received data
(this 2nd error could be just a consequence of the 1st error).
Code: Select all
2025-01-04 23:30:31.485 Information ExtraSensorslog constructor: Using fixed path: | data/ |; file: | *log.txt
2025-01-04 23:30:31.485 Information ExtraSensorslog: starting
2025-01-04 23:30:31.486 Information ExtraSensorslog: timeStart = 04.01.2025 23:16:00; timeEnd = 04.01.2025 23:30:00
2025-01-04 23:30:31.486 Information ExtraSensorslog: Require data/ExtraLog202501.txt to start
2025-01-04 23:30:31.498 Information ExtraSensorslog: Finished reading the log at 04.01.2025 23:30:00
2025-01-04 23:30:31.498 Information ExtraSensorslog: MainExtraSensorsValuesList created: 3 records.
2025-01-04 23:30:31.498 Information ExtraSensorslog: End
2025-01-04 23:30:31.498 Information UserAskedData: Failing in GenerateExtraSensorDataJson - i.e. ExtraSensors (incl External) data)
2025-01-04 23:30:31.498 Information UserAskedData: Message - Object reference not set to an instance of an object.)
2025-01-04 23:30:31.498 Information UserAskedData: Continuing
I tried to delete the extrasensorsdata.json file. But then either the UserAskedData does not try to upload at all, or tries to upload a zero size file (with invalid JSON data).
3) I think the problem might be related to CMX/CU Null Value handling. Since the upgrade to CMX b4067 and the restart arround 16:00 the ExtraLog202501.txt file contains null-values. And one of my SoilMoist sensors just stopped working today (battery) and so null values are recored for this sensor.
I also had problems with invalid JSON structure for the customLogs and file customlogsRecentdata.json. I could fix that problem by editing the Clog*.txt file and replacing the - (hyphen) by 0 and modifying the custom log webtags to <#SoilMoisture2 rc=y nv=0>.
4) Attached a zip file with the most recent utilslog of UserAskedData and the Extra Logfile.
Re: CU v7.3.2 Upgrade Problems with Extra Sensors (null values? Failing in GenerateExtraSensorDataJson)
Posted: Sun 05 Jan 2025 8:26 am
by lse-cumulus
Problem with Extra Sensors seemed to fix itself, after I replaced the battery in SoilMost sensor#2 and the ExtraLogfile no longer recored this sensor with null values (started to report 0 from 06:35). The next run auf UserAskedData at 07:00 had no longer problems in GenerateExtraSensorDataJson and only reported no valid JSON once and generated new extrasensorsdata.json file on my webserver directory. With that valid json file now Extra Sensorsdisplays charts again (of course with just a couple of values as file was produced from scratch).
The Later 2nd run at 08:00 of UserAskedData could succesfully append data to the extrasensorsdata.json file.
But at next 3rd run at 09:00 of UserAskedData I got again the error and no upload/append was tried. And the Extra Logfile shows that soilMoist Sensor#2 again had 2x null values from 08:30 - 08:35 (have to use better battery) and that falls exactly into the parsing time of GenerateExtraSensorDataJson:
Code: Select all
2025-01-05 09:05:02.152 Information ExtraSensorslog: starting
2025-01-05 09:05:02.152 Information ExtraSensorslog: timeStart = 05.01.2025 08:01:00; timeEnd = 05.01.2025 09:00:00
2025-01-05 09:05:02.152 Information ExtraSensorslog: Require data/ExtraLog202501.txt to start
2025-01-05 09:05:02.166 Information ExtraSensorslog: Finished reading the log at 05.01.2025 09:00:00
2025-01-05 09:05:02.166 Information ExtraSensorslog: MainExtraSensorsValuesList created: 11 records.
2025-01-05 09:05:02.166 Information ExtraSensorslog: End
2025-01-05 09:05:02.167 Information UserAskedData: Failing in GenerateExtraSensorDataJson - i.e. ExtraSensors (incl External) data)
2025-01-05 09:05:02.167 Information UserAskedData: Message - Object reference not set to an instance of an object.)
2025-01-05 09:05:02.167 Information UserAskedData: Continuing
See attached utilslog and Extra Logfile.
So I think that strongly hints that CU might have a problem with CMX null values in the Extra Sensor module, when referenced extra sensors are not reporting/producing data. Seems also to be the case for CustomLogs, but there as workarround the webtag can be specified with nv=0 syntax for compensation.
Hans maybe you can have a look into this. Thx.
Re: CU v7.3.2 Upgrade Problems with Extra Sensors (null values)
Posted: Mon 06 Jan 2025 8:17 am
by lse-cumulus
All my sensors are now reachable and sending data, so no null values produced in Extra Logs.
Therefore ExtraSensor module from CU is working fine and no errors in UserAskedData.
I think my problem is related to the following forum topic:
viewtopic.php?t=22846.
For CustomLogs the workarround from CMX/Mark with Webtag nv=0 is a valid solution. For CU ExtraLogs I have no direct control of the webtags used internally by CU ... (would need a code change in CU or a global parameter settings in CMX for webtag null values as Hans suggested).
Re: CU v7.3.2 Upgrade Problems with Extra Sensors (null values)
Posted: Tue 07 Jan 2025 11:34 am
by HansR
lse-cumulus wrote: ↑Mon 06 Jan 2025 8:17 am
All my sensors are now reachable and sending data, so no null values produced in Extra Logs.
Therefore ExtraSensor module from CU is working fine and no errors in UserAskedData.
I think my problem is related to the following forum topic:
viewtopic.php?t=22846.
For CustomLogs the workarround from CMX/Mark with Webtag nv=0 is a valid solution. For CU ExtraLogs I have no direct control of the webtags used internally by CU ... (would need a code change in CU or a global parameter settings in CMX for webtag null values as Hans suggested).
- I consider this topic solved
- It is not related to the CustomLog issue in the cited topic because the ExtraSensor values are read by CUtils explicitly from the log and not through the webtags. CustomLogs are fundamentally different from ExtraSensors (both in CMX as in CUtils).
- When there are null values, they should display in the chart as a straight line to the next valid value. If there appears to be a problem with that (I'll start testing later) I will take action.
Re: CU v7.3.2 Upgrade Problems with Extra Sensors null values cause that no extrasensorsdata.json is produced
Posted: Tue 07 Jan 2025 2:29 pm
by lse-cumulus
Hans
a) I agree, my topic here with extra sensors, is independant from Custom Logs
b) I was not aware of inner working of CU and that Extra Sensor data is not read via Webtag but directly from Extralog File.
c) But my problem is the following: as soon as an extra sensor does not send data, a NULL VALUE is written to Extra Logfile (in the CMX Edit log Editor I see an empty field in that case, instead of numerical value like 0 or 1.3, ...)
and exactly in that situation the utils UseraskedData does not produce any extrasensorsdata.json data structure at all and does not try to upload any data or produces an invalid json structure detected by upload.php.
And as a consequence the CU extra chart stop. And not only for the missing sensor but for all extra sensors.
That is my problem.
I do not know where CU writes the interim extrasensorsdata.json file before trying the upload so I could not attach.
In the cutils log also no error appears, but just the following informational lines:
Information UserAskedData: Failing in GenerateExtraSensorDataJson - i.e. ExtraSensors (incl External) data)
Information UserAskedData: Message - Object reference not set to an instance of an object.)
As soon as no null values are recorded any longer in the extra Logfile (in the 1 hour intervall that useraskedata looks up, as I run it hourly), the two informational lines disappear and a correct extrasensorsdata.json is uploaded.
During the CMX/CU upgrade I did first overlook the informational lines and thought i had just an upload.php problem and deleted the file extrasensorsdata.json from my webserver directory. Then of course no extra sensor charts were displayed at all,
but I also did not get a new extrasensorsdata.json file as any useraskeddata run failed to produce a new file (or upload it) as long as null values were found in the Extra Logfile.
Re: CU v7.3.2 Upgrade Problems with Extra Sensors
Posted: Tue 07 Jan 2025 3:29 pm
by HansR
@Leo: OK. Fair enough. As I said I will be testing and find a solution. The solution will be in the sense that the json will be created and that specific sensor will no longer show. As soon as it starts giving data that will be plotted again with a straight line between the last valid value and the new value.
Re: CU v7.3.2 Upgrade Problems with Extra Sensors null values cause that no extrasensorsdata.json is produced
Posted: Tue 07 Jan 2025 5:43 pm
by HansR
Some intermediate info:
lse-cumulus wrote: ↑Tue 07 Jan 2025 2:29 pm
c) But my problem is the following: as soon as an extra sensor does not send data, a NULL VALUE is written to Extra Logfile (in the CMX Edit log Editor I see an empty field in that case, instead of numerical value like 0 or 1.3, ...)
and exactly in that situation the utils UseraskedData does not produce any extrasensorsdata.json data structure at all and does not try to upload any data or produces an invalid json structure detected by upload.php.
And as a consequence the CU extra chart stop. And not only for the missing sensor but for all extra sensors.
That is my problem.
OK, it seems a bit more complex than just that (see
here) but I am understanding the null value issue and why it stops.
It seems to me however that the problem should automatically go away as soon as you re-detect a value.
Deleting the json from the server may be a root cause of the whole thing. The error would just cancel the update of the json and therefore the chart.
lse-cumulus wrote: ↑Tue 07 Jan 2025 2:29 pm
I do not know where CU writes the interim extrasensorsdata.json file before trying the upload so I could not attach.
All files are written to the utils directory. BUT: the json files are deleted when successfully uploaded. If unsuccessful, they are not deleted and ready for inspection.
The fact that you don't see a json in the utils directory or on the server would mean it is not generated at all or successfully transferred
In the cutils log
lse-cumulus wrote: ↑Tue 07 Jan 2025 2:29 pm
also no error appears, but just the following informational lines:
Information UserAskedData: Failing in GenerateExtraSensorDataJson - i.e. ExtraSensors (incl External) data)
Information UserAskedData: Message - Object reference not set to an instance of an object.)
This is caused by a bug.
lse-cumulus wrote: ↑Tue 07 Jan 2025 2:29 pm
As soon as no null values are recorded any longer in the extra Logfile (in the 1 hour intervall that useraskedata looks up, as I run it hourly), the two informational lines disappear and a correct extrasensorsdata.json is uploaded.
During the CMX/CU upgrade I did first overlook the informational lines and thought i had just an upload.php problem and deleted the file extrasensorsdata.json from my webserver directory. Then of course no extra sensor charts were displayed at all,
but I also did not get a new extrasensorsdata.json file as any useraskeddata run failed to produce a new file (or upload it) as long as null values were found in the Extra Logfile.
Ik will correct the bug and wait for certainty on the null values logging for a sensor that is not available.
to be cont.
Re: CU v7.3.2 Upgrade Problems with Extra Sensors
Posted: Tue 07 Jan 2025 8:38 pm
by lse-cumulus
fair enough hans, now I understand we are on the same page. I thought I had not explained the problem good enough.
(and I just should have replaced the battery in my sensor and executed a new UserAskedData before deleting the extrasensorsdata.json from my webserver ...)
Re: CU v7.3.2 Upgrade Problems with Extra Sensors
Posted: Wed 08 Jan 2025 11:36 am
by HansR
@Leo:
Please find attached a beta with the null value issue for ExtraSensors fixed (I hope) - only the bin content.
Could you test this?
Please note that if the files does not exist on the server it will create one but only with the values it receives. This means that the ExtraSensors chart(s) will most likely slowly fill. With only an hourly update don't get impatient with the mostly empty chart(s) but do check if the values are there on the right of the chart after the first update (assuming no null values are there anymore).
If successful, please post a link to the chart(s).
NOTE: the CMX fix may take some time.
NOTE: I withdrew v7.3.3 beta 3 as it was overtaken by beta 4. Please use that version for your tests
Re: CU v7.3.2 Upgrade Problems with Extra Sensors
Posted: Wed 08 Jan 2025 6:42 pm
by lse-cumulus
Hans,
thx for the fast fix. I can and will test the beta on the weekend.
Re: CU v7.3.2 Upgrade Problems with Extra Sensors
Posted: Wed 08 Jan 2025 6:50 pm
by lse-cumulus
Hans, just one question: why do you say there will also be a future CMX fix? for me the CMX null value behavior seems correct ...
Re: CU v7.3.2 Upgrade Problems with Extra Sensors
Posted: Wed 08 Jan 2025 7:30 pm
by HansR
lse-cumulus wrote: ↑Wed 08 Jan 2025 6:50 pm
Hans, just one question: why do you say there will also be a future CMX fix? for me the CMX null value behavior seems correct ...
See
here.
Re: CU v7.3.2 Upgrade Problems with Extra Sensors
Posted: Sat 11 Jan 2025 6:12 am
by HansR
I withdrew beta 3, please continue with beta 4.
Re: CU v7.3.2 Upgrade Problems with Extra Sensors: Test with CU 7.3.3 Beta4
Posted: Sat 11 Jan 2025 6:11 pm
by lse-cumulus
hi Hans,
I installed CU 7.3.3 Beta4 today and tested Extra Sensors with null Values.
Result: partially succesfull.
- 15:00 utils useraskeddata and utisl Website BEFORE null values; just to verify that all is ok with CU 7.3.3 Beta4
- 15:45 removed batterie from WH51CH2 soilmoisture sensor. Needed to restart CMX to ask GW2000 again to detect that sensor sends no longer data
- 16:00 Utils UserAskedData runs OK and can handle null vaues, no error messages, no info messages in GenerateExtraSensorDataJson; extrasensorsdata.json uploaded without errors; problem seems to be resolved. Extra Chart shows continuing line with previous value. Unfortunately I did NOT take a screenshot and wanted to do it after next UserAskedData.
- 17:00 but 2nd UserAskedData could not upload extrasensorsdata.json. upload.php reported no valid json data in file; but in the logfile I canot see the previous info lines that accompanied the null value problem (Failing in GenerateExtraSensorDataJson, Message - Object reference not set to an instance of an object). The Website Extra Sensor Charts no longer shows any data at all. So the problem seems to be back but in a slightly different form. But it could also be that I ran here into a new or other issue ...
- 18:00 disabled another sensor WH31CH3 Temperature (as I saw that soil moisture is no ideal candidate and takes too long to refelect changes and went to 0 when removing from soil). Utils Useraskeddata reports no errors during Generation of Extra Sensors, but reports no valid json data when trying to upload extrasensorsdata.json
- 18:15 activated both sensors again; restarted CMX and waited until extra Logfile shows no longer null values
- 18:30 utils UserAskedData works OK and uploads succesfully extrasensorsdata.json. The error no valid json data disappeared. The Website Extra Sensors Charts work again and I took screenshot. The charts show no data for both sensors before 18:15, but data start at 18:15 again for extra Temperature and Extra Soil Moisture.
- 19:00 waited for next utils UserAskedData and continues to be ok.
Attached you find the logfiles of utils useraskedata commands, screenshots from Extra Sensor charts and Extra Logfile.
Should I run test again?
https://leonas.ddns.net/Wetterstation.S ... ilMoisture
https://leonas.ddns.net/Wetterstation.S ... emperature
Leo.Extra.Sensors.Chart.v7.3.3.beta4.after.null.values.temp.OK.jpg
Re: CU v7.3.2 Upgrade Problems with Extra Sensors
Posted: Sat 11 Jan 2025 6:55 pm
by HansR
@leo: thanks for the extensive report. I'll come back to it when studied.