I am trying to run rosserial on my UDOO Neo. I can't get the arduino side to connect with but i can get an arduino connected via usb to connect. I have followed all the same steps but it seems as if using /dev/ttyMCC is preventing rosserial to sync giving the following error: [ERROR] [WallTime: 1492405523.257336] Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino.
I do not understand completely. As I read your question you have an separate Arduino connected with usb and that works. Then you do the same with the Neo Arduino and then you got the error when trying to connect through /dev/ttyMCC. I did not look into the code of rosserial but the Neo Arduino is not the same as an Arduino Uno. Only if the rosserial software uses the correct references you have a chance that it works. Mostly the libraries use hardware references in them and then the software will fail.
Nice protocol. Looks like /dev/ttyMCC is a blocker (like for Firmata). Is your roscore running on the Neo or on another PC? I think it will only work when running on the Neo itself. What happens if you use "minicom -D /dev/ttyMCC" ? Do you see data coming in? I also see that it is using baudrate 56700 while Neo (although being Virtual) is standard run on 115200 What you also could try is to use Arduino Serial1 and hardwire that to UART6 (/dev/ttymxc5). You have to patch Udoobuntu 2 first, then enable UART6 in the Device Tree Editor and reboot. Off course you have to modify the rosserial arduino sketch/library where the serial device is defined. Then use /dev/ttymxc5 in your rosrun command.
Yes roscore is running on the Neo itself. I don't see any data coming into ttyMCC when I run the serial node. I have run the connection at 56700 and 115200 baud both have the same results. Assuming I could modify the library to use the correct hardware reference is there a known description for the M4 core?- I should note I downloaded the UDOO Neo board in the Arduino app and that didn't change anything.
So is modifying the file like this all I would need to do? (Originally the file was ArduinoHardware.h but I cant upload a .h file.)
I could not upload the file at all so I have put the important part down here and higlighted the changes I would suggest to execute (on your own risk ) Code: #if defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__) || defined(__MKL26Z64__) #if defined(USE_TEENSY_HW_SERIAL) #define SERIAL_CLASS HardwareSerial // Teensy HW Serial #else #include <usb_serial.h> // Teensy 3.0 and 3.1 #define SERIAL_CLASS usb_serial_class #endif #elif defined(_SAM3XA_) #include <UARTClass.h> // Arduino Due #define SERIAL_CLASS UARTClass #elif defined(USE_USBCON) // Arduino Leonardo USB Serial Port #define SERIAL_CLASS Serial_ #elif defined(PSP_CPU_IMX6SX_M4) // UDOO Neo #include <HardwareSerial.h> // Arduino AVR #define SERIAL_CLASS HardwareSerial #else #include <HardwareSerial.h> // Arduino AVR #define SERIAL_CLASS HardwareSerial #endif class ArduinoHardware { public: ArduinoHardware(SERIAL_CLASS* io , long baud= 57600){ iostream = io; baud_ = baud; } ArduinoHardware() { #if defined(USBCON) and !(defined(USE_USBCON)) /* Leonardo support */ iostream = &Serial1; #elif defined(USE_TEENSY_HW_SERIAL) iostream = &Serial1; #elif defined(PSP_CPU_IMX6SX_M4) // UDOO Neo iostream = &Serial0; #else iostream = &Serial; #endif baud_ = 57600; } ArduinoHardware(ArduinoHardware& h){ this->iostream = h.iostream; this->baud_ = h.baud_; } void setBaud(long baud){ this->baud_= baud; } int getBaud(){return baud_;} void init(){ #if defined(USE_USBCON) // Startup delay as a fail-safe to upload a new sketch delay(3000); #endif iostream->begin(baud_); } int read(){return iostream->read();}; void write(uint8_t* data, int length){ for(int i=0; i<length; i++) iostream->write(data[i]); } unsigned long time(){return millis();} protected: SERIAL_CLASS* iostream; long baud_; }; #endif
I tried this modifying the (sketchbook)/libraries/ros_lib/ArduinoHardware.h and /catkin_ws/src/rosserial/rosserial_arduino/src/ros_lib/ArduinoHardware.h as well as connecting /dev/ttymxc5 to Serial1 of the M4 core. Both without any success. Any suggestions on how to connect the M4 core to the A9 in ROS?
Does your Neo Arduino work? Can you compile and upload the standard blink example? Is serial0/UART6 (/dev/ttymxc5) working after patching? Do you see something coming in when you compile and upload the next Arduino sketch. On the linux side in a terminal window do "minicom -D /dev/ttymxc5" If this is working and rosserial is not then the protocol is doing something wrong. The Neo Arduino is known for being critical in string handling. Code: void setup() { Serial0.begin(115200); delay(100); pinMode(13, OUTPUT); } void loop() { // Print out the data // Accelerometer Serial0.print("Accel "); Serial0.print("X: "); Serial0.print("2121"); Serial0.print(" Y: "); Serial0.print("2122"); Serial0.print(" Z: "); Serial0.println("2123"); digitalWrite(13, HIGH); // turn the LED on delay(1000); // Magnometer Serial0.print("Mag "); Serial0.print("X: "); Serial0.print("2124"); Serial0.print(" Y: "); Serial0.print("2125"); Serial0.print(" Z: "); Serial0.println("2126"); digitalWrite(13, LOW); // turn the LED off delay(1000); }
The Arduino side works. The sketch you posted works as well. To test the serial node I uploaded the pubsub example from ros_lib. When I am trying to run the serial node (rosrun rosserial_python serial_node.py _port:=/dev/ttymxc5 _baud:=115200) it still doesn't sync. On ttymxc5 I see some unintelligible characters: Code: ÿ÷ õÿþH·}chatterstd_msgs/String 992ce8a1687cec8c8bd883ec73ca41d1#ÿþJﷵd
Yes, it looks like the Neo Arduino is not processing the ROS message strings correctly. This could be very difficult to solve.
Hi, I have the same problem, with the same configuration (using /dev/ttymxc5 on Linux side and Serial0 on Arduino side) and also the same strange string on picocom (minicom). Did you make any progress since last post? EDIT: to be more precise, I can see the string in picocom only if I send manually some characters, and the string that appears is something like Code: H}chatterstd_msgs/String 992ce8a1687cec8c8bd883ec73ca41d1#}hello world!