Open mupsje opened 2 years ago
Hi,
Its been some time I have worked on it. :) One question.. have you tried putting the files in a custom component and use it that way?
Regards, Sourabh Jaiswal.
Hi. Yes that's what I thought I needed to do .. is it not the way? Please tell me how.
Again thanks
Op ma 8 nov. 2021 20:35 schreef Sourabh Jaiswal @.***>:
Hi,
Its been some time I have worked on it. :) One question.. have you tried putting the files in a custom component and use it that way?
Regards, Sourabh Jaiswal.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sourabhjaiswal/zmpt101b/issues/1#issuecomment-963505301, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALEFS6TNDOIMDHVTEKNVU53ULARBHANCNFSM5HSTIZRA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Well easiest way is to create a folder with name "zmpt101b" under "homeassistant/esphome/custom_components/" and place the files there. post that you don't need to include the files in your yaml file. Simple sensor definition should work fine.
For instance I have a supervised install of home assistant and here is my directory structure for this sensor:-
pi@raspberrypi:~$ ls /usr/share/hassio/homeassistant/esphome/custom_components/zmpt101b/ __init__.py README.md sensor.py zmpt101b.cpp zmpt101b.h
Regards, Sourabh Jaiswal
Thank you very much Sourabh,
I tried this, but still get the same error,
Maybe you can post me your Yaml file so I can see if it is correct what I do.. I think thats the easiest way before we have allot of spam in our Mails ;)
Thank you allot, again and again.
hi Sourabh,
We found a problem bacause the code is outdated.
> "the problem simply is that this component is not up-to-date with the current release of ESPHome."
_> The way the component checks if the analog pin is correct, is outdated.
You could try a quick hack by changing return pins.analogpin(value) to simply return value in sensor.py
Now we don't get any error anymore inside Yaml file... But now when Installing the file we get.
`Compiling /data/test/.pioenvs/test/src/ZMPT101B.cpp.o In file included from src/ZMPT101B.cpp:1:0: src/zmpt101b.h:4:33: fatal error: esphome/core/esphal.h: No such file or directory
^
compilation terminated. *** [/data/test/.pioenvs/test/src/ZMPT101B.cpp.o] Error 1 Compiling /data/test/.pioenvs/test/src/esphome/components/zmpt101b/ZMPT101B.cpp.o In file included from src/esphome/components/zmpt101b/ZMPT101B.cpp:1:0: src/zmpt101b.h:4:33: fatal error: esphome/core/esphal.h: No such file or directory
^
compilation terminated. *** [/data/test/.pioenvs/test/src/esphome/components/zmpt101b/ZMPT101B.cpp.o] Error 1 ========================== [FAILED] Took 2.63 seconds ==========================`
hi again,
First I found..
inside ZMPT101B.cpp
First line
changed
include "zmpt101b.h"
to
include "ZMPT101B.h" (Capitals)
### next I found the problem esphal.....
I changed,
include "esphome/core/esphal.h"
to
include "esphome/core/hal.h"
Because esphal.h does not exist anymore.. ( I think)
Then I got following error...
src/ZMPT101B.cpp: In member function 'virtual void esphome::zmpt101b::ZMPT101BSensor::setup()':
src/ZMPT101B.cpp:12:30: error: cannot allocate an object of abstract type 'esphome::GPIOPin'
GPIOPin(this->pin_, INPUT).setup();
^
In file included from src/esphome/core/hal.h:4:0,
from src/ZMPT101B.h:4,
from src/ZMPT101B.cpp:1:
src/esphome/core/gpio.h:50:7: note: because the following virtual functions are pure within 'esphome::GPIOPin':
class GPIOPin {
^
src/esphome/core/gpio.h:52:16: note: virtual void esphome::GPIOPin::setup()
virtual void setup() = 0;
^
src/esphome/core/gpio.h:54:16: note: virtual void esphome::GPIOPin::pin_mode(esphome::gpio::Flags)
virtual void pin_mode(gpio::Flags flags) = 0;
^
src/esphome/core/gpio.h:56:16: note: virtual bool esphome::GPIOPin::digital_read()
virtual bool digital_read() = 0;
^
src/esphome/core/gpio.h:58:16: note: virtual void esphome::GPIOPin::digital_write(bool)
virtual void digital_write(bool value) = 0;
^
src/esphome/core/gpio.h:60:23: note: virtual std::string esphome::GPIOPin::dump_summary() const
virtual std::string dump_summary() const = 0;
^
*** [/data/test-1/.pioenvs/test-1/src/ZMPT101B.cpp.o] Error 1
========================== [FAILED] Took 3.94 seconds ==========================
Hi,
My apologies for not being too prompt in replying. A bit busy elsewhere.
Unfortunately this code is too outdated it seems. I just checked and ESPhome has changed quite a bit since I wrote this.
I guess you can try using ct_clamp sensor for the same thing and see if that helps. Because right now as I can see zmpt101b requires a full work up and unfortunately I don't have bandwidth for that atm.
Regards, Sourabh Jaiswal.
Hi Sourabh,
Not a problem at all. I hope you will get time in the future.
meanwhile I will go on with this.
The CT_Clame does not have a pin setup...
So I cannot use that. because thats the problem...
The GPIOPin is changed to Classes....
anyway
Thanks allot
Regards,
Remco Brouwer , from The Netherlands
Hi,
I have given it a go at changing the code. But cant test the same as I that part requires me pulling out my breadboard and all. So if that you can test I can commit the changes.
Regards, Sourabh Jaiswal.
Hi,
I don't really understand what you are trying to say. But if you want me to test the code, because your equipment is up and running. Sure, give me the codes and I'll test it for you. no problemo!
I have allot of test equipments here ;)
Greets Remco
Hi,
Yes exactly I have done the changes and tested that it compiles at least. I will push the code.
Please test that.
Thanks and Regards, Sourabh Jaiswal.
just take your time... No rush ;)
HAve a nice day.
okay, I changed again the name line 1 from
to
then its compiling but with some minor errors.
INFO Reading configuration /config/esphome/test-1.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing test-1 (board: esp32dev; framework: arduino; platform: espressif32 @ 3.3.2)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
Dependency Graph
|-- <EmonLib> 1.1.0
Compiling /data/test-1/.pioenvs/test-1/src/ZMPT101B.cpp.o
Compiling /data/test-1/.pioenvs/test-1/src/esphome/components/esp32/gpio_arduino.cpp.o
Compiling /data/test-1/.pioenvs/test-1/src/esphome/components/esp32/gpio_idf.cpp.o
Compiling /data/test-1/.pioenvs/test-1/src/esphome/components/esp32/preferences.cpp.o
Compiling /data/test-1/.pioenvs/test-1/src/esphome/components/sensor/automation.cpp.o
Compiling /data/test-1/.pioenvs/test-1/src/esphome/components/sensor/filter.cpp.o
Compiling /data/test-1/.pioenvs/test-1/src/esphome/components/sensor/sensor.cpp.o
Compiling /data/test-1/.pioenvs/test-1/src/esphome/components/zmpt101b/ZMPT101B.cpp.o
Compiling /data/test-1/.pioenvs/test-1/src/esphome/core/application.cpp.o
Compiling /data/test-1/.pioenvs/test-1/src/esphome/core/color.cpp.o
Compiling /data/test-1/.pioenvs/test-1/src/esphome/core/component.cpp.o
Compiling /data/test-1/.pioenvs/test-1/src/esphome/core/controller.cpp.o
Compiling /data/test-1/.pioenvs/test-1/src/esphome/core/entity_base.cpp.o
Compiling /data/test-1/.pioenvs/test-1/src/esphome/core/helpers.cpp.o
Compiling /data/test-1/.pioenvs/test-1/src/esphome/core/log.cpp.o
Compiling /data/test-1/.pioenvs/test-1/src/esphome/core/scheduler.cpp.o
Compiling /data/test-1/.pioenvs/test-1/src/esphome/core/util.cpp.o
Compiling /data/test-1/.pioenvs/test-1/src/main.cpp.o
Generating partitions /data/test-1/.pioenvs/test-1/partitions.bin
Compiling /data/test-1/.pioenvs/test-1/lib3d7/EmonLib/EmonLib.cpp.o
Archiving /data/test-1/.pioenvs/test-1/libFrameworkArduinoVariant.a
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/Esp.cpp.o
Archiving /data/test-1/.pioenvs/test-1/lib3d7/libEmonLib.a
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/FunctionalInterrupt.cpp.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/HardwareSerial.cpp.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/IPAddress.cpp.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/IPv6Address.cpp.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/MD5Builder.cpp.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/Print.cpp.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/Stream.cpp.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/StreamString.cpp.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/WMath.cpp.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/WString.cpp.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/base64.cpp.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/cbuf.cpp.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/esp32-hal-adc.c.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/esp32-hal-bt.c.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/esp32-hal-cpu.c.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/esp32-hal-dac.c.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/esp32-hal-gpio.c.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/esp32-hal-i2c.c.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/esp32-hal-ledc.c.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/esp32-hal-log.c.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/esp32-hal-matrix.c.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/esp32-hal-misc.c.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/esp32-hal-psram.c.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/esp32-hal-rmt.c.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/esp32-hal-sigmadelta.c.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/esp32-hal-spi.c.o
/data/cache/platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-spi.c: In function 'spiTransferBytesNL':
/data/cache/platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-spi.c:922:39: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
uint8_t * last_out8 = &result[c_longs-1];
^
/data/cache/platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-spi.c:923:40: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
uint8_t * last_data8 = &last_data;
^
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/esp32-hal-time.c.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/esp32-hal-timer.c.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/esp32-hal-touch.c.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/esp32-hal-uart.c.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/libb64/cdecode.c.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/libb64/cencode.c.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/main.cpp.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/stdlib_noniso.c.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/wiring_pulse.c.o
Compiling /data/test-1/.pioenvs/test-1/FrameworkArduino/wiring_shift.c.o
Archiving /data/test-1/.pioenvs/test-1/libFrameworkArduino.a
Linking /data/test-1/.pioenvs/test-1/firmware.elf
/data/test-1/.pioenvs/test-1/src/esphome/components/zmpt101b/ZMPT101B.cpp.o: In function `esphome::zmpt101b::ZMPT101BSensor::setup()':
/data/cache/platformio/packages/toolchain-xtensa32/xtensa-esp32-elf/include/c++/5.2.0/functional:1830: multiple definition of `esphome::zmpt101b::ZMPT101BSensor::setup()'
/data/test-1/.pioenvs/test-1/src/ZMPT101B.cpp.o:/config/esphome/test-1/src/ZMPT101B.cpp:11: first defined here
/data/test-1/.pioenvs/test-1/src/esphome/components/zmpt101b/ZMPT101B.cpp.o: In function `non-virtual thunk to esphome::zmpt101b::ZMPT101BSensor::setup()':
ZMPT101B.cpp:(.text._ZThn188_N7esphome8zmpt101b14ZMPT101BSensor5setupEv+0x0): multiple definition of `non-virtual thunk to esphome::zmpt101b::ZMPT101BSensor::setup()'
/data/test-1/.pioenvs/test-1/src/ZMPT101B.cpp.o:ZMPT101B.cpp:(.text._ZThn188_N7esphome8zmpt101b14ZMPT101BSensor5setupEv+0x0): first defined here
/data/test-1/.pioenvs/test-1/src/esphome/components/zmpt101b/ZMPT101B.cpp.o: In function `esphome::zmpt101b::ZMPT101BSensor::dump_config()':
ZMPT101B.cpp:(.text._ZN7esphome8zmpt101b14ZMPT101BSensor11dump_configEv+0x0): multiple definition of `esphome::zmpt101b::ZMPT101BSensor::dump_config()'
/data/test-1/.pioenvs/test-1/src/ZMPT101B.cpp.o:ZMPT101B.cpp:(.text._ZN7esphome8zmpt101b14ZMPT101BSensor11dump_configEv+0x0): first defined here
/data/test-1/.pioenvs/test-1/src/esphome/components/zmpt101b/ZMPT101B.cpp.o: In function `non-virtual thunk to esphome::zmpt101b::ZMPT101BSensor::dump_config()':
ZMPT101B.cpp:(.text._ZThn188_N7esphome8zmpt101b14ZMPT101BSensor11dump_configEv+0x0): multiple definition of `non-virtual thunk to esphome::zmpt101b::ZMPT101BSensor::dump_config()'
/data/test-1/.pioenvs/test-1/src/ZMPT101B.cpp.o:ZMPT101B.cpp:(.text._ZThn188_N7esphome8zmpt101b14ZMPT101BSensor11dump_configEv+0x0): first defined here
/data/test-1/.pioenvs/test-1/src/esphome/components/zmpt101b/ZMPT101B.cpp.o: In function `esphome::zmpt101b::ZMPT101BSensor::loop()':
ZMPT101B.cpp:(.text._ZN7esphome8zmpt101b14ZMPT101BSensor4loopEv+0x0): multiple definition of `esphome::zmpt101b::ZMPT101BSensor::loop()'
/data/test-1/.pioenvs/test-1/src/ZMPT101B.cpp.o:ZMPT101B.cpp:(.text._ZN7esphome8zmpt101b14ZMPT101BSensor4loopEv+0x0): first defined here
/data/test-1/.pioenvs/test-1/src/esphome/components/zmpt101b/ZMPT101B.cpp.o: In function `non-virtual thunk to esphome::zmpt101b::ZMPT101BSensor::loop()':
ZMPT101B.cpp:(.text._ZThn188_N7esphome8zmpt101b14ZMPT101BSensor4loopEv+0x0): multiple definition of `non-virtual thunk to esphome::zmpt101b::ZMPT101BSensor::loop()'
/data/test-1/.pioenvs/test-1/src/ZMPT101B.cpp.o:ZMPT101B.cpp:(.text._ZThn188_N7esphome8zmpt101b14ZMPT101BSensor4loopEv+0x0): first defined here
/data/test-1/.pioenvs/test-1/src/esphome/components/zmpt101b/ZMPT101B.cpp.o: In function `esphome::zmpt101b::ZMPT101BSensor::update()':
ZMPT101B.cpp:(.text._ZN7esphome8zmpt101b14ZMPT101BSensor6updateEv+0x0): multiple definition of `esphome::zmpt101b::ZMPT101BSensor::update()'
/data/test-1/.pioenvs/test-1/src/ZMPT101B.cpp.o:ZMPT101B.cpp:(.text._ZN7esphome8zmpt101b14ZMPT101BSensor6updateEv+0x0): first defined here
/data/test-1/.pioenvs/test-1/src/esphome/components/zmpt101b/ZMPT101B.cpp.o: In function `non-virtual thunk to esphome::zmpt101b::ZMPT101BSensor::update()':
ZMPT101B.cpp:(.text._ZThn188_N7esphome8zmpt101b14ZMPT101BSensor6updateEv+0x0): multiple definition of `non-virtual thunk to esphome::zmpt101b::ZMPT101BSensor::update()'
/data/test-1/.pioenvs/test-1/src/ZMPT101B.cpp.o:ZMPT101B.cpp:(.text._ZThn188_N7esphome8zmpt101b14ZMPT101BSensor6updateEv+0x0): first defined here
collect2: error: ld returned 1 exit status
*** [/data/test-1/.pioenvs/test-1/firmware.elf] Error 1
========================= [FAILED] Took 34.34 seconds =========================
The errors suggest duplicate definition of class functions. I would start with doing a clean build, to make sure there are no lingering cpp files with those function definitions in them. Not exactly sure what would be wrong there, but at the same time these aren't very obvious errors to run into. So better make sure the build is clean.
Greets Remco
Yes... Please clean your existing zmpt101b folder and do another git clone in esphome/custom_components folder.
Regards, Sourabh Jaiswal.
I think something wrong with your test-bed then. Because for me the build is successful. Here are the logs..
INFO Reading configuration /config/esphome/remote-test2.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing remote-test2 (board: esp32doit-devkit-v1; framework: arduino; platform: espressif32 @ 3.3.2)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
Library Manager: Installing EmonLib
Unpacking [------------------------------------] 0%
Unpacking [###---------------------------------] 9%
Unpacking [######------------------------------] 18%
Unpacking [#########---------------------------] 27%
Unpacking [#############-----------------------] 36%
Unpacking [################--------------------] 45%
Unpacking [###################-----------------] 54%
Unpacking [######################--------------] 63%
Unpacking [##########################----------] 72%
Unpacking [#############################-------] 81%
Unpacking [################################----] 90%
Unpacking [####################################] 100%
Library Manager: EmonLib @ 1.1.0 has been installed!
Dependency Graph
|-- <AsyncTCP-esphome> 1.2.2
|-- <WiFi> 1.0
|-- <FS> 1.0
|-- <Update> 1.0
|-- <ESPAsyncWebServer-esphome> 2.0.0
| |-- <AsyncTCP-esphome> 1.2.2
|-- <DNSServer> 1.1.0
|-- <EmonLib> 1.1.0
|-- <ESPmDNS> 1.0
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/api/api_connection.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/api/api_frame_helper.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/api/api_pb2.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/api/api_pb2_service.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/api/api_server.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/api/list_entities.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/api/proto.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/api/subscribe_state.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/api/user_services.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/api/util.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/captive_portal/captive_portal.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/esp32/core.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/esp32/gpio_arduino.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/esp32/gpio_idf.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/esp32/preferences.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/logger/logger.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/md5/md5.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/mdns/mdns_component.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/mdns/mdns_esp32_arduino.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/mdns/mdns_esp8266.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/mdns/mdns_esp_idf.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/network/util.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/ota/ota_backend_arduino_esp32.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/ota/ota_backend_arduino_esp8266.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/ota/ota_backend_esp_idf.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/ota/ota_component.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/sensor/automation.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/sensor/filter.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/sensor/sensor.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/socket/bsd_sockets_impl.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/socket/lwip_raw_tcp_impl.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/web_server_base/web_server_base.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/wifi/wifi_component.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/wifi/wifi_component_esp32_arduino.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/wifi/wifi_component_esp8266.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/wifi/wifi_component_esp_idf.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/components/zmpt101b/zmpt101b.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/core/application.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/core/color.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/core/component.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/core/controller.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/core/entity_base.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/core/helpers.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/core/log.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/core/scheduler.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/esphome/core/util.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/src/main.cpp.o
Generating partitions /data/remote-test2/.pioenvs/remote-test2/partitions.bin
Compiling /data/remote-test2/.pioenvs/remote-test2/lib528/AsyncTCP-esphome/AsyncTCP.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/lib64d/WiFi/ETH.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/lib64d/WiFi/WiFi.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/lib64d/WiFi/WiFiAP.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/lib64d/WiFi/WiFiClient.cpp.o
Archiving /data/remote-test2/.pioenvs/remote-test2/lib528/libAsyncTCP-esphome.a
Compiling /data/remote-test2/.pioenvs/remote-test2/lib64d/WiFi/WiFiGeneric.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/lib64d/WiFi/WiFiMulti.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/lib64d/WiFi/WiFiSTA.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/lib64d/WiFi/WiFiScan.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/lib64d/WiFi/WiFiServer.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/lib64d/WiFi/WiFiUdp.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/lib01c/FS/FS.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/lib01c/FS/vfs_api.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/libbc6/Update/HttpsOTAUpdate.cpp.o
Archiving /data/remote-test2/.pioenvs/remote-test2/lib64d/libWiFi.a
Compiling /data/remote-test2/.pioenvs/remote-test2/libbc6/Update/Updater.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/libc74/ESPAsyncWebServer-esphome/AsyncEventSource.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/libc74/ESPAsyncWebServer-esphome/AsyncWebSocket.cpp.o
Archiving /data/remote-test2/.pioenvs/remote-test2/lib01c/libFS.a
Compiling /data/remote-test2/.pioenvs/remote-test2/libc74/ESPAsyncWebServer-esphome/WebAuthentication.cpp.o
Archiving /data/remote-test2/.pioenvs/remote-test2/libbc6/libUpdate.a
Compiling /data/remote-test2/.pioenvs/remote-test2/libc74/ESPAsyncWebServer-esphome/WebHandlers.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/libc74/ESPAsyncWebServer-esphome/WebRequest.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/libc74/ESPAsyncWebServer-esphome/WebResponses.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/libc74/ESPAsyncWebServer-esphome/WebServer.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/lib333/DNSServer/DNSServer.cpp.o
Archiving /data/remote-test2/.pioenvs/remote-test2/lib333/libDNSServer.a
Compiling /data/remote-test2/.pioenvs/remote-test2/lib714/EmonLib/EmonLib.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/lib915/ESPmDNS/ESPmDNS.cpp.o
Archiving /data/remote-test2/.pioenvs/remote-test2/libc74/libESPAsyncWebServer-esphome.a
Archiving /data/remote-test2/.pioenvs/remote-test2/libFrameworkArduinoVariant.a
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/Esp.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/FunctionalInterrupt.cpp.o
Archiving /data/remote-test2/.pioenvs/remote-test2/lib714/libEmonLib.a
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/HardwareSerial.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/IPAddress.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/IPv6Address.cpp.o
Archiving /data/remote-test2/.pioenvs/remote-test2/lib915/libESPmDNS.a
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/MD5Builder.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/Print.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/Stream.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/StreamString.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/WMath.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/WString.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/base64.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/cbuf.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/esp32-hal-adc.c.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/esp32-hal-bt.c.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/esp32-hal-cpu.c.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/esp32-hal-dac.c.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/esp32-hal-gpio.c.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/esp32-hal-i2c.c.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/esp32-hal-ledc.c.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/esp32-hal-log.c.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/esp32-hal-matrix.c.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/esp32-hal-misc.c.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/esp32-hal-psram.c.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/esp32-hal-rmt.c.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/esp32-hal-sigmadelta.c.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/esp32-hal-spi.c.o
/data/cache/platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-spi.c: In function 'spiTransferBytesNL':
/data/cache/platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-spi.c:922:39: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
uint8_t * last_out8 = &result[c_longs-1];
^
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/esp32-hal-time.c.o
/data/cache/platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-spi.c:923:40: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
uint8_t * last_data8 = &last_data;
^
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/esp32-hal-timer.c.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/esp32-hal-touch.c.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/esp32-hal-uart.c.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/libb64/cdecode.c.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/libb64/cencode.c.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/main.cpp.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/stdlib_noniso.c.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/wiring_pulse.c.o
Compiling /data/remote-test2/.pioenvs/remote-test2/FrameworkArduino/wiring_shift.c.o
Archiving /data/remote-test2/.pioenvs/remote-test2/libFrameworkArduino.a
Linking /data/remote-test2/.pioenvs/remote-test2/firmware.elf
RAM: [= ] 12.7% (used 41724 bytes from 327680 bytes)
Flash: [===== ] 49.9% (used 915134 bytes from 1835008 bytes)
Building /data/remote-test2/.pioenvs/remote-test2/firmware.bin
======================== [SUCCESS] Took 104.07 seconds ========================
INFO Successfully compiled program.
Regards, Sourabh Jaiswal.
Hi,
Yes after reinstall the directory and clean al files. It uploaded again , and i t works,
Thank you very much for your time and patience.
unfortanly I get no measure. And also no connection with HA. No reconized through intergration.
It took 1 min to get a respons from the sensor.
So there need a little bit more fine-tuning inside the code :( Sorry........
[19:56:32][I][app:099]: ESPHome version 2021.10.3 compiled on Nov 13 2021, 19:56:00
[19:56:33][C][wifi:490]: WiFi:
[19:56:33][C][wifi:352]: Local MAC: 40:F5:20:21:D9:4A
[19:56:33][C][wifi:353]: SSID: [redacted]
[19:56:33][C][wifi:354]: IP Address: 192.168.20.72
[19:56:33][C][wifi:356]: BSSID: [redacted]
[19:56:33][C][wifi:357]: Hostname: 'esp8266-zmpt101b'
[19:56:33][C][wifi:359]: Signal strength: -34 dB ▂▄▆█
[19:56:33][C][wifi:363]: Channel: 11
[19:56:33][C][wifi:364]: Subnet: 255.255.254.0
[19:56:33][C][wifi:365]: Gateway: 192.168.20.1
[19:56:33][C][wifi:366]: DNS1: 192.168.20.1
[19:56:33][C][wifi:367]: DNS2: 0.0.0.0
[19:56:33][C][logger:233]: Logger:
[19:56:33][C][logger:234]: Level: DEBUG
[19:56:33][C][logger:235]: Log Baud Rate: 115200
[19:56:33][C][logger:236]: Hardware UART: UART0
[19:56:33][C][zmpt101b:017]: ZMPT101B Sensor 'Measured Voltage'
[19:56:33][C][zmpt101b:017]: State Class: ''
[19:56:33][C][zmpt101b:017]: Unit of Measurement: 'V'
[19:56:33][C][zmpt101b:017]: Accuracy Decimals: 2
[19:56:33][C][zmpt101b:017]: Icon: 'mdi:pulse'
[19:56:33][C][zmpt101b:018]: Phase Shift: 1.700000, Sample Duration: 2500, Calibration: 86.000000
[19:56:33][C][zmpt101b:019]: Update Interval: 60.0s
[19:56:33][C][captive_portal:150]: Captive Portal:
[19:56:33][C][ota:082]: Over-The-Air Updates:
[19:56:33][C][ota:083]: Address: esp8266-zmpt101b.local:8266
[19:56:33][C][ota:086]: Using Password.
[19:56:33][C][api:134]: API Server:
[19:56:33][C][api:135]: Address: esp8266-zmpt101b.local:6053
[19:56:33][C][api:139]: Using noise encryption: NO
[19:57:14][D][sensor:113]: 'Measured Voltage': Sending state 0.00000 V with 2 decimals of accuracy
[19:58:14][D][sensor:113]: 'Measured Voltage': Sending state 0.00000 V with 2 decimals of accuracy
[19:59:15][D][sensor:113]: 'Measured Voltage': Sending state 0.00000 V with 2 decimals of accuracy
Greets Remco
Yes... that part of code is something which needs more work. As last I checked the results were too noisy so I had increased sample size. which leads to delay in getting first non zero result.
But changing that part is not feasible atm. So apologies.
Regards, Sourabh Jaiswal.
Hi Sourabh.
No apologies, no rush.. relax..... I have no hurry. Keep me posted when you are ready, so I can test for you again.
Again thanks allot :)
greets Remco
Hi, I like this code allot, I'm trying to put inside ESPHome, maybe I do something wrong.
Please help me out with this one.
I put the files inside the ESPhome folder and created also the sensor.h
but when I created the yaml. I get the follow error.
Thanks for taking time for me.
Greets from Holland