Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CT1-3 not reporting with warning about atm90e32.sensor operation time #189

Open
iamwyza opened this issue Dec 21, 2024 · 10 comments
Open

CT1-3 not reporting with warning about atm90e32.sensor operation time #189

iamwyza opened this issue Dec 21, 2024 · 10 comments

Comments

@iamwyza
Copy link

iamwyza commented Dec 21, 2024

Recently started tinkering with my newly arrived board. It's a v1.4 rev 1.

I have a Aokin ESP32 ESP-32S NodeMCU-32s board hooked up and flashed with ESPHome using the sample from this repo for the main board with no alterations other than the wifi config and setting the current_cal to the be the appropriate one for the CTs (SCT-010).

The board boots fine and reports CT4-6, but does not report CT1-3. It has these warnings in it:

Component atm90e32.sensor took a long time for an operation (78 ms).
Components should block for at most 30 ms.

Since only half of these are reporting

For reference here's the yaml and logs:

# CircuitSetup 6 Channel Energy Meter Main Board example config

substitutions:
# Change the disp_name to something you want  
  disp_name: Energy Meter
  friendly_name: CircuitSetup Energy Meter
# Interval of how often the power is updated
  update_time: 10s
# Current Transformers:
#  20A/25mA SCT-006: 11143
#  30A/1V SCT-013-030: 8650
#  50A/1V SCT-013-050: 15420
#  50A/16.6mA SCT-010: 41334
#  80A/26.6mA SCT-010: 41660
#  100A/50ma SCT-013-000: 27518
#  120A/40mA: SCT-016: 41787
#  200A/100mA SCT-024: 27518
#  200A/50mA SCT-024: 55036
  current_cal: '41660'
# Jameco 9VAC Transformer: 
#  For meter versions: 
#  >= v1.3: 7305
  voltage_cal: '7305'

esphome:
  name: energy-meter
  friendly_name: "${friendly_name}"
  project:
    name: circuitsetup.6c-energy-meter-main
    version: "1.4.1"

esp32:
  board: nodemcu-32s


wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password


captive_portal:

esp32_improv:
# Sets up Bluetooth LE to allow the user
# to provision wifi credentials to the device.
  authorizer: none

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  - platform: esphome

dashboard_import:
  package_import_url: github://circuitsetup/Expandable-6-Channel-ESP32-Energy-Meter/Software/ESPHome/6chan_energy_meter_main_board.yaml@master
  import_full_config: true

web_server:
  port: 80

spi:
  clk_pin: 18
  miso_pin: 19
  mosi_pin: 23

sensor:
  - platform: wifi_signal
    name: ${disp_name} WiFi
    update_interval: 60s
#IC1
  - platform: atm90e32
    cs_pin: 5
    phase_a:
      voltage:
        name: ${disp_name} Volts A
        id: ic1Volts
        accuracy_decimals: 1
      current:
        name: ${disp_name} CT1 Amps
        id: ct1Amps
# The max value for current that the meter can output is 65.535. If you expect to measure current over 65A, 
# divide the gain_ct by 2 (120A CT) or 4 (200A CT) and multiply the current and power values by 2 or 4 by uncommenting the filter below
#        filters:
#          - multiply: 2
      power:
        name: ${disp_name} CT1 Watts
        id: ct1Watts
#        filters:
#          - multiply: 2
      gain_voltage: ${voltage_cal}
      gain_ct: ${current_cal}
    phase_b:
      current:
        name: ${disp_name} CT2 Amps
        id: ct2Amps
      power:
        name: ${disp_name} CT2 Watts
        id: ct2Watts
      gain_voltage: ${voltage_cal}
      gain_ct: ${current_cal}
    phase_c:
      current:
        name: ${disp_name} CT3 Amps
        id: ct3Amps
      power:
        name: ${disp_name} CT3 Watts
        id: ct3Watts
      gain_voltage: ${voltage_cal}
      gain_ct: ${current_cal}
    frequency:
      name: ${disp_name} Freq A
    line_frequency: 60Hz
    gain_pga: 1X
    update_interval: ${update_time}
#IC2
  - platform: atm90e32
    cs_pin: 4
    phase_a:
#this voltage is only needed if monitoring 2 voltages
      voltage:
        name: ${disp_name} Volts B
        id: ic2Volts
        accuracy_decimals: 1
      current:
        name: ${disp_name} CT4 Amps
        id: ct4Amps
      power:
        name: ${disp_name} CT4 Watts
        id: ct4Watts
      gain_voltage: ${voltage_cal}
      gain_ct: ${current_cal}
    phase_b:
      current:
        name: ${disp_name} CT5 Amps
        id: ct5Amps
      power:
        name: ${disp_name} CT5 Watts
        id: ct5Watts
      gain_voltage: ${voltage_cal}
      gain_ct: ${current_cal}
    phase_c:
      current:
        name: ${disp_name} CT6 Amps
        id: ct6Amps
      power:
        name: ${disp_name} CT6 Watts
        id: ct6Watts
      gain_voltage: ${voltage_cal}
      gain_ct: ${current_cal}
    frequency:
      name: ${disp_name} Freq B
    line_frequency: 60Hz
    gain_pga: 1X
    update_interval: ${update_time}
        
