ahermann86 / LX79x_WiFi

LX79x Mähroboter WiFi Erweiterung mit ESP32
10 stars 7 forks source link

Unable to compile - newer ESP32 libs fail i2c slave init #5

Closed sanchosk closed 2 years ago

sanchosk commented 2 years ago

The problem is with newer i2c libs for ESP32. The new version requires the clk_speed to be initialized to 0, otherwise it will assign undetermined value and fail. See this thread: https://www.esp32.com/viewtopic.php?t=21030

sanchosk commented 2 years ago

I've added following code on line 28 of file ahWire.cpp: memset(&config, 0, sizeof(config)); //Might require to #include "string.h" and on line 36: config.clk_flags = 0;

This made the code compilation OK, but after connecting it to the mower, I can't see anything on the display. It beeps around each 20 seconds, but not much more. I can't see any debug messages on the serial port other than the fact it's connected to the wifi. Any ideas how to debug?

ahermann86 commented 2 years ago

Hi sanchosk, I have adapted the code in ahWireSlave.cpp and LX790_ESP32.ino so that it can be compiled with Core Version 2.0.3. I tested this with my mower and it works like this. The only thing I noticed is that the host name is no longer set by the ESP and my Fritzbox gives a new address via DHCP... Maybe this is a new ESP bug?

sanchosk commented 2 years ago

OK, with your latest update and me changing the pins the other way around (input was output and output was input), I finally got something on the display. Does not yet work as it should, but at least it displays what it should and the buttons work. Now to wait until Monday to test actual grass cutting and then I can add MQTT to the module ;)