This problem is happening again.
For some reason my rover stopped connecting between the arduino and the ESP32. When I connect the rover to USB I’m getting:
---- Opened the serial port /dev/ttyUSB1 ----
GalaxyRVR version 1.1.0
Initializing...
SET+RESET
...SET+RESET
...SET+RESET
...[FAIL]
I’ve tried flashing each of the releases to the ESP up to the latest 1.4.1 with no change. I can flash a basic WiFi RSSI program and the AdvancedWebServer and I’m seeing output with that. I’ve also pulled the 1.2.0 release of the rover code for the arduino.
Booting the ESP and watching output I’m seeing this.
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:4916
load:0x40078000,len:16492
load:0x40080400,len:4
load:0x40080404,len:3524
entry 0x400805b8
[Init]
1.4.1
Is there a way to debug this with the ESP32 attached to the rover? I would like to see what the ESP32 is doing during the communication b/w the arduino and it.
As a follow-up I put the ESP32 on a test harness / dev board and was able to send commands to it. It’s not connecting in STA mode to my network (the board does work, as I mentioned above, connecting with the AdvancedWebServer sketch, so I think this is probably a software / library issue).
If I use SET+MODE 2
and SET+START
then ESP goes into AP mode and I can see it as an AP from my phone / macbook.
17:13:57.164 -> [CAM_D] RX: SET+RESET
17:13:57.164 -> [CAM_D] Reset
17:13:57.164 -> ets Jul 29 2019 12:21:46
17:13:57.164 ->
17:13:57.164 -> rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
17:13:57.164 -> configsip: 0, SPIWP:0xee
17:13:57.164 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
17:13:57.164 -> mode:DIO, clock div:1
17:13:57.164 -> load:0x3fff0030,len:4916
17:13:57.164 -> load:0x40078000,len:16492
17:13:57.164 -> load:0x40080400,len:4
17:13:57.164 -> load:0x40080404,len:3524
17:13:57.164 -> entry 0x400805b8
17:13:57.971 -> [Init]
17:13:57.971 -> [OK] 1.4.1
17:15:19.487 -> [CAM_D] RX: SET+NAME GalaxyRVR
17:15:19.519 -> [CAM_D] Set NAME: GalaxyRVR
17:15:19.519 -> [OK]
17:15:22.894 -> [CAM_D] RX: SET+TYPE GalaxyRVR
17:15:22.894 -> [CAM_D] Set TYPE: GalaxyRVR
17:15:22.894 -> [OK]
17:15:30.828 -> [CAM_D] RX: SET+SSID XXX
17:15:30.828 -> [CAM_D] Set SSID: XXX
17:15:30.828 -> [OK]
17:15:37.544 -> [CAM_D] RX: SET+PSK YYY
17:15:37.544 -> [CAM_D] Set password: YYY
17:15:37.544 -> [OK]
17:15:45.289 -> [CAM_D] RX: SET+MODE 1
17:15:45.289 -> [CAM_D] Set mode: STA
17:15:45.289 -> [OK]
17:15:55.219 -> [CAM_D] RX: SET+PORT 8765
17:15:55.219 -> [CAM_D] Set port: 8765
17:15:55.219 -> [OK]
17:16:16.896 -> [CAM_D] RX: SET+START
17:16:16.896 -> Connecting to WiFi ...
17:16:16.896 -> ssid: XXX
17:16:16.896 -> psk: YYY
17:16:16.960 -> [DEBUG] Connecting................................
17:16:32.477 -> 1
17:16:32.477 -> [CAM_E] TIMEOUT
What if you update and install SunFounder_AI_Camera to version 1.1.1 and then go back and re-upload the code and see how it works. (as shown in the picture)
After you uploaded the code, did you activate the ESP32 CAM by moving the mode switch to the run position and then pressing the reset button to reboot the R3 board?
You need to move the mode switch to the Run position after uploading the code, regardless of whether you are connecting in AP mode or STA mode.
Then you can check the serial monitor to print the information.
This looks like a library problem with the WebSockets library (probably an interaction with an update to the library and the current board support packages). This is one of those things about building in this world that’s really frustrating (and what’s driving me more toward platformio) – the inability to easily lock a library version to a project.
~/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-addr2line -aspCfire .pio/build/esp32cam/firmware.elf 0x400e24fc:0x3ffb1ba0
0x400dbd2e:0x3ffb1bc0 0x400d2ce1:0x3ffb2150 0x400d3307:0x3ffb21b0 0x400d37fa:0x3ffb2220 0x400d39e1:0x3ffb2270 0x400eb2f9:0x3ffb2290
0x400e24fc: WebSocketsServer::begin() at WebSocketsServer.cpp:951
0x400dbd2e: WS_Server::begin(int, String, String, String) at ws_server.cpp:62
0x400d2ce1: start() at ai-camera-firmware.cpp:456 (discriminator 4)
0x400d3307: handleSet(String) at ai-camera-firmware.cpp:362
0x400d37fa: serial_received_handler() at ai-camera-firmware.cpp:188
0x400d39e1: loop() at ai-camera-firmware.cpp:159
0x400eb2f9: loopTask(void*) at main.cpp:50
I’m right back where I started. I finally gave up trying to build and run the camera firmware. I was able to directly flash the most recent BIN file and can talk to the ESP32 over serial without a problem. That is, I can ask it to RESET, turn the LAMP on and off, and connect to my local WiFi.
I have the most recent RVR branch and I’ve tried both 1.1.0 and 1.1.1 of the AI_Camera library. I think what I’m seeing is that the debug serial port and the communications port for the ESP are the same. Not sure how I didn’t see that before. I finally realized it this morning while trying to debug this that I was seeing the ESP32 commands in my serial monitor and that’s clearly not going to work.
What am I missing here? What exact versions of the camera firmware, rover firmware, and libraries are needed to make this all work (again)?