#Total Amps   
  - platform: template
    name: ${disp_name} Total Amps
    id: totalAmps
    lambda: return id(ct1Amps).state + id(ct2Amps).state + id(ct3Amps).state + id(ct4Amps).state + id(ct5Amps).state + id(ct6Amps).state ;
    accuracy_decimals: 2
    unit_of_measurement: A
    device_class: current
    update_interval: ${update_time}         
#Total Watts
  - platform: template
    name: ${disp_name} Total Watts
    id: totalWatts
    lambda: return id(ct1Watts).state + id(ct2Watts).state + id(ct3Watts).state + id(ct4Watts).state + id(ct5Watts).state + id(ct6Watts).state ;
    accuracy_decimals: 1
    unit_of_measurement: W
    device_class: power
    update_interval: ${update_time}
#kWh
  - platform: total_daily_energy
    name: ${disp_name} Total kWh
    power_id: totalWatts
    filters:
      - multiply: 0.001
    unit_of_measurement: kWh
    device_class: energy
    state_class: total_increasing
switch:
  - platform: restart
    name: ${disp_name} Restart  
time:
  - platform: sntp
    id: sntp_time   

And the logs:

INFO ESPHome 2024.12.2
INFO Reading configuration /config/esphome/circuit-monitor-1.yaml...
WARNING GPIO5 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
INFO Detected timezone 'America/New_York'
INFO Starting log output from ###.###.###.### using esphome API
INFO Successfully connected to energy-meter @ ###.###.###.### in 0.098s
INFO Successful handshake with energy-meter @ ###.###.###.### in 0.182s
[15:22:16][I][app:100]: ESPHome version 2024.12.2 compiled on Dec 21 2024, 14:52:26
[15:22:18][I][app:102]: Project circuitsetup.6c-energy-meter-main version 1.4.1
[15:22:18][C][wifi:600]: WiFi:
[15:22:18][C][wifi:428]:   Local MAC: [redacted]
[15:22:18][C][wifi:433]:   SSID: ''[redacted]"
[15:22:18][C][wifi:436]:   IP Address: ###.###.###.###
[15:22:18][C][wifi:440]:   BSSID: [redacted]
[15:22:18][C][wifi:441]:   Hostname: 'energy-meter'
[15:22:18][C][wifi:443]:   Signal strength: -78 dB ▂▄▆█
[15:22:18][C][wifi:447]:   Channel: 6
[15:22:18][C][wifi:448]:   Subnet: 255.255.0.0
[15:22:18][C][wifi:449]:   Gateway: ###.###.###.###
[15:22:18][C][wifi:450]:   DNS1: ###.###.###.###
[15:22:18][C][wifi:451]:   DNS2: 0.0.0.0
[15:22:18][C][spi:065]:   CLK Pin: GPIO18
[15:22:18][D][sensor:094]: 'Energy Meter Total Amps': Sending state nan A with 2 decimals of accuracy
[15:22:25][D][sensor:094]: 'Energy Meter Total Watts': Sending state nan W with 1 decimals of accuracy
[15:22:27][D][sensor:094]: 'Energy Meter Volts B': Sending state 117.17000 V with 1 decimals of accuracy
[15:22:27][D][sensor:094]: 'Energy Meter CT4 Amps': Sending state 0.01300 A with 2 decimals of accuracy
[15:22:27][D][sensor:094]: 'Energy Meter CT5 Amps': Sending state 0.01300 A with 2 decimals of accuracy
[15:22:27][D][sensor:094]: 'Energy Meter CT6 Amps': Sending state 0.00800 A with 2 decimals of accuracy
[15:22:27][D][sensor:094]: 'Energy Meter CT4 Watts': Sending state 0.30944 W with 2 decimals of accuracy
[15:22:28][D][sensor:094]: 'Energy Meter CT5 Watts': Sending state 0.24416 W with 2 decimals of accuracy
[15:22:28][D][sensor:094]: 'Energy Meter CT6 Watts': Sending state 0.16288 W with 2 decimals of accuracy
[15:22:28][W][component:237]: Component atm90e32.sensor took a long time for an operation (78 ms).
[15:22:35][D][sensor:094]: 'Energy Meter Total Watts': Sending state nan W with 1 decimals of accuracy
[15:22:37][D][sensor:094]: 'Energy Meter Volts B': Sending state 117.30000 V with 1 decimals of accuracy
[15:22:37][D][sensor:094]: 'Energy Meter CT4 Amps': Sending state 0.01100 A with 2 decimals of accuracy
[15:22:37][D][sensor:094]: 'Energy Meter CT5 Amps': Sending state 0.01000 A with 2 decimals of accuracy
[15:22:37][D][sensor:094]: 'Energy Meter CT6 Amps': Sending state 0.00700 A with 2 decimals of accuracy
[15:22:37][D][sensor:094]: 'Energy Meter CT4 Watts': Sending state -0.12096 W with 2 decimals of accuracy
[15:22:37][D][sensor:094]: 'Energy Meter CT5 Watts': Sending state -0.19232 W with 2 decimals of accuracy
[15:22:39][D][sensor:094]: 'Energy Meter CT6 Watts': Sending state -0.01152 W with 2 decimals of accuracy
[15:22:39][D][sensor:094]: 'Energy Meter Freq B': Sending state 60.00000 Hz with 1 decimals of accuracy
[15:22:39][D][sensor:094]: 'Energy Meter Total Amps': Sending state nan A with 2 decimals of accuracy
[15:22:46][D][sensor:094]: 'Energy Meter Total Watts': Sending state nan W with 1 decimals of accuracy
[15:22:47][D][sensor:094]: 'Energy Meter Volts B': Sending state 117.01000 V with 1 decimals of accuracy
[15:22:47][D][sensor:094]: 'Energy Meter CT4 Amps': Sending state 0.01400 A with 2 decimals of accuracy
[15:22:47][D][sensor:094]: 'Energy Meter CT5 Amps': Sending state 0.01400 A with 2 decimals of accuracy
[15:22:47][D][sensor:094]: 'Energy Meter CT6 Amps': Sending state 0.01000 A with 2 decimals of accuracy
[15:22:47][D][sensor:094]: 'Energy Meter CT4 Watts': Sending state 0.16480 W with 2 decimals of accuracy
[15:22:47][D][sensor:094]: 'Energy Meter CT5 Watts': Sending state 0.08544 W with 2 decimals of accuracy
[15:22:47][D][sensor:094]: 'Energy Meter CT6 Watts': Sending state 0.00128 W with 2 decimals of accuracy
[15:22:47][D][sensor:094]: 'Energy Meter Freq B': Sending state 60.00000 Hz with 1 decimals of accuracy
[15:22:47][W][component:237]: Component atm90e32.sensor took a long time for an operation (75 ms).
[15:22:47][W][component:238]: Components should block for at most 30 ms.
[15:22:48][D][sensor:094]: 'Energy Meter Total Amps': Sending state nan A with 2 decimals of accuracy
@iamwyza
Copy link
Author

