Serial pass through stops working

Discussion in 'UDOO NEO' started by bnt2025, Dec 6, 2015.

  1. bnt2025

    bnt2025 New Member

    Joined:
    Apr 21, 2014
    Messages:
    6
    Likes Received:
    0
    Hi there,

    I have an Adafruit Ultimate GPS Breakout module that I have connected up to the Arduino side. I can view the NMEA sentences when looking at the serial console in the Arduino IDE so I know the wiring it correct and the module works.

    I am trying to read the GPS data through the Arduino into /dev/ttyMCC and then have GPSD connect to that in order to provide GPS. To do this I am using this sketch;


    void setup() {
    Serial.begin(9600);
    Serial0.begin(9600);
    }
    void loop() {

    while (Serial0.available() > 0 ){
    char char_buffer = Serial0.read();
    Serial.print( char_buffer );
    }
    }
    If I run sudo cat /dev/ttyMCC I can see about a dozen sentences pass through but then I get nothing and In a very few cases the Neo has to be reset.
    Can anyone shed any light onto what I am doing wrong?

    Thank you in advance.
     
  2. ddewaele

    ddewaele Member

    Joined:
    Dec 2, 2014
    Messages:
    48
    Likes Received:
    11
    I'm seeing the same thing ... from time to time it gets stuck and I can't even CTRL-BREAK the cat.
    Didn't happen as often when I was sending small pieces of txt.
    When it halts the serial output remains broken even after uploading new sketches.
    A reboot is typically required to get it working again.
     
  3. bnt2025

    bnt2025 New Member

    Joined:
    Apr 21, 2014
    Messages:
    6
    Likes Received:
    0
    OK, so at least it isn't something I am doing wrong. Do you (or anyone) have any suggestions oh what to do?
    I want to avoid just a USB to serial adapter.
     
  4. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Dear @bnt2025, in which language your app is developed? CAT is not the best for reading the serial. You should read /dev/ttyMCC for example with fopen in C...
     
  5. bnt2025

    bnt2025 New Member

    Joined:
    Apr 21, 2014
    Messages:
    6
    Likes Received:
    0
    @Andrea Rovai I am just using CAT to test the stream. I have tried using sudo gpsd /dev/ttyMCC -F /var/run/gpsd.sock and then testing using gpsmon and cgps but i get no GPS info out of either.
     
  6. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    What GPS module are you using?
     
  7. bnt2025

    bnt2025 New Member

    Joined:
    Apr 21, 2014
    Messages:
    6
    Likes Received:
    0
    So as an update;
    I ran gpsd using sudo gpsd -N -D 5 /dev/ttyMCC -F /var/run/gpsd.sock and got the following message;
    gpsd:pROG: control socket opened at /var/run/gpsd.sock
    gpsd:INFO: launching (Version 3.11)
    gpsd:IO: opening IPv4 socket
    gpsd:ERROR: can't bind to IPv4 port gpsd, Address already in use
    gpsd:ERROR: maybe gpsd is already running!
    gpsd:IO: opening IPv6 socket
    gpsd:ERROR: can't bind to IPv6 port gpsd, Address already in use
    gpsd:ERROR: maybe gpsd is already running!
    gpsd:INFO: command sockets creation failed, netlib errors -1, -1


    I killed gpsd and re-ran it with the same options. It appears to be working now. I will leave it running for a while as a test. I guess CAT wasn't a good testing program.
    It is the Adafruit ultimate gps breakout.
     
  8. tcmichals

    tcmichals Member

    Joined:
    Feb 25, 2015
    Messages:
    54
    Likes Received:
    27
    I've added to your issue list in github.
     
    Andrea Rovai likes this.

Share This Page