LoRa32 V1.0 ESP32 Development Board continually rebooting when using ROS
-
I’m trying to run ros code below on a LILYGO TTGO LoRa32 V1.0 ESP32 Development Board, but it is continually rebooting.
/* used to debug rosserial running on ESP32 TTGO Board */ #define ROSSERIAL_ARDUINO_TCP #include <ros.h> #include <std_msgs/Empty.h> ros::NodeHandle nh; void messageCb( const std_msgs::Empty& toggle_msg){ digitalWrite(LED_BUILTIN, HIGH); delay(200); digitalWrite(LED_BUILTIN, LOW); delay(200); } ros::Subscriber<std_msgs::Empty> sub("cmd_vel", &messageCb ); void setup(){ pinMode(LED_BUILTIN, OUTPUT); Serial.begin(115200); while (!Serial){delay(1000); } delay(2000); Serial.println("starting"); nh.initNode(); nh.subscribe(sub); } void loop(){ nh.spinOnce(); digitalWrite(LED_BUILTIN, HIGH); delay(500); digitalWrite(LED_BUILTIN, LOW); delay(500); Serial.println("looping"); }
This post [https://github.com/espressif/arduino-esp32/issues/4807](link url) suggested putting this code in the ros.h file which I have done because “…after some digging in the source code I found out that ROS opts to use a wifi connection over the serial connection if you program an ESP32 . If you want to circumvent this you can manually change the ros.h file…”, but the board continues to reboot.
#if defined(ROSSERIAL_ARDUINO_TCP) #include "ArduinoTcpHardware.h" #else #include "ArduinoHardware.h" #endif
I am using the Arduino IDE with esp32 by Espressif 2.0.7 package.
Based on https://github.com/Xinyuan-LilyGO/LilyGo-LoRa-Series?spm=a2g0o.detail.1000023.10.3c4a74e6RNWEq6 I have selected the ESP32 Dev Module.
One output verbose compilation message mentions: “…Using library Rosserial_Arduino_Library at version 0.9.1 in folder:…”
I don’t know where the issue is. I have tried 2 separate boards. The current TTGO board that has no wires connected to the board other than the USB connection. Other programs uploaded to the board work fine. If I comment out the ros related code the board works fine.
The reboot sequence message is:assert failed: tcpip_send_msg_wait_sem IDF/components/lwip/lwip/src/api/tcpip.c:455 (Invalid mbox) Backtrace: 0x40083549:0x3ffb1fa0 0x400882a9:0x3ffb1fc0 0x4008d9c1:0x3ffb1fe0 0x400df806:0x3ffb2110 0x400eb839:0x3ffb2140 0x400eb898:0x3ffb2160 0x400df53d:0x3ffb21b0 0x400d2eca:0x3ffb21d0 0x400d289a:0x3ffb2220 0x400d2421:0x3ffb2250 0x400d3bd2:0x3ffb2290 ELF file SHA256: 34fdf7d99cba0a23 Rebooting... ets Jul 29 2019 12:21:46 rst:0xc (SW_CPU_RESET),boot:0x17 (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:1344 load:0x40078000,len:13924 ho 0 tail 12 room 4 load:0x40080400,len:3600 entry 0x400805f0 starting assert failed: tcpip_send_msg_wait_sem IDF/components/lwip/lwip/src/api/tcpip.c:455 (Invalid mbox) Backtrace: 0x40083549:0x3ffb1fa0 0x400882a9:0x3ffb1fc0 0x4008d9c1:0x3ffb1fe0 0x400df806:0x3ffb2110 0x400eb839:0x3ffb2140 0x400eb898:0x3ffb2160 0x400df53d:0x3ffb21b0 0x400d2eca:0x3ffb21d0 0x400d289a:0x3ffb2220 0x400d2421:0x3ffb2250 0x400d3bd2:0x3ffb2290 ELF file SHA256: 34fdf7d99cba0a23 Rebooting... (repeats)….