I have a chicken feeder that I would like to get feedback for the level of pellets and water.
My ESP32 is connected and working. It sends the output from one VL53LOX but I cannot get it to recognise the second. Below is Yaml code
``
esphome:
name: esphome-chook-wellbeing
INFO Reading configuration /config/esphome/esphome-web-d787a4.yaml…
INFO Starting log output from esphome-chook-wellbeing.local using esphome API
INFO Successfully connected to esphome-chook-wellbeing.local
[19:42:37][I][app:102]: ESPHome version 2022.3.1 compiled on Sep 21 2023, 20:14:00
[19:42:37][C][wifi:491]: WiFi:
[19:42:37][C][wifi:353]: Local MAC: 24:62:AB:D7:87:A4
[19:42:37][C][wifi:354]: SSID: ‘Home_network’[redacted]
[19:42:37][C][wifi:355]: IP Address: 192.168.1.182
[19:42:37][C][wifi:357]: BSSID: 78:45:58:46:15:E9[redacted]
[19:42:37][C][wifi:358]: Hostname: ‘esphome-chook-wellbeing’
[19:42:37][C][wifi:360]: Signal strength: -75 dB ▂▄▆█
[19:42:37][C][wifi:364]: Channel: 1
[19:42:37][C][wifi:365]: Subnet: 255.255.255.0
[19:42:37][C][wifi:366]: Gateway: 192.168.1.1
[19:42:37][C][wifi:367]: DNS1: 192.168.1.1
[19:42:37][C][wifi:368]: DNS2: 0.0.0.0
[19:42:38][C][logger:233]: Logger:
[19:42:38][C][logger:234]: Level: DEBUG
[19:42:38][C][logger:235]: Log Baud Rate: 115200
[19:42:38][C][logger:236]: Hardware UART: UART0
[19:42:38][C][i2c.arduino:038]: I2C Bus:
[19:42:38][C][i2c.arduino:039]: SDA Pin: GPIO21
[19:42:38][C][i2c.arduino:040]: SCL Pin: GPIO22
[19:42:38][C][i2c.arduino:041]: Frequency: 50000 Hz
[19:42:38][C][i2c.arduino:044]: Recovery: bus successfully recovered
[19:42:38][I][i2c.arduino:054]: Results from i2c bus scan:
[19:42:38][I][i2c.arduino:060]: Found i2c device at address 0x29
[19:42:38][C][vl53l0x:024]: VL53L0X ‘distance1’
[19:42:38][C][vl53l0x:024]: State Class: ‘measurement’
[19:42:38][C][vl53l0x:024]: Unit of Measurement: ‘m’
[19:42:38][C][vl53l0x:024]: Accuracy Decimals: 2
[19:42:38][C][vl53l0x:024]: Icon: ‘mdi:arrow-expand-vertical’
[19:42:38][C][vl53l0x:025]: Update Interval: 60.0s
[19:42:38][C][vl53l0x:026]: Address: 0x41
[19:42:38][C][vl53l0x:028]: Enable Pin: GPIO16
[19:42:38][C][vl53l0x:030]: Timeout: 200us
[19:42:38][C][vl53l0x:024]: VL53L0X ‘distance2’
[19:42:38][C][vl53l0x:024]: State Class: ‘measurement’
[19:42:38][C][vl53l0x:024]: Unit of Measurement: ‘m’
[19:42:38][C][vl53l0x:024]: Accuracy Decimals: 2
[19:42:38][C][vl53l0x:024]: Icon: ‘mdi:arrow-expand-vertical’
[19:42:38][C][vl53l0x:025]: Update Interval: 60.0s
[19:42:38][C][vl53l0x:026]: Address: 0x29
[19:42:38][C][vl53l0x:028]: Enable Pin: GPIO17
[19:42:38][C][vl53l0x:030]: Timeout: 200us
[19:42:38][C][captive_portal:088]: Captive Portal:
[19:42:38][C][mdns:084]: mDNS:
[19:42:38][C][mdns:085]: Hostname: esphome-chook-wellbeing
[19:42:38][C][ota:085]: Over-The-Air Updates:
[19:42:38][C][ota:086]: Address: esphome-chook-wellbeing.local:3232
[19:42:38][C][api:138]: API Server:
[19:42:38][C][api:139]: Address: esphome-chook-wellbeing.local:6053
[19:42:38][C][api:143]: Using noise encryption: NO
[19:43:11][D][vl53l0x:308]: ‘distance1’ - Got distance 0.184 m
[19:43:11][D][sensor:125]: ‘distance1’: Sending state 0.18400 m with 2 decimals of accuracy
[19:43:21][D][api:102]: Accepted ::FFFF:C0A8:197
[19:43:21][W][api.connection:083]: Home Assistant 2022.2.0 (::FFFF:C0A8:197): Connection closed
[19:44:11][D][vl53l0x:308]: ‘distance1’ - Got distance 0.000 m
[19:44:11][D][sensor:125]: ‘distance1’: Sending state 0.00000 m with 2 decimals of accuracy
[19:44:21][D][api:102]: Accepted ::FFFF:C0A8:197
[19:44:21][W][api.connection:083]: Home Assistant 2022.2.0 (::FFFF:C0A8:197): Connection closed
[19:45:11][D][vl53l0x:308]: ‘distance1’ - Got distance 0.032 m
[19:45:11][D][sensor:125]: ‘distance1’: Sending state 0.03200 m with 2 decimals of accuracy
Although the Yaml file sets the address of “distance2” to 0x42, the log is stating it as 0x29. This may be the cause, but I don’t know how to fix it - any help appreciated.
ESPHome does not set the address, that is done by jumpers on the device. You have to set ESPHome to whatever address you set with the jumpers on the device.
Hey Tom,
Thanks for your reply. I am using an ESP32 Wrover from Lonely Binery. There is no provision for jumpers. Do you think I may be wasting my time with it?
Hi,I have removed one from the Yaml file and reloaded. Distance measure is OK. Address: 0x41. GPIO16
Removed this one and ran second sensor. Address: 0x42. GPIO 17. Distance measure sucessful.
Put both back into Yaml file and only get result from one sensor.
The log details first sensor as Address: 0x41 but second sensor has defaulted to Address: 0x29 on log file
Mahko_Mahko - This ismy second only post. I have looked for some assistance in formatting code for forum without sucess. Could you give me a clue after I have copied how to format to make it easer.
Hey Mako_Mako, thanks for your help. Changed second address 0x42 to 0x29 - no change.
also tries several ideas from your github link without sucess.
Will keep trying. Grum
If its Esp32 there are two I2C busses put one on each. Then they can use the same address. if you want to stay on one bus you may need pullup or pull downs. Ive had issues with two different i2c devices not wanting to be neighborly the two bus fix worked.
I know this is an old post but I’ll past the answer from another site that explains how to get these to work on the same bus. The issue is because the address is set from software (if you change it from the default) and the VL53LOX apparently doesn’t remember what address you set after a power cycle so you have to do it every time you start it.
From multiple VL53L0X on the same I2C bus
The recommended way to use multiple VL53L0X on the same I2C bus involves an initialization process where you initially drive the GPIO0/CE chip enable pin low to disable every sensor except the first one. You can change the address of the first sensor to something other than the default, then release CE on the next sensor (which will start up with the default address) and change it to another unique address, continuing in sequence until you have assigned each sensor a unique address.