A9 - M4 Serial Communications Not Reliable

Discussion in 'UDOO NEO' started by Kirk Bierach, Apr 25, 2020.

  1. Kirk Bierach

    Kirk Bierach UDOOer

    Joined:
    Apr 25, 2020
    Messages:
    2
    Likes Received:
    0
    Hi,

    I am having difficulty to start a project because the A9 and M4 ttyMCC serial communications are not working properly.

    Using the A9 - c code to Arduino serial example, works fine with 1 message, as written, try putting it into a while loop, and repeat endlessly. Does not work properly! Tried unidirectional and bidirectional examples. Spent a lot of time fiddling with the code.

    There must be a proper example of M4 to A9 serial comm to leverage.

    Anyone else have this issue?

    How to fix?

    I am really blown away. It seems to me that better example programs should be available.
     
  2. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    For examples see the how to topics in my signature.
    The trick is that there is a small buffer which can overload easily stopping the A9 part. So first send something to the Arduino and after confirmed receipt by Arduino send something to the A9. There is also only 1 serial viewer possible so don't use Arduino IDE serial monitor and another Linux serial monitor on the same time.
     
  3. Kirk Bierach

    Kirk Bierach UDOOer

    Joined:
    Apr 25, 2020
    Messages:
    2
    Likes Received:
    0
    Hi,

    Thanks for the quick reply.

    I am using UDOObuntu 2.3.0 (Ubuntu 14.04 LTS)

    Compiling with the built in Arduino IDE.

    Serial.print is not stable, unless I reboot, then run the LXTerminal shell only. If the Arduino IDE is active, then the Serial.print("Hello World") loop I am using as an example is slow as stops.

    Not that fun, I would like to be able to upload a sketch, test, make changes, upload another sketch. Not possible. Must reboot after every upload.
    Looks like others are having this problem, but I have not seen a fix.
     
  4. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    Hello Kirk, Your reply just got visible for me so now I can reply.....
    As mentioned there is an issue with Serial.Print but it can be handled. I never had the issue that the data slowed down. I can only imagine that you send het "Hello World" string to fast so it cannot be read and the small buffer fills up.
    See for more information https://www.udoo.org/docs-neo/Debug...g/USB_stops_working_after_programming_M4.html
     
  5. alpha

    alpha UDOOer

    Joined:
    Jul 24, 2020
    Messages:
    3
    Likes Received:
    2
    Kirk, I'm having issues there as well. The main loop on the arduino side is serial.printing output from analog channels to a php handler on the linux side, to be sent via xml to an html page. When attempting to send data to the arduino side from the linux side, the process works for about three seconds and then crashes. If we simply let the arduino loop endlessly send the analog data, everything works just fine for days on end. Since it is so difficult to troubleshoot the arduino code in action, I'm sort of at a standstill... did you ever figure it out? I've attached the code for both the php handler and the arduino test loop.
    Walter, this whole thing is your fault because of your initial Webcontrol post lol! ;) I stepped into this project to replace my existing remote pasture monitoring web page which was built using an Arduino Uno and ethernet shield feeding a Ubiquiti AirMax router to link to our LAN a half mile away. The UDOO Neo has so much more utility (speed, memory, ssh etc.). Just for fun I've attached a screen shot of the html page as well...
     

    Attached Files:

    waltervl likes this.
  6. alpha

    alpha UDOOer

    Joined:
    Jul 24, 2020
    Messages:
    3
    Likes Received:
    2
    I just noticed that, during the process of troubleshooting this issue, I changed the termination character in the arduino code to "\n" as opposed to the transmitted begin (<) and termination (>) characters listed in the php code. This is a result of my multiple attempts to solve the problem with various parsing routines but is not a valid idiosyncrasy as, while actually troubleshooting, both software packages shared the proper start and/or termination characters.
    Sorry, no edit capability observed as an option to postings.
     

Share This Page