Serial communication error , can not figure it out. Help !!

Discussion in 'Troubleshooting' started by samira, Feb 7, 2014.

  1. samira

    samira New Member

    Oct 26, 2013
    Likes Received:
    Environment : UDOO quad.
    The J18 jumper is not used( empty ).
    CN6 is not connected, ie I am using direct serial connection between iMX6 with SAM arduino.
    Potentiometer is connected to A0 pin on arduino.

    I am trying to send data from analog reading on the Arduino side via serial comm to iMX6.
    I can see the data being generated and print on the arduiono monitor.
    When I run Python code, I can see data on python side for about 8-10 lines then the error. ( see below )

    // Adruino code 
    int ADCpin0 = A0;
    void setup() {
      Serial.begin( 9600);
    void loop() {
      int myVal = analogRead(ADCpin0);
      Serial.println( myVal, DEC);
    # this is my Udoo linux python code( iMX6 side )
    # reading serial data

    import serial 
    ser = serial.Serial(timeout=1);
    ser.port = "/dev/ttymxc3"
    ser.baudrate = 9600
    data = ""
    try : 
    	while True:
    		ch =    # **** 
    		while ch != '\n':
    			data = data + ch
    			ch =
    		print "Data: " + data
    		data = ""
    except Exception, e : 
    		print "error ::" + str(e )
    Result on python screen

    Data: 167
    Data: 166
    Data: 12
    error ::device reports readiness to read but 
    returned no data (device disconnected or multiple access on port?)
    I also tried
    ser.readline() #****
    It gave the same error.

    Question : what is causing this error mesage ?

Share This Page