Arduino Yun and Batman-adv to create a mesh network


I am trying to create a mesh network using Arduino Yun and Batman-advance. I think I've succeeded in that because I was first able to install the package "kmod-batman-adv" and then to configure a mesh network with my two Yun.

The problem is that once I restart the Yuns to switch from my home wlan to the mesh, I cannot access anymore to the arduino! I've tried both using ssh via terminal and typing arduino.local in the browser. Essentially I can't reach the two nodes of the network anymore but using wireshark on my laptop I see the "batman" protocol messages exchange.

To configure the Yun I modified these two files:


config wifi-iface option device radio0 option ifname mesh0 option network mesh option mode adhoc option ssid mesh option bssid '02:CA:FE:CA:CA:40' option mcast_rate 18000 option encryption none


config interface 'mesh' option mtu 1532 option proto batadv option mesh bat0

config interface 'bat' option ifname 'bat0' option proto 'static' option mtu '1500' option ipaddr '' option netmask ''

I am not sure about what I should write in "option bssid", I wrote the MAC address of my home network AP, is it correct?

Thank you


Sorry, for this, but let’s start with a canned answer.

= [Q:] I cannot connect to My Arduino Yún. What do I do? =

First it’s good to know, when Arduino Yun cannot find the AP you have set it for (like your home wifi), it has a script that puts it back into default SSID and AP mode.

Next, you may have already watched this video, but it’s worth watching again. Pay extra attention to the part with the sketches.
Getting started with Arduino Yún - tutorial (6:53)

Then, read the short instructions immediately below. We (the volunteer support group) already know these steps by heart, so be familiar with the different reboot methods, and especially the 30+ second wifi reset. Also, not mentioned on that page, if you reset the Wifi/Linux part of the Yun, it will take from 2-8 minutes for the reboot. Lastly on this part, YOU MUST WAIT for the Linux portion to fully boot BEFORE YOU PRESS ANY of the RESET buttons.

Resetting the processors (AR9331, WiFi, and 32U4)

Then start over, plug your Yun into the USB port, run this sketch, and hit the ‘‘Wifi Reset button’’ (for 5-10 seconds).

The YunSerialTerminal provides a simplified console access to the Linux part of the Yun. It works via the USB port (the one that powers the Yun - the microUSB). From there you’ll be able to run a few commands to give us a better idea of problems.

Also, be ready with this sketch YunWiFiStatus. This sketch will help us see the status of your home AP. The sketch prints the wifi status to the console every 5 seconds or so. This sketch might seem familiar as it was in that first video link (above).

Let us know how it goes.
Post results from the YunSerialTerminal, if you are still having problems.
Please use markup when posting results.


Thank you for the reply.

Running the YunSerialTerminal I've found this:

[   40.460000] batman_adv: B.A.T.M.A.N. advanced 2013.4.0 (compatibility version 14) loaded
[   40.720000] i2c /dev entries driver
[   40.760000] Linux video capture interface: v2.00
[   40.880000] fuse init (API version 7.18)
[   50.800000] mesh0: Created IBSS using preconfigured BSSID 5c:35:3b:d5:a6:c6
[   50.810000] mesh0: Creating new IBSS network, BSSID 5c:35:3b:d5:a6:c6
[   51.950000] batman_adv: bat0: Adding interface: mesh0
[   51.950000] batman_adv: bat0: Interface activated: mesh0
[  142.460000] Removing MTD device #3 (rootfs_data) with use count 1
[  142.480000] Res�

U-Boot 1.1.4-linino-gca1b422d-dirty (Sep 15 2014 - 04:07:17)

So it appears that the network has been created but I don't know why after a while it automatically reboots the system.

Running WifiStatus instead, it seems that the interface it's not working because there are no values, like the address is and so on.

Any idea?

@mridolfi, I going to blunt.

1 When debugging a problem, you cannot be selective.

2 It's apparent you have a weak understanding of IP networking.

3 Wireshark is a neat toy, but your wasting your time and my time by playing with it.

4 Most important, You did not read what I posted.

On #4, I'm going to reiterate in a different way.

If you setup your Yun to talk to your home computer (or internet gateway or internet router), and you reboot, and it does not see your computer (gateway or router), it will reboot the Yun and go back to factory defaults. This is a feature. An annoying feature, but a feature none the less.

Let's start over. Let's first get your Yun connect to the outside world or your home network. Once that is running you may be able to get the Mesh on your own, or I might have to help you.

I'll assume you have attached a Yun to the Internet (or your home computer). If not this is a good time to learn that.

Assuming you have your Yun connected to the home computer, let's get the IP setup of both systems.

1) Go to your Yun and via the YunSerialTerminal, you should be able to get the IP setup by typing ifconfig in the top input field. The output will be on the lower pane.

2) On your home computer, you should be able to do similar.

I'm looking for the

the IP of each machine the IP mask of each machine the IP gateway for each machine the IP default route for each machine

Let's start here. TIA Jesse