{"action":"created","issue":{"url":"https://api.github.com/repos/olehs/PZEM004T/issues/40","repository_url":"https://api.github.com/repos/olehs/PZEM004T","labels_url":"https://api.github.com/repos/olehs/PZEM004T/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/olehs/PZEM004T/issues/40/comments","events_url":"https://api.github.com/repos/olehs/PZEM004T/issues/40/events","html_url":"https://github.com/olehs/PZEM004T/issues/40","id":322418609,"number":40,"title":"Using ESP8266 Hardware UART for PZEM-004t","user":{"login":"Vadzz-K","id":38971967,"avatar_url":"https://avatars2.githubusercontent.com/u/38971967?v=4","gravatar_id":"","url":"https://api.github.com/users/Vadzz-K","html_url":"https://github.com/Vadzz-K","followers_url":"https://api.github.com/users/Vadzz-K/followers","following_url":"https://api.github.com/users/Vadzz-K/following{/other_user}","gists_url":"https://api.github.com/users/Vadzz-K/gists{/gist_id}","starred_url":"https://api.github.com/users/Vadzz-K/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vadzz-K/subscriptions","organizations_url":"https://api.github.com/users/Vadzz-K/orgs","repos_url":"https://api.github.com/users/Vadzz-K/repos","events_url":"https://api.github.com/users/Vadzz-K/events{/privacy}","received_events_url":"https://api.github.com/users/Vadzz-K/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-11T20:06:21Z","updated_at":"2018-05-12T09:50:00Z","closed_at":null,"author_association":"NONE","body":"Hi all!\r\nI 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:\r\n`HardwareSerial hwser(UART0);`\r\n`PZEM004T pzem(&hwser); // Connect to PZEM via HW_serial`\r\nI 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:\r\n`ets Jan  8 2013,rst cause:8, boot mode:(3,6)`\r\n`wdt reset`\r\n`load 0x4010f000, len 1264, room 16`\r\n`tail 0`\r\n`chksum 0x42`\r\n`csum 0x42`\r\n`~ld`\r\nIf 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:\r\n`PZEM004T pzem(&Serial);`\r\n`IPAddress ip(192,168,1,1);`\r\nThank you. Maybe someone will benefit from this information.\r\n\r\n>@vortigont:\r\n @Vadzz-K actually it's the same setup. \"Serial\" object you are using must be created first.\r\nCould you, pls, specify esp core version and SDK you've faced this issues? Was it a default Arduino's IDE update or a trunk/git version os ESP8266 core? Looks like something has changed in recent core's updates to the default objects. Maybe we need to fix the example but it must be done in a way to keep compatibility with an old IDE/core versions.\r\nThanks for the report!\r\nP.S. pls, create a new issue for this case. It would be easier to track it.\r\n\r\nI 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...."},"comment":{"url":"https://api.github.com/repos/olehs/PZEM004T/issues/comments/388543789","html_url":"https://github.com/olehs/PZEM004T/issues/40#issuecomment-388543789","issue_url":"https://api.github.com/repos/olehs/PZEM004T/issues/40","id":388543789,"user":{"login":"KPeare","id":38277260,"avatar_url":"https://avatars0.githubusercontent.com/u/38277260?v=4","gravatar_id":"","url":"https://api.github.com/users/KPeare","html_url":"https://github.com/KPeare","followers_url":"https://api.github.com/users/KPeare/followers","following_url":"https://api.github.com/users/KPeare/following{/other_user}","gists_url":"https://api.github.com/users/KPeare/gists{/gist_id}","starred_url":"https://api.github.com/users/KPeare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KPeare/subscriptions","organizations_url":"https://api.github.com/users/KPeare/orgs","repos_url":"https://api.github.com/users/KPeare/repos","events_url":"https://api.github.com/users/KPeare/events{/privacy}","received_events_url":"https://api.github.com/users/KPeare/received_events","type":"User","site_admin":false},"created_at":"2018-05-12T09:50:00Z","updated_at":"2018-05-12T09:50:00Z","author_association":"NONE","body":"Hi, and thank you for your reply. I am very new to using Arduino so please excuse me.\r\nthe unit I have is a wemos.cc LoLin new NodeMcu V3.\r\nI have downloaded a default example 'Blink' and connected a LED just to check it out.\r\nI have then copied the files for PZEM004t from github. Then tried download but that's when I get the error, \"Error compiling for board NodeMCU 1.0 (ESP-12E Module).\".\r\n\r\nAt this stage I don't really know where I'm going wrong.\r\n\r\nRegards\r\nKevin"}}
{"actor":{"display_login":"KPeare"}}