iamwyza commented Jan 4, 2025

Update, I've also flashed a LILYGO T-ETH-Lite-ESP32-S3 and attempted the same thing and am getting the same behavior. CT4-6 work, CT1-3 don't.

@SzymonSlupik
Copy link

WARNING GPIO5 is a strapping PIN and should only be used for I/O with care.

Have you tried configuring the first chip to use a different CS line?

@iamwyza
Copy link
Author

iamwyza commented Jan 5, 2025

Can I specify any unused GPIO pin as a cs_pin? (keeping in mind that I'm using the configs directly from this repo and on the board directly from the store, so if cs_pin 5 is not advised, then the repo should not specify that as the pin to use).

That said, the 2nd board (the Lilygo one) doesn't have that warning. Here's it's config + logs:

# CircuitSetup 6 Channel Energy Meter Main Board example config

substitutions:
# Change the disp_name to something you want  
  disp_name: Energy Meter
  friendly_name: CircuitSetup Energy Meter
# Interval of how often the power is updated
  update_time: 10s
# Current Transformers:
#  20A/25mA SCT-006: 11143
#  30A/1V SCT-013-030: 8650
#  50A/1V SCT-013-050: 15420
#  50A/16.6mA SCT-010: 41334
#  80A/26.6mA SCT-010: 41660
#  100A/50ma SCT-013-000: 27518
#  120A/40mA: SCT-016: 41787
#  200A/100mA SCT-024: 27518
#  200A/50mA SCT-024: 55036
  current_cal: '41660'
# Jameco 9VAC Transformer: 
#  For meter versions: 
#  >= v1.3: 7305
  voltage_cal: '7305'

esphome:
  name: energy-meter
  friendly_name: "${friendly_name}"
  project:
    name: circuitsetup.6c-energy-meter-main
    version: "1.4.1"

esp32:
  board: esp32s3box
  framework:
    type: arduino



wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password


captive_portal:

esp32_improv:
# Sets up Bluetooth LE to allow the user
# to provision wifi credentials to the device.
  authorizer: none

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  - platform: esphome

dashboard_import:
  package_import_url: github://circuitsetup/Expandable-6-Channel-ESP32-Energy-Meter/Software/ESPHome/6chan_energy_meter_main_board.yaml@master
  import_full_config: true

web_server:
  port: 80

spi:
  clk_pin: 7
  miso_pin: 5
  mosi_pin: 6

sensor:
  - platform: wifi_signal
    name: ${disp_name} WiFi
    update_interval: 60s
#IC1
  - platform: atm90e32
    cs_pin: 8
    phase_a:
      voltage:
        name: ${disp_name} Volts A
        id: ic1Volts
        accuracy_decimals: 1
      current:
        name: ${disp_name} CT1 Amps
        id: ct1Amps
# The max value for current that the meter can output is 65.535. If you expect to measure current over 65A, 
# divide the gain_ct by 2 (120A CT) or 4 (200A CT) and multiply the current and power values by 2 or 4 by uncommenting the filter below
#        filters:
#          - multiply: 2
      power:
        name: ${disp_name} CT1 Watts
        id: ct1Watts
#        filters:
#          - multiply: 2
      gain_voltage: ${voltage_cal}
      gain_ct: ${current_cal}
    phase_b:
      current:
        name: ${disp_name} CT2 Amps
        id: ct2Amps
      power:
        name: ${disp_name} CT2 Watts
        id: ct2Watts
      gain_voltage: ${voltage_cal}
      gain_ct: ${current_cal}
    phase_c:
      current:
        name: ${disp_name} CT3 Amps
        id: ct3Amps
      power:
        name: ${disp_name} CT3 Watts
        id: ct3Watts
      gain_voltage: ${voltage_cal}
      gain_ct: ${current_cal}
    frequency:
      name: ${disp_name} Freq A
    line_frequency: 60Hz
    gain_pga: 1X
    update_interval: ${update_time}
#IC2
  - platform: atm90e32
    cs_pin: 4
    phase_a:
#this voltage is only needed if monitoring 2 voltages
      voltage:
        name: ${disp_name} Volts B
        id: ic2Volts
        accuracy_decimals: 1
      current:
        name: ${disp_name} CT4 Amps
        id: ct4Amps
      power:
        name: ${disp_name} CT4 Watts
        id: ct4Watts
      gain_voltage: ${voltage_cal}
      gain_ct: ${current_cal}
    phase_b:
      current:
        name: ${disp_name} CT5 Amps
        id: ct5Amps
      power:
        name: ${disp_name} CT5 Watts
        id: ct5Watts
      gain_voltage: ${voltage_cal}
      gain_ct: ${current_cal}
    phase_c:
      current:
        name: ${disp_name} CT6 Amps
        id: ct6Amps
      power:
        name: ${disp_name} CT6 Watts
        id: ct6Watts
      gain_voltage: ${voltage_cal}
      gain_ct: ${current_cal}
    frequency:
      name: ${disp_name} Freq B
    line_frequency: 60Hz
    gain_pga: 1X
    update_interval: ${update_time}
        
#Total Amps   
  - platform: template
    name: ${disp_name} Total Amps
    id: totalAmps
    lambda: return id(ct1Amps).state + id(ct2Amps).state + id(ct3Amps).state + id(ct4Amps).state + id(ct5Amps).state + id(ct6Amps).state ;
    accuracy_decimals: 2
    unit_of_measurement: A
    device_class: current
    update_interval: ${update_time}         
#Total Watts
  - platform: template
    name: ${disp_name} Total Watts
    id: totalWatts
    lambda: return id(ct1Watts).state + id(ct2Watts).state + id(ct3Watts).state + id(ct4Watts).state + id(ct5Watts).state + id(ct6Watts).state ;
    accuracy_decimals: 1
    unit_of_measurement: W
    device_class: power
    update_interval: ${update_time}
#kWh
  - platform: total_daily_energy
    name: ${disp_name} Total kWh
    power_id: totalWatts
    filters:
      - multiply: 0.001
    unit_of_measurement: kWh
    device_class: energy
    state_class: total_increasing
switch:
  - platform: restart
    name: ${disp_name} Restart  
time:
  - platform: sntp
    id: sntp_time   
INFO ESPHome 2024.12.2
INFO Reading configuration /config/esphome/circuit-monitor-1.yaml...
INFO Detected timezone 'America/New_York'
INFO Starting log output from ###.###.###.### using esphome API
INFO Successfully connected to energy-meter @ ###.###.###.### in 0.063s
INFO Successful handshake with energy-meter @ ###.###.###.###in 0.024s
[10:44:13][I][app:100]: ESPHome version 2024.12.2 compiled on Jan  4 2025, 14:51:21
[10:44:13][I][app:102]: Project circuitsetup.6c-energy-meter-main version 1.4.1
[10:44:13][C][wifi:600]: WiFi:
[10:44:13][C][wifi:428]:   Local MAC: [redacted]
[10:44:13][C][wifi:433]:   SSID: [redacted]
[10:44:13][C][wifi:436]:   IP Address: ###.###.###.###
[10:44:13][C][wifi:440]:   BSSID: [redacted]
[10:44:13][C][wifi:441]:   Hostname: 'energy-meter'
[10:44:13][C][wifi:443]:   Signal strength: -54 dB ▂▄▆█
[10:44:13][C][wifi:447]:   Channel: 6
[10:44:13][C][wifi:448]:   Subnet: ###.###.###.###
[10:44:13][C][wifi:449]:   Gateway: ###.###.###.###
[10:44:13][C][wifi:450]:   DNS1: ###.###.###.###
[10:44:13][C][wifi:451]:   DNS2: 0.0.0.0
[10:44:13][C][logger:185]: Logger:
[10:44:13][C][logger:186]:   Level: DEBUG
[10:44:13][C][logger:188]:   Log Baud Rate: 115200
[10:44:13][C][logger:189]:   Hardware UART: USB_CDC
[10:44:13][C][spi:064]: SPI bus:
[10:44:13][C][spi:065]:   CLK Pin: GPIO7
[10:44:13][C][spi:066]:   SDI Pin: GPIO5
[10:44:13][C][spi:067]:   SDO Pin: GPIO6
[10:44:13][C][spi:072]:   Using HW SPI: SPI
[10:44:13][C][:250]: ATM90E32:
[10:44:13][C][atm90e32:251]:   CS Pin: GPIO8
[10:44:13][E][atm90e32:253]: Communication with ATM90E32 failed!
[10:44:13][C][atm90e32:255]:   Update Interval: 10.0s
[10:44:13][C][atm90e32:256]:   Voltage A 'Energy Meter Volts A'
[10:44:13][C][atm90e32:256]:     Device Class: 'voltage'
[10:44:13][C][atm90e32:256]:     State Class: 'measurement'
[10:44:13][C][atm90e32:256]:     Unit of Measurement: 'V'
[10:44:13][C][atm90e32:256]:     Accuracy Decimals: 1
[10:44:13][C][atm90e32:257]:   Current A 'Energy Meter CT1 Amps'
[10:44:14][C][atm90e32:257]:     Device Class: 'current'
[10:44:14][C][atm90e32:257]:     State Class: 'measurement'
[10:44:14][C][atm90e32:257]:     Unit of Measurement: 'A'
[10:44:14][C][atm90e32:257]:     Accuracy Decimals: 2
[10:44:14][C][atm90e32:258]:   Power A 'Energy Meter CT1 Watts'
[10:44:14][C][atm90e32:258]:     Device Class: 'power'
[10:44:14][C][atm90e32:258]:     State Class: 'measurement'
[10:44:14][C][atm90e32:258]:     Unit of Measurement: 'W'
[10:44:14][C][atm90e32:258]:     Accuracy Decimals: 2
[10:44:14][C][atm90e32:267]:   Current B 'Energy Meter CT2 Amps'
[10:44:14][C][atm90e32:267]:     Device Class: 'current'
[10:44:14][C][atm90e32:267]:     State Class: 'measurement'
[10:44:14][C][atm90e32:267]:     Unit of Measurement: 'A'
[10:44:14][C][atm90e32:267]:     Accuracy Decimals: 2
[10:44:14][C][atm90e32:268]:   Power B 'Energy Meter CT2 Watts'
[10:44:14][C][atm90e32:268]:     Device Class: 'power'
[10:44:14][C][atm90e32:268]:     State Class: 'measurement'
[10:44:14][C][atm90e32:268]:     Unit of Measurement: 'W'
[10:44:14][C][atm90e32:268]:     Accuracy Decimals: 2
[10:44:14][C][atm90e32:277]:   Current C 'Energy Meter CT3 Amps'
[10:44:14][C][atm90e32:277]:     Device Class: 'current'
[10:44:14][C][atm90e32:277]:     State Class: 'measurement'
[10:44:14][C][atm90e32:277]:     Unit of Measurement: 'A'
[10:44:14][C][atm90e32:277]:     Accuracy Decimals: 2
[10:44:14][C][atm90e32:278]:   Power C 'Energy Meter CT3 Watts'
[10:44:14][C][atm90e32:278]:     Device Class: 'power'
[10:44:14][C][atm90e32:278]:     State Class: 'measurement'
[10:44:14][C][atm90e32:278]:     Unit of Measurement: 'W'
[10:44:14][C][atm90e32:278]:     Accuracy Decimals: 2
[10:44:14][C][atm90e32:286]:   Frequency 'Energy Meter Freq A'
[10:44:14][C][atm90e32:286]:     State Class: 'measurement'
[10:44:14][C][atm90e32:286]:     Unit of Measurement: 'Hz'
[10:44:14][C][atm90e32:286]:     Accuracy Decimals: 1
[10:44:14][C][atm90e32:286]:     Icon: 'mdi:current-ac'
[10:44:14][E][component:082]:   Component atm90e32.sensor is marked FAILED
[10:44:14][C][atm90e32:251]:   CS Pin: GPIO4
[10:44:14][C][atm90e32:256]:     Device Class: 'voltage'
[10:44:14][C][atm90e32:256]:     State Class: 'measurement'
[10:44:14][C][atm90e32:256]:     Unit of Measurement: 'V'
[10:44:14][C][atm90e32:256]:     Accuracy Decimals: 1
[10:44:14][C][atm90e32:257]:   Current A 'Energy Meter CT4 Amps'
[10:44:14][C][atm90e32:257]:     Device Class: 'current'
[10:44:14][C][atm90e32:257]:     State Class: 'measurement'
[10:44:14][C][atm90e32:257]:     Unit of Measurement: 'A'
[10:44:14][C][atm90e32:257]:     Accuracy Decimals: 2
[10:44:14][C][atm90e32:258]:   Power A 'Energy Meter CT4 Watts'
[10:44:14][C][atm90e32:258]:     Device Class: 'power'
[10:44:14][C][atm90e32:258]:     State Class: 'measurement'
[10:44:14][C][atm90e32:258]:     Unit of Measurement: 'W'
[10:44:14][C][atm90e32:258]:     Accuracy Decimals: 2
[10:44:14][C][atm90e32:267]:   Current B 'Energy Meter CT5 Amps'
[10:44:14][C][atm90e32:267]:     Device Class: 'current'
[10:44:14][C][atm90e32:267]:     State Class: 'measurement'
[10:44:14][C][atm90e32:267]:     Unit of Measurement: 'A'
[10:44:14][C][atm90e32:267]:     Accuracy Decimals: 2
[10:44:14][C][atm90e32:268]:   Power B 'Energy Meter CT5 Watts'
[10:44:14][C][atm90e32:268]:     Device Class: 'power'
[10:44:14][C][atm90e32:268]:     State Class: 'measurement'
[10:44:14][C][atm90e32:268]:     Unit of Measurement: 'W'
[10:44:14][C][atm90e32:268]:     Accuracy Decimals: 2
[10:44:14][C][atm90e32:277]:   Current C 'Energy Meter CT6 Amps'
[10:44:14][C][atm90e32:277]:     Device Class: 'current'
[10:44:14][C][atm90e32:277]:     State Class: 'measurement'
[10:44:14][C][atm90e32:277]:     Unit of Measurement: 'A'
[10:44:14][C][atm90e32:277]:     Accuracy Decimals: 2
[10:44:14][C][atm90e32:278]:   Power C 'Energy Meter CT6 Watts'
[10:44:14][C][atm90e32:278]:     Device Class: 'power'
[10:44:14][C][atm90e32:278]:     State Class: 'measurement'
[10:44:14][C][atm90e32:278]:     Unit of Measurement: 'W'
[10:44:14][C][atm90e32:278]:     Accuracy Decimals: 2
[10:44:14][C][atm90e32:286]:   Frequency 'Energy Meter Freq B'
[10:44:14][C][atm90e32:286]:     State Class: 'measurement'
[10:44:14][C][atm90e32:286]:     Unit of Measurement: 'Hz'
[10:44:14][C][atm90e32:286]:     Accuracy Decimals: 1
[10:44:14][C][atm90e32:286]:     Icon: 'mdi:current-ac'
[10:44:14][C][template.sensor:022]: Template Sensor 'Energy Meter Total Amps'
[10:44:14][C][template.sensor:022]:   Device Class: 'current'
[10:44:14][C][template.sensor:022]:   State Class: ''
[10:44:14][C][template.sensor:022]:   Unit of Measurement: 'A'
[10:44:14][C][template.sensor:022]:   Accuracy Decimals: 2
[10:44:14][C][template.sensor:023]:   Update Interval: 10.0s
[10:44:14][C][template.sensor:022]:   State Class: ''
[10:44:14][C][template.sensor:022]:   Unit of Measurement: 'W'
[10:44:14][C][template.sensor:022]:   Accuracy Decimals: 1
[10:44:14][C][template.sensor:023]:   Update Interval: 10.0s
[10:44:14][C][total_daily_energy:023]: Total Daily Energy 'Energy Meter Total kWh'
[10:44:14][C][total_daily_energy:023]:   Device Class: 'energy'
[10:44:14][C][total_daily_energy:023]:   State Class: 'total_increasing'
[10:44:14][C][total_daily_energy:023]:   Unit of Measurement: 'kWh'
[10:44:14][C][total_daily_energy:023]:   Accuracy Decimals: 3
[10:44:14][C][restart:068]: Restart Switch 'Energy Meter Restart'
[10:44:14][C][restart:070]:   Icon: 'mdi:restart'
[10:44:14][C][restart:091]:   Restore Mode: always OFF
[10:44:14][C][esp32_ble:418]: ESP32 BLE:
[10:44:14][C][esp32_ble:420]:   MAC address: F0:F5:BD:4B:EC:8D
[10:44:14][C][esp32_ble:421]:   IO Capability: none
[10:44:14][C][esp32_ble_server:200]: ESP32 BLE Server:
[10:44:14][C][esp32_improv.component:269]: ESP32 Improv:
[10:44:14][C][captive_portal:089]: Captive Portal:
[10:44:14][C][web_server:153]: Web Server:
[10:44:14][C][web_server:154]:   Address: energy-meter.local:80
[10:44:14][C][sntp:042]: SNTP Time:
[10:44:14][C][sntp:045]:   Server 0: '0.pool.ntp.org'
[10:44:14][C][sntp:045]:   Server 1: '1.pool.ntp.org'
[10:44:14][C][sntp:045]:   Server 2: '2.pool.ntp.org'
[10:44:14][C][mdns:116]: mDNS:
[10:44:14][C][mdns:117]:   Hostname: energy-meter
[10:44:14][C][esphome.ota:073]: Over-The-Air updates:
[10:44:14][C][esphome.ota:074]:   Address: energy-meter.local:3232
[10:44:14][C][esphome.ota:075]:   Version: 2
[10:44:14][C][safe_mode:018]: Safe Mode:
[10:44:14][C][safe_mode:020]:   Boot considered successful after 60 seconds
[10:44:14][C][safe_mode:021]:   Invoke after 10 boot attempts
[10:44:14][C][safe_mode:023]:   Remain in safe mode for 300 seconds
[10:44:14][W][safe_mode:029]: Last reset occurred too quickly; safe mode will be invoked in 8 restarts
[10:44:14][C][api:140]: API Server:
[10:44:14][C][api:141]:   Address: energy-meter.local:6053
[10:44:14][C][api:145]:   Using noise encryption: NO
[10:44:14][C][wifi_signal.sensor:010]: WiFi Signal 'Energy Meter WiFi'
[10:44:14][C][wifi_signal.sensor:010]:   Device Class: 'signal_strength'
[10:44:14][C][wifi_signal.sensor:010]:   State Class: 'measurement'
[10:44:14][C][wifi_signal.sensor:010]:   Unit of Measurement: 'dBm'
[10:44:14][C][wifi_signal.sensor:010]:   Accuracy Decimals: 0
[10:44:20][D][sensor:094]: 'Energy Meter Total Watts': Sending state nan W with 1 decimals of accuracy
[10:44:21][D][sensor:094]: 'Energy Meter Total Amps': Sending state nan A with 2 decimals of accuracy
[10:44:22][D][sensor:094]: 'Energy Meter Volts B': Sending state 114.38000 V with 1 decimals of accuracy
[10:44:22][D][sensor:094]: 'Energy Meter CT4 Amps': Sending state 0.01200 A with 2 decimals of accuracy
[10:44:22][D][sensor:094]: 'Energy Meter CT5 Amps': Sending state 0.01900 A with 2 decimals of accuracy
[10:44:22][D][sensor:094]: 'Energy Meter CT6 Amps': Sending state 0.01600 A with 2 decimals of accuracy
[10:44:22][D][sensor:094]: 'Energy Meter CT4 Watts': Sending state -0.07104 W with 2 decimals of accuracy
[10:44:22][D][sensor:094]: 'Energy Meter CT5 Watts': Sending state -0.11392 W with 2 decimals of accuracy
[10:44:22][D][sensor:094]: 'Energy Meter CT6 Watts': Sending state 0.01504 W with 2 decimals of accuracy
[10:44:22][D][sensor:094]: 'Energy Meter Freq B': Sending state 59.98000 Hz with 1 decimals of accuracy
[10:44:30][D][sensor:094]: 'Energy Meter Total Watts': Sending state nan W with 1 decimals of accuracy
[10:44:31][D][sensor:094]: 'Energy Meter Total Amps': Sending state nan A with 2 decimals of accuracy
[10:44:32][D][sensor:094]: 'Energy Meter Volts B': Sending state 114.29000 V with 1 decimals of accuracy
[10:44:32][D][sensor:094]: 'Energy Meter CT4 Amps': Sending state 0.01200 A with 2 decimals of accuracy
[10:44:32][D][sensor:094]: 'Energy Meter CT5 Amps': Sending state 0.01500 A with 2 decimals of accuracy
[10:44:32][D][sensor:094]: 'Energy Meter CT6 Amps': Sending state 0.01500 A with 2 decimals of accuracy
[10:44:32][D][sensor:094]: 'Energy Meter CT4 Watts': Sending state 0.09728 W with 2 decimals of accuracy
[10:44:32][D][sensor:094]: 'Energy Meter CT5 Watts': Sending state -0.29984 W with 2 decimals of accuracy
[10:44:32][D][sensor:094]: 'Energy Meter CT6 Watts': Sending state 0.12256 W with 2 decimals of accuracy
[10:44:32][D][sensor:094]: 'Energy Meter Freq B': Sending state 59.99000 Hz with 1 decimals of accuracy
[10:44:40][D][sensor:094]: 'Energy Meter Total Watts': Sending state nan W with 1 decimals of accuracy
[10:44:41][D][sensor:094]: 'Energy Meter Total Amps': Sending state nan A with 2 decimals of accuracy
[10:44:42][D][sensor:094]: 'Energy Meter Volts B': Sending state 114.19000 V with 1 decimals of accuracy
[10:44:42][D][sensor:094]: 'Energy Meter CT4 Amps': Sending state 0.01200 A with 2 decimals of accuracy
[10:44:42][D][sensor:094]: 'Energy Meter CT5 Amps': Sending state 0.01700 A with 2 decimals of accuracy
[10:44:42][D][sensor:094]: 'Energy Meter CT6 Amps': Sending state 0.02000 A with 2 decimals of accuracy
[10:44:42][D][sensor:094]: 'Energy Meter CT4 Watts': Sending state -0.01152 W with 2 decimals of accuracy
[10:44:42][D][sensor:094]: 'Energy Meter CT5 Watts': Sending state 0.12864 W with 2 decimals of accuracy
[10:44:42][D][sensor:094]: 'Energy Meter CT6 Watts': Sending state 0.41312 W with 2 decimals of accuracy
[10:44:42][D][sensor:094]: 'Energy Meter Freq B': Sending state 60.00000 Hz with 1 decimals of accuracy
[10:44:50][D][sensor:094]: 'Energy Meter Total Watts': Sending state nan W with 1 decimals of accuracy
[10:44:51][D][sensor:094]: 'Energy Meter Total Amps': Sending state nan A with 2 decimals of accuracy
[10:44:52][D][sensor:094]: 'Energy Meter Volts B': Sending state 114.24000 V with 1 decimals of accuracy
[10:44:52][D][sensor:094]: 'Energy Meter CT4 Amps': Sending state 0.01200 A with 2 decimals of accuracy
[10:44:52][D][sensor:094]: 'Energy Meter CT5 Amps': Sending state 0.01600 A with 2 decimals of accuracy
[10:44:52][D][sensor:094]: 'Energy Meter CT6 Amps': Sending state 0.01600 A with 2 decimals of accuracy
[10:44:52][D][sensor:094]: 'Energy Meter CT4 Watts': Sending state -0.12512 W with 2 decimals of accuracy
[10:44:52][D][sensor:094]: 'Energy Meter CT5 Watts': Sending state 0.24096 W with 2 decimals of accuracy
[10:44:52][D][sensor:094]: 'Energy Meter CT6 Watts': Sending state 0.03136 W with 2 decimals of accuracy
[10:44:52][D][sensor:094]: 'Energy Meter Freq B': Sending state 60.00000 Hz with 1 decimals of accuracy
[10:44:54][D][sensor:094]: 'Energy Meter WiFi': Sending state -53.00000 dBm with 0 decimals of accuracy

@SzymonSlupik
Copy link

You select the CS for each of the 2 ICs with a jumper. The jumper selection must match what you have in the YAML. Just try a different one and make sure it matches your jumpers.

@iamwyza
Copy link
Author

iamwyza commented Jan 5, 2025

There are no jumpers on the main board. The jumpers only exist on the addon boards as far as I can tell.
image

@SzymonSlupik
Copy link

True... Then I still believe you have an issue with the GPIO 5 on your ESP32 variant. But my knowledge of ESP32 is too shallow to help you further.

@iamwyza
Copy link
Author

iamwyza commented Jan 5, 2025

I'd agree, but given that both ESP32's (from different mfg with different firmwares) have the same issue, i'm leaning towards it being the main board. I suppose I could breadboard the first one so that I could move the pin that way. But 2 different boards with the same issue? That seems less likely. I'm hoping @CircuitSetup will see this and respond with some further diagnostics I can take.

@CircuitSetup
Copy link
Owner

CircuitSetup commented Jan 5, 2025

The sensor took a long time for an operation warning is normal because of the speed of the SPI bus, and won't block actually getting data.

I don't think it would matter in this case, since you're getting connected with GPIO 4 with the Lilygo T-eth board, but take a look at the ethernet example, it uses software SPI, and a compile with the esp-idf. Try that just to make sure there isn't something limiting on the hardware SPI bus.

You very well may have a defective meter. If that's the case I'll get you a replacement.

@iamwyza
Copy link
Author

iamwyza commented Jan 5, 2025

Sadly no dice. Used the given example:

esp32:
  board: esp32s3box
  variant: esp32s3
  framework:
    type: esp-idf

#.... cut.....

spi:
  interface: software
  clk_pin: 7
  miso_pin: 5
  mosi_pin: 6

sensor:
  - platform: wifi_signal
    name: ${disp_name} WiFi
    update_interval: 60s
#IC1
  - platform: atm90e32
    cs_pin: 8
    phase_a:
      voltage:
[16:22:10][E][component:082]:   Component atm90e32.sensor is marked FAILED

@CircuitSetup
Copy link
Owner

Okay, please open a ticket on circuitsetup.us so I can get you a replacement meter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants