mathieucarbou / MycilaPZEM004Tv3

Arduino / ESP32 library for the PZEM-004T v3 Power and Energy monitor
https://oss.carbou.me/MycilaPZEM004Tv3/
MIT License
0 stars 0 forks source link

When compiling any example, does it produce such an error?! #1

Closed todosko closed 7 months ago

todosko commented 7 months ago

K:\Arduino_IDE_1.8.19\portable\sketchbook\libraries\MycilaPZEM004Tv3\examples\Read\Read.ino: In function 'void loop()': Read:18:10: error: 'class Mycila::PZEM' has no member named 'toJson' pzem.toJson(doc.to()); ^~ exit status 1 'class Mycila::PZEM' has no member named 'toJson'

mathieucarbou commented 7 months ago

Look at the header and how it runs in CI. If you want Json support, you need:

todosko commented 7 months ago

This is your "Read.ino" example and it doesn't compile. ArduinoJson lib - is installed and its examples are compiled good.

mathieucarbou commented 7 months ago

This is your "Read.ino" example and it doesn't compile. ArduinoJson lib - is installed and its examples are compiled good.

It compiles. You just don't know how to compile it ;-)

FYI, this project has some CI setup which verifies at each commit that all samples are compiling.

Like I said, you need to make sure you have the library in place and add the correct macro.

Json support is optional.

mathieucarbou commented 7 months ago

https://github.com/mathieucarbou/MycilaPZEM004Tv3/blob/9e5a083542ec0c84cd4c0fb022f08a256beffe53/.github/workflows/ci.yml#L74