Rosanswers logo

I am trying to run the hello world tutorial and when I type "tma-0@tma-0-laptop:~$ rosrun rosserial_python serial_node.py /dev/ttyACM0" I keep getting the following error messages:

[INFO] [WallTime: 1321395246.850533] ROS Serial Python Node [INFO] [WallTime: 1321395246.857889] Connected on /dev/ttyACM0 at 57600 baud [ERROR] [WallTime: 1321395249.783413] Creation of publisher failed: unpack requires a string argument of length 4 [ERROR] [WallTime: 1321395250.786880] Tried to publish before configured, topic id 125

I have run roswtf and checked to make sure that all of the dependencies for rosserial_arduino have been installed.

My arduino code is the same as the example

 * rosserial Publisher Example
 * Prints "hello world!"

#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()

void loop()
  str_msg.data = hello;
  chatter.publish( &str_msg );
    enter code here

Also, I am running Ubuntu 10.04 and I am using an Arduino Mega 2560. I have tried going through the FAQ but am really stuck, any help would be greatly appreciated.

Originally posted by shakingatoms on ROS Answers with karma: 31 on 2011-11-15

Post score: 1


2 Answers 2


Rosanswers logo

This looks like you upgraded the computer to rosserial 0.3.0, but did not update your Arduino libraries and/or re-upload the code to the Arduino. We recently added the md5 checksum to each topic negotiation so that users are alerted about changes in messages (which causes difficult to debug errors).

Originally posted by fergs with karma: 13902 on 2011-11-15

This answer was ACCEPTED on the original site

Post score: 2


Rosanswers logo

Running this works for me

roscd rosserial
hg update -C 138
rosrun rosserial_python serial_node.py /dev/ttyACM0

Originally posted by YHE with karma: 21 on 2011-11-29

This answer was NOT ACCEPTED on the original site

Post score: 2

Original comments

Comment by fergs on 2011-11-29:
That would get you an 0.2.0 release of rosserial. If this is the problem, you probably want to update your libraries to 0.3.0 and reload the Arduino sketch as 0.3.0 has a number of upgrades.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.