Ping from tap interface of one RIOT instance to another dont work.

Hi,

I followed the following tutorial to get used to developing application in RIOT.

https://github.com/cgundogan/RIOT-Tutorial/

As per the below, I have configured one instance of RIOT to tap0 and another instance to tap1. and try to ping between 2 instances and this does not work. Am I missing something? Please advice.

  1. Running RIOT on Native -> 8th point…

RIOT (Instance 1):

ifconfig Iface 4 HWaddr: 22:a4:56:14:8a:61 MTU:1280 HL:64 Source address length: 6 Link type: wired inet6 addr: ff02::1/128 scope: local [multicast] inet6 addr: fe80::20a4:56ff:fe14:8a61/64 scope: local inet6 addr: ff02::1:ff14:8a61/128 scope: local [multicast] inet6 addr: ff02::2/128 scope: local [multicast]

RIOT (Instance 2) :

ifconfig Iface 4 HWaddr: ca:ec:7d:fd:db:d0 MTU:1280 HL:64 Source address length: 6 Link type: wired inet6 addr: ff02::1/128 scope: local [multicast] inet6 addr: fe80::c8ec:7dff:fefd:dbd0/64 scope: local inet6 addr: ff02::1:fffd:dbd0/128 scope: local [multicast] inet6 addr: ff02::2/128 scope: local [multicast]

I try to ping RIOT1 from RIOT2 :

ping6 fe80::20a4:56ff:fe14:8a61 ping timeout ping timeout ping timeout — fe80::20a4:56ff:fe14:8a61 ping statistics — 3 packets transmitted, 0 received, 100% packet loss

I try to ping RIOT instance 1 from instance 2 and dont work. I tried various other means like mentioning tap interface in ping command, still, don’t work.

-Rik

Hello Rikhu,

Can you try creating the tap interfaces with the tapsetup script located in RIOT/dist/tools/tapsetup/tapsetup ?

This tapsetup script will create an interface (br0) that serves as a bridge between tap0 and tap1 (and other taps created by the tapsetup script).

Thank you for pointing out this issue, I will address this in the tutorial.

Best, Cenk

Hi Cenk,

Perfect! it works… I was searching for a bridging script and nice that its already provided :slight_smile:

Thanks, Rik

Hi Cenk,

I am trying to use the example provided for Arduino Mega 2560, and I believe it should work for this board too. But I receive the below error.

When I reset the board before uploading, I get timeout errors (listed below). The same issue happens with the default example provided in RIOT. When I upload the Receive and/or Transmit lights on the Arduino blink.

