OpenWrt Forum Archive

Topic: Fonera mixed mode (AP+mesh)

The content of this topic has been archived on 29 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

On fonera with latest kamikaze I try this configuration to have an access point and an adhoc mesh node on same atheros wireless card.

/etc/config/wireless

config wifi-device wifi0
        option type atheros
        option channel 5

config wifi-iface
        option device wifi0
        option network lan
        option mode ap
        option ssid testap
        option encryption none
        option hidden 0

config wifi-iface
        option device wifi0
        option mode adhoc
        option ssid testmesh
        option encryption none
        option hidden 0

But with /sbin/wifi up I get an error:

wifi0: Invalid mode combination in config
wlanconfig: ioctl: Input/output error
enable_atheros(wifi0): Failed to set up adhoc vif

What is my mistake?

if you use a ad-hoc interface on a card it can be the only interface, no other vap's are allowed

onebit wrote:

On fonera with latest kamikaze I try this configuration to have an access point and an adhoc mesh node on same atheros wireless card.
...
What is my mistake?

A few time ago I read somewhere (openwrt wiki?) that you can't mix adhoc and ap modes... there are also other virtualizing limits (maximum number of APs and STAs; check the wiki and/or the forum). I still don't know why, but I think is a sort of "hard limit".
I come to the forum right now to search a bit before loosing myself into the code...

Please report here if you succeded in such thing.

ciao

Wallace

thepeople wrote:

http://nbd.name/openwrt.html#x1-100001.2.2 it is a driver limitation

What do you mean for "driver limitation"? It's the Atheros HAL, the madwifi driver or something else?

ciao

Wallace

p.s.: thanks for the nbd page, I didn't know it, and there are a lot of usefull developers infos!

What I found out searching a little bit:

- Atheros chipsets can do it: ad-hoc and AP mode togheter with one radio. This beacouse Roofnet guys do it.
- Here the their madwifi.stripped http://pdos.lcs.mit.edu/~jbicket/madwifi.stripped/ . It is described as a "device driver for Atheros chipsets which allows you to send and receive pure 802.11 frames, as opposed to 802.3 (normal ethernet) frames. This allows you to build your own access point with specific policy or algorithms."
- As far as I can understand they do it using Click... a dependancy that maybe can be avoided.
- nbd more than one year ago told me on the forum that it wasn't possible to do in on broadcom hardware (no WRT54G, Asus wl500g, and so on).

So we have to have a look at Roofnet/Meraki code to see if it is possible to port this feature to madwifi head! Am I right?

ciao

Wallace

Having an adhoc and infrastructue-mode on the same interface would be useful, but I don't think it's essential to forming a mesh network - Freifunk has proved that it can all be done in adhoc mode alone.  Of course, outsiders to the mesh network might feel more comfortable associating with an access point rather than an adhoc network.

you can also do it in infrastructure mode alone, of course, if you have control over the mesh design

Yeah, it depends on what sort of organisation is behind the mesh network.  If it is a company or organisation controlling the network hardware, then you can specify what hardware everyone uses.  If it is a community mesh where everyone brings their own equipment, you are kind-of forced to use the lowest common denominator in hardware and wireless protocols.

Adhoc on Channel 10 works for everyone, no matter what hardware they've got.  Of course, it helps if the wireless drivers can force a BSSID, or you get BSSID splits which is what happened in Freifunk before Sven-Ola added the fixed-BSSID to the wl driver.

I am also interested in such ap/ad-hoc configuration. This could attract more people to our community wireless network.

danversj wrote:

Having an adhoc and infrastructue-mode on the same interface would be useful, but I don't think it's essential to forming a mesh network - Freifunk has proved that it can all be done in adhoc mode alone.  Of course, outsiders to the mesh network might feel more comfortable associating with an access point rather than an adhoc network.

There are some flaws in doing it in ad-hoc only. As an example in ad-hoc there's no OFDM (54mbit!)... and having two interfaces it seems better to me, as an example for QoS purposes, or to split the wireless side into public/private as FON does. It's a matter of flexibility...
If I could at least access to the Fonera, set one virtual AP to ad-hoc, and load my software in it, I would keep the Fonera into the FON social network (keeping the FON_* ssid for foneros usage and doing my own business on the other virtual ap)... instead now I'm obliged to remove their firmware beacouse it's useless to me. Having them using (support) standard OpenWrt distro would be even better... I don't like this way to use open projects... I prefer companies that contribute to head development instead of forking (moreover I know that OpenWrt developers are very kind, if one send them patches and features compatible with their guidelines they apply them in short time; as an example nbd spent a lot of time with me to add meshing capabilities to qos-scripts!).

