Talk:Raspberry Pi 3 - Configuring it as wireless access point -AP Mode: Difference between revisions

From Alpine Linux
No edit summary
No edit summary
 
Line 3: Line 3:
BTW, I have tried running a script which stops a bunch services and then starts them back up (similar to when the Pi boots), but that does not help; as described above, I have to reboot the Pi for the AP mode to persist.  Here is the aforementioned script:
BTW, I have tried running a script which stops a bunch services and then starts them back up (similar to when the Pi boots), but that does not help; as described above, I have to reboot the Pi for the AP mode to persist.  Here is the aforementioned script:


<nowiki>#!/bin/bash</nowiki>
=AP Mode Script=
 
<nowiki># SETUP GREENBOX AS WIRELESS ACCESS POINT</nowiki>
 
<nowiki># Stop services</nowiki>
 
<nowiki>service sshd stop</nowiki>
 
<nowiki>service crond stop</nowiki>
 
<nowiki>service chronyd stop</nowiki>
 
<nowiki>service dbus stop</nowiki>
 
<nowiki>service hostapd stop</nowiki>
 
<nowiki>service dnsmasq stop</nowiki>
 
<nowiki>service syslog stop</nowiki>
 
<nowiki>service klogd stop</nowiki>
 
<nowiki>service networking stop</nowiki>
 
<nowiki>service mdev stop</nowiki>
 
<nowiki>service acpid stop</nowiki>
 
<nowiki>#Copy over configuration files with content per https://wiki.alpinelinux.org/wiki/Raspberry_Pi_3_-_Configuring_it_as_wireless_access_point_-AP_Mode</nowiki>
 
<nowiki>cp -f /etc/hostapd/hostapd.conf.field /etc/hostapd/hostapd.conf</nowiki>
 
<nowiki>cp -f /etc/dnsmasq.conf.field /etc/dnsmasq.conf</nowiki>
 
<nowiki>cp -f /etc/network/interfaces.field /etc/network/interfaces</nowiki>
 
<nowiki>#Commit the changes</nowiki>
 
<nowiki>lbu ci -d</nowiki>
 
<nowiki>#Wipe the tmp folder</nowiki>
 
<nowiki>rm -rf /tmp</nowiki>
 
<nowiki>#Start services</nowiki>
 
<nowiki>service acpid start</nowiki>
 
<nowiki>service mdev start</nowiki>
 
<nowiki>service networking start</nowiki>
 
<nowiki>service klogd start</nowiki>
 
<nowiki>service syslog start</nowiki>
 
<nowiki>service dnsmasq start</nowiki>
 
<nowiki>service hostapd start</nowiki>
 
<nowiki>service dbus start</nowiki>
 
<nowiki>service chronyd start</nowiki>
 
<nowiki>service crond start</nowiki>
 
<nowiki>service sshd start</nowiki>
 
 


#!/bin/bash
# SETUP GREENBOX AS WIRELESS ACCESS POINT
# Stop services
service sshd stop
service crond stop
service chronyd stop
service dbus stop
service hostapd stop
service dnsmasq stop
service syslog stop
service klogd stop
service networking stop
service mdev stop
service acpid stop
#Copy over configuration files with content per https://wiki.alpinelinux.org/wiki/Raspberry_Pi_3_-_Configuring_it_as_wireless_access_point_-AP_Mode
cp -f /etc/hostapd/hostapd.conf.field /etc/hostapd/hostapd.conf
cp -f /etc/dnsmasq.conf.field /etc/dnsmasq.conf
cp -f /etc/network/interfaces.field /etc/network/interfaces
#Commit the changes
lbu ci -d
#Wipe the tmp folder
rm -rf /tmp
#Start services
service acpid start
service mdev start
service networking start
service klogd start
service syslog start
service dnsmasq start
service hostapd start
service dbus start
service chronyd start
service crond start
service sshd start
Thanks,
Thanks,


BB
BB

Latest revision as of 21:15, 12 April 2017

This works. The only thing I don't like is that it seems I have to restart the Pi for it to come up stably as an AP. What I mean is if I do everything as specified on the wiki page and then restart ONLY the networking, I can see the Pi in the scan list of my peripheral device (my phone for instance) but only for about 10-20 seconds; then it disappears. If I connect to the Pi during said 10-20 second interval, it connects but then disconnects after the 10-20 seconds have passed. However, once I restart the Pi, it shows up in my peripheral device's scan list and stays. Then I can connect to it and the connection persists indefinitely. Anybody know how to get the Pi into AP mode and have it persist WITHOUT rebooting?

BTW, I have tried running a script which stops a bunch services and then starts them back up (similar to when the Pi boots), but that does not help; as described above, I have to reboot the Pi for the AP mode to persist. Here is the aforementioned script:

AP Mode Script

#!/bin/bash
# SETUP GREENBOX AS WIRELESS ACCESS POINT
# Stop services
service sshd stop
service crond stop
service chronyd stop
service dbus stop
service hostapd stop
service dnsmasq stop
service syslog stop
service klogd stop
service networking stop
service mdev stop
service acpid stop
#Copy over configuration files with content per https://wiki.alpinelinux.org/wiki/Raspberry_Pi_3_-_Configuring_it_as_wireless_access_point_-AP_Mode
cp -f /etc/hostapd/hostapd.conf.field /etc/hostapd/hostapd.conf
cp -f /etc/dnsmasq.conf.field /etc/dnsmasq.conf
cp -f /etc/network/interfaces.field /etc/network/interfaces
#Commit the changes
lbu ci -d
#Wipe the tmp folder
rm -rf /tmp
#Start services
service acpid start
service mdev start
service networking start
service klogd start
service syslog start
service dnsmasq start
service hostapd start
service dbus start
service chronyd start
service crond start
service sshd start

Thanks,

BB