[Documentation] [TitleIndex] [WordIndex

  Show EOL distros: 

linux_networking: access_point_control | asmach | asmach_tutorials | ddwrt_access_point | hostapd_access_point | ieee80211_channels | linksys_access_point | multi_interface_roam | network_control_tests | network_detector | network_monitor_udp | network_traffic_control | wpa_supplicant | wpa_supplicant_node

Package Summary

A ROS node that controls a hostapd-based access point. It is mainly intended for use with a wireless network adapter running in master mode. It implements the dynamic_reconfigure interface defined in the [[access_point_control]] package.

linux_networking: access_point_control | asmach | asmach_tutorials | ddwrt_access_point | hostapd_access_point | ieee80211_channels | linksys_access_point | multi_interface_roam | network_control_tests | network_detector | network_monitor_udp | network_traffic_control | wpa_supplicant | wpa_supplicant_node

Package Summary

A ROS node that controls a hostapd-based access point. It is mainly intended for use with a wireless network adapter running in master mode. It implements the dynamic_reconfigure interface defined in the [[access_point_control]] package.

linux_networking: access_point_control | asmach | asmach_tutorials | ddwrt_access_point | hostapd_access_point | ieee80211_channels | linksys_access_point | multi_interface_roam | network_control_tests | network_detector | network_monitor_udp | network_traffic_control | wpa_supplicant | wpa_supplicant_node

Package Summary

A ROS node that controls a hostapd-based access point. It is mainly intended for use with a wireless network adapter running in master mode. It implements the dynamic_reconfigure interface defined in the [[access_point_control]] package.

linux_networking: access_point_control | asmach | asmach_tutorials | ddwrt_access_point | hostapd_access_point | ieee80211_channels | linksys_access_point | multi_interface_roam | network_control_tests | network_detector | network_monitor_udp | network_traffic_control

Package Summary

A ROS node that controls a hostapd-based access point. It is mainly intended for use with a wireless network adapter running in master mode. It implements the dynamic_reconfigure interface defined in the [[access_point_control]] package.

Package Summary

A ROS node that controls a hostapd-based access point. It is mainly intended for use with a wireless network adapter running in master mode. It implements the dynamic_reconfigure interface defined in the [[access_point_control]] package.

  • Maintainer status: maintained
  • Maintainer: Devon Ash <dash AT clearpathrobotics DOT com>
  • Author: Catalin Drula
  • License: BSD

Overview

A ROS node for starting and controlling a hostapd-based access point. This node works with wifi adapters that have nl80211-compatible drivers which support master mode (see here for more information).

ROS API

ap_hostapd_node.py

ap_hostapd_node.py provides control of a hostapd-based access point running on a Linux network interface in master mode.

Parameters

Node parameters
These are the startup parameters of the node. ~interface (string) ~ip (string) ~netmask (string) ~hostapd_path (string, default: hostapd)
Dynamically Reconfigurable Parameters
Implements the dynamic_reconfigure interface defined in access_point_control. See the dynamic_reconfigure package for details on dynamically reconfigurable parameters. ~enabled (bool, default: False) ~ssid (str, default: test) ~wmm (bool, default: False) ~mode (str, default: b) ~freq (double, default: 2412000000.0) ~ieee80211n (bool, default: False) ~encryption_mode (string, default: open) ~encryption_pass (string) ~txpower_auto (bool, default: True) ~txpower (int, default: 0) ~bitrate (int, default: 0) ~status (string, default: OK) ~errmsg (string, default: )

Usage examples

Manual control

This is an example that shows how to set up an access point and control its parameters using the reconfigure_gui interface.

The following launch file starts an AP node on the wlan0 interface and the reconfigure_gui:

<launch>
    <node name="ap_wlan0" pkg="hostapd_access_point" type="ap_hostapd_node.py">
        <param name="interface" value="wlan0"/>
        <param name="ip" value="192.168.68.1"/>
        <param name="netmask" value="255.255.255.0"/>
    </node>
    <node name="reconfigure_node" pkg="dynamic_reconfigure" type="reconfigure_gui"/>
</launch>

The following window will appear showing that initially the AP is not running (the enable checkbox is unchecked):

reconfigure1.png

The desired configuration is selected: mode a, channel 44, WPA security with the chosen password, a TX power level of 8 dBm and a TX bitrate of 24Mbit/s. Next the enabled checkbox is checked at the AP is started:

reconfigure2.png

Next, a channel in the 2.4GHz band is selected, which is illegal in 802.11a mode, thus an error message is displayed and the AP is stopped:

reconfigure3.png

AP control from Python

The hostapd access point can be controlled programatically via the dynamic_reconfigure interface described above. The following snippet reproduces the manual interaction from the previous section.

import dynamic_reconfigure.client

ap = dynamic_reconfigure.client.Client("ap_wlan0")

freq = IEEE80211_Channels.get_freq(44, IEEE80211_Channels.BAND_5000_MHz)
config = ap.update_configuration({"enabled": True, "mode": 'a', "freq": freq, "encryption_mode": "wpa", "encryption_pass": "sample_password", "txpower_auto": False, "txpower": 8, "bitrate": 24*10**6})

if config['status'] != "OK":
    raise Exception("AP failed to start: " + config['errmsg'])

freq = IEEE80211_Channels.get_freq(1, IEEE80211_Channels.BAND_2400_MHz)
config = ap.update_configuration({"freq": freq})

if config['status'] != "OK":
    raise Exception("AP failed to start: " + config['errmsg'])

Command-line tools

find_hwsim_iface.py

This script is useful for setting up a mac80211_hwsim-based setup. mac80211_hwsim is a 802.11 radio simulator. The script takes two parameters:

If the mac80211_hwsim is not loaded or if the number of radios it has currently spawned is smaller than total number of radios then it is re-loaded with the proper radio count. The script prints to its output the name of the radio index-th interface.

For example (this is taken from a real setup), suppose that the system has a real wireless interface with name wlan1 and we need to spawn three virtual interfaces. Their names will be wlan0, wlan1 and wlan2.

Using find_hwsim_iface.py:

$ echo `rosrun hostapd_access_point find_hwsim_iface.py 1 3`
wlan0
$ echo `rosrun hostapd_access_point find_hwsim_iface.py 2 3`
wlan1
$ echo `rosrun hostapd_access_point find_hwsim_iface.py 3 3`
wlan1

The script can be used to launch nodes on the n-th virtual interface with roslaunch. The following example, launches two nodes on the first and second mac80211_hwsim interfaces while ensuring that there are at least three total interfaces:

<launch>
    <node name="ap1" pkg="hostapd_access_point" type="ap_hostapd_node.py">
        <param name="interface" command="$(find hostapd_access_point)/scripts/find_hwsim_iface.py 1 3"/>
    </node>

    <node name="ap2" pkg="hostapd_access_point" type="ap_hostapd_node.py">
        <param name="interface" command="$(find hostapd_access_point)/scripts/find_hwsim_iface.py 2 3"/>
    </node>
</launch>

hwsim_nat_setup.sh

This script sets up NAT routes and ARP entries so that packets can be sent "over-the-air" between two interfaces connected to the same host. By default, packets addressed to the IP of a local interface get sent over the local route.

The script takes six parameters:

An example:

# rosrun hostapd_access_point hwsim_nat_setup.sh wlan0 192.168.68.1 192.168.69.1 wlan1 192.168.69.2 192.168.68.2

# ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr 02:00:00:00:00:00  
          inet addr:192.168.68.1  Bcast:192.168.68.255  Mask:255.255.255.0

# ifconfig wlan1
wlan1     Link encap:Ethernet  HWaddr 02:00:00:00:01:00  
          inet addr:192.168.69.2  Bcast:192.168.69.255  Mask:255.255.255.0

A packet with destination IP 192.168.69.1 will travel "over-the-air" from wlan1 to wlan0, while packets with destination IP 192.168.68.2 will travel from wlan0 to wlan1.

Known problems:

Tips and known bugs


2019-08-24 12:50