psvanstrom / esphome-p1reader

ESPHome custom component for reading P1 data from electricity meters.
MIT License
267 stars 116 forks source link

Issue compiling #23

Closed RealElwood closed 2 years ago

RealElwood commented 2 years ago

I get the following when installing, i get 1 device and no entities. Wired with the custom PCB and a wemos d1 mini. Running ESPHome 2021.10.3

`INFO Reading configuration /config/esphome/p1-reader.yaml... INFO Generating C++ source... INFO Compiling app... Processing p1-reader (board: nodemcu; framework: arduino; platform: platformio/espressif8266 @ 2.6.3)

HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash Dependency Graph |-- 1.2.3 | |-- 1.0 |-- 2.0.0 | |-- 1.2.3 | | |-- 1.0 | |-- 1.0 | |-- 1.0 |-- 1.0 |-- 1.2 | |-- 1.0 |-- 0.1.4 | |-- 1.10018.1 |-- 1.1.1 | |-- 1.0 Compiling /data/p1-reader/.pioenvs/p1-reader/src/main.cpp.o Compiling /data/p1-reader/.pioenvs/p1-reader/lib67b/ESP8266WiFi/WiFiClientSecureBearSSL.cpp.o Compiling /data/p1-reader/.pioenvs/p1-reader/lib67b/ESP8266WiFi/WiFiServer.cpp.o Compiling /data/p1-reader/.pioenvs/p1-reader/lib67b/ESP8266WiFi/WiFiServerSecureAxTLS.cpp.o In file included from src/main.cpp:53:0: src/p1reader.h:97:3: error: stray '\302' in program

esphome-p1reader/p1reader.h at main · psvanstrom/esphome-p1reader · GitHub

^ src/p1reader.h:97:3: error: stray '\267' in program src/p1reader.h:97:3: error: stray '\302' in program src/p1reader.h:97:3: error: stray '\267' in program In file included from src/main.cpp:53:0: src/p1reader.h:366:10: warning: missing terminating ' character [enabled by default]

^ src/p1reader.h:2672:7: error: missing terminating ' character
^ In file included from src/main.cpp:53:0: src/p1reader.h:2738:5: error: stray '\342' in program You can’t perform that action at this time. ^ src/p1reader.h:2738:5: error: stray '\200' in program src/p1reader.h:2738:5: error: stray '\231' in program Compiling /data/p1-reader/.pioenvs/p1-reader/lib67b/ESP8266WiFi/WiFiServerSecureBearSSL.cpp.o Compiling /data/p1-reader/.pioenvs/p1-reader/lib67b/ESP8266WiFi/WiFiUdp.cpp.o In file included from src/main.cpp:53:0: src/p1reader.h:7:1: error: expected unqualified-id before '<' token ^ In file included from src/main.cpp:53:0: src/p1reader.h:223:27: error: 'up' does not name a type Sign up ^ src/p1reader.h:262:270: error: expected unqualified-id before '<' token Features ^ src/p1reader.h:266:248: error: expected unqualified-id before '<' token
  • Mobile
  • ^ src/p1reader.h:267:259: error: expected unqualified-id before '<' token
  • Actions
  • ^ src/p1reader.h:268:265: error: expected unqualified-id before '<' token
  • Codespaces
  • ^ src/p1reader.h:269:261: error: expected unqualified-id before '<' token
  • Packages
  • ^ src/p1reader.h:270:261: error: expected unqualified-id before '<' token
  • Security
  • ^ src/p1reader.h:271:268: error: expected unqualified-id before '<' token
  • Code review
  • ^ src/p1reader.h:272:258: error: expected unqualified-id before '<' token
  • Issues
  • ^ src/p1reader.h:273:269: error: expected unqualified-id before '<' token
  • Integrations
  • ^ src/p1reader.h:279:318: error: expected unqualified-id before '<' token
  • GitHub Sponsors
  • ^ src/p1reader.h:280:334: error: expected unqualified-id before '<' token
  • Customer stories
  • ^ src/p1reader.h:303:302: error: expected unqualified-id before '<' token
  • Explore GitHub
  • ^ src/p1reader.h:308:294: error: expected unqualified-id before '<' token
  • Topics
  • ^ src/p1reader.h:309:311: error: expected unqualified-id before '<' token
  • Collections
  • ^ src/p1reader.h:310:300: error: expected unqualified-id before '<' token
  • Trending
  • ^ src/p1reader.h:311:322: error: expected unqualified-id before '<' token
  • Learning Lab
  • ^ src/p1reader.h:312:335: error: expected unqualified-id before '<' token
  • Open source guides
  • ^ src/p1reader.h:317:274: error: expected unqualified-id before '<' token
  • The ReadME Project
  • ^ src/p1reader.h:318:312: error: expected unqualified-id before '<' token
  • Events
  • ^ src/p1reader.h:319:329: error: expected unqualified-id before '<' token
  • Community forum
  • ^ src/p1reader.h:320:335: error: expected unqualified-id before '<' token
  • GitHub Education
  • ^ src/p1reader.h:321:344: error: expected unqualified-id before '<' token
  • GitHub Stars program
  • ^ src/p1reader.h:341:265: error: expected unqualified-id before '<' token Plans ^ src/p1reader.h:344:328: error: expected unqualified-id before '<' token
  • Compare plans
  • ^ src/p1reader.h:345:338: error: expected unqualified-id before '<' token
  • Contact Sales
  • ^ src/p1reader.h:349:338: error: expected unqualified-id before '<' token
  • Education
  • ^ *** [/data/p1-reader/.pioenvs/p1-reader/src/main.cpp.o] Error 1 ========================= [FAILED] Took 22.21 seconds =========================`
    Anteus commented 2 years ago

    Check if you have the weird chars in the source code files p1reader.h and p1reader.yaml. https://arduino.stackexchange.com/questions/30581/stray-302-in-program-error-when-compiling

    RealElwood commented 2 years ago

    Well i deleted the p1reader.h and used the latest and now the installation went through. I must've DL'd an old version from the beginning.

    Still not a complete success INFO Successfully compiled program. INFO Resolving IP address of p1-reader.local INFO -> 192.168.1.227 INFO Uploading /data/p1-reader/.pioenvs/p1-reader/firmware.bin (392000 bytes) INFO Compressed to 276225 bytes ERROR Error auth result: Error: Authentication invalid. Is the password correct?

    What password is the error for? I've checked the WiFi and it can connect, i haven't set up an HASS_API so I've tried leaving it blank (``) or hashed those lines.

    RealElwood commented 2 years ago

    All above issues resolved, probably an unfortunate series of events. What worked was to uninstall ESPHome from Home Assistant. Delete the whole ESPHome folder using Samba, and also starting "Let's Encrypt". Not sure if the last part did anything. When ESPHome was installed all communication worked. Now i just need to verify that my power meter is active on the port and that if follows protocol 1.3 (It's a Kamstrup OmniPower meter with an HAN adapter)