Skip to content

Display initialisation messages don't always arrive in expected order, causing crashes #795

@tyeth

Description

@tyeth

Seeing the reboot on I2cWrite messages out of sync too. Was the XIAO, but I confused some LED thing with it actually rebooting.
Has SSD1306 128x64 and a Character LCD 16x2 attached.

See it reboot after init twice then boot okay thrid time, no changes:

01:21:17:921 -> ERROR [WDT RESET IN -4]: 
01:21:17:922 -> ERROR: Unable to connect to WiFi, rebooting soon...
01:21:18:922 -> ERROR [WDT RESET IN -5]: 
01:21:18:923 -> ERROR: Unable to connect to WiFi, rebooting soon...
01:21:19:922 -> ERROR [WDT RESET IN -6]: 
---- Closed serial port COM52 due to disconnection from the machine ----
---- Reopened serial port COM52 ----
01:21:21:766 -> Found single wifi network in secrets.json
01:21:21:769 -> Adafruit.io WipperSnapper
01:21:21:769 -> -------Device Information-------
01:21:21:769 -> Firmware Version: 1.0.0-beta.108
01:21:21:769 -> Board ID: xiao-esp32s3
01:21:21:769 -> Adafruit.io User: tyeth
01:21:21:769 -> WiFi Network: free4all
01:21:21:769 -> MAC Address: 74:4D:BD:81:B8:A0
01:21:21:769 -> -------------------------------
01:21:21:769 -> ESP32 CPU0 RESET REASON: NO_MEAN
01:21:21:769 -> ESP32 CPU1 RESET REASON: POWERON_RESET
01:21:21:769 -> Generating device's MQTT topics...
01:21:21:769 -> Running Network FSM...
01:21:21:769 -> Establishing network connection...
01:21:21:769 -> Performing a WiFi scan for SSID...WipperSnapper found these WiFi networks:
01:21:24:908 -> free4all (6C:63:9C:23:A3:AB) -60dB (ch6)
01:21:24:908 -> free4all (28:F5:D1:EF:10:12) -68dB (ch1)
01:21:24:908 -> free4all (10:7C:61:82:50:F1) -76dB (ch6)
01:21:24:908 -> Ginger Moggie (20:35:43:4:83:6E) -88dB (ch1)
01:21:24:909 -> Shaun (48:D3:43:A2:44:81) -91dB (ch6)
01:21:24:909 -> VM1451252 (40:D:10:C1:4E:C9) -92dB (ch11)
01:21:24:910 -> TP-Link_BD8E (B0:A7:B9:98:BD:8E) -94dB (ch9)
01:21:25:510 -> Connecting to WiFi (attempt #0)
01:21:31:129 -> Connected to WiFi!
01:21:31:130 -> Connecting to AIO MQTT (attempt #0)
01:21:31:133 -> WiFi Status: 20
01:21:33:919 -> Registering hardware with WipperSnapper...
01:21:33:919 -> Registering hardware with IO...
01:21:33:919 -> Encoding registration request...Encoding registration msg...Published!
01:21:34:022 -> Polling for registration message response...2
01:21:34:624 -> GOT Registration Response Message:
01:21:34:625 -> Hardware Response Msg:
01:21:34:625 ->         GPIO Pins: 14
01:21:34:625 ->         Analog Pins: 11
01:21:34:625 ->         Reference voltage: 2.60v
01:21:34:737 -> Completed registration process, configuration next!
01:21:34:738 -> Polling for message containing hardware configuration...
01:21:34:750 -> cbSignalTopic: New Msg on Signal Topic
01:21:34:750 -> 16 bytes.
01:21:34:750 -> decodeSignalMsg
01:21:34:750 -> cbSignalMsg
01:21:34:750 -> Sub-messages found: 1
01:21:34:750 -> Signal Msg Tag: Pin Configuration
01:21:34:750 -> cbDecodePinConfigMsg
01:21:34:750 -> Configuring digital input pin on D0with internal pull-up enabled
01:21:34:751 -> Interval (ms):0
01:21:34:751 -> Initial Pin Configuration Complete!
01:21:34:751 -> Publishing to pin config complete...
01:21:34:754 -> * NEW MESSAGE [Topic: Signal-I2C]: 
01:21:34:754 -> 87 bytes.
01:21:34:754 -> cbDecodeSignalRequestI2C
01:21:34:754 -> I2C Device LIST Init Request Found!
01:21:34:754 -> EXEC: cbDecodeI2CDeviceInitRequestList
01:21:34:755 -> EXEC: New I2C Port 
01:21:34:755 ->         Port #: 0
01:21:34:755 ->         SDA Pin: 5
01:21:34:755 ->         SCL Pin: 6
01:21:34:755 ->         Frequency (Hz): 100000
01:21:34:923 -> Attempting to initialize I2C device: oled128x64large
01:21:34:924 -> SSD1306 display detected!
01:21:34:924 -> Configuring SSD1306 display...
01:21:34:941 -> SSD1306 display configured successfully!
01:21:34:942 -> SSD1306 display initialized Successfully!
01:21:34:942 -> Publishing Message: I2CResponse...ERROR: Failed to publish I2C Response!
01:21:34:944 -> EXEC: cbDecodeI2CDeviceInitRequestList
01:21:34:944 -> Attempting to initialize I2C device: chardisplay16x2
01:21:35:049 -> Char LCD Display Initialized Successfully!
01:21:35:050 -> Publishing Message: I2CResponse...* NEW MESSAGE [Topic: Signal-I2C]: 
01:21:35:054 -> 68 bytes.
01:21:35:054 -> cbDecodeSignalRequestI2C
01:21:35:054 -> [app] I2C Device Output Write
---- Closed serial port COM52 due to disconnection from the machine ----
---- Reopened serial port COM52 ----
01:21:40:160 -> WipperSnapper found these WiFi networks:
01:21:40:160 -> free4all (6C:63:9C:23:A3:AB) -61dB (ch6)
01:21:40:161 -> free4all (28:F5:D1:EF:10:12) -68dB (ch1)
01:21:40:161 -> free4all (10:7C:61:82:50:F1) -77dB (ch6)
01:21:40:161 -> Ginger Moggie (20:35:43:4:83:6E) -88dB (ch1)
01:21:40:162 -> Shaun (48:D3:43:A2:44:81) -90dB (ch6)
01:21:40:163 -> TP-Link_BD8E (B0:A7:B9:98:BD:8E) -91dB (ch9)
01:21:40:164 -> VM1451252 (40:D:10:C1:4E:C9) -94dB (ch11)
01:21:40:164 -> VM7662787 (18:35:D1:3A:9:9) -94dB (ch11)
01:21:40:769 -> Connecting to WiFi (attempt #0)
01:21:46:983 -> Connecting to WiFi (attempt #1)
01:21:52:601 -> Connected to WiFi!
01:21:52:601 -> Connecting to AIO MQTT (attempt #0)
01:21:52:606 -> WiFi Status: 20
01:21:55:423 -> Registering hardware with WipperSnapper...
01:21:55:424 -> Registering hardware with IO...
01:21:55:424 -> Encoding registration request...Encoding registration msg...Published!
01:21:55:531 -> Polling for registration message response...2
01:21:56:129 -> GOT Registration Response Message:
01:21:56:130 -> Hardware Response Msg:
01:21:56:130 ->         GPIO Pins: 14
01:21:56:130 ->         Analog Pins: 11
01:21:56:130 ->         Reference voltage: 2.60v
01:21:56:242 -> Completed registration process, configuration next!
01:21:56:243 -> Polling for message containing hardware configuration...
01:21:56:254 -> cbSignalTopic: New Msg on Signal Topic
01:21:56:255 -> 16 bytes.
01:21:56:255 -> decodeSignalMsg
01:21:56:255 -> cbSignalMsg
01:21:56:255 -> Sub-messages found: 1
01:21:56:255 -> Signal Msg Tag: Pin Configuration
01:21:56:255 -> cbDecodePinConfigMsg
01:21:56:255 -> Configuring digital input pin on D0with internal pull-up enabled
01:21:56:256 -> Interval (ms):0
01:21:56:256 -> Initial Pin Configuration Complete!
01:21:56:256 -> Publishing to pin config complete...
01:21:56:259 -> * NEW MESSAGE [Topic: Signal-I2C]: 
01:21:56:259 -> 87 bytes.
01:21:56:259 -> cbDecodeSignalRequestI2C
01:21:56:259 -> I2C Device LIST Init Request Found!
01:21:56:259 -> EXEC: cbDecodeI2CDeviceInitRequestList
01:21:56:259 -> EXEC: New I2C Port 
01:21:56:259 ->         Port #: 0
01:21:56:260 ->         SDA Pin: 5
01:21:56:260 ->         SCL Pin: 6
01:21:56:260 ->         Frequency (Hz): 100000
01:21:56:411 -> Attempting to initialize I2C device: oled128x64large
01:21:56:411 -> SSD1306 display detected!
01:21:56:411 -> Configuring SSD1306 display...
01:21:56:446 -> SSD1306 display configured successfully!
01:21:56:446 -> SSD1306 display initialized Successfully!
01:21:56:446 -> Publishing Message: I2CResponse...ERROR: Failed to publish I2C Response!
01:21:56:449 -> EXEC: cbDecodeI2CDeviceInitRequestList
01:21:56:449 -> Attempting to initialize I2C device: chardisplay16x2
01:21:56:577 -> Char LCD Display Initialized Successfully!
01:21:56:578 -> Publishing Message: I2CResponse...* NEW MESSAGE [Topic: Signal-I2C]: 
01:21:56:578 -> 68 bytes.
01:21:56:578 -> cbDecodeSignalRequestI2C
01:21:56:578 -> [app] I2C Device Output Write
---- Closed serial port COM52 due to disconnection from the machine ----
---- Reopened serial port COM52 ----
01:22:01:664 -> WipperSnapper found these WiFi networks:
01:22:01:665 -> free4all (6C:63:9C:23:A3:AB) -59dB (ch6)
01:22:01:665 -> free4all (28:F5:D1:EF:10:12) -68dB (ch1)
01:22:01:665 -> free4all (10:7C:61:82:50:F1) -74dB (ch6)
01:22:01:666 -> Ginger Moggie (20:35:43:4:83:6E) -86dB (ch1)
01:22:01:667 -> TP-Link_BD8E (B0:A7:B9:98:BD:8E) -92dB (ch9)
01:22:01:667 -> VM1451252 (40:D:10:C1:4E:C9) -92dB (ch11)
01:22:01:668 -> Shaun (48:D3:43:A2:44:81) -93dB (ch6)
01:22:02:269 -> Connecting to WiFi (attempt #0)
01:22:08:487 -> Connecting to WiFi (attempt #1)
01:22:14:106 -> Connected to WiFi!
01:22:14:106 -> Connecting to AIO MQTT (attempt #0)
01:22:14:110 -> WiFi Status: 20
01:22:16:724 -> Registering hardware with WipperSnapper...
01:22:16:725 -> Registering hardware with IO...
01:22:16:725 -> Encoding registration request...Encoding registration msg...Published!
01:22:16:848 -> Polling for registration message response...2
01:22:17:430 -> GOT Registration Response Message:
01:22:17:430 -> Hardware Response Msg:
01:22:17:430 ->         GPIO Pins: 14
01:22:17:431 ->         Analog Pins: 11
01:22:17:431 ->         Reference voltage: 2.60v
01:22:17:543 -> Completed registration process, configuration next!
01:22:17:543 -> Polling for message containing hardware configuration...
01:22:17:564 -> Polling for message containing hardware configuration...
01:22:17:569 -> cbSignalTopic: New Msg on Signal Topic
01:22:17:570 -> 16 bytes.
01:22:17:570 -> decodeSignalMsg
01:22:17:570 -> cbSignalMsg
01:22:17:570 -> Sub-messages found: 1
01:22:17:570 -> Signal Msg Tag: Pin Configuration
01:22:17:570 -> cbDecodePinConfigMsg
01:22:17:570 -> Configuring digital input pin on D0with internal pull-up enabled
01:22:17:570 -> Interval (ms):0
01:22:17:570 -> Initial Pin Configuration Complete!
01:22:17:570 -> * NEW MESSAGE [Topic: Signal-I2C]: 
01:22:17:570 -> 87 bytes.
01:22:17:570 -> cbDecodeSignalRequestI2C
01:22:17:570 -> I2C Device LIST Init Request Found!
01:22:17:570 -> EXEC: cbDecodeI2CDeviceInitRequestList
01:22:17:570 -> EXEC: New I2C Port 
01:22:17:570 ->         Port #: 0
01:22:17:570 ->         SDA Pin: 5
01:22:17:570 ->         SCL Pin: 6
01:22:17:570 ->         Frequency (Hz): 100000
01:22:17:721 -> Attempting to initialize I2C device: oled128x64large
01:22:17:721 -> SSD1306 display detected!
01:22:17:721 -> Configuring SSD1306 display...
01:22:17:756 -> SSD1306 display configured successfully!
01:22:17:756 -> SSD1306 display initialized Successfully!
01:22:17:756 -> Publishing Message: I2CResponse...Published!
01:22:17:958 -> EXEC: cbDecodeI2CDeviceInitRequestList
01:22:17:958 -> Attempting to initialize I2C device: chardisplay16x2
01:22:18:063 -> Char LCD Display Initialized Successfully!
01:22:18:064 -> Publishing Message: I2CResponse...Published!
01:22:18:367 -> Publishing to pin config complete...
01:22:18:469 -> Hardware configured successfully!
01:22:20:029 -> Registration and configuration complete!
01:22:20:029 -> Running application...
01:22:20:031 -> Sending MQTT PING: * NEW MESSAGE [Topic: Signal-I2C]: 
01:22:20:034 -> 68 bytes.
01:22:20:034 -> cbDecodeSignalRequestI2C
01:22:20:034 -> [app] I2C Device Output Write
01:22:21:127 -> [app] I2C Device Output Write Done
01:22:21:129 -> * NEW MESSAGE [Topic: Signal-I2C]: 
01:22:21:130 -> 56 bytes.
01:22:21:130 -> cbDecodeSignalRequestI2C
01:22:21:130 -> [app] I2C Device Output Write
01:22:21:261 -> [app] I2C Device Output Write Done
01:22:21:261 -> SUCCESS!
01:22:21:261 -> WiFi RSSI: -66
01:22:21:282 -> Executing state-based event on D0
01:22:21:283 -> Encoding pinEvent...Encoded!
01:22:21:283 -> Publishing pinEvent...Published!
01:22:25:775 -> Sending MQTT PING: SUCCESS!
01:22:25:938 -> WiFi RSSI: -68
---- Closed the serial port COM52 ----

Originally posted by @tyeth in #768

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions