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:


#!/bin/bash
<nowiki>#!/bin/bash</nowiki>
# SETUP GREENBOX AS WIRELESS ACCESS POINT
 
# Stop services
<nowiki># SETUP GREENBOX AS WIRELESS ACCESS POINT</nowiki>
service sshd stop
 
service crond stop
<nowiki># Stop services</nowiki>
service chronyd stop
 
service dbus stop
<nowiki>service sshd stop</nowiki>
service hostapd stop
 
service dnsmasq stop
<nowiki>service crond stop</nowiki>
service syslog stop
 
service klogd stop
<nowiki>service chronyd stop</nowiki>
service networking stop
 
service mdev stop
<nowiki>service dbus stop</nowiki>
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
<nowiki>service hostapd stop</nowiki>
cp -f /etc/hostapd/hostapd.conf.field /etc/hostapd/hostapd.conf
 
cp -f /etc/dnsmasq.conf.field /etc/dnsmasq.conf
<nowiki>service dnsmasq stop</nowiki>
cp -f /etc/network/interfaces.field /etc/network/interfaces
 
#Commit the changes
<nowiki>service syslog stop</nowiki>
lbu ci -d
 
#Wipe the tmp folder
<nowiki>service klogd stop</nowiki>
rm -rf /tmp
 
#Start services
<nowiki>service networking stop</nowiki>
service acpid start
 
service mdev start
<nowiki>service mdev stop</nowiki>
service networking start
 
service klogd start
<nowiki>service acpid stop</nowiki>
service syslog start
 
service dnsmasq start
<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>
service hostapd start
 
service dbus start
<nowiki>cp -f /etc/hostapd/hostapd.conf.field /etc/hostapd/hostapd.conf</nowiki>
service chronyd start
 
service crond start
<nowiki>cp -f /etc/dnsmasq.conf.field /etc/dnsmasq.conf</nowiki>
service sshd start
 
<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>
 




Thanks,
Thanks,
BB
BB

Revision as of 21:05, 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:

#!/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