Adhoc wifi network

raspberrypi3

#1

Hi all,

I had a Adhoc wifi network functioning great before they added Network-Manager on top of WPA_Supplicant and so trying to re-learn how to do everything. Has anyone had success getting a Adhoc network setup with network-manager at all?

I’m currently placing this in a file in system-connections (how I’ve been configuring my balena nodes to put up access points - different file obv which works great). So trying to understand what’s wrong with this file, if I can get it working with this then I’ll script it with the Python API for Nwtwork Manager

I’ve tried:
With/Without Security
With/Without Static IP
With/Without band specification


[connection]
id=ADHOCPI
type=wifi
autoconnect=false
permissions=

[wifi]
mac-address-blacklist=
mode=adhoc
ssid=ADHOCPI

[wifi-security]
key-mgmt=wpa-psk
psk=1234567890

[ipv4]
address1=10.42.1.1/24
dns-search=
method=shared


#2

I’ve noticed on the Arch linux wiki page the following note: NetworkManager does not support WPA encryption in ad-hoc mode. Could be the reason. I do not have personally experience with setting up an ad-hoc type of network.


#3

@majorz Thanks for the reply!

I’ve tried without security as well - no luck. Was wondering if there’s any requirements from Balena side that they might not accept a network without security?


#4

Will making the device act as an access point with DNS/DHCP enabled be also suitable for your use case? Can you please provide more details about the purpose.


#5

No, I can’t be reliant on a single node hence using adhoc. I have a bunch of pis on drones that communicate over adhoc wifi network. I’m trying to use Balena as easy way of managing the whole swarm but network is proving difficult

ideas?


#6

Hi r4space,

Did you manage to get this concept working?

I am also thinking about using an adhoc solution to collect the sensor data from multiple RPi without a need of a ready Wifi infrastructure. A Wifi adhoc can also extend the collection coverage. However, I don’t know if Balena.io is a suitable system for this concept.


#7

@r4space @vbtdung

Here are two examples with using an Ad-Hoc network, which I verified they are working on two devices connected with each other.

First one is with static IP (you need to change 192.168.2.1 to 192.168.2.2 on the second device):

[connection]
id=Ad-Hoc
uuid=291b2424-9f8c-3d32-bae0-fd5e2c831e68
type=802-11-wireless

[802-11-wireless]
ssid=Ad-Hoc
mode=adhoc

[ipv4]
method=manual
address1=192.168.2.1/24,0.0.0.0

[ipv6]
method=ignore

After this you may ping both of those devices from each other.

Another way is with a local-link method:

[connection]
id=Ad-Hoc
uuid=291b2424-9f8c-3d32-bae0-fd5e2c831e68
type=802-11-wireless

[802-11-wireless]
ssid=Ad-Hoc
mode=adhoc

[ipv4]
method=link-local

[ipv6]
method=ignore

You may also use method=auto on one of the devices, but then you will need to run a DHCP service (e.g. dnsmasq) on the other device, so that IP addresses are assigned.


P2P/WiFi-Direct Support?
#8

Thanks @majorz!

In the end I got it working with python dbus so here’s another method for anyone looking!


#9

Hi majorz and rspace,
Thank you for your comments! It is a very useful information for me.