- Image Types:
- basesdk-amd64 / sdk-amd64 / target-armhf-internal / target-amd64
- Image Deployment:
Test ConnMan support for bluetooth PAN Network Access Profile. This test will test internet access from Apertis to a bluetooth device sharing its internet connection. The underlying connection makes use of Bluetooth Network Access Profile with connman. First the two devices will be paired, then connection will be established. It will then be possible to verify that internet is usable from Apertis.
- A USB Bluetooth adapter.
- A phone supporting PAN NAP. A computer can also be used to share its internet connection.
- Ensure Rootfs is remounted as read/write.
- Install dependencies
- Restart the system to restore the filesystem state to read-only before running the test.
- Make sure an Internet connection is active on the phone and can be shared. The steps are phone specific.
- Ensure the bluetooth adapter is detected in Apertis: In VirtualBox menu, select "Devices > USB" and check the entry corresponding to the selected bluetooth adapter.
- Please note that connman disables bluetooth by default on a fresh image. If it's already enabled, connmanctl will give an "In progress" error that may be ignored. To enable the device:
- Start simple agent:
- Pair both devices initiating from the phone side
- Pay attention to the simple-agent window as it requires input during the pairing process.
$ sudo mount -o remount,rw /
$ sudo apt install apertis-tests python3-dbus python3-gi
$ sudo reboot
$ connmanctl enable bluetooth
$ /usr/lib/chaiwala-tests/bluez/simple-agent -y
- To ensure effective usage of bluetooth and not ethernet, one can use:
- List connman services and Check no other network technologies is in use with:
- From the result select the bluetooth service which matches both the adapter and phone addresses. If connections succeeds, connmanctl will display Connected bluetooth_aabbccddeeff_feedbeefcafe:
- Control ip routing goes through PAN interface. IP addresses can vary, but the default gateway should be bnepX or enXaabbccddeeff:
$ connmanctl disable ethernet
$ connmanctl services
$ connmanctl connect bluetooth_aabbccddeeff_feedbeefcafe
$ ip route
default via 192.168.2.1 dev bnep0
192.168.2.0/24 dev bnep0 proto kernel scope link src 192.168.2.3
192.168.2.1 dev bnep0 scope link
At this point, you should be able to navigate on the internet from Apertis. For example:
user@apertis:~$ ping www.google.fr
PING www.google.fr (184.108.40.206) 56(84) bytes of data.
64 bytes from lhr25s10-in-f3.1e100.net (220.127.116.11): icmp_seq=1 ttl=50 time=62.0 ms
Start the web browser from the Applications menu and display a web page.
Specifying a DNS should not be necessary, it can be done as follow:
$ connmanctl config bluetooth_aabbccddeeff_feedbeefcafe --nameservers 18.104.22.168
- Disconnect using connmanctl:
- Enable ethernet again if it was disabled
$ connmanctl disconnect bluetooth_aabbccddeeff_feedbeefcafe
$ connmanctl enable ethernet
- Warning: Connman changes are persistent (over reboot!). After finishing testing, it might be wise to perform the dhcp test to ensure that the network is in a sensible state.
- For ALL tests the enable step will give an "In progress" error if the device is already enabled. This is to be expected.