I am trying to configure a Grove Water Level Sensor using this GitHub link. I am using a Wemos Mini D1.
Now the thing is - as soon as I add I2C and the water sensor, the device randomly does not boot up anymore - actually it more often does not boot than it boots. With not booting I mean that I don’t see the device as connected in ESPHome - when trying to get logs via USB I just see an empty black box where the logs should be, completely no output.
This somehow happens no matter whether the I2C device is attached or not.
Now I am wondering:
Does the device only boot when it has found an I2C device? Can I change this?
Am I just being stupid and there is something I am completely doing wrong? By now I already tried two sensors, both with the same outcome. Also changing GPIO ports does not help, the outcome seems to be always the same.
Why does it sometimes work and sometimes not?
Does anyone maybe have an idea what I could try to solve this issue?
> ls /dev/tty.*
/dev/tty.BLTH /dev/tty.BoseNC700HP
/dev/tty.Bluetooth-Incoming-Port /dev/tty.usbserial-1430
/dev/tty.usbserial-1430 seems to be the right one.
Interesting enough, when I open the logs in EspHome and then press “reset” (just discovered it), then I get log output - maybe also due to the now disabled I2C scan?:
[C][wifi:038]: Setting up WiFi...
[C][wifi:039]: Local MAC: E0:98:06:8E:56:21
[D][wifi:387]: Starting scan...
However, this now makes even less sense. Wifi is configured like the following:
More weirdness - when removing all the config it still scans I2C - so installing tells it succeeds, but it is actually still running the old version. I guess I have to reset it somehow …
Edit: And also this is not true. Trying to flash a brand new D1 Mini, I still see the artifacts of I2C. So this seems like EspHome is building something weird…
Edit2: Setting up a brand new EspHome device makes it work again - at least when its empty. As soon as I add I2C, wifi scanning breaks …
Edit3: Manual ip for the rescue. Somehow all of this is a sequence of workarounds which should not exist …
I finally found a solution - I never got this to work with a Wemos D1 Mini, but the same configuration just works with an ESP32. So I will go with that one now … Thanks!
I believe I have encountered a very similar issue with the same symptoms - not sure if it had the same root.
I have a “bigger” Wemos board - ESP8266 with a built-in OLED screen connected via I2C to GPIO5+GPIO4 (D1+D2 pins). Never had issues with it.
Everything “worked” on my device until I connected a second I2C device, on a different set of SDA/SCL pins (I initially planned to have 2 I2C buses before learning ESP8266 can support only one).
I assumed that I will just disable the I2C bus that handles the screen and simply assign the I2C bus to different pins in the configuration.
I have selected GPIO15+GPIO13 (D8+D7 pins).
I had failures with booting esp8266 but only when I2C device was physically connected. I managed to boot the board only when the I2C was disconnected.