Running to the software serial limit ?
Posted: Sun Jan 26, 2020 6:05 pm
Hello All,
Im using an LoLIn ESP8266 nodemcu to read out my digital (electricity and gas) meter via
#define SERIAL_RX D7 // pin for SoftwareSerial RX
SoftwareSerial mySerial(SERIAL_RX, -1, true, MAXLINELENGTH); // (RX, TX. inverted, buffer)
But most of the readings ( 1 per second and software serial speed is 115200 ) always contain one or some mis readings. I only have 1 correct reading in about 10 to 30 readings ( luckly there is a CRC)
See example below :
0-1:24.1.0(0p3)
should have been
0-1:24.1.0(003)
( in human language : current consumptions is 003 amperes )
One compleet reading looks like this (I removed or modified some lines as these are id's ) :
1-0:1.8.1(000155.825*kWh)
1-0:1.8.2(000115.526*kWh)
1-0:2.8.1(000029.778*kWh)
1-0:2.8.2(000013.810*kWh)
0-0:96.14.0(0001)
1-0:1.7.0(00.562*kW)
1-0:2.7.0(00.000*kW)
1-0:32.7.0(228.0*V)
1-0:31.7.0(002*A)
0-0:96.3.10(1)
0-0:17.0.0(999.9*kW)
1-0:31.4.0(999*A)
0-0:96.13.0()
0-1:24.1.0(0p3)
0-1:96.1.1(123456789)
0-1:24.4.0(1)
0-1:24.2.3(123456789)(00161.732*m3)
!4249
===INVALID CRC FOUND!===
I know software serial isn't ideal for such high speeds, but as far as I untherstood I don't have an alternative here as the uart is used/connected by/to the USB chip ( and swapping to the uart data control lines didn't work for me)
Do you thing I'm running here to the limit of the software serial capacity ?
Or should there still be somewhere a solutions ?
Seems to me that timing isn't just correct or a bit off ?
PS : my sketch is a deriviate from
https://github.com/jantenhove/P1-Meter-ESP8266/blob/master/P1Meter.ino
( Thanks Jan ! Bedankt Jan Ten Hove voor dit mooi stukje programeerwerk !)
Already thanks for all reactions and replys !
Im using an LoLIn ESP8266 nodemcu to read out my digital (electricity and gas) meter via
#define SERIAL_RX D7 // pin for SoftwareSerial RX
SoftwareSerial mySerial(SERIAL_RX, -1, true, MAXLINELENGTH); // (RX, TX. inverted, buffer)
But most of the readings ( 1 per second and software serial speed is 115200 ) always contain one or some mis readings. I only have 1 correct reading in about 10 to 30 readings ( luckly there is a CRC)
See example below :
0-1:24.1.0(0p3)
should have been
0-1:24.1.0(003)
( in human language : current consumptions is 003 amperes )
One compleet reading looks like this (I removed or modified some lines as these are id's ) :
1-0:1.8.1(000155.825*kWh)
1-0:1.8.2(000115.526*kWh)
1-0:2.8.1(000029.778*kWh)
1-0:2.8.2(000013.810*kWh)
0-0:96.14.0(0001)
1-0:1.7.0(00.562*kW)
1-0:2.7.0(00.000*kW)
1-0:32.7.0(228.0*V)
1-0:31.7.0(002*A)
0-0:96.3.10(1)
0-0:17.0.0(999.9*kW)
1-0:31.4.0(999*A)
0-0:96.13.0()
0-1:24.1.0(0p3)
0-1:96.1.1(123456789)
0-1:24.4.0(1)
0-1:24.2.3(123456789)(00161.732*m3)
!4249
===INVALID CRC FOUND!===
I know software serial isn't ideal for such high speeds, but as far as I untherstood I don't have an alternative here as the uart is used/connected by/to the USB chip ( and swapping to the uart data control lines didn't work for me)
Do you thing I'm running here to the limit of the software serial capacity ?
Or should there still be somewhere a solutions ?
Seems to me that timing isn't just correct or a bit off ?
PS : my sketch is a deriviate from
https://github.com/jantenhove/P1-Meter-ESP8266/blob/master/P1Meter.ino
( Thanks Jan ! Bedankt Jan Ten Hove voor dit mooi stukje programeerwerk !)
Already thanks for all reactions and replys !