[collected] WiFi Hotspot

Hi! First of all i wanna thank the team behind Volumio for this great Raspberry Pi distro.

I’m planning of building a Music Box with a Pi, Volumio, Amp, Speaker, WiFi, and Dac.
The use case would be mostly in my room but, sometimes I wanna use elsewhere where different WiFi or no WiFi is.

My feature request would be:
Volumio should make automatic an WiFi Hotspot when it can’t connect (maybe with a timeout etc) to the wifi network it normally connects to.

For example. I’ll took the music box to my Garage where is no wifi. I could connect to it and still stream my music via Airplay or play the music from internal storage. I also could select another WiFi Profile and reboot e.g. when i took the musicbox to my friend.

I know some of those cheap 10€ wifi adapter can do AP mode.
What do you guys think?

Hello from Brazil!

I’ve been working in this case… I found this tutorial that help me to create a ad-hoc networking. :smiley:

I don’t use the table conversion…

elinux.org/RPI-Wireless-Hotspot

sorry my english is very bad! :stuck_out_tongue:

Hi! I totally agree! Direct connection between smartphone or tablet and Volumio on whichever platform is absolutely necessary. This feature would give Volumio a maximum of flexibility. I realized such a connection through the installation of the wicd-curses, where I created my smartphone as a hot spot- that allows direct access to raspi. But the other way round i think would be more solid and an implementation of this function to Volumio would be just perfect!

Greetings
Robert

that does sound like a great feature to implement!

I’m working on that! :wink:

This would be cool and something I was trying to get working, but I haven’t been able to get the adhoc network to show up :frowning:

I was following this tutorial:
lcdev.dk/2012/11/18/raspberry-pi … -fallback/

My use case is a little different. I never want the Pi to connect to a wireless network. I always want to have it create an ad-hoc network so I can keep it in my car and airplay to it and still use my phones internet connection.

Any ideas on why the ad-hoc network can’t be created? I added this to the rc.local in /var/www/_OS_SETTINGS/

ifconfig wlan0 down
iwconfig wlan0 mode ad-hoc
iwconfig wlan0 key aaaaa11111 #WEP key
iwconfig wlan0 essid RPi      #SSID
ifconfig wlan0 10.0.0.200 netmask 255.255.255.0 up
/usr/sbin/dhcpd wlan0

This is exactly what i did.
First, follow the Adafruit guide to setup Raspberry as a Wifi Access point (learn.adafruit.com/setting-up-a- … l-software ). You probably need to adapt it if your Wifi dongle is not the same as Adafruit one.

Assuming the Ip address for your Wifi ad-hoc is 192.168.2.1

For the Set up DHCP server part, the lines to add are :

