jomjol / AI-on-the-edge-device

Easy to use device for connecting "old" measuring units (water, power, gas, ...) to the digital world
https://jomjol.github.io/AI-on-the-edge-device-docs/
5.27k stars 580 forks source link

GPIO12 (External Led) cause loop Reboot after 1st image #3009

Closed spanzetta closed 3 months ago

spanzetta commented 3 months ago

The Problem

I am using AI on the edge from few months without big issues (apart of some problems with digit recognition during transition.. but this is another story)

Today I updated my ESP32 (and 3D Case designed by me) by adding an external WS2812B Led stripe (on the side of the 3D Support to avoid reflection on the Water meter) following instructions at https://jomjol.github.io/AI-on-the-edge-device-docs/External-LED/..

Well.. as soon as I enable the GPIO12 in the Configuration.. the system reboots after the 1st image taken...

It happens also if I don't connect the GPIO12 cable (so external LED will not be powered)...

As soon as I disable the GPIO12 in the configuration (I have to be fast to do it because I have few seconds after boot to be able to modify the configuration), the system comes back to work normally..

See log below.. the relevant info is the following one: [CAM] is not working anymore (CaptureToBasisImage) - most probably caused by a hardware problem (instablility, ...). System will reboot.

I wonder if it's only me using the external LED..

The fact that it reboots even without the LED connected.. makes me confident that it's not a power problem or a resistor/capacitor/connection/LED problem.. (anyway.. with the GPIO12 connected I see that LED is powered properly.. )

Can you pls let me know how can I provide some more info in order to let you understand where the problem can be?

For now.. I will continue to use it without the External LED connected..

Thanks

Version

v15.7.0 (Commit: 0d0b018+)

Logfile

[0d00h00m00s] 2024-03-22T16:39:22 <INF> [MAIN] =================================================
[0d00h00m00s] 2024-03-22T16:39:22 <INF> [MAIN] ==================== Start ======================
[0d00h00m00s] 2024-03-22T16:39:22 <INF> [MAIN] =================================================
[0d00h00m00s] 2024-03-22T16:39:22 <INF> [MAIN] PSRAM size: 8388608 byte (8MB / 64MBit)
[0d00h00m00s] 2024-03-22T16:39:22 <INF> [MAIN] Total heap: 4380067 byte
[0d00h00m04s] 2024-03-22T16:39:26 <INF> [MAIN] Camera info: PID: 0x26, VER: 0x42, MIDL: 0x7f, MIDH: 0xa2
[0d00h00m04s] 2024-03-22T16:39:26 <INF> [SDCARD] Basic R/W check started...
[0d00h00m04s] 2024-03-22T16:39:26 <INF> [SDCARD] Basic R/W check successful
[0d00h00m04s] 2024-03-22T16:39:26 <INF> [SNTP] TimeServer not defined, using default: pool.ntp.org
[0d00h00m04s] 2024-03-22T16:39:26 <INF> [SNTP] Configuring NTP Client...
[0d00h00m04s] 2024-03-22T17:39:26 <INF> [SNTP] Time zone set to CET-1CEST,M3.5.0,M10.5.0/3
[0d00h00m04s] 2024-03-22T17:39:26 <INF> [SNTP] time zone: +0100 Delta to UTC: 3600 seconds
[0d00h00m04s] 2024-03-22T17:39:26 <INF> [SNTP] Time is already set: 2024-03-22 17:39:26
[0d00h00m04s] 2024-03-22T17:39:26 <INF> [MAIN] CPU frequency: 160 MHz
[0d00h00m05s] 2024-03-22T17:39:27 <INF> [SDCARD] Folder/file presence check started...
[0d00h00m05s] 2024-03-22T17:39:27 <INF> [SDCARD] Folder/file presence check successful
[0d00h00m05s] 2024-03-22T17:39:27 <INF> [MAIN] Tag: 'v15.7.0', Release: v15.7.0 (Commit: 0d0b018+), Date/Time: 2024-02-17 00:15, Web UI: Release: v15.7.0 (Commit: 0d0b018+)
[0d00h00m05s] 2024-03-22T17:39:27 <INF> [MAIN] Reset reason: Via esp_restart
[0d00h00m05s] 2024-03-22T17:39:27 <INF> [WLANINI] SSID: Marilu_water
[0d00h00m05s] 2024-03-22T17:39:27 <INF> [WLANINI] Password: XXXXXXXX
[0d00h00m05s] 2024-03-22T17:39:27 <INF> [WLANINI] IP-Address: 192.168.1.111
[0d00h00m05s] 2024-03-22T17:39:27 <INF> [WLANINI] Gateway: 192.168.1.1
[0d00h00m05s] 2024-03-22T17:39:27 <INF> [WLANINI] Netmask: 255.255.255.0
[0d00h00m05s] 2024-03-22T17:39:27 <INF> [WLANINI] DNS: 8.8.8.8
[0d00h00m05s] 2024-03-22T17:39:27 <INF> [WLANINI] RSSIThreshold: -75
[0d00h00m05s] 2024-03-22T17:39:27 <INF> [MAIN] WLAN config loaded, init WIFI...
[0d00h00m05s] 2024-03-22T17:39:27 <INF> [WIFI] Manual interface config -> IP: 192.168.1.111, Gateway: 192.168.1.1, Netmask: 255.255.255.0
[0d00h00m05s] 2024-03-22T17:39:27 <INF> [WIFI] Manual interface config -> DNS: 8.8.8.8
[0d00h00m05s] 2024-03-22T17:39:27 <INF> [WIFI] Set hostname to: watermeter
[0d00h00m05s] 2024-03-22T17:39:27 <INF> [WIFI] Init successful
[0d00h00m08s] 2024-03-22T17:39:30 <INF> [WIFI] Connected to: Marilu_water, RSSI: -49
[0d00h00m08s] 2024-03-22T17:39:30 <INF> [WIFI] Assigned IP: 192.168.1.111
[0d00h00m09s] 2024-03-22T17:39:31 <INF> [SNTP] Time is synced with NTP Server pool.ntp.org: 2024-03-22 17:39:31
[0d00h00m09s] 2024-03-22T17:39:31 <INF> [MAIN] Device info: CPU cores: 2, Chip revision: 101
[0d00h00m09s] 2024-03-22T17:39:31 <INF> [MAIN] SD card info: Name: 00000, Capacity: 7527MB, Free: 7498MB
[0d00h00m11s] 2024-03-22T17:39:33 <INF> [MAIN] Initialization completed successfully
[0d00h00m14s] 2024-03-22T17:39:36 <INF> [LOGFILE] Set log level to ERROR
[0d00h00m24s] 2024-03-22T17:39:46 <ERR> [CAM] is not working anymore (CaptureToBasisImage) - most probably caused by a hardware problem (instablility, ...). System will reboot.
[0d00h00m00s] 2024-03-22T16:39:54 <INF> [MAIN] =================================================
[0d00h00m00s] 2024-03-22T16:39:54 <INF> [MAIN] ==================== Start ======================
[0d00h00m00s] 2024-03-22T16:39:54 <INF> [MAIN] =================================================
[0d00h00m00s] 2024-03-22T16:39:54 <INF> [MAIN] PSRAM size: 8388608 byte (8MB / 64MBit)
[0d00h00m00s] 2024-03-22T16:39:54 <INF> [MAIN] Total heap: 4380067 byte
[0d00h00m04s] 2024-03-22T16:39:58 <INF> [MAIN] Camera info: PID: 0x26, VER: 0x42, MIDL: 0x7f, MIDH: 0xa2
[0d00h00m04s] 2024-03-22T16:39:58 <INF> [SDCARD] Basic R/W check started...
[0d00h00m04s] 2024-03-22T16:39:59 <INF> [SDCARD] Basic R/W check successful
[0d00h00m04s] 2024-03-22T16:39:59 <INF> [SNTP] TimeServer not defined, using default: pool.ntp.org
[0d00h00m04s] 2024-03-22T16:39:59 <INF> [SNTP] Configuring NTP Client...
[0d00h00m04s] 2024-03-22T17:39:59 <INF> [SNTP] Time zone set to CET-1CEST,M3.5.0,M10.5.0/3
[0d00h00m04s] 2024-03-22T17:39:59 <INF> [SNTP] time zone: +0100 Delta to UTC: 3600 seconds
[0d00h00m04s] 2024-03-22T17:39:59 <INF> [SNTP] Time is already set: 2024-03-22 17:39:59
[0d00h00m04s] 2024-03-22T17:39:59 <INF> [MAIN] CPU frequency: 160 MHz
[0d00h00m05s] 2024-03-22T17:39:59 <INF> [SDCARD] Folder/file presence check started...
[0d00h00m05s] 2024-03-22T17:39:59 <INF> [SDCARD] Folder/file presence check successful
[0d00h00m05s] 2024-03-22T17:39:59 <INF> [MAIN] Tag: 'v15.7.0', Release: v15.7.0 (Commit: 0d0b018+), Date/Time: 2024-02-17 00:15, Web UI: Release: v15.7.0 (Commit: 0d0b018+)

