0

Problem:

I am trying to configure batman-adv network on raspberry pi 3b+ following this, using on-board wlan0 interface coming with raspberry pi 3b+.

Once the network is executed by following all the steps in the page given above, it sets up healthily only occasionally, but once setup is successful, then it is possible to ping the nodes with each other. But during other instances nodes are not visible to each other.

The differences seen between the two instances when iwconfig is executed are;

(1) during the instance of perfect funtionality;

wlan0    IEEE 802.11 ESSID: "network_name"
         Mode:Ad-Hoc Frequency:2.447GHz Cell:26:AB:FD:65:E7:9E
         Tx-Power=20dBm
         Retry short  long limit:2  RTS thr:off  Fragment thr:off
         Power Management:off

and (2) during the faulty instance;

wlan0      IEEE 802.11 ESSID: "network_name"
           Mode:Managed Frequency:2.447GHz Access Point:Not-Associated
           Tx-Power=31 dBm
           Retry short limit:7  RTS thr:off  Fragment thr:off
           Power Management:on

What I have tried:

I've tried this on 2018-10-09-raspbian-stretch-lite and 2018-11-13-raspbian-strech-lite images, which still has no effect.

The commands to setup the network as given in the page was;

sudo modprobe batman-adv
sudo ip link set wlan0 down
sudo ifconfig wlan0 mtu 1532
sudo iwconfig wlan0 mode ad-hoc
sudo iwconfig wlan0 essid my-mesh-network
sudo iwconfig wlan0 ap any
sudo iwconfig wlan0 channel 8
sudo ip link set wlan0 up
sudo batctl if add wlan0
sudo ifconfig bat0 up
sudo ifconfig bat0 172.27.0.1/16

I have tried executing the commands in the script provided in the page above line by line, without letting the whole script of commands to run during the booting of the Pi (as recommended in the page). Then the following issues were encountered.

$ifconfig wlan0 mtu 1532
SCIOSIFMTU: Invalid argument

$sudo iwconfig wlan0 mode ad-hoc
Error for wireless request "set mode" (8B06):
SET failed on device wlan0; Device or resource busy

And all the other commands seems to be accepted without any error (eg: sudo iwconfig wlan0 essid network_name which comes after the above commands takes effect and is reflected in iwconfig)

I would be grateful to have any ideas to solve this issue and get the batman-adv up and running reliably.

Ingo
  • 40,606
  • 15
  • 76
  • 189
user96388
  • 1
  • 1

1 Answers1

2

UPDATE:
The answer below is obsolete. At the time I answered it, I don't realized that mode IBSS is the implementation of an ad-hoc network. Look at
How to setup an unprotected Ad Hoc (IBSS) Network and if possible with WPA encryption?.


OBSOLETE
I don't know what page you are followed to setup your network. There is no link. Is it specific for a Raspberry Pi? This is unlikely because a RPi 3B/3B+ does not support mode ad-hoc so you cannot set it. The modes supported by the Raspi are:

Supported interface modes:
         * IBSS
         * managed
         * AP
         * P2P-client
         * P2P-GO
         * P2P-device

You will find this with:

rpi ~$ sudo iw list | less

You are using deprecated commands ifconfig and iwconfig. You should use its successors ip (from iproute2) and iw. I don't know what's wrong with ifconfig wlan0 mtu 1532 giving you the error message. Maybe you have to prefix it with sudo? With the following command setting the mtu works:

rpi ~$ sudo ip link set wlan0 mtu 1532

But it will not help because you cannot set mode ad-hoc. You may look for another solution using one of the available modes or you may consider to purchase an USB wifi dongle that supports ad-hoc.

Ingo
  • 40,606
  • 15
  • 76
  • 189