Udoo neo Arduino

Discussion in 'Arduino IDE' started by Ayeed Shaikh, May 21, 2016.

  1. Ayeed Shaikh

    Ayeed Shaikh Member

    Joined:
    Mar 9, 2016
    Messages:
    52
    Likes Received:
    1
    I m facing with this error Board at COM1 is not available I am using ardunio ide 1.6.5 preinstalled in udoobuntu 2.0 rc desktop trying to connect my adafruit ultimate GPS rx and tx in pin 0 and 1 GND and 3v3 pin in my udoo neo board I have downloaded the library of GPS from git and copied it in ardunio library folder. I am new with this can any one help me.
     
    Last edited: May 21, 2016
  2. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,262
    Likes Received:
    564
    The arduino side is not on COM1 but on /dev/ttyMCC so set your IDE to that (as it is preinstalled).

    Second, to talk with your GPS shield from Arduino side you better use the build in Serial0, available on pin 0 and 1. Perhaps you have to modify some sketches and libraries to adapt to this situation.

    If you want to talk from the Linux side to the Arduino side you use Serial. If you want to use the GPS data on the Linux side you first read them with Serial0 from shield to Arduino and then send them with Serial to the Linux side.

    See also the communication part of the Neo documentation.
     
  3. Ayeed Shaikh

    Ayeed Shaikh Member

    Joined:
    Mar 9, 2016
    Messages:
    52
    Likes Received:
    1
    Thank you will try and let you know.
     
  4. Ayeed Shaikh

    Ayeed Shaikh Member

    Joined:
    Mar 9, 2016
    Messages:
    52
    Likes Received:
    1
    need some help.
    im trying to run a basic script with related to adafruit ultimate GPS but as udoo neo not supported with SoftwareSerial I dont know what to do

    SoftwareSerial mySerial(3,2);
    Adafruit_GPS GPS(&mySerial);

    I am unable to get any values on ttyMMC
    getting an error

    Kindly help me.
     
  5. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,262
    Likes Received:
    564
    You have to erase all SoftwareSerial references and use Serial0 instead.

    Change your code with

    Adafruit_GPS GPS(&Serial0);

    Be sure you connect the TX and RX pins of your gps to pin 0 and 1 (not sure I have the correct order, could be the other way) please check the documentation yourself.
     
  6. Ayeed Shaikh

    Ayeed Shaikh Member

    Joined:
    Mar 9, 2016
    Messages:
    52
    Likes Received:
    1
    will try and let you know.
     
  7. Ayeed Shaikh

    Ayeed Shaikh Member

    Joined:
    Mar 9, 2016
    Messages:
    52
    Likes Received:
    1
    I connected Rx and tx to pin 0 and 1 and trying to run this code it successfully uploads but no output

    Code:
    #include <Adafruit_GPS.h>
    Adafruit_GPS GPS(&Serial0);
    
    String NMEA1;
    String NMEA2;
    char c;
    
    void setup(){
      Serial.begin(115200);
      Serial.println("Adafruit GPS library basic test!");
      GPS.begin(9600);
      GPS.sendCommand("&PGCMD,33,0*6D");
      GPS.sendCommand(PMTK_SET_NMEA_UPDATE_10HZ);
      GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);
      //GPS.begin(9600);
      //GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_ALLDATA);
      delay(1000);
    }
    
    void loop(){
    
      readGPS();
      
    }
    
    
    void readGPS()
    {
      while(!GPS.newNMEAreceived())
      {
      c=GPS.read();
    
      }
      GPS.parse(GPS.lastNMEA());
      NMEA1=GPS.lastNMEA();
    
      while(!GPS.newNMEAreceived())
      {
      c=GPS.read();
    
      }
      GPS.parse(GPS.lastNMEA());
      NMEA2=GPS.lastNMEA();
    Serial.println("Adafruit GPS library basic test!");
      Serial.println(NMEA1);
      Serial.println(NMEA2);
    
    }
    
     
    Last edited by a moderator: May 25, 2016
  8. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,262
    Likes Received:
    564
    I looked in the Adafruit_GPS library and it is full of references to softserial. So this could be an issue.
    To get rid of the library first what happens if you run the following code? Do you see GPS data arriving in the Serial Monitor

    Code:
    void setup() {
    
      Serial.begin(115200); // setup serial for serial monitor
      delay(100);
      Serial.println("GPS test Started");
    
      // GPS Setup
      serial0.begin(9600);  // adapt speed for your GPS, try 4800 if ails
      delay(100);
      // Cut first gibberish
      while(serial0.available())
        if (serial0.read() == '\r')
          break;
    }
    
    void loop()
    {
      String s = checkGPS();
      if(s && s.substring(0, 6) == "$GPGGA")
      {
        Serial.println(s);
      }
    }
    
    // Check GPS and returns string if full line recorded, else false
    String checkGPS()
    {
      if (serial0.available())
      {
        char c = serialGPS.read();
        if (c != '\n' && c != '\r')
        {
          stringGPS  = c;
        }
        else
        {
          if (stringGPS != "")
          {
            String tmp = stringGPS;
            stringGPS = "";
            return tmp;
          }
        }
      }
      return false;
    }
     
  9. Ayeed Shaikh

    Ayeed Shaikh Member

    Joined:
    Mar 9, 2016
    Messages:
    52
    Likes Received:
    1
    will check and let you know in 10mins
     
  10. Ayeed Shaikh

    Ayeed Shaikh Member

    Joined:
    Mar 9, 2016
    Messages:
    52
    Likes Received:
    1
    getting an error serial0 not declared in the scope
     
  11. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,262
    Likes Received:
    564
    Type error my side: serial0 should be Serial0.
    I adapted this script without IDE.....
     
  12. Ayeed Shaikh

    Ayeed Shaikh Member

    Joined:
    Mar 9, 2016
    Messages:
    52
    Likes Received:
    1
  13. Ayeed Shaikh

    Ayeed Shaikh Member

    Joined:
    Mar 9, 2016
    Messages:
    52
    Likes Received:
    1
    Arduino: 1.6.5 (Linux), Board: "UDOO Neo (Cortex M4)"

    gps.ino: In function 'void setup()':
    gps:8: error: 'serial0' was not declared in this scope
    gps.ino: In function 'String checkGPS()':
    gps:30: error: 'serialGPS' was not declared in this scope
    gps:33: error: 'stringGPS' was not declared in this scope
    gps:37: error: 'stringGPS' was not declared in this scope
    In file included from /usr/share/arduino/hardware/UDOO/solox/variants/udooneo/Arduino.h:26:0,
    from gps.ino:1:
    gps:45: error: converting to 'String' from initializer list would use explicit constructor 'String::String(int, unsigned char)'
    'serial0' was not declared in this scope

    This report would have more information with
    "Show verbose output during compilation"
    enabled in File > Preferences.
     
  14. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,262
    Likes Received:
    564
    You did not change all serial0 into Serial0
    Furthermore it was an old sketch I found somewhere on the net and modified a little hoping it would compile. But debugging is an task you have to be able to do yourself.
     
  15. Ayeed Shaikh

    Ayeed Shaikh Member

    Joined:
    Mar 9, 2016
    Messages:
    52
    Likes Received:
    1
    can you check with this atleast

    gps:30: error: 'serialGPS' was not declared in this scope
    gps:33: error: 'stringGPS' was not declared in this scope
    gps:37: error: 'stringGPS' was not declared in this scope
     
  16. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,262
    Likes Received:
    564
    stringGPS was not declared yet. Add a line at the beginning of the sketch to declare it:
    String stringGPS ="";
     
  17. Ayeed Shaikh

    Ayeed Shaikh Member

    Joined:
    Mar 9, 2016
    Messages:
    52
    Likes Received:
    1
    not working yet
     
  18. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,262
    Likes Received:
    564
    You have to be more specific what is not working?
     
  19. Ayeed Shaikh

    Ayeed Shaikh Member

    Joined:
    Mar 9, 2016
    Messages:
    52
    Likes Received:
    1
    Wait will send you the error.
     
  20. Ayeed Shaikh

    Ayeed Shaikh Member

    Joined:
    Mar 9, 2016
    Messages:
    52
    Likes Received:
    1
    I only need to retrieve speed from my gps and display it into udoo.
     

Share This Page