subnet 192.168.2.0 netmask 255.255.255.0 { range 192.168.2.10 192.168.2.50; option broadcast-address 192.168.2.255; option routers 192.168.2.1; default-lease-time 600; max-lease-time 7200; option domain-name "local"; #option domain-name-servers 8.8.8.8, 8.8.4.4; }

Comment the option domain-name-servers. Doing that, you can access Internet with your phone even when you’ll be wifi connected to your Raspberry.

For the Set up wlan0 for static IP part :
the /etc/network/interfaces should be

auto lo
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet static
address 192.168.2.1
netmask 255.255.255.0
wireless-mode ad-hoc
wireless-essid Volumio_AP

Defining eth0 with allow-hotplug is important. Without that, DHCP server will try to define a new address for your eth0 interfaces, even when no cable is connected. The boot time will be very long when you’ll bring your Raspberry to car.

For the Configure Access Point

interface=wlan0 driver=rtl871xdrv ssid=Volumio_AP hw_mode=g channel=6 macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa=2 wpa_passphrase=Raspberry wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP

Skip the Configure Network Address Translation part… you just don’t need it to do what you want.

Finally edit your /etc/hosts and define volumio name for your wlan0 address.

127.0.0.1 localhost
127.0.0.1 volumio
192.168.2.1 volumio

reboot your rapsberry and enjoy…

@jedail just saw your post, thanks so much for the info…I’m gonna try it now!

@jedail

Did you run into the following error when starting the dhcp service?

/etc/dhcp/dhcpd.conf line 109: subnet 192.168.2.1 netmask 255.255.255.0: bad subnet number/mask combination. subnet 192.168.2.1 netmask 255.255.255.0 ^ Configuration file errors encountered -- exiting

I had to set the subnet to 192.168.2.0 and it worked.

Thanks for the help!

I also got the correct hostapd for my edimax wifi from this:

daveconroy.com/turn-your-ras … ment-11110

@jedail

So when connecting to the hotspot via an iphone, the iphone uses its cellular network connection fine. When I connect with an android phone, it doesn’t use its cellular network for internet.

Any ideas/thoughts on how to fix?

@flynfish

You perfectly right, I made a mistake in my dhcp.conf. I’ll try to edit my post.

I cannot help you for the Android setup, but the idea is to use the raspberry DHCP to have an IP address on the raspberry subnet, but use your phone carrier DNS for world wide access.

This would be a great feature to add to the WebGUI.

I personally would like to use Volumio at work with IQAudioDac+ with my in-ear monitors. I don’t have access to the wifi at work and running an access point / ad-hoc access would mean I could still control the Volumio via my phone.

@michelangelo - any further thoughts on adding this?

Thanks for collecting!

My volumio on Raspberry Pi2 functions also a WLAN hotspot bridged with my home network.

Here the steps and challenges I see when implementing it as a volumio standard feature:

  1. Making sure that volumio users choose a WLAN Stick that features the needed AP-mode. Or in case they did not - communicating them why it does not work.

  2. Loading the correct driver/firmware for the WLAN stick (e.g. as described here for one specific hardware type: wiki.debian.org/zd1211rw )

  3. Rather easy: add packages hostap-utils iw bridge-utils (usb-modeswitch ??)

  4. Rather easy: produce correct /etc/hostapd/hostapd.conf

  5. Rather easy: produce correct /etc/network/interfaces (if lo, eth0, wlan0, br0 = bridge)

  6. Make sure that everything gets loaded - also in cases of poweroutages an regular reboots (e.g. add line DAEMON_CONF="/etc/hostapd/hostapd.conf" to /etc/default/hostapd

  7. Make sure that config changes do not overwrite /etc/interfaces o /etc/hostapd/hostapd.conf

Here my own notes from my setup:
I used the following tutorial as a base:
project-with-lot-songs-and-wifi-access-point-t1761.html
However - I did not install adafruit hostapd but the original (allready installed) instead!!

Loading WLAN stick driver/firmware
See e.g. for the WLAN device I use: wiki.debian.org/zd1211rw

/etc/apt/sources.list   --> add "non-free" to each line
sudo apt-get install zd1211-firmware

Installation of packages - follow detailled instructions in link above:
However - I did not install adafruit hostapd but the original (allready installed) instead!!

sudo apt-get install hostapd usb-modeswitch hostap-utils iw bridge-utils
....

Here are my conifg files:
pi@volumio:~$ cat /etc/hostapd/hostapd.conf

interface=wlan0
bridge=br0
driver=nl80211
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
ssid=<CHOOSE-NAME>
hw_mode=g
channel=10
wpa=3
wpa_passphrase=<CHOOSE-PW>
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
macaddr_acl=0
beacon_int=100
auth_algs=3
wmm_enabled=1
country_code=DE

/etc/network/interfaces:
pi@volumio:~$ cat /etc/network/interfaces

auto lo br0
iface lo inet loopback

iface eth0 inet manual

iface wlan0 inet manual

iface br0 inet static
address 192.168.0.<XY>
netmask 255.255.255.0
gateway 192.168.0.1
nameserver <IP Nameserver>
bridge_ports eth0 wlan0

Yes after some more reading and self education I’ve learnt the basics and seen there’s lots of people trying to get either AP or ad-hoc mode working on Raspian and other OS with a variety of chipsets. I hadn’t quite realised how disparate the chipsets were and how some just didn’t want to work in certain modes whilst others did. When bought my wifi adaptor I just went for Pi Hut’s own brand one here in the UK. And have now done some digging to see it has the ubiquitous Ralink 5370 chipset. I haven’t tried it as an AP or ad-hoc yet but will see what I can do this week. I’ve bookmarked a number of threads and guides. Thanks for the info above though.

Hi, I think Volumio 2 is using different setup for the interfaces. I don’t know if these methods would still work, but since this is a suggestion post, I guess I can just shamelessly demand this awesome feature. :smiley:

Wouldn’t it be great to have a HiFi music player + router in your pocket all the time?

I’m interested in this feature, too. I have a CuBox-i4 and it would be neat to be able to take my audio setup to a meetup and control it with my tablet.

This a feature that I would love to see in Volumio2. After a lot of reading round and experimention, I am going to try this approach next https://github.com/foosel/netconnectd; it seems to offer great flexibility. I’ll report back when I see how well the daemon plays with Volumio’s inner workings

Hi, thanks for a great product! Is it possible to make a hotspot can be switched off from the web interface, or enable encryption on it. It is not good when your neighbor can manage your music center.

Sorry for my english