* [[:|Wiki Home]]
* [[:cheat_sheet|Cheat Sheet]]
* [[:compiling_on_virtualbox|Precompiled virtual tools]]
* [[:carambola_where_to_start|Where to start]]
* [[:carambola_connecting|Connecting to carambola]]
* [[:carambola_using_and_customizing|Using and Customizing]]
* [[:carambola_demo_projects|Demo projects/examples]]
* [[:carambola_hardware|Hardware]]
====== About ======
This article describes how to have ability to select AP or STA with jumper.
====== Hardware ======
Put jumper between GND and GPIO7 to activate AP mode. Remove to leave in STA mode.
====== Configuring ======
* Create script ''/usr/bin/wifi_mode.sh'' and fill with content
#!/bin/sh
EXPORT='echo 7 > /sys/class/gpio/export'
DIRECTION='echo in > /sys/devices/virtual/gpio/gpio7/direction'
BODY=`cat /sys/devices/virtual/gpio/gpio7/value`;
if [ "$BODY" == 1 ];
then
echo "AP mode"
cp /etc/config/wireless_ap /etc/config/wireless
else
echo "STA mode"
cp /etc/config/wireless_sta /etc/config/wireless
fi
* Create two versions of wireless configuration file. ''/etc/config/wireless_ap'' and ''/etc/config/wireless_sta''. More about wireless configuration can be found [[carambola_wifi|here]]. Add "option auto 0" to interface configuration.
====== Run on boot ======
* Edit ''/etc/rc.local'' file to be like this:
/usr/bin/wifi_mode.sh
wifi
exit 0