Difference between revisions of "Wlan"

From RobotinoWiki
(Robotino v3)
(TP-Link WN722N v2)
(10 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
==Robotino v3==
 
==Robotino v3==
 
The next generation Robotino will use an USB WLAN stick to either connect to an access point in client mode or provide a access point external clients can connect to in master mode. Various WLAN USB adapters are supported. The following list shows the USB sticks tested to work in both client and master mode:
 
The next generation Robotino will use an USB WLAN stick to either connect to an access point in client mode or provide a access point external clients can connect to in master mode. Various WLAN USB adapters are supported. The following list shows the USB sticks tested to work in both client and master mode:
* AVM Fritz!WLAN USB Stick N (support for a/b/g/n)
+
* AVM Fritz!WLAN USB Stick N (supports a/b/g/n)
 +
* TP-Link TL-WDN4800 (PCIe-adapter, supports a/b/g/n)
 
The following adapters are known to work at least in client mode:
 
The following adapters are known to work at least in client mode:
 
* Alfa AWUS036EW USB WLAN Stick (support for b/g)
 
* Alfa AWUS036EW USB WLAN Stick (support for b/g)
 
* Alfa AWUS036H USB WLAN (support for b/g)
 
* Alfa AWUS036H USB WLAN (support for b/g)
  
===hostapd configuration===
+
===WLAN master===
 
The WLAN master on Robotino is run by [http://linuxwireless.org/en/users/Documentation/hostapd hostapd]. A german how-to on setting up a WLAN router using hostapd can be found [http://wiki.ubuntuusers.de/WLAN_Router here]. Additionally a [http://wiki.ubuntuusers.de/ISC-DHCPD DHCP server] is running assigning IP addresses to clients connecting to Robotino's access point.
 
The WLAN master on Robotino is run by [http://linuxwireless.org/en/users/Documentation/hostapd hostapd]. A german how-to on setting up a WLAN router using hostapd can be found [http://wiki.ubuntuusers.de/WLAN_Router here]. Additionally a [http://wiki.ubuntuusers.de/ISC-DHCPD DHCP server] is running assigning IP addresses to clients connecting to Robotino's access point.
  
When running as WLAN master Robotino has the fixed IP address 172.26.1.1 with netmask 255.255.0.0. The DHCP server assigns addresses in the range 172.27.1.100 to 172.26.1.200.
+
When running as WLAN master Robotino has the fixed IP address 172.26.1.1 with netmask 255.255.0.0. The DHCP server assigns addresses in the range 172.26.1.100 to 172.26.1.200.
  
 
Configuration:
 
Configuration:
*[http://svn.openrobotino.org/daemons/trunk/scripts/etc/hostapd.conf.default /etc/hostapd.conf]
+
*[http://svn.openrobotino.org/config/trunk/files/etc/hostapd.conf.default /etc/hostapd.conf]
*[http://svn.openrobotino.org/daemons/trunk/scripts/etc/default/isc-dhcp-server.default /etc/default/isc-dhcp-server]
+
*[http://svn.openrobotino.org/config/trunk/files/etc/default/isc-dhcp-server.default /etc/default/isc-dhcp-server]
*[http://svn.openrobotino.org/daemons/trunk/scripts/etc/default/dhcpd.conf.default /etc/dhcp/dhcpd.conf]
+
*[http://svn.openrobotino.org/config/trunk/files/etc/dhcp/dhcpd.conf.default /etc/dhcp/dhcpd.conf]
*[http://svn.openrobotino.org/daemons/trunk/scripts/etc/network/interfaces.default /etc/network/interfaces]
+
*[http://svn.openrobotino.org/config/trunk/files/etc/network/interfaces.default /etc/network/interfaces]
*[http://svn.openrobotino.org/daemons/trunk/scripts/usr/local/bin/start-wlan0-master.sh usr/local/bin/start-wlan0-master.sh]
+
*[http://svn.openrobotino.org/config/trunk/files/etc/udev/rules.d/99-wlan.rules /etc/udev/rules.d/99-wlan.rules]
*[http://svn.openrobotino.org/daemons/trunk/scripts/usr/local/bin/stop-wlan0-master.sh usr/local/bin/stop-wlan0-master.sh]
+
*[http://svn.openrobotino.org/config/trunk/files/usr/local/bin/start-wlan0-master.sh usr/local/bin/start-wlan0-master.sh]
 +
*[http://svn.openrobotino.org/config/trunk/files/usr/local/bin/stop-wlan0-master.sh usr/local/bin/stop-wlan0-master.sh]
  
===/etc/network/interfaces===
+
====5GHz WLAN====
 +
If your network adapter supports 5GHz WLAN you can setup your system to use this frequency by manually editing /etc/hostapd.conf
 
<pre>
 
<pre>
#auto wlan0
+
hw_mode=a
iface wlan0 inet static
+
channel=44
  address 172.26.1.1
 
  netmask 255.255.0.0
 
  #wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
 
 
</pre>
 
</pre>
 
+
After saving your changes restart the wlan interface
===/etc/udev/rules.d/99-wlan.rules===
 
 
<pre>
 
<pre>
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNEL=="wlan0", RUN+="/usr/bin/at -f /etc/init.d/start-wlan0-master.sh now",
+
ifdown wlan0
SUBSYSTEM=="net", ACTION=="remove", DRIVERS=="?*", KERNEL=="wlan0", RUN+="/usr/bin/at -f /etc/init.d/stop-wlan0-master.sh now"
+
ifup wlan0
 
</pre>
 
</pre>
  
===/etc/init.d/start-wlan0-master.sh===
+
===WLAN client===
<pre>
+
In client mode the WLAN interface of Robotino connects to an external accesspoint. Robotino can be assigned a fixed IP address or can obtain an address from an external DHCP server.
#!/bin/bash
 
 
 
LOG=/var/log/start-wlan0-master.log
 
 
 
echo "ifup wlan0" > $LOG
 
/sbin/ifup wlan0 2>>$LOG 1>>$LOG
 
 
 
sleep 2
 
 
 
echo "start hostapd" >> $LOG
 
/usr/sbin/hostapd -B /etc/hostapd.conf 2>>$LOG 1>>$LOG
 
 
 
 
 
sleep 2
 
 
 
echo "start dhcpd" >> $LOG
 
dhcpd -pf /var/run/dhcpd.pid wlan0 2>>$LOG 1>>$LOG
 
  
 +
Configuration:
 +
*[http://svn.openrobotino.org/daemons/trunk/scripts/etc/wpa_supplicant/wpa_supplicant.conf.default /etc/wpa_supplicant/wpa_supplicant.conf]
 +
*/etc/network/interfaces will contain the line ''wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf''
  
echo "Finished" >> $LOG
+
====Hint====
</pre>
+
Remember that eth0:10 is preconfigured to 192.168.1.244. If this is in conflict to your settings for eth0 you might want to disable eth0:10 in /etc/network/interfaces.
  
===/etc/init.d/stop-wlan0-master.sh===
+
==TP-Link WN722N v2==
 
<pre>
 
<pre>
#!/bin/bash
+
git clone https://github.com/jeremyb31/rtl8188eu
 +
cd rtl8188eu
  
LOG=/var/log/stop-wlan0-master.log
+
Edit os_dep/usb_intf.c and add the following line
 +
{USB_DEVICE(0x2357, 0x010c)}, /* TP-Link WN722N v2 */
  
echo "killall dhcpd" > $LOG
+
make
killall dhcpd 1>>$LOG 2>>$LOG
+
make install
  
echo "killall hostapd" >> $LOG
+
****************************
killall hostapd 1>>$LOG 2>>$LOG
+
Actions of make install:
 +
install -p -m 644 8188eu.ko  /lib/modules/4.4.0-34-generic/kernel/drivers/net/wireless
 +
cp rtl8188eufw.bin /lib/firmware/.
 +
/sbin/depmod -a 4.4.0-34-generic
 +
mkdir -p /lib/firmware/rtlwifi
 +
cp rtl8188eufw.bin /lib/firmware/rtlwifi/.
 +
****************************
  
echo "Shutdown wlan0" >> $LOG
+
echo 8188eu >> /etc/modules
/sbin/ifdown wlan0 1>>$LOG 2>>$LOG
 
 
 
echo "Finished" >> $LOG
 
</pre>
 
 
 
===/lib/udev/rules.d/75-cd-aliases-generator.rules===
 
<pre>
 
SUBSYSTEMS=="usb", ATTRS{idVendor}=="057c", ATTRS{idProduct}=="84ff", ACTION=="add", OPTIONS+="ignore_device", GOTO="persistent_cd_end"
 
</pre>
 
 
 
===/lib/udev/rules.d/60-persistent-storage.rules===
 
<pre>
 
SUBSYSTEMS=="usb", ATTRS{idVendor}=="057c", ATTRS{idProduct}=="84ff", ACTION=="add", OPTIONS+="ignore_device", GOTO="persistent_storage_end"
 
 
</pre>
 
</pre>

Revision as of 09:05, 3 May 2017

Robotino v1 and v2

Robotino up to version 2 is equipped with an internal access point. This internal AP can be configured as client or master.

Robotino v3

The next generation Robotino will use an USB WLAN stick to either connect to an access point in client mode or provide a access point external clients can connect to in master mode. Various WLAN USB adapters are supported. The following list shows the USB sticks tested to work in both client and master mode:

  • AVM Fritz!WLAN USB Stick N (supports a/b/g/n)
  • TP-Link TL-WDN4800 (PCIe-adapter, supports a/b/g/n)

The following adapters are known to work at least in client mode:

  • Alfa AWUS036EW USB WLAN Stick (support for b/g)
  • Alfa AWUS036H USB WLAN (support for b/g)

WLAN master

The WLAN master on Robotino is run by hostapd. A german how-to on setting up a WLAN router using hostapd can be found here. Additionally a DHCP server is running assigning IP addresses to clients connecting to Robotino's access point.

When running as WLAN master Robotino has the fixed IP address 172.26.1.1 with netmask 255.255.0.0. The DHCP server assigns addresses in the range 172.26.1.100 to 172.26.1.200.

Configuration:

5GHz WLAN

If your network adapter supports 5GHz WLAN you can setup your system to use this frequency by manually editing /etc/hostapd.conf

hw_mode=a
channel=44

After saving your changes restart the wlan interface

ifdown wlan0
ifup wlan0

WLAN client

In client mode the WLAN interface of Robotino connects to an external accesspoint. Robotino can be assigned a fixed IP address or can obtain an address from an external DHCP server.

Configuration:

Hint

Remember that eth0:10 is preconfigured to 192.168.1.244. If this is in conflict to your settings for eth0 you might want to disable eth0:10 in /etc/network/interfaces.

TP-Link WN722N v2

git clone https://github.com/jeremyb31/rtl8188eu
cd rtl8188eu

Edit os_dep/usb_intf.c and add the following line
{USB_DEVICE(0x2357, 0x010c)}, /* TP-Link WN722N v2 */

make
make install

****************************
Actions of make install:
install -p -m 644 8188eu.ko  /lib/modules/4.4.0-34-generic/kernel/drivers/net/wireless
cp rtl8188eufw.bin /lib/firmware/.
/sbin/depmod -a 4.4.0-34-generic
mkdir -p /lib/firmware/rtlwifi
cp rtl8188eufw.bin /lib/firmware/rtlwifi/.
****************************

echo 8188eu >> /etc/modules