Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Bluetooth is widely used when it is necessary to provide a wireless access to the devices located in short distances. In this application note we will show how to organize a wireless FTP access to the NXP i.MX RT1050 EVK /RT1060 EVKB running Linux using a USB Bluetooth adapter. In practical embedded applications such a wireless channel may be used to retrieve data collected by the i.MX RT1050 RT10XX via the standard FTP protocol. The most obvious use case scenario for this need is a technician visiting an embedded device residing at a remote site in order to retrieve data collected and stored locally by the i.MX RT1050 RT10XX board locally (e.g. the i.MX RT1050 RT10XX may store data on a EXT2 partition in the SD Card or on a connected USB Flash). Being able to access the i.MX RT1050 RT10XX over Bluetooth from a notebook or a smartphone, with no need to connect to the i.MX RT1050 RT10XX with any physical cables, comes in very hand, especially for devices with limited physical access.

1. Hardware Platform

The hardware platform used in this application note is the NXP i.MX RT1050 EVK EVKB board with a USB Bluetooth adapter plugged into the USB 2 J9 connector or the NXP i.MX RT1060 EVKB board with a USB Bluetooth adapter plugged into the USB 2 J10 J47 connector. The generic Linux kernel device driver for the USB transport HCI layer (CONFIG_BT_HCIBTUSB) is used in this configuration so other USB Bluetooth adapters should work as described below too.

2. Software Platform

Support for the Bluetooth FTP server is implemented by the obexftp package:
http://dev.zuckschwerdt.org/openobex/wiki/ObexFtp.

...

The functionality described below is available from the rootfs.uImage project provided by Emcraft for the NXP i.MX RT1050/RT1060 EVK board.

3. Test Setup

We will use the following terminology below:

  • Target: NXP i.MX RT1050 EVK /RT1060 EVKB board with the Bluetooth adapter plugged into the USB HS port.
    The Bluetooth <Target address> in the examples below is 04:7F:0E:31:B7:94;

  • Host: Any computer with a Bluetooth interface, running Linux with the Bluetooth tools (bluez-utils, openobex, and obexftp) installed.
    The Bluetooth <Host address> in the examples below is BC30:7703:37C8:5CC9:3210:57E6.

4. Bluetooth FTP Server on i.MX

...

RT10XX

Power-on the NXP i.MX RT1050 EVK /RT1060 EVKB board and wait for the Linux to boot on the Target. Run the Bluetooth daemons in the background:

...

Plug-in the Bluetooth adapter to the USB HS interface of the NXP i.MX RT1050 EVK /RT1060 EVKB board. Observe the messages similar to the following in the Target console:

Code Block
usb 1ci_hdrc ci_hdrc.0: EHCI Host Controller
ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 2
ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
usb 2-1: new full-speed USB device number 2 using ci_hdrc
usb 12-1: Duplicate descriptor for config 1 interface 1 altsetting 5, skipping
hcid[96]: HCI dev 0 registeredBluetooth: hci0: CSR: Setting up dongle with HCI ver=9 rev=0001
Bluetooth: hci0: LMP ver=9 subver=0001; manufacturer=2279
Bluetooth: hci0: CSR: Unbranded CSR clone detected; adding workarounds and force-suspending once...
Bluetooth: hci0: CSR: Failed toCouldn't suspend the device for our Barrot 8041a02 receive-issue workaround
hcid[96
Bluetooth: hci0: HCI Delete Stored Link Key command is advertised, but not supported.
Bluetooth: hci0: HCI Read Default Erroneous Data Reporting command is advertised, but not supported.
Bluetooth: hci0: HCI Set Event Filter command not supported.
hcid[74]: HCI dev 0 registered
hcid[74]: HCI dev 0 up
hcid[10180]: Can't set encrypt on hci0: Invalid request code (56)
hcid[9674]: Starting security manager 0

...

Code Block
$ sudo obexftp -b 04:7F:0E:31:B7:94 -B 2 -l
Connecting..\done

Receiving "(null)"...|<?xml version="1.0"?>
<!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd">
<folder-listing version="1.0">
<file name="busybox" size="12" user-perm="RWD" modified="19700101T000426Z19700101T001051Z" created="19700101T000426Z19700101T001051Z" accessed="19700101T000426Z19700101T001051Z" />
</folder-listing>
done
Disconnecting../done

...

Code Block
/root # ls -lt /root
-rw-r--r-- 1 root root 524288 Jan 1 00:09 512kB.host
lrwxrwxrwx 1 root root 12 Jan 1 00:00 busybox -> /bin/busybox

5. Bluetooth

...

FTP Client on i.MX

...

RT10XX

The Target may also implement the FTP Client functionality and connect to the FTP servers exported over Bluetooth by other devices. The obexftp utility is integrated into the rootfs project and may be used for this purpose. See the commands executed on the Host above in this application note: similar commands may be run on the Target side if we want it to perform the FTP Client role.