ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

ESP32 keep rebooting with rosserial

asked 2022-01-22 02:56:26 -0600

takijo gravatar image

Hello

I try rosserial with ESP32 on Ubuntu20.04.

but, ESP32 keep rebooting when using rosserial.

The Error is

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_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:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:10944
load:0x40080400,len:6388
entry 0x400806b4
assertion "Invalid mbox" failed: file "/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/api/tcpip.c", line 374, function: tcpip_send_msg_wait_sem
abort() was called at PC 0x400d556b on core 1

ELF file SHA256: 0000000000000000

Backtrace: 0x40085050:0x3ffb1dd0 0x400852cd:0x3ffb1df0 0x400d556b:0x3ffb1e10 0x400ec99f:0x3ffb1e40 0x400ec439:0x3ffb1e70 0x400ec5ec:0x3ffb1e90 0x400e47d0:0x3ffb1ed0 0x400d26be:0x3ffb1ef0 0x400d20be:0x3ffb1f40 0x400d1c01:0x3ffb1f70 0x400d31ce:0x3ffb1fb0 0x400862de:0x3ffb1fd0

I don't know why this error.

The skech is below.

#include <ros.h>
#include <std_msgs/String.h>


ros::NodeHandle  nh;

std_msgs::String str_msg;
ros::Publisher chatter("chatter", &str_msg);

char hello[13] = "hello world!";

    void setup()
    {
      nh.initNode();
      nh.advertise(chatter);
    }

    void loop()
    {
      str_msg.data = hello;
      chatter.publish( &str_msg );
      nh.spinOnce();
      delay(1000);
    }

Thanks.

edit retag flag offensive close merge delete

Comments

Please take a look at this thread: https://github.com/espressif/arduino-...

It seems ESP32 is trying to connect to wifi. Let me know if the recommended change works to document as an answer

osilva gravatar image osilva  ( 2022-01-22 04:53:13 -0600 )edit

Thank you for your reply. It worked well!

takijo gravatar image takijo  ( 2022-01-22 08:14:29 -0600 )edit

Thank you for confirming. I documented for future users.

osilva gravatar image osilva  ( 2022-01-22 09:23:37 -0600 )edit

i am trying to build a facial recognition trigger project with esp32cam but i keep getting this on the serial monitor arduino ide : SOMEONE PLEASE HELP!!!!!!!!!!!

rst: 0xc (SW_CPU RESET), boot: 0x13 (SPI FAST FLASH BOOT) configsip: 0, SPIWP: Oxee c1k_drv: 0x00, 9_drv: 0x00,d_drv: 0x00, c0_drv: 0x00,hd_drv: 0x00, wp_drv: 0x00 mode: DIO, clock div:1 load:0x3fff0018, len: 4 load:0x3fff001c, len:1216 ho 0 tail 12 room 4 Load: 0x40078000, 1en: 10944 load: 0x40080400, 1en: 6388 entry 0x40080664

xaobahn gravatar image xaobahn  ( 2023-04-29 17:58:41 -0600 )edit

3 Answers

Sort by ยป oldest newest most voted
0

answered 2022-01-22 09:23:12 -0600

osilva gravatar image

This answer is based on this solution found here for future users.

The problem is caused by ROS looking for wifi connection over serial.

To solve, change ros.h in the library folder: ~/Arduino/libraries/ros_lib/ros.h

Original:

#if defined(ESP8266) or defined(ESP32) or defined(ROSSERIAL_ARDUINO_TCP)
  #include "ArduinoTcpHardware.h"
#else
  #include "ArduinoHardware.h"
#endif

Modified:

#if defined(ROSSERIAL_ARDUINO_TCP)
  #include "ArduinoTcpHardware.h"
#else
  #include "ArduinoHardware.h"
#endif

Also it's suggested to check baud rate.

edit flag offensive delete link more

Comments

The baud rate is 57600.I cannot find how change this. Also, the serial monitor of Arduino IDE works fine on Windows, but not on Ubuntu. rosserial works on both.

takijo gravatar image takijo  ( 2022-01-22 19:00:54 -0600 )edit
0

answered 2023-06-21 08:40:03 -0600

ElNas gravatar image

Thank you guyz for the solution. Been such a long day debugging :).

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-01-22 02:56:26 -0600

Seen: 3,574 times

Last updated: Jan 22 '22