A9 and M4 serial communication problem from Bash

Discussion in 'UDOO NEO' started by ckuehnel, Feb 23, 2016.

  1. ckuehnel

    ckuehnel New Member

    Joined:
    Dec 5, 2013
    Messages:
    2
    Likes Received:
    0
    I want to send a command to Arduino to trigger data aquisition and read the results (two values).
    A first test with cu works as expected (see first image). Building a shell script was not successful.
    Using stty to set the baud rate was not accepted. stty /dev/ttyMCC -a shows a baud rate of 38400. I think this is wrong. Default should be 115200. The cooked option was not accepted, too. Furthermore calling read the script hangs (see second image).
    Do you have any hint what's wrong here?

    cu.PNG

    Code:
    #!/bin/bash
    
    set -ex
    
    #stty -F /dev/ttyMCC 115200 cooked
    
    while true; do
      echo "AAA" > /dev/ttyMCC
      read -r ID < /dev/ttyMCC
      echo $ID
    done 
    serial.PNG
     
  2. ckuehnel

    ckuehnel New Member

    Joined:
    Dec 5, 2013
    Messages:
    2
    Likes Received:
    0
    The following script worked on a UDOO Quad. The Arduino was connected via ttymxc3.
    For UDOO NEO the program hangs. stty is commented because it fails too.

    Code:
    #!/bin/bash
    
    #Port settings
    #stty -F /dev/ttyMCC raw speed 115200
    
    while  :
    do
      echo 1 > /dev/ttyMCC
      read -r CMD < /dev/ttyMCC
      echo $CMD
      sleep 1
    done
     
  3. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    It's a known issue. we're looking for a way to solve it.
     

Share This Page