connman-pan-network-access manual

medium

Image Types:
basesdk-amd64 / sdk-amd64 / target-armhf-internal / target-amd64
Image Deployment:
APT
Type:
functional

Description

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.


Resources

  • A USB Bluetooth adapter.
  • A phone supporting PAN NAP. A computer can also be used to share its internet connection.

Pre Conditions

  1. Ensure Rootfs is remounted as read/write.
  2. $ sudo mount -o remount,rw /

  3. Install dependencies
  4. $ sudo apt install apertis-tests python3-dbus python3-gi

  5. Restart the system to restore the filesystem state to read-only before running the test.
  6. $ sudo reboot

  7. Make sure an Internet connection is active on the phone and can be shared. The steps are phone specific.
  8. Ensure the bluetooth adapter is detected in Apertis: In VirtualBox menu, select "Devices > USB" and check the entry corresponding to the selected bluetooth adapter.
  9. 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:
  10. $ connmanctl enable bluetooth

  11. Start simple agent:
  12. $ /usr/lib/chaiwala-tests/bluez/simple-agent -y

  13. Pair both devices initiating from the phone side
  14. Pay attention to the simple-agent window as it requires input during the pairing process.

Execution Steps

  1. To ensure effective usage of bluetooth and not ethernet, one can use:
  2. $ connmanctl disable ethernet

  3. List connman services and Check no other network technologies is in use with:
  4. $ connmanctl services

  5. 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:
  6. $ connmanctl connect bluetooth_aabbccddeeff_feedbeefcafe

    Connected bluetooth_aabbccddeeff_feedbeefcafe

  7. Control ip routing goes through PAN interface. IP addresses can vary, but the default gateway should be bnepX or enXaabbccddeeff:
  8. $ 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


Expected

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 (216.58.198.163) 56(84) bytes of data.

64 bytes from lhr25s10-in-f3.1e100.net (216.58.198.163): 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 8.8.8.8


Post Conditions

  1. Disconnect using connmanctl:
  2. $ connmanctl disconnect bluetooth_aabbccddeeff_feedbeefcafe

  3. Enable ethernet again if it was disabled
  4. $ connmanctl enable ethernet

Notes

  • 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.