Anyway, I found also a note from Sven-Ola (on his server there's a dir with freifunk packages compiled for FON firmware) saying that ad-hoc+AP works (unstable, but works).
It would be nice to port this feature into OpenWrt.

Wallace78 wrote:

Anyway, I found also a note from Sven-Ola (on his server there's a dir with freifunk packages compiled for FON firmware) saying that ad-hoc+AP works (unstable, but works).
It would be nice to port this feature into OpenWrt.

Do you know what are the differences they did? Or why is it possible with their firmware?

Mitar wrote:
Wallace78 wrote:

Anyway, I found also a note from Sven-Ola (on his server there's a dir with freifunk packages compiled for FON firmware) saying that ad-hoc+AP works (unstable, but works).
It would be nice to port this feature into OpenWrt.

Do you know what are the differences they did? Or why is it possible with their firmware?

No, I don't. All I got is here:

http://olsrexperiment.de/sven-ola/fonera/

"Known Problems: Adhoc+Mastermode does not work perfect, some wifi cards
do not want to cooperate (at least my atheros/madwifi does not see the
Hotspot with kubunu nor do it see the WPA "MyPlace"). A centrino IPW2100
and a Siemens-Atheros-USB (ndiswrapper) work fine. Ad-hoc is fine too now.
You also need to put FF_IP=x.x.x.x in /etc/init.d/S80freifunk currently."

The diffs are in one of the packages in that dir... maybe in one of:

kmod-madwifi_2.4.32+0.9.0-ar531x-1_mips.ipk 
hostapd-mini_0.5.5-1_mips.ipk
ff-fonera-pack_0.2-1_mips.ipk 
base-files-ar531x-2.4_8-0_mips.ipk

Didn't have time to look at them (and I don't know where to get sources; last time I found the Freifunk CVS, one year ago, it was quite messy!).

ciao

Wallace

Hi everybody, I tested Ad-hoc+ap on meraki and it works! But the SDK has lots of problems and there's no docs sad Is there any plan of embedding these features on OpenWRT? If there's any, how long will it take (approx.)?

Ciao

lan

Wallace78 wrote:

Didn't have time to look at them (and I don't know where to get sources; last time I found the Freifunk CVS, one year ago, it was quite messy!).

Maybe this could help?

http://download.fon.com/firmware/fonera … ra.tar.bz2

This kinda sounds intresting i tried AP+adhoc  with madwifi on openwrt....when i have an AP first it fails (thats also whats said on madwifi docs)...but if i have adhoc first and then i create a Ap (VAP) on it it works.....a bit unstable tho but works on my raw openwrt and madwifi by just using wlanconfig.
Anyhow its got issues like same channel should be used for adhoc and AP etc which i dont think should be the case.

Can you post some configuration and exact versions of your modules?

Ian wrote:

Hi everybody, I tested Ad-hoc+ap on meraki and it works!

The guys at Roofnet (Meraki parent) rewrote a part of l2 of the madwifi driver... they got it working a long time ago...

Mitar wrote:

Maybe this could help?

http://download.fon.com/firmware/fonera ? ra.tar.bz2

I was referring to the Freifunk code!

zabi wrote:

Anyhow its got issues like same channel should be used for adhoc and AP etc which i dont think should be the case.

That's not an issue... remember that you only have one radio (one channel)! Having two ssids doesn't mean you have two radios (nor double troughput)!

ciao

Wallace78

I tried it on madwifi(0.9.2.1) and openwrt kamikaze (x86).
Its pretty basic; wlanconfig create ath wlandev wifi0 wlanmode adhoc ; wlanconfig create ath wlandev wifi0 wlanmode ap ;

True asking for multiple channels from one server is illogical...but what i meant was wouldn't the performance be affected dues to same channel presence esp in a mesh where in multiple nodes and access points and clients are on same channel ?

zabi wrote:

True asking for multiple channels from one server is illogical...but what i meant was wouldn't the performance be affected dues to same channel presence esp in a mesh where in multiple nodes and access points and clients are on same channel ?

it will reduce the performance of course, but speed is not always essential.
For example i got a mesh routing connection over 2,2 km, and the maximal throughput is about 400kb/s, so there should be enough space for other connections.

Hi, everyone.

A little while ago, a patch of CLICK was submitted.
https://dev.openwrt.org/changeset/7196
Does this boost this topic? Does this make adhoc & ap mode of atheros module more reliable?

zukky

I can get Adhoc+master mode working if I don't use the OpenWRT routines for setting up wireless - i.e - /etc/config/wireless and "wifi up".

I am using a Meraki Mini with Kamikaze snapshot from 17 May 2007.
Here is /etc/config/network

# Copyright (C) 2006 OpenWrt.org

config interface loopback
        option ifname   lo
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0

config interface lan
        option type     bridge
        option ifname   eth0 ath2
        option proto    static
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0

config interface mesh
        option ifname   ath0
        option proto    static
        option ipaddr   10.10.255.254
        option netmask  255.255.0.0

config interface wifi
        option ifname   ath1
        option proto    static
        option ipaddr   10.10.200.1
        option netmask  255.255.255.240

and /etc/config/wireless

config wifi-device  wifi0
        option type     atheros
        option channel  5
#       option diversity 1
#       option txantenna 0
#       option rxantenna 0
#       option distance  2000
# disable radio to prevent an open ap after reflashing:
        option disabled 0


config wifi-iface
        option device   wifi0
        option network  mesh
        option mode     adhoc
        option ssid     dans_mesh
        option hidden   0
        option txpower  15
        option bgscan   enable
        option encryption none

config wifi-iface
        option device   wifi0
        option network  wifi
        option mode     ap
        option ssid     dans_open_network
        option hidden   0

config wifi-iface
        option device   wifi0
        option network  lan
        option mode     ap
        option ssid     dans_LAN
        option hidden   0

if I let the OpenWRT init scripts handle this I get this situation

root@OpenWrt:/# wifi up
wifi0: Invalid mode combination in config
root@OpenWrt:/# iwconfig
eth0      no wireless extensions.

lo        no wireless extensions.

br-lan    no wireless extensions.

wifi0     no wireless extensions.

ath0      IEEE 802.11g  ESSID:""  Nickname:""
          Mode:Ad-Hoc  Frequency:2.432 GHz  Cell: 02:18:0A:01:20:67
          Bit Rate:0 kb/s   Tx-Power=15 dBm   Sensitivity=0/3
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=0/94  Signal level=-94 dBm  Noise level=-94 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

ath1      IEEE 802.11g  ESSID:"dans_open_network"  Nickname:""
          Mode:Master  Frequency:2.432 GHz  Access Point: 06:18:0A:01:20:67
          Bit Rate:0 kb/s   Tx-Power=15 dBm   Sensitivity=0/3
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=0/94  Signal level=-94 dBm  Noise level=-94 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

ath2      IEEE 802.11g  ESSID:"dans_LAN"  Nickname:""
          Mode:Master  Frequency:2.432 GHz  Access Point: 0A:18:0A:01:20:67
          Bit Rate:0 kb/s   Tx-Power=15 dBm   Sensitivity=0/3
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=0/94  Signal level=-94 dBm  Noise level=-94 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

the mesh interface has no ssid when it should be dans_mesh, and I can see but can't connect to dans_open_network and dans_LAN.

If however, I do this:

root@OpenWrt:/# wifi down
wifi0: Invalid mode combination in config
root@OpenWrt:/# wlanconfig ath create wlandev wifi0 wlanmode adhoc
ath0
root@OpenWrt:/# wlanconfig ath create wlandev wifi0 wlanmode ap
ath1
root@OpenWrt:/# wlanconfig ath create wlandev wifi0 wlanmode ap
ath2
root@OpenWrt:/# iwconfig ath0 essid dans_mesh
root@OpenWrt:/# iwconfig ath1 essid dans_open_network
root@OpenWrt:/# iwconfig ath2 essid dans_LAN
root@OpenWrt:/# iwconfig
eth0      no wireless extensions.

lo        no wireless extensions.

br-lan    no wireless extensions.

wifi0     no wireless extensions.

ath0      IEEE 802.11g  ESSID:"dans_mesh"  Nickname:""
          Mode:Ad-Hoc  Frequency:2.412 GHz  Cell: 02:18:0A:01:20:67
          Bit Rate:0 kb/s   Tx-Power=15 dBm   Sensitivity=0/3
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=0/94  Signal level=-94 dBm  Noise level=-94 dBm
          Rx invalid nwid:2  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

ath1      IEEE 802.11g  ESSID:"dans_open_network"  Nickname:""
          Mode:Master  Frequency:2.412 GHz  Access Point: 06:18:0A:01:20:67
          Bit Rate:0 kb/s   Tx-Power=15 dBm   Sensitivity=0/3
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=0/94  Signal level=-94 dBm  Noise level=-94 dBm
          Rx invalid nwid:2  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

ath2      IEEE 802.11g  ESSID:"dans_LAN"  Nickname:""
          Mode:Master  Frequency:2.412 GHz  Access Point: 0A:18:0A:01:20:67
          Bit Rate:0 kb/s   Tx-Power=15 dBm   Sensitivity=0/3
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=0/94  Signal level=-94 dBm  Noise level=-94 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

root@OpenWrt:/# ifconfig ath0 up
root@OpenWrt:/# ifconfig ath1 up
root@OpenWrt:/# ifconfig ath2 up

everything seems to work the way I expect - I find it is important to do the ifconfig athX up in the right order or not all the wireless come up (checking from my laptop with NetStumbler).

Hi All,
The click patch doesn't do anything other than setup click for roofnet without requireing ath0 to be up or defined. Which is actually bad in some ways as monitor interfaces (which click uses to send raw packets) need to be defined last for them to work.

Mike

danversj: Are you sure the AP actually works? Playing with the latest kamikaze firmware (may 23rd), I set both interfaces, but the AP doesn't really work, as I don't see it when I scan the network. The adhoc interface works fine though, I could connect and talk with other adhoc nodes. Were you able to associate with the AP?

(Last edited by RalucaM on 25 May 2007, 22:40)

RalucaM wrote:

danversj: Are you sure the AP actually works? Playing with the latest kamikaze firmware (may 23rd), I set both interfaces, but the AP doesn't really work, as I don't see it when I scan the network. The adhoc interface works fine though, I could connect and talk with other adhoc nodes. Were you able to associate with the AP?

I could associate with both APs - although I only had DHCP set up on "dans_LAN".  This was with me using the wlanconfig commands.  If I used /etc/config/wireless and wifi up I could not associate to either AP at all.

The discussion might have continued from here.