-
Notifications
You must be signed in to change notification settings - Fork 114
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
Using ESP8266 Hardware UART for PZEM-004t #40
Comments
Hi, and thank you for your reply. I am very new to using Arduino so please excuse me. At this stage I don't really know where I'm going wrong. Regards |
@Vadzz-K
But I've used https://platformio.org/ IDE for building and switching different core versions. So the issue might be in way arduino IDE build runs or maybe there is something special in your sketch? Could you, please, try to build and test just an example sketch from PZEM004T lib and check if it crashes too? Also would be nice to try and build it with your class option to check if builds at all? |
@KPeare |
@vortigont |
Found a PR esp8266/Arduino#2807 that now allows disabling global serial obj's through define's. So I I've tested both lib's example sketch and using global obj serial (PZEM004T pzem(&Serial);), both seems fine to me. Pls, let me know if you could find more details about your issue or exluding other libs tests. |
Hi @vortigont |
Use this library : https://github.com/SumeriLal/Arduino/tree/master/MasterPZEM |
Hi all!
I have a long time working ESP8266 (ESP12-E) with PZEM-004t. I using hardware UART (and OTA for firmware update). To work with hardware UART, the configuration was used as indicated in the example:
HardwareSerial hwser(UART0);
PZEM004T pzem(&hwser); // Connect to PZEM via HW_serial
I periodically updated Arduino IDE, libraries and boards. And recently I needed to make changes to the firmware of ESP8266 (changes not related to the PZEM-004t module). All successfully compiled, updated the firmware on the OTA, and the ESP8266 stopped running - more precisely, it constantly rebooted by the watchdog timer, like this:
ets Jan 8 2013,rst cause:8, boot mode:(3,6)
wdt reset
load 0x4010f000, len 1264, room 16
tail 0
chksum 0x42
csum 0x42
~ld
If you exclude the PEME004T.h library and associated functions from the project, then the ESP starts and runs normally. I spent a lot of time figuring out this problem, eventually it all worked after I determined the use of hardware UART in the sketch as follows:
PZEM004T pzem(&Serial);
IPAddress ip(192,168,1,1);
Thank you. Maybe someone will benefit from this information.
I can not say at exactly the exact moment when the design specified in the example stopped working because my device has been running for about six months and during this period I periodically updated Arduino IDE, libraries and boards (including esp8266 core) - but there was no need to compile the firmware for my device. I saw this bug just now: Arduino IDE 1.8.0, Esp8266 by Esp8266 Community version 2.4.1....
The text was updated successfully, but these errors were encountered: