Possible to use Neo as a Super arduino including ethernet shield (with UDOO libaries)

Discussion in 'UDOO NEO' started by Masquime, May 12, 2017.

  1. Masquime

    Masquime New Member

    Joined:
    May 4, 2017
    Messages:
    13
    Likes Received:
    3
    I planed to use my Neo basic board as a super Arduino. In order to do the same things I can do with an Arduino Mega + an Ethernet shield but only with the Neo Board, which is more compact (using the Gpios as arduino pins)

    So, can I do this using those libraires ? It seems that they are built in order to work with the udoo dual/quad but I found the github link in the neo docs...
    Is it a way which libraires works with neo board ?
     
  2. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    They could work. The virtual serial device (/dev/ttyMCC) on the Neo is not so reliable as an hardware one like on the Mega but you definitely could give it a try.
     
  3. jas-mx

    jas-mx Active Member

    Joined:
    Dec 31, 2013
    Messages:
    407
    Likes Received:
    118
    It seems a bit convoluted (as well wasting peripherals) to send data from M4 via a serial port back to the A9. The imx6sx has built-in mechansims to aid sharing/accessing memory regions between the two cores. The Arduino layer(s) should be coded to use these features correctly in order to realise a 'super arduino'.
     
  4. Masquime

    Masquime New Member

    Joined:
    May 4, 2017
    Messages:
    13
    Likes Received:
    3
    I'm not sure understanding all what you said.

    But I want to use the linux side as a library, just like a ethernet shield for the M4.

    I already configure the board in order to use the GPIO as digital arduino PINS, so I can acces to the GPIO directly from the arduino IDE ( I modified the dtb file, I recompiled them...and it's works).
    On this library David Smerkous tells : "The ultimate Udoo library that allows you to use the linux side as a library, just like a shield for the Sam3x"
    What I understand is the udoo library uses a python script to make a bridge between the Arduino IDE/Sam3x and the linux side. And, using custom arduino lib provide by david, the arduino IDE considers the linux side as a shield (for example an ethernet shield).
    But I use a Neo which has a M4, not a Sam3x, so I'm questioning me about the possibility to use David's libraries...

    From what you said, I think I don't need to use the virtual serial port between M4 to A9, to communicate with GPIOs, but I need it to communicate with the linux side on this way : Arduino sketch -> python script -> ethernet port ( I need it between arduino sketch and python script)

    My final goal is to send udp packets directly from an arduino sketch via the ethernet port of the Neo board
     
  5. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    What @jas-mx is saying is that the A9/M4 processor that the Neo is using has better functions than the virtual serial device /dev/ttyMCC for the datatransfer from M4 to A9 and vice versa. But they are not implemented yet in Udoobuntu 2 so you do not need to worry about this. If you are an embedded programmer then you could write your own datatransfer function.

    I would just give it a try on the Neo. It looks like David Smerkous adapted it also for the Neo.
    from Udoo.py:
    Code:
    try:
    ser = Serial("/dev/ttymxc3", 115200) #For udoo dual or quad
    except:
    ser = Serial("/dev/ttyMCC", 115200) #For udoo neo
     
  6. Masquime

    Masquime New Member

    Joined:
    May 4, 2017
    Messages:
    13
    Likes Received:
    3
    Thanks @watervl . I'm absolutely not an embedded programmer :). I'm a beginner with that.
    So, I would try Davis Smerkous lib, and I'll post my feedback !
     
    waltervl likes this.
  7. Masquime

    Masquime New Member

    Joined:
    May 4, 2017
    Messages:
    13
    Likes Received:
    3
    So, here is my feedback :
    I tried to use David Smerkous lib, but I didn't succeed. Probably because I don't understand everything I have to do. (and I'm a little bit lazy)
    But, what I really need to do is to send Arduino data to another computer using OSC protocol.
    And I found a way to do it :
    I use this python script generator which works perfectly.

    Some details :

    What I wanted to do : Using Neo board as an arduino with about 33 pins (13 analog + 20 pins) and send datas via Neo's ethernet port using OSC protocol (in order to use it with MAX/SMP)
    Here is a little schem : Sensors ->Arduinos -> Virtual serial bus /dev/ttyMCC -> Pyhton script (to convert serial datas to OSC datas) -> ethernet physical port -> computer with Max/MSP

    What I did :
    1/ First, I extended arduino's PINs to external PINs using this topic. Now I can use 35 pins as Arduinos digital pins from my Neo board (+ sda and scl)
    2/ I wrote my Arduino program to send datas via virtual serial bus ( /dev/ttyMCC)
    3/ I used this python script generator to generate a script that convert serial datas from arduino to OSC protocol. I followed the instructions I found on the Github repository to program Arduino (It's very important).
    One more thing, in order to use the generated script you have to close the Arduino IDE program, if not, the script will not be able to find the virtual serial port.
    4/ I launched my generated script, and I'm able to find OSC messages in Max/msp

    What I plan to do :
    As I said before, I need to use 13 analogs pins, and Udoo neo only have 6 of them. So, I planed to use 4051 Multiplexer to extend analog pin, as I saw there.

    And now, with my Neo board, I made my SuperArduinotoOSC board :)
     
    waltervl likes this.
  8. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    Good work! Keep it simple is always the best way.

    Just 1 remark: You do not have to close the complete Arduino IDE, just the serial monitor to get Python find the serial device.
     
    Masquime likes this.

Share This Page