ESP-WROOM-32 / GPIO16/17

Hexman64
Posts: 16
Joined: Wed Mar 14, 2018 3:03 pm

Re: ESP-WROOM-32 / GPIO16/17

Postby Hexman64 » Mon Mar 19, 2018 8:08 pm

It might be too early, but your hint was definitely needed here.
I fought three problems so far:

.) Added 2k2 pullups -> no scrambled LCD since then.
.) I was using breadboard-cables, but they are a biiiit too small for female pinstripe connectors, so I soldered male pinstripe-connectors with shielded cables for the I2C devices, which eliminated the other half of randomly occuring problems on the bus.
.) Running web pages is tricky. Once it works for a PC with Firefox, a page refresh on an android with chrome browser may lock up the cpu. Does it? No... it just stays in the 'while client.connected()' loop forever, making your I2C devices look like the bus is frozen (and everything else... no reaction to serial bytes). Finally I'm watching millis() within the loop, 'break'-ing out of it when stuck longer than 4 seconds. So that was a third thing which made me believe Wifi disturbs the I2C bus.
Surprisingly, the client doesn't seem to be connected when the loop comes to that question again. Good for me, so my solution works.

The only thing I sometimes see:
I'm also displaying the time in the lower right corner of the 20x4 LCD (updated every second), and usually write "SD card OK" on the top left. Every now and then it says "5D card ok". I saw "8D card ok" rarely. I believe it's not a code error, but comes from 65535 minutes (where the last 5 is displayed on the top left).

As I haven't seen anything worse since yesterday, I'd just live with these two additional pixels if they like to show. I haven't shielded the I2C connectors from the antenna yet (only the cables), and since pushing the RTClock deeper into its connector eliminated a getTime problem I could still solder it to the board.

Hexman64
Posts: 16
Joined: Wed Mar 14, 2018 3:03 pm

Re: ESP-WROOM-32 / GPIO16/17

Postby Hexman64 » Tue Mar 20, 2018 5:17 pm

Guess what... when I hit the "submit" button yesterday and looked at the lcd display, it was stuck.

Meanwhile I found out: When the DS3231 clock does not work on the I2C bus for whatever reason, read values default to 165 (which is why I get an additional 5 on my lcd).
esp.restart() did not help last night - after multiple reboots, I still got 165 for hour, minute, second. I believe I also read that esp.restart does not recover the I2C bus.
Wire.setClock(50000 or whatever value) does not seem to have an impact on the I2C bus, or at least my cheap oscilloscope's output always looks the same, no matter what frequency I try.
Connecting an Osci to the I2C bus on the fly disturbs the bus, and it won't return to a working condition again until...

Wire.reset() <-- makes all three I2C devices work again on the fly!
(even though I'm using other libraries, but they're using wire.h)

So I wrote:
if ((hour==165) or (minute==165) or (second==165)) { Wire.reset(); }

As the bus is in working condition once I connected my Osci, but might stay malfunctioning on those randomly occuring problems, I'm not yet done with investigations :(

Hexman64
Posts: 16
Joined: Wed Mar 14, 2018 3:03 pm

Re: ESP-WROOM-32 / GPIO16/17

Postby Hexman64 » Fri Mar 23, 2018 5:11 pm

The story continued here:

viewtopic.php?f=19&t=5094&start=20

and seems to come to an end finally.

Who is online

Users browsing this forum: No registered users and 112 guests