-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[P078] - Eastron - SoftwareSerial - ESP8266_4M1M - failing #4745
Comments
What is the 'success rate' on that setup using the "working" older firmware? (good/fail ratio of packets) |
Thanks @TD-er , them are all good questions. I did not want to flood the issue with info that might not be useful. Both devices are running five task, three which are P078 Test - test unit has an SDM120C - 2400 baud -
|
Edit | 1 | ✔ | Generic - System Info | SysInfo | ❶ | Uptime: 160.00 RSSI: -74.00 SystemLoad: 23.93 WebActivity: 117.18 | ||
---|---|---|---|---|---|---|---|---|
Edit | 2 | ✔ | Environment - BMx280 | BMx280 | I2C | ❶ | SDA: GPIO-4 (D2)SCL: GPIO-5 (D1) | Temperature: 16.58 Humidity: 0.00 Pressure: 1027.29 |
Edit | 3 | ✔ | Energy (AC) - Eastron SDM120C/220T/230/630 | SDM120C | SoftwareSerial | ❶ | RX: GPIO-13 (D7)TX: GPIO-12 (D6) | V: 236.50 A: 0.72 W: 163.50 cos_phi: 0.98 |
Edit | 4 | ✔ | Energy (AC) - Eastron SDM120C/220T/230/630 | SDM120P | SoftwareSerial | ❶ | RX: GPIO-13 (D7)TX: GPIO-12 (D6) | Hz: 50.04 Wh_imp: 4728.78 Wh_exp: 0.00 Wh_tot: 4728.78 |
Edit | 5 | ✔ | Energy (AC) - Eastron SDM120C/220T/230/630 | SDM120O | SoftwareSerial | ❶ | RX: GPIO-13 (D7)TX: GPIO-12 (D6) | VA: 167.55 VAr: -35.30 W: 163.70 Wh_tot: 4728.78 |
Live unit has an SDM220C - 9600 baud - Checksum (pass/fail): 5736/0
Edit | 1 | ✔ | Generic - System Info | SysInfo | ❶ | Uptime: 268.00 RSSI: -59.00 SystemLoad: 17.48 WebActivity: 499.08 | ||
---|---|---|---|---|---|---|---|---|
Edit | 2 | ✔ | Environment - DHT11/12/22 SONOFF2301/7021 | DHT22 | ❶ | GPIO-13 (D7) | Temperature: 19.20 Humidity: 46.10 | |
Edit | 3 | ✔ | Energy (AC) - Eastron SDM120C/220T/230/630 | SDM220C | SoftwareSerial | ❶ | RX: GPIO-12 (D6)TX: GPIO-14 (D5) | V: 238.31 A: 0.14 W: 34.34 cos_phi: 1.00 |
Edit | 4 | ✔ | Energy (AC) - Eastron SDM120C/220T/230/630 | SDM220W | SoftwareSerial | ❶ | RX: GPIO-12 (D6)TX: GPIO-14 (D5) | Hz: 50.15 Wh_imp: 34095.60 Wh_exp: 211.04 Wh_tot: 34306.64 |
Edit | 5 | ✔ | Energy (AC) - Eastron SDM120C/220T/230/630 | SDM220O | SoftwareSerial | ❶ | RX: GPIO-12 (D6)TX: GPIO-14 (D5) | VA: 34.38 VAr: 0.00 W: 34.34 Wh_tot: 34306.64 |
Old settings
Serial Settings:
Enable Serial port: [x]
Baud Rate: 115200
New settings
Serial Settings:
Enable Serial port: [x]
Baud Rate: 115200
Serial Port: HW Serial0: GPIO-3 (D9) <- TX / GPIO-1 (D10) -> RX
Thou I only use the Serial Console for provisioning and debugging.
Would the timing stats be helpful in any way?
I got a hypothesis about this, still need to verify.... I think the 'energy' build on ESP8266 is not having LIMIT_BUILD_SIZE defined and thus using the latest version of SW serial. Just wondering, why aren't you using GPIO 13 and 15 for this Eastron device? You need an extra PNP transistor for it (because GPIO-15 is pulled down and must be pulled down at boot), but it takes a lot less resources to use HWserial0 swapped compared to SW serial. So you could also try to set the unit to at least 9600 baud. Anyway, I will look into the SW serial issue. |
Hmm apparently I already reverted that so all ESP8266 builds should now use the older SWserial library: #ifndef USES_SW_SERIAL
# ifndef DISABLE_SOFTWARE_SERIAL
# define USES_SW_SERIAL 1
# ifndef USES_LATEST_SOFTWARE_SERIAL_LIBRARY
# ifdef ESP32
# define USES_LATEST_SOFTWARE_SERIAL_LIBRARY 1
# elif defined(ESP8266)
# define USES_LATEST_SOFTWARE_SERIAL_LIBRARY 0
# else // ifdef ESP32
# define USES_LATEST_SOFTWARE_SERIAL_LIBRARY 1
# endif // ifdef ESP32
# endif // ifndef USES_LATEST_SOFTWARE_SERIAL_LIBRARY
# else // ifndef DISABLE_SOFTWARE_SERIAL
# define USES_SW_SERIAL 0
# endif // ifndef DISABLE_SOFTWARE_SERIAL
#endif // ifndef USES_SW_SERIAL Is it possible for you to set the Eastron unit to 9600 baud? |
Can't really change the baud rate, without using the setup until, if I remember correctly? But, my main unit is set at 9600 and had the same problem, so I don't think that would help much. As for the reason for not using the hardware serial, was that I was debugging in the past and did not think I could use both serial console for debugging and ModBus Eastron meter. Can say that it's not the most stable setup, but these meters were only used for reporting and the meter maintains the metrics, not perfect, but gave me what I needed at the time. Not sure if this is worth debugging? Would anybody else want to use SW Serial on ESP8266 devices with these meters? Would it work better on ESP32? I can test and debug firmware, but I think I am going to work toward removing these devices as the solar inverter gives me the similar data that I can run my automation with. |
Yep ESP32 does have upto 3 hardware serial ports. I'm personally quite pleased with those small ESP32-C3 units with external antenna. (Seeed Studio XIAO - ESP32-C3) Those ESP32-variants with native USB allow to have the ESPeasy console via USB, so that doesn't cost you a hardware serial port. Better not use the ESP32-S2 as that one is a bit strange regarding native USB support. |
Here my extremely professional test bench setup.... It is running a build I made yesterday and it should be the same as this GH Actions build: https://github.com/letscontrolit/ESPEasy/actions/runs/5728205521 But just to be sure, here is the exact custom build I am using I did not get it to work without a separate linke between a GPIO pin and both DE/RE pins. So I will take a look at the signalling as it should also work with DE/RE connected to the TX pin. N.B. I have the MAX485 chip running at 5V here in my test setup. When using these GPIO pins, it should make no difference as these pins should be able to handle 5V. |
When this test build is ready, you can try testing as I'm quite confident about how it is now working :) Tested on ESP32 and ESP8266 board.
They are all 3 connected to the same board and working just fine. Tested using
Meaning that on ESP32 we don't even need to generate the low signal during TX transfers anymore as I now use the RTS signal to generate this exactly when we're sending data. As a bonus, I now also changed the SDM library to allow for async communications. I also reduced the build size, while maintaining all registers for all Eastron modules out there. There are now commands in ESPEasy to set/change baud rate and Modbus address for those modules with only a single button (e.g. SDM120) See the documentation |
Downloading and will test in the next few days, as I have not yet had a chance to change the hardware. Thanks @TD-er , you are a rock star! |
Custom build Using 2400 baud on SDM120 is working at the moment, tomorrow I will try and bump the baud to 9600. |
When using the OTA feature you can select ether the |
Please have a look at the documentation of these new commands: https://espeasy.readthedocs.io/en/latest/Plugin/P078.html#set-baudrate-id Also the changed baud rate is only active after a power cycle of the Eastron module. I know it is working as I have done it myself on a SDM120 which only has a single button and thus only allows changing settings via Modbus. |
Thank @TD-er , I did find the new docs, which are awesome. Using Node has been running since last night, which now has an uptime of 10h+ with only |
Thanks @tonhuisman , might be I am using OSX? But I can't select Thou it's FireFox, don't know if that should be a problem? |
The .bin.gz files (only for >1M ESP8266 builds) are exactly the same as the .bin files. |
Hmm have to look at the code, perhaps I forgot to add a You can still keep using the 2400 baud rate, but in my tests here, I noticed the SW serial gave way more often a watchdog reset when using SW serial at such a lower baud rate. |
The code is correct. |
Well, I don't have OSX available, but the file-browser does get |
Thanks for the info @TD-er Just checked on another 8266 node, gz firmware not selectable in the firmware upload dialog from my Mac. Also noted that there is not bin for the energy collection, need to ungzip, unlike some of the other collections. Not sure if this is an oversight or a bug? |
Thanks @tonhuisman . I don't know it's not supported on Mac, almost sure I have used the dialog box to upload zips. Some local testing, seems like I did see that the bin file for energy was included in 08th August build, did only check after I had posted. Oh boy, my test unit did not want to flash the new firmware. Had to wait 15min after cold boot before the firmware flashing worked. I see the Can I use the commands in the Not to make firmware bigger, but adding Ran into another odd issue, in |
That is caused by the selectors for the output Values, they overwrite with their default names on save, AFAICS.
Yes, you can type any command there, including the Eastron command. Only requirement is that the plugin (that handles the command if it's not an internal/core command) is Enabled. |
It seems that OSX is somewhat picky here. This SO answer lists the requirements quite clearly, but the description for 'starts with a period then a file-extension' is open for interpretation, and OSX obviously does that different from Windows (haven't tried on Linux, as I don't use Linux machines that have a GUI...). |
And what if you change the value names yourself and press submit? |
I did try change the names and hit submit, but the return page and Other plugins work as expected with updated names. |
Check! |
I see PR #4763, I will wait for a new release and test again. Thanks! |
Ton already noticed some issue with that PR, probably related to caching on ESP32, so it is not 100% fixed yet... |
It is all working well in the latest build, so this one can be closed From left to right...
|
Using
ESP_Easy_mega_20230623_energy_ESP8266_4M1M
.bin on two older NodeMCUs with Software Serial is returningnan
, where rolling back toESP_Easy_mega_20221224_energy_ESP8266_4M1M
.bin restores working operation.Under device, task using plugin P078, I am seeing
Checksum (pass/fail): 1/5193
. I have disabled all controller and plugins and still not getting the newer of the firmware working.I have setup, but disable for testing openhab mqtt controller. Both NodeMCUs have Sysinfo. One device has BMx280 on I2C and the other DHT22 temp sensors.
Not sure what else is useful info. Not urgent, as I have rolled back, but have a testing unit that I can/will test newer firmware on.
Checklist
I have...
ESP_Easy_mega-20181001_test_ESP8266_4096_VCC.bin
)Steps already tried...
.bin
files are included in the ZIP)If you self compile, please state this and PLEASE try to ONLY REPORT ISSUES WITH OFFICIAL BUILDS!
Summarize of the problem/feature request
YOUR TEXT GOES HERE
Expected behavior
YOUR TEXT GOES HERE
Actual behavior
YOUR TEXT GOES HERE
Steps to reproduce
System configuration
Hardware:
ESP Easy version:
ESP Easy settings/screenshots:
Rules or log data
The text was updated successfully, but these errors were encountered: