ACM0-Interface gets stuck after serial.write

Discussion in 'Arduino IDE' started by hendrik, Jan 16, 2018.

  1. hendrik

    hendrik New Member

    Joined:
    Jan 16, 2018
    Messages:
    2
    Likes Received:
    0
    Hi everyone,
    i'm running ROS on Linux Mint on the UDOO and in addition to publishing my data in the ROS-environment, I also want to feed it to the onboard arduino, therefore the information is also written to the serialport of the ACM0-interface (/dev/ttyACM0).
    Data subscribed via ROS is coming in about every half second, which means that also the serial port is being written to about every half second (so there shouldn't be a problem with the baudrate, string is 50 characters max). It's a python-script handling the writing to the serial port. pyserial library is used for the communication as so:

    # set once:
    ser = serial.Serial(port='/dev/ttyACM0', baudrate=9600)
    # invoked whenever new data is coming in:
    ser.write("data-string")

    Problem is that after writing to the serialport a couple of times, it seems to get stuck in writing.
    Also tried flushing the port before writing the latest data to the port.
    Did anyone run into problems like that, or has an idea, what might be the problem?

    Your help is much appreciated!
    Thanks in advance,
    hendrik
     
  2. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    On what Udoo are you trying to do this?
     
  3. hendrik

    hendrik New Member

    Joined:
    Jan 16, 2018
    Messages:
    2
    Likes Received:
    0
    It's the UDOO x86 Ultra.
     
  4. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    This can be a normal PC-USB-Arduino communication issue. Are you reading the data on the Arduino side correctly?
    Also Search the arduino 101 forum for these problems (if there are). https://forum.arduino.cc/index.php?board=103.0

    There are enough examples to find how to send data through serial to an Arduino.
    You can look to the firmata examples on Arduino or to the arduino communication examples:
    [​IMG]
     
    Ali faraj likes this.

Share This Page