Linux – Can’t set up ad-hoc network (raspberry pi)

linuxnetworkingraspberry piraspbianwireless-networking

Question: How do I manually set my Cell Id? I have tried the following code sudo iwconfig wlan0 ap 02:12:34:56:78:9a but it randomly resets the Cell Id to a different value.

I am trying to create a wireless mesh network using some raspberry pi devices;
http://www.open-mesh.org/projects/batman-adv/wiki/Quick-start-guide.

It wouldn't work and whilst troubleshooting the problem, I find that I can't even get a basic ad-hoc network going. It doesn't allow me to manually set the ap (cell id) nor does it allow you to set an essid that is already in use by another rpi device.

Everything is connected out of box. Rpi are set up using NOOBS with raspbian. I ran apt-get update, upgrade, installed batctl and enabled batman_adv module on boot. I have limited experience with linux and rely heavily on google for answers.

lsusb:

Bus 001 Device 004: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter

modinfo:

filename:       /lib/modules/3.12.28+/kernel/drivers/net/wireless/rtl8192cu/8192cu.ko
version:        v4.0.2_9000.20130911
author:         Realtek Semiconductor Corp.
description:    Realtek Wireless Lan Driver
license:        GPL
srcversion:     92ABD77EE49D06D8157B4F8

How I set up the network:

ifconfig wlan0 down
iwconfig wlan0 mode ad-hoc essid mymeshnet channel 1 ap 02:12:34:56:78:9a
ifconfig wlan0 up

rpi(a):

ifconfig wlan0 inet 192.168.2.1/24

rpi(b):

ifconfig wlan0 inet 192.168.2.2/24

iwconfig on rpi(a):

wlan0     IEEE 802.11bg  ESSID:"mymeshnet"  Nickname:"<WIFI@REALTEK>"
          Mode:Ad-Hoc  Frequency:2.412 GHz  Cell: 02:11:87:75:18:01   
          Bit Rate:54 Mb/s   Sensitivity:0/0  
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

iwconfig on rpi(b):

wlan0     unassociated  Nickname:"<WIFI@REALTEK>"
          Mode:Ad-Hoc  Frequency=2.412 GHz  Cell: Not-Associated   
          Sensitivity:0/0  
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

Searching through similar questions I have tried using different essid and using iwlist wlan0 scan to sync the cells but still no gas.

Thank-you for reading this lengthy post. Any help would be appreciated.

Best Answer

I've done quite a bit of research on wireless adapters and it has become very clear to me that if you want to do something outside of the intended parameters for a device you'll want a device that uses an Atheros chip.

The chip in use here is the same model used by this guy. His solution was to try another device, I would imagine you will probably need to do the same.

It hasn't been updated in a while, but here is a chart showing supported chips for pfSense. It should be clear by this chart why I would recommend a device with an atheros chip. You can find information on which devices use a particular chip on wikidevi

Related Question