Sharing Data Between Arduino and UDOO

Discussion in 'General Programming Discussion' started by czu, May 5, 2016.

  1. czu

    czu New Member

    Joined:
    May 5, 2016
    Messages:
    4
    Likes Received:
    2
    Hi guys,

    I am trying to share data between the UDOO server and the Arduino. I currently have an Arduino Feather that I am receiving radio data from. Is there any way I can wire in the Arduino Feather into the UDOO Arduino interface, and then have it send data to the UDOO server? Ideally, I would like to save the Arduino data to an SD Card, and have the UDOO read from that same SD Card. Thanks in advance.
     
  2. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    You have several options:
    1. Don't use the Arduino feather but the Arduino on the Udoo itself and read the data from arduino with serial port. Use a program (Python, C++, Java, Perl) on the Linux side to read the data and store it in a file or database on the SD card.
    2. connect the feather with USB to the Udoo and read the feather with a program like in option 1. The Udoo Linux side is not a server but a PC.
    3. Connect the feather using a serial connection with the Arduino side of the Udoo and transfer that data to the Linux side. Use the Serial0 (standard on udoo Neo) for the feather connection and Serial to transfer it to the Linux side.
     
    Andrea Rovai and czu like this.
  3. czu

    czu New Member

    Joined:
    May 5, 2016
    Messages:
    4
    Likes Received:
    2
    Thanks for the quick reply! I think I am more interested in #3. I have an UDOO Neo. Can you point me to some samples/docs online regarding #3?
     
  4. czu

    czu New Member

    Joined:
    May 5, 2016
    Messages:
    4
    Likes Received:
    2
    Andrea Rovai and waltervl like this.
  5. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    And another quick response:
    General information about Arduino Serial and Serial0 can be found here: http://www.udoo.org/docs-neo/Arduino_M4_Processor/Communication.html

    You can use the Udoo Serial example library for reading the Udoo Arduino on /dev/ttyMCC with C, java PHP and Python.\
    The library is written for the Udoo Quad so you have to replace serial device /dev/ttyS0 with /dev/ttyMCC
    https://github.com/UDOOboard/serial_libraries_examples

    Sample Arduino code for passing data from serial0 to Serial /dev/ttyMCC :
    Code:
    void setup() {
    // initialize both serial ports
    // Serial0 is M4 ext pin 0 and 1
    // Serial is /dev/ttyMCC A9 to M4 core
    Serial.begin(115200);
    delay(100);
    Serial0.begin(9600);
    delay(100);
    }
    void loop() {
    // read from port 0, send to port A9 Serial:
    if (Serial0.available()) {
    int inByte = Serial0.read();
    Serial.write(inByte);
    }
    // read from port A9 Serial, send to port 0:
    if (Serial.available()) {
    int inByte = Serial.read();
    Serial0.write(inByte);
    }
    } 
     
    Andrea Rovai and czu like this.
  6. czu

    czu New Member

    Joined:
    May 5, 2016
    Messages:
    4
    Likes Received:
    2
    Excellent! Thanks!
     
  7. Bairon

    Bairon New Member

    Joined:
    Feb 1, 2016
    Messages:
    14
    Likes Received:
    2
    hi @waltervl do you know where is the voltage of Tx an Rx serial port on UDOO ?? i want to connect a device that use 3.3v.
    Regards!
     
  8. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    All IO pins on the Neo are 3.3V so your device should work
     
    Andrea Rovai and Bairon like this.
  9. Bairon

    Bairon New Member

    Joined:
    Feb 1, 2016
    Messages:
    14
    Likes Received:
    2
    Thanks!
     

Share This Page