To test if Arduino is working : I tested with Blink sketch using Arduino IDE and it works fine. I even tried without the IDE using Arduino-Makefile (https://github.com/sudar/Arduino-Makefile) to reassure myself and it works. The problem happens with using RIOT.

Without RESET: avrdude -p m2560 -c stk500v2 -P /dev/ttyACM0 -b 115200 -F -U flash:w:bin/arduino-mega2560/default.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9801 avrdude: NOTE: “flash” memory has been specified, an erase cycle will be performed To disable this feature, specify the -D option. avrdude: erasing chip avrdude: stk500v2_command(): command failed

avrdude done. Thank you.

make: *** [flash] Error 255

After Reset:

“make” -C /home/rikhu/Desktop/RIOT/sys/xtimer text data bss dec hex filename 48670 5326 11189 65185 fea1 /home/rikhu/Desktop/RIOT-Tutorial/application/bin/arduino-mega2560/ieee_wf-iot_2015.elf avrdude -p m2560 -c stk500v2 -P /dev/ttyACM0 -b 115200 -F -U flash:w:bin/arduino-mega2560/ieee_wf-iot_2015.hex avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_getsync(): timeout communicating with programmer

avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout

Thanks, Rikhu

Hello Rikhu,

Sorry for the late response. I just tried to flash the default example (master) on an arduino mega 2560 board and it works without any errors. Does your problem still persist? Admittedly, I have not much knowledge in this area. Maybe Hauke or someone else can give more hints regarding this problem?

Best, Cenk

Hi Cenk,

Thank you for your response. Its very strange that its not working. I tried to use another piece of Arduino Mega 2560, and it gives the same error. I am trying to flash using the default USB connector.

Just to make further clear, I tried flashing it in “Arduino MEGA ADK for Android” [Link: https://www.arduino.cc/en/Main/ArduinoBoardMegaADK ] using default USB connector. Its extremely strange that the flashing works for this!!! It may be because The MEGA ADK is based on the Mega 2560. But, how can it be that flashing works for this and does not work in the Mega 2560 (which its mentioned specifically in the RIOT that it supports for this device). One problem with ArduinoBoardMegaADK is that I do not get networking support - after flashing I cannot use ifconfig for the device. Probably it should be that networking is its not supported for ArduinoBoardMegaADK.

But my main concern/problem I am facing is why flasehing does not work in Mega 2560 in 2 devices when trying to flash from USB. Both give same errors.

Regards, Rikhu

Hej!

I think I had a similar problem once when trying to flash the arduino-mega2560. If I recall correctly, I think I fixed this by updating my avrdude tool to a new version (build it from their master). My current version is 6.2-20151117 which works fine under Linux Mint 17. Maybe you give that a try?

Cheers, Hauke

Hi ,

Thank you. It works finally, I tried the below for the Mega 2560 by checking what the IDE does actually and and following accordingly. So, the below works for me without updating the avrdude. I am using avrdude 6.1 version.

avrdude -v -patmega2560 -cwiring -P/dev/ttyACM0 -b115200 -D -Uflash:w:bin/arduino-mega2560/default.hex

Now the issue is that I am not able to use ifconfig (networking) does not work. When I do a help command, it only shows as below… Does not have support for ifconfig. Your opinions would give me further insights.

2016-01-09 01:51:54,238 - INFO # Welcome to RIOT! 2016-01-09 01:51:54,238 - INFO # > >

2016-01-09 01:51:54,239 - INFO # main(): This is RIOT! 2016-01-09 01:51:54,250 - INFO # Welcome to RIOT! help 2016-01-09 01:51:56,408 - INFO # > help 2016-01-09 01:51:56,445 - INFO # Command Description 2016-01-09 01:51:56,486 - INFO # --------------------------------------- 2016-01-09 01:51:56,523 - INFO # reboot Reboot the node 2016-01-09 01:51:56,593 - INFO # ps Prints information about running threads.

Regards, Rikhu

I did try to update avrdude to the latest version (thinking maybe the image created by the older version was not fully compatible) - available at http://download.savannah.gnu.org/releases/avrdude/

Now I am using Ubuntu 14.04. I get the below error while flashing. avrdude version 6.2.

System wide configuration file is “/usr/local/etc/avrdude.conf” User configuration file is “/home/rikhu/.avrduderc” User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/ttyACM0 Using Programmer : stk500v2 Overriding Baud Rate : 115200 make: *** [flash] Floating point exception (core dumped)

Anyone faced these issues, please.

Regards, Rikhu

Hej,

I did have a similar issue, though as stated I thought updating avrdude fixed it for me… I can’t really recall if I did something else to get it to work. But maybe you can just PR a fix with to the make flash target for the arduino-mega2560 board with the avrdude command parameters that were working for you?

Regarding ifconfig: For your board no networking support is compiled in for the default example, since the board does not come with any on-board network devices. You could would need to connect some external radio/ethernet device to the board and add the the driver as well as the gnrc_netif_default module to the USEMODULE variable -> this should compile the ifconfig shell command into your application.

Cheers, Hauke

Hi,

I added an external ArduinoXBee and still the same issue. I am curious whether RIOT supports networking for arduino-mega2560. Because in the following command I don’t see that arduino-mega2560 is included [I had to add it so that its included as you advised]. I am assuming that for all the boards listed, networking has been checked to be working, but I am curious what for arduino-mega2560.

IN MAKEFILE :

BOARD_PROVIDES_NETIF := airfy-beacon fox iotlab-m3 mulle native nrf51dongle
nrf6310 pba-d-01-kw2x pca10000 pca10005 saml21-xpro samr21-xpro spark-core
yunjia-nrf51822

Is there any other way to check if the driver as well as the gnrc_netif_default has been added properly? The below verbose output shows its been compiled.

rikhu@rikhu-Lenovo-G50-70:~/RIOT/examples/default$ make all flash term BOARD=arduino-mega2560 Building application “default” for “arduino-mega2560” with MCU “atmega2560”.

“make” -C /home/rikhu/RIOT/boards/arduino-mega2560 “make” -C /home/rikhu/RIOT/core “make” -C /home/rikhu/RIOT/cpu/atmega2560 “make” -C /home/rikhu/RIOT/cpu/atmega2560/periph “make” -C /home/rikhu/RIOT/cpu/atmega_common “make” -C /home/rikhu/RIOT/drivers “make” -C /home/rikhu/RIOT/drivers/xbee “make” -C /home/rikhu/RIOT/sys “make” -C /home/rikhu/RIOT/sys/auto_init “make” -C /home/rikhu/RIOT/sys/auto_init/netif “make” -C /home/rikhu/RIOT/sys/net/gnrc “make” -C /home/rikhu/RIOT/sys/net/gnrc/netapi “make” -C /home/rikhu/RIOT/sys/net/gnrc/netif “make” -C /home/rikhu/RIOT/sys/net/gnrc/netif/hdr “make” -C /home/rikhu/RIOT/sys/net/gnrc/netreg “make” -C /home/rikhu/RIOT/sys/net/gnrc/pktbuf_static “make” -C /home/rikhu/RIOT/sys/net/gnrc/pktdump “make” -C /home/rikhu/RIOT/sys/od “make” -C /home/rikhu/RIOT/sys/ps “make” -C /home/rikhu/RIOT/sys/shell “make” -C /home/rikhu/RIOT/sys/shell/commands “make” -C /home/rikhu/RIOT/sys/tsrb “make” -C /home/rikhu/RIOT/sys/uart_stdio “make” -C /home/rikhu/RIOT/sys/xtimer text data bss dec hex filename 7828 718 715 9261 242d /home/rikhu/RIOT/examples/default/bin/arduino-mega2560/default.elf avrdude -v -p m2560 -c stk500v2 -P /dev/ttyACM0 -b 115200 -F -U flash:w:bin/arduino-mega2560/default.hex

avrdude: Version 6.1, compiled on Nov 23 2014 at 21:15:32 Copyright © 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright © 2007-2014 Joerg Wunsch

System wide configuration file is “/etc/avrdude.conf” User configuration file is “/home/rikhu/.avrduderc” User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/ttyACM0 Using Programmer : stk500v2 Overriding Baud Rate : 115200 AVR Part : ATmega2560 Chip Erase delay : 9000 us PAGEL : PD7 BS2 : PA0 RESET disposition : dedicated RETRY pulse : SCK serial program mode : yes parallel program mode : yes Timeout : 200 StabDelay : 100 CmdexeDelay : 25 SyncLoops : 32 ByteDelay : 0 PollIndex : 3 PollValue : 0x53 Memory Detail :

Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


eeprom 65 10 8 0 no 4096 8 0 9000 9000 0x00 0x00 flash 65 10 256 0 yes 262144 256 1024 4500 4500 0x00 0x00 lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00 hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00 efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00 lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00 calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00 signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : STK500V2 Description : Atmel STK500 Version 2.x firmware Programmer Model: AVRISP Hardware Version: 15 Firmware Version Master : 2.10 Vtarget : 0.0 V SCK period : 239.9 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9801 avrdude: safemode: lfuse reads as 0 avrdude: safemode: hfuse reads as 0 avrdude: safemode: efuse reads as 0 avrdude: NOTE: “flash” memory has been specified, an erase cycle will be performed To disable this feature, specify the -D option. avrdude: erasing chip avrdude: reading input file “bin/arduino-mega2560/default.hex” avrdude: input file bin/arduino-mega2560/default.hex auto detected as Intel Hex avrdude: writing flash (8546 bytes):

Writing | ################################################## | 100% 1.39s

avrdude: 8546 bytes of flash written avrdude: verifying flash memory against bin/arduino-mega2560/default.hex: avrdude: load data flash data from input file bin/arduino-mega2560/default.hex: avrdude: input file bin/arduino-mega2560/default.hex auto detected as Intel Hex avrdude: input file bin/arduino-mega2560/default.hex contains 8546 bytes avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.10s

avrdude: verifying … avrdude: 8546 bytes of flash verified

avrdude: safemode: lfuse reads as 0 avrdude: safemode: hfuse reads as 0 avrdude: safemode: efuse reads as 0 avrdude: safemode: Fuses OK (E:00, H:00, L:00)

avrdude done. Thank you.

/home/rikhu/RIOT/dist/tools/pyterm/pyterm -b 9600 -p /dev/ttyACM0 2016-01-12 15:39:24,609 - INFO # Connect to serial port /dev/ttyACM0 Welcome to pyterm! Type ‘/exit’ to exit. 2016-01-12 15:39:25,611 - INFO #

2016-01-12 15:39:25,614 - INFO # main(): This is RIOT! (Version: 2015.12-devel-526-gbfb6-rikhu-Lenovo-G50-70) 2016-01-12 15:39:25,617 - INFO # Welcome to RIOT! help 2016-01-12 15:39:27,857 - INFO # > help 2016-01-12 15:39:27,894 - INFO # Command Description 2016-01-12 15:39:27,935 - INFO # --------------------------------------- 2016-01-12 15:39:27,976 - INFO # reboot Reboot the node 2016-01-12 15:39:28,041 - INFO # ps Prints information about running threads.

Regards, Rikhu

Hi Rikhu, since the XBee is a module you can add to the board (and isn’t soldered to it like on most of our other boards) it isn’t automatically bootstrapped. You need to do two things for that to happen:

  1. add the xbee module to the USEMODULE list in the Makefile and adapt the CFLAGS a little (see [1] for a working example):

XBEE_UART ?= “UART_x” # where x is the UART you want to use. USEMODULE += xbee CFLAGS += -DXBEE_UART=$(XBEE_UART) # import XBEE_UART to preprocessor CFLAGS += -I$(CURDIR) # add application dir to include path

  1. add a xbee_params.h to you application’s directory. See [2] for its content.

Be aware that with the XBee shield for Arduino the UART is UART_0, which is also the UART the shell uses. Since there is no (de)multiplexing happining it is advised to use another UART (to my knowledge the Arduino Mega 2560 has at least one other) for the xbee module. I usually connect the shield via jumper cable.

Hope that was helpful, Martine

[1] https://github.com/RIOT-OS/RIOT/tree/master/tests/driver_xbee [2] https://github.com/RIOT-OS/RIOT/blob/master/tests/driver_xbee/xbee_params.h