Lyr3x / Roode

A reliable smart home people counter based on VL53L1X and ESPHome
The Unlicense
149 stars 41 forks source link

Perpendicular orientation no effect #140

Open yuqianma opened 10 months ago

yuqianma commented 10 months ago

Describe the bug The orientation perpendicular doesn't work.

To Reproduce Steps to reproduce the behavior:

external_components:
  - source: github://Lyr3x/Roode@master
    refresh: always
vl53l1x:
roode:
  orientation: perpendicular # no effect
  # orientation: parallel # works

Expected behavior Change the orientation.

Additional context I want to change the default orientation from parallel to perpendicular. But once I set it to to perpendicular, the sensor stops working (no error, but also no output in the logs). I tried several times that the keyword parallel works. Do I have to config more to make perpendicular functional? Or how can I debug it?

Thank you for the awesome work!

Logs:

[13:30:06][I][app:102]: ESPHome version 2023.8.2 compiled on Sep  3 2023, 13:21:37
[13:30:06][C][wifi:543]: WiFi:
***
[13:30:06][C][logger:301]: Logger:
[13:30:06][C][logger:302]:   Level: DEBUG
[13:30:06][C][logger:303]:   Log Baud Rate: 115200
[13:30:06][C][logger:305]:   Hardware UART: UART0
[13:30:06][C][i2c.arduino:053]: I2C Bus:
[13:30:06][C][i2c.arduino:054]:   SDA Pin: GPIO21
[13:30:06][C][i2c.arduino:055]:   SCL Pin: GPIO22
[13:30:06][C][i2c.arduino:056]:   Frequency: 400000 Hz
[13:30:06][C][i2c.arduino:059]:   Recovery: bus successfully recovered
[13:30:06][I][i2c.arduino:069]: Results from i2c bus scan:
[13:30:06][I][i2c.arduino:075]: Found i2c device at address 0x29
[13:30:06][C][VL53L1X:007]: VL53L1X:
[13:30:06][C][VL53L1X:008]:   Address: 0x29
[13:30:06][C][VL53L1X:010]:   Ranging: Longest
[13:30:06][C][Roode:006]: Roode:
[13:30:06][C][Roode:007]:   Sample size: 2
[13:30:06][C][Roode:008]:   Update Interval: 0.000s
[13:30:07][C][Zone:007]:    Entry
[13:30:07][C][Zone:008]:      ROI: { width: 6, height: 16, center: 194 }
[13:30:07][C][Zone:011]:      Threshold: { min: 0mm (0%), max: 55704mm (85%), idle: 65535mm }
[13:30:07][C][Zone:007]:    Exit
[13:30:07][C][Zone:008]:      ROI: { width: 6, height: 16, center: 59 }
[13:30:07][C][Zone:011]:      Threshold: { min: 0mm (0%), max: 55704mm (85%), idle: 65535mm }
[13:30:07][C][captive_portal:088]: Captive Portal:
[13:30:07][C][mdns:112]: mDNS:
[13:30:07][C][mdns:113]:   Hostname: esphome-web-5993dc
[13:30:07][C][ota:093]: Over-The-Air Updates:
[13:30:07][C][ota:094]:   Address: esphome-web-5993dc.local:3232
[13:30:07][C][api:138]: API Server:
[13:30:07][C][api:139]:   Address: esphome-web-5993dc.local:6053
[13:30:07][C][api:141]:   Using noise encryption: YES

### no output here
yuqianma commented 10 months ago

I happened to come across the issue just as I was about to leave:

roode:
  orientation: perpendicular
  roi: { height: 6, width: 16 } # reverse the height and width size

Just leaving the config here for further investigation.