esp8266_p1meter icon indicating copy to clipboard operation
esp8266_p1meter copied to clipboard

Compiling in Arduino IDE

Open HanSyt opened this issue 6 years ago • 6 comments

It seems that some default libraries are changed. Ik had a view errors when compiling the code and uploading it to the ESP. Two main errors were:

  1. using double WifiUDP
  2. method not found

I changed the includes to this: #include <FS.h> #include <EEPROM.h> // * #include <DNSServer.h> #include <ESP8266WiFi.h> #include <Ticker.h> #include <WiFiManager.h> #include <ESP8266mDNS.h> // * #include <WiFiUdp.h> #include <ArduinoOTA.h> #include <PubSubClient.h> #include <SoftwareSerial.h>

HanSyt avatar Oct 20 '19 14:10 HanSyt

Thanks for letting me know, I recently moved and haven't had the time to reinstall the esp8266 on my meter. I hope I'l get to it soon, feel welcome to create a PR :)

fliphess avatar Jan 03 '20 09:01 fliphess

I've just fixed the SoftwareSerial object declaration in my fork and PR'd that #4

Why didn't the WifiUDP library compile? Those includes are probably not necessary and can be removed, but also shouldn't cause any harm...

Roosted7 avatar Jan 04 '20 23:01 Roosted7

I think it has something to do with not pinning the library versions, even though there not used... I didn't do much with arduino when I created this sketch so It must be something stupid ;)

In a few weeks the electrician is coming to my home to create a power outlet in the closet where the meter is located and I'll get to it....

fliphess avatar Jan 06 '20 08:01 fliphess

I think the libraries are depending on the compiler? I use Arduino IDE with esp8266 specific libraries. Also using a Wemos D1 Mini, so other board can behave in a different way.

HanSyt avatar Jan 11 '20 13:01 HanSyt

Hi, I uploaded my version with extra readings as a fork to github. Also added the changes of Roosted7 in it.

It compiles, but the p1 meter is not giving any data. So I studied a bit on the changes in espserial and made a further few changes in a develop branche with this information. However, no information either... so reverted back to the first version with board 2.5.2... shxx no data either. So, not sure whats wrong, maybe it's my p1 meter itself, it tends to stop sending data for a couple of hours in the past. Maybe somebody can check the code in de development branche?

HanSyt avatar Jan 11 '20 20:01 HanSyt

Hey @HanSyt !

I'm sorry for being so passive: At the moment I have no way of testing suggested changes as my own meter is not installed at the moment because of a move to a new home.

As soon as my power connection next to the meter is installed I will install my sketch on a new esp and check what needs to be done to have it running for the newer meter standard and with the newer arduino firmware for esp8266.

I prefer not to merge any PR until then as I can't test the suggested changes and I have some trust issues when it gets to merging without testing (no offence, it's a personal issue I'm working on :))

Thanks for your effort: Much appreciated! 👍

fliphess avatar Jan 13 '20 14:01 fliphess