Closed borpin closed 3 years ago
I noticed that some of the startup messages were missing. This is because not every line in the startup messages generated by the EmonTX have a /r/n
.
2021-01-17 17:52:02,600 DEBUG SerialTx START MESSAGE: emonTx V3.4 EmonLibCM Continuous Monitoring V1.80
2021-01-17 17:52:02,709 DEBUG SerialTx START MESSAGE: OpenEnergyMonitor.org
2021-01-17 17:52:02,821 DEBUG SerialTx START MESSAGE: Loaded EEPROM config
2021-01-17 17:52:02,929 DEBUG SerialTx START MESSAGE: Settings:
2021-01-17 17:52:03,045 DEBUG SerialTx START MESSAGE: Group 210, Node 15, Band 433 MHz
2021-01-17 17:52:03,260 DEBUG SerialTx START MESSAGE: Calibration:
2021-01-17 17:52:03,367 DEBUG SerialTx START MESSAGE: vCal = 268.97
2021-01-17 17:52:03,481 DEBUG SerialTx START MESSAGE: i1Cal = 90.90
2021-01-17 17:52:03,588 DEBUG SerialTx START MESSAGE: i1Lead = 4.20
2021-01-17 17:52:03,695 DEBUG SerialTx START MESSAGE: i2Cal = 90.90
2021-01-17 17:52:03,802 DEBUG SerialTx START MESSAGE: i2Lead = 4.20
2021-01-17 17:52:03,910 DEBUG SerialTx START MESSAGE: i3Cal = 90.90
2021-01-17 17:52:04,019 DEBUG SerialTx START MESSAGE: i3Lead = 4.20
2021-01-17 17:52:04,130 DEBUG SerialTx START MESSAGE: i4Cal = 16.67
2021-01-17 17:52:04,262 DEBUG SerialTx START MESSAGE: i4Lead = 6.00
2021-01-17 17:52:04,386 DEBUG SerialTx START MESSAGE: datalog = 10.01
2021-01-17 17:52:04,493 DEBUG SerialTx START MESSAGE: pulses = 1
2021-01-17 17:52:04,601 DEBUG SerialTx START MESSAGE: pulse period = 100
2021-01-17 17:52:04,709 DEBUG SerialTx START MESSAGE: temp_enable = 1
2021-01-17 17:52:04,820 DEBUG SerialTx START MESSAGE: Temperature Sensors found = 0 of 1
2021-01-17 17:52:04,936 DEBUG SerialTx START MESSAGE: Temperature measurement is NOT enabled.
2021-01-17 17:52:05,040 DEBUG SerialTx START MESSAGE:
2021-01-17 17:52:05,147 DEBUG SerialTx START MESSAGE: RF off
2021-01-17 17:52:05,258 DEBUG SerialTx START MESSAGE: POST.....wait 10s
2021-01-17 17:52:05,384 DEBUG SerialTx START MESSAGE: '+++' then [Enter] for config mode
2021-01-17 17:52:12,614 DEBUG SerialTx START MESSAGE: CT1 detected, i1Cal:90.90
2021-01-17 17:52:23,061 DEBUG SerialTx START MESSAGE: AC present
2021-01-17 17:52:23,180 DEBUG SerialTx 1041 NEW FRAME : MSG:1,Vrms:243.27,P1:546,E1:1,pulse:1
Thanks @borpin sounds good, sorry for the delay in merging this.
If the EmonTX is reset, the interfacer trys to interpret the incoming serial lines as data messages. This can result in spurious inputs being created.
By checking for the string "MSG:" in the decoded text, this can be avoided.
As a bonus, the initial output from the EmonTX can be recorded.
I have also reset the buffer at line 50. I think this is more correct.
I also query why this return does not return
False
Output seen in
emonhub.log
to first MSG