Expected Behavior

Be able to use the external LED as described at https://jomjol.github.io/AI-on-the-edge-device-docs/External-LED/

Screenshots

No response

Additional Context

No response

spanzetta commented 3 months ago

any comments from developers?

SybexX commented 3 months ago

Without sufficient details they won't be able to help you^^ you write ESP32, which board????? ESP32-Cam, ESP32-Wrower.........????? Did you really remove everything from the external LED or just pin 12 and tried to activate pin 12?????? a few pictures would also be helpful (e.g. of the configuration you want to make, regarding pin 12 / WS2812B..........)

spanzetta commented 3 months ago

Ops.. sorry.. Yes.. of course ESP32-CAM..

The scheme and component used is exactly the one illustrated at https://jomjol.github.io/AI-on-the-edge-device-docs/External-LED/

The problem appears to be at sw level.. whatever I physically connect the Led stripe or not the reboot problem happens anyway as soon as I enable the option in configuration

And when I physically connect the Led stripe - and enable the option in configuration- I see that it works properly (just the first run.. then it reboots)

SybexX commented 3 months ago

I personally don't have a WS2812B LED strip, so I can't really test it. However, if I activate pin 12, my onboard LED is no longer activated and the ESP continues to do its work without rebooting. Therefore I can only assume that your power supply is not enough to properly supply the ESP and the WS2812B LED strip. I made the following settings: WS2812B

spanzetta commented 3 months ago

Thanks for your reply..

In my configuration I had 10 bits (instead of 20) at PWM duty cicle resolution.. I will try that setting to see if something changes..

Thanks again

spanzetta commented 3 months ago

I also realized that when enabled GPIO switch to enable GPIO12 .. also GPIO0 was flagged as enabled.. but I see that that one should not be enabled.. Isn't it?

spanzetta commented 3 months ago

UPDATE: solved! Maybe it was the wrong GPIO0 enabled.. maybe the 20 bit instead of 10.. now it works without rebooting! Thanks for the suggestion!