Ubuntu to Riot Communication

Dear all,

I am currently working on a proxy program on ubuntu, which do both receiving packet from and sending packet to Riot OS (Riot Mote is a samr21-xpro board connected to the Ubuntu pc via USB port). I run into the following problems:

  1. Is there a way I can send packet from Ubuntu to RIOT via USB port? Any related library and example will be appreciated.

  2. For receiving a packet at Ubuntu, currently I understand I can write a script to extract the information in the debug message. Is there a more standard way to do that?

Also I have some issue with pyterm the node. After successfully “make flash”

I can not access the node via pyterm: sudo pyterm -p “/dev/ttyACM0”

2015-11-23 23:13:14,061 - INFO # Connect to serial port /dev/ttyACM0 Welcome to pyterm! Type ‘/exit’ to exit. 2015-11-23 23:13:15,064 - WARNING # Serial port disconnected, waiting to get reconnected… 2015-11-23 23:13:16,065 - WARNING # Try to reconnect to /dev/ttyACM0 again… 2015-11-23 23:13:16,066 - WARNING # Serial port disconnected, waiting to get reconnected… 2015-11-23 23:13:17,067 - WARNING # Try to reconnect to /dev/ttyACM0 again… 2015-11-23 23:13:17,068 - WARNING # Serial port disconnected, waiting to get reconnected… 2015-11-23 23:13:18,069 - WARNING # Try to reconnect to /dev/ttyACM0 again… 2015-11-23 23:13:18,070 - WARNING # Serial port disconnected, waiting to get reconnected…

Any idea? The debug light flash as the same frequency as the warning information.

Thanks

Hi!

1. Is there a way I can send packet from Ubuntu to RIOT via USB port? Any related library and example will be appreciated.

In general, yes, you can use SLIP [1]. In order to do so, please take a look at the border router example [2]. In particular, you need to copy the slip_params.h file into your application folder and add something like this to your Makefile:

ifeq (,$(SLIP_UART)) # set default (first available UART)     SLIP_UART="UART_DEV(0)" endif ifeq (,$(SLIP_BAUDRATE))     # set default    SLIP_BAUDRATE=115200 endif          GNRC_NETIF_NUMOF := 2 INCLUDES += -I$(CURDIR) CFLAGS += -DSLIP_UART=$(SLIP_UART) CFLAGS += -DSLIP_BAUDRATE=$(SLIP_BAUDRATE)

USEMODULE += gnrc_slip

This will add a SLIP interface that uses the primary UART as a serial port.

However, you might run into problems since this UART is also used for the shell and I don't know how well multiplexing works on both ends. A common solution that is, for example, used for our the before mentioned border router is to add a second USB-to-UART by using an external adapter that can be found for a low price on ebay [3].

2. For receiving a packet at Ubuntu, currently I understand I can write a script to extract the information in the debug message. Is there a more standard way to do that?

Not that I'm aware of.

Also I have some issue with pyterm the node. After successfully "make flash"

I can not access the node via pyterm: sudo pyterm -p "/dev/ttyACM0"

<snip>

Any idea? The debug light flash as the same frequency as the warning information.

That seems strange to me. Is there anything else that tries to access the ACM device? Maybe some Ubuntu magic? Maybe some of the other Ubuntu (derivate) users here can help (Hauke, Martine...)?

Cheers, Oleg

[1] RFC 1055 - Nonstandard for transmission of IP datagrams over serial lines: SLIP [2] RIOT/examples/gnrc_border_router at master · RIOT-OS/RIOT · GitHub [3] http://www.ebay.com/itm/6Pin-USB-2-0-to-TTL-UART-Module-Serial-Converter-CP2102-STC-Replace-Ft232-Module-

Hi,