Differences in Revisions: Configuration for the WlanAP - DreamPlug

Removed extra hash in title, fixed code blocks, fixed Notes
## Configuration for the WlanAP - DreamPlug
# Configuration for the WlanAP - DreamPlug
 
**Step 1:**
 
* Copy the firmware to /lib/firmware/mrvl/* and the program uaputl to /usr/bin/. These files can be downloaded from the DreamPlug-Site or from the link (DreamPlug Downloads).
* After restarting IPFire the Wlan-interface can be configured over the setup menu.
<note> The interface will be identified as “Unknown Network Interface uap0” during the setup. The Hostapd Addon is not compatible with this hardware.</note>
* Therefore the WlanAP must be configured with the program uaputl.
 
**Step 2:**
 
* The following link [Dreamplug Downloads](http://www.spinifex.com.au/plugs/downloads/dreamplug/) contains a zip-File (uaputl.zip), which includes the config-file (uaputl.conf).
 
 
**Step 3:**
 
* Adapt the file uaputl.conf
* Adapt the file `/root/uaputl.conf`
<box 90% round green|Datei: /root/uaputl.conf>
`I made the following changes`
* I made the following changes:
```
`SSID="Marvell Micro AP" # SSID of Micro AP`
SSID="Marvell Micro AP" # SSID of Micro AP
`# AuthMode=0 Comment this line out`
# AuthMode=0 Comment this line out
`Protocol=32 # 32: WPA2`
Protocol=32 # 32: WPA2
`# WPA/WPA2 PSK setting`
# WPA/WPA2 PSK setting
`PairwiseCipher=8 # Pairwise cipher type 8: AES CCMP`
PairwiseCipher=8 # Pairwise cipher type 8: AES CCMP
`GroupCipher=8 # group cipher type 8: AES CCMP`
GroupCipher=8 # group cipher type 8: AES CCMP
`PSK="1234567890" # WPA/WPA2 passphrase`
PSK="1234567890" # WPA/WPA2 passphrase
</box>
```
 
* The other settings are OK.
 
**Commands to start the WlanAP** \\
**Commands to start the WlanAP**
```
`/usr/bin/uaputl -i blue0 sys_config /root/uaputl.conf`
/usr/bin/uaputl -i blue0 sys_config /root/uaputl.conf
`/usr/bin/uaputl -i blue0 bss_start`
/usr/bin/uaputl -i blue0 bss_start
```
 
**Commands to stop the WlanAP** \\
**Commands to stop the WlanAP**
```
`/usr/bin/uaputl -i blue0 bss_stop`
/usr/bin/uaputl -i blue0 bss_stop
`/usr/bin/uaputl -i blue0 sys_reset`
/usr/bin/uaputl -i blue0 sys_reset
```
 
**Automatically start the WlanAP at system start**
 
* Edit the file /etc/sysconfig/rc.local
* I copied both files uaputl.conf and the script that you will find at the end of this site into the home-directory of root (/root/)
`Only one entry is needed (rc.local)`
`/root/<Name of the script> start`
 
<note important>If the configuration file is not successfully loaded but the AP is activated, you have an ** open ** Wlan because default values are loaded.</note>
Only one entry is needed (rc.local):
```
/root/<Name of the script> start
```
 
| Note! |
|---|
| If the configuration file is not successfully loaded but the AP is activated, you have an **open** Wlan because default values are loaded. |
 
**Other configurations ** \\
**Other configurations **
After these steps you can configure the remaining settings over the web interface. (Access to blue, DHCP,…)
After these steps you can configure the remaining settings over the web interface (access to blue, DHCP, etc.)
 
 
**Script to start, restart and stop**
 
<code bash>
```text
#!/bin/bash
`interface="blue0"`
interface="blue0"
`pfadUaputlConfig="/root/uaputl.conf"`
pfadUaputlConfig="/root/uaputl.conf"
 
`starteWlanAP(){`
starteWlanAP(){
if [ -e $pfadUaputlConfig ]; then
/usr/bin/uaputl -i $interface sys_config $pfadUaputlConfig
if [ $? -eq 0 ]; then # Checks if the last command was successfully completed (exit 0)
`/usr/bin/uaputl -i $interface bss_start`
/usr/bin/uaputl -i $interface bss_start
if [ $? -eq 0 ]; then
` # Set Wlan Led`
# Set Wlan Led
` echo 1 > `eval ls /sys/class/leds/dreamplug\:blue\:wlanap/brightness``
echo 1 > `eval ls /sys/class/leds/dreamplug\:blue\:wlanap/brightness`
`fi`
fi
fi
`else`
else
`echo "Configuration file couldn't be found $pfadUaputlConfig"`
echo "Configuration file couldn't be found $pfadUaputlConfig"
`exit 1;`
exit 1;
 
`fi`
fi
`return 0`
return 0
`}`
}
 
`stopWlanAp(){`
stopWlanAp(){
`# Reset config`
# Reset config
`/usr/bin/uaputl -i $interface bss_stop`
/usr/bin/uaputl -i $interface bss_stop
`sleep 1`
sleep 1
`/usr/bin/uaputl -i $interface sys_reset`
/usr/bin/uaputl -i $interface sys_reset
`echo 0 > `eval ls /sys/class/leds/dreamplug\:blue\:wlanap/brightness``
echo 0 > `eval ls /sys/class/leds/dreamplug\:blue\:wlanap/brightness`
`}`
}
 
`#Startpoint`
#Startpoint
if [ $# = 1 ]; then # Checks for one parameter
if [ $1 == start ]; then # If the first parameter is start
`starteWlanAP`
starteWlanAP
elif [ $1 == restart ]; then
`stopWlanAp`
stopWlanAp
`starteWlanAP`
starteWlanAP
elif [ $1 == stop ]; then
`stopWlanAp`
stopWlanAp
else
echo "Invalid parameter ; $1"
echo "Possible parameter: start, restart or stop"
fi
`else`
else
`echo "One parameter necessary: start, restart or stop"`
echo "One parameter necessary: start, restart or stop"
`fi`
</code>
fi
```