Compare 0 Products     empty

WIFI+BLUETOOTH STERLING-LWB

In this section are reported the procedures how to use the Wi-Fi and Bluetooth on device Engicam. The driver for support of these modules are automatically compiled in the recipes engicam-test-hw.

AP MODE

Create the file "/etc/udhcpd.conf" that will contains the address range that will assign AP

# Sample udhcpd configuration file (/etc/udhcpd.conf)
#The start and end of the IP lease block

start 192.168.3.10
end   192.168.3.100

# The interface that udhcpd will use

interface   wlan1   #default: eth0

Edit the hostapd.conf file

interface=wlan1
driver=nl80211
logger_syslog=-1
logger_syslog_level=0
logger_stdout=-1
logger_stdout_level=3
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0

ssid=softAP
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=12345678
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

Launch this command for configure AP MODE

iw dev wlan0 interface add wlan1 type __ap
ifconfig wlan1 hw ether 00:25:ca:07:0d:a6
ifconfig wlan1 192.168.3.1 up
hostapd /etc/hostapd.conf -B
udhcpd /etc/udhcpd.conf

WIRELESS MODE

WIRELESS PROTECTED NETWORKS

Up the network interface

ifconfig wlan0 up

Scan wireless network

iw dev wlan0 scan | grep SSID

Set the wpa_supplicant.conf with the SSID and Password of the AP network wireless

wpa_passphrase SSID PASSWORD > /etc/wpa_supplicant.conf

Use wpa_supplicant to connect to the AP

wpa_supplicant -iwlan0 -Dnl80211 -c/etc/wpa_supplicant.conf -B

Launch the dhcp client to acquire the ip address

udhcpc -iwlan0

Test the connection

ping 192.168.X.XXX

HOTSPOT MODE

Create the file "/etc/udhcpd.conf" that will contains the address range that will assign AP

# Sample udhcpd configuration file (/etc/udhcpd.conf)
#The start and end of the IP lease block

start 192.168.3.10
end   192.168.3.100

# The interface that udhcpd will use

interface   wlan1   #default: eth0

# DNS servers that connected devices will use.  Use Google DNS.
opt    dns      8.8.8.8 8.8.4.4

# The IP address of the access point
opt    router   192.168.3.1
opt    subnet   255.255.255.0
opt    domain   local

Edit the hostapd.conf file

interface=wlan1
driver=nl80211
logger_syslog=-1
logger_syslog_level=0
logger_stdout=-1
logger_stdout_level=3
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0

ssid=softAP
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=12345678
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

Launch this command for configure AP MODE

iw dev wlan0 interface add wlan1 type __ap
ifconfig wlan1 hw ether 00:25:ca:07:0d:a6
ifconfig wlan1 192.168.3.1 up
hostapd /etc/hostapd.conf -B
udhcpd /etc/udhcpd.conf

Launch this command for configure HOTSPOT

udhcpc -ieth0
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i wlan1 -o eth0 -j ACCEPT

BLUETOOTH

Example of sending file via Bluetooth

hciconfig hci0 up
hcitool scan
sdptool browse "MAC"
obexftp -b "MAC" -B 12 -U NONE -p file.txt