Smart Sensor BleuIO User manual


Table of Contents
How it works .................................................................................................................................................3
How to use ....................................................................................................................................................4
Windows..................................................................................................................................................4
Linux / Raspberry Pi...............................................................................................................................7
Mac OS X..............................................................................................................................................10
Issues...........................................................................................................................................................14
Firmware Updates....................................................................................................................................15
Troubleshooting........................................................................................................................................17
AT COMMANDS.......................................................................................................................................18
Scripts & Tutorials.......................................................................................................................................28
Getting Started........................................................................................................................................28
iBeacon....................................................................................................................................................29
Eddystone Beacon...................................................................................................................................33
Scan Example ..........................................................................................................................................38
Scan and Store Example..........................................................................................................................41
SPS Script.................................................................................................................................................44

How it works
Introduction
Thank you for purchasing the Smart USB Dongle 2.0!
In this user manual we will show you how to start using the Smart USB Dongle 2.0, what it can
do and how to use it.
Smart USB Dongle 2.0 is a Bluetooth Low Energy (BLE) capable USB Dongle that, with simple
AT-Commands, can easily be used to create new BLE applications.
When in the Central role it can scan and present a list of nearby advertising Peripherals,
connect to a connectable peripheral and if the SPS profile is present in the peripheral it can
receive and transmit data.
When in the Peripheral role it can start and stop advertising, set custom advertising- and
response data, allow a Central device to connect to it and receive and transmit data via the SPS
profile.
It is also possible to update the firmware via the USB port.
Requirements
The following hardware and software elements are required to use the Smart USB Dongle 2.0:
The Smart USB Dongle 2.0.
A Windows OS Computer with a functioning USB port.
A terminal software such as RealTerm, Putty or Teraterm.
A target device such as:
A Mobile Phone with Bluetooth and an App such as BLE Scanner, LightBlue or DSPS from
Dialog Semiconductor
A Computer with Bluetooth and a BLE scanning application installed
Another Smart USB Dongle 2.0 connected to a Computer
Recommended Port Setup
Recommended
Port setup:
Baudrate:
57600
Data bits:
8
Parity:
None
Stop bits:
1
Flow controll:
None

How to use
Windows
Step 1
Figure 1: Connect the dongle to your computer.

Step 2
Figure 2: Open Device Manager and check under Ports (COM & LPT) that a new COM port
has popped up.
You can open up Device Manager to see that the dongle is properly connected. The Smart USB
Dongle 2.0 includes a bootloader which allows you to easily update the firmware (or flash your
own application to the dongle, more on that HERE). When starting up, the dongle will open up a
COM port for the bootloader for 10 seconds to allow you to update the firmware (or flash your
own application). Afterwards it will close that port and open a new port for the Smart USB
Dongle 2.0 application which is the one we're interested in here.
NOTE: The COM port number may vary and may not be the same as in the picture above.
Step 3
Figure 3: Open your terminal software and select the COM port your dongle is plugged into.

Linux / Raspberry Pi
Step 1
Figure 1: Connect the dongle to your Linux / RaspberryPi.

Step 2
Figure 2: Run: ls /dev.
To identify which device name the dongle is connected to, you will need to run:
1. ls /dev
You might need to do it twice, once before you connect the dongle and once after to be able to
identify which one is the device name. The Smart USB Dongle 2.0 includes a bootloader which
allows you to easily update the firmware (or flash your own application to the dongle, more on
that HERE). When starting up, the dongle will open up a COM port for the bootloader for 10
seconds to allow you to update the firmware (or flash your own application). Afterwards it will
close that port and open a new port for the Smart USB Dongle 2.0 application which is the one
we're interested in here. You can run:
1. lsusb

It should list a device with the ID: 2dcf:6001 when the bootloader is active but change to
2dcf:6002 after 10 seconds when the application is running.
NOTE: The device name may vary and may not be the same as in the picture above.
Step 3
You will need a serial communication program to communicate with the dongle. For this tutorial
we will be using Minicom. You can get Minicom by running:
1. sudo apt-get install minicom
Now, to start using the dongle run the following command if, for example, your dongle is
connected to the device name ttyACM0:
1. minicom -b 9600 -o -D /dev/ttyACM0
Figure 3: Open your terminal software.
Step 4
Now try typing an AT-Command. For example AT .
If you get an OK response that means the dongle is working.
Done
Great job! You are now ready to start using Smart USB Dongle 2.0!
Now check out the different AT Commands available or how to get started using scripts.

Mac OS X
Step 1
First connect the dongle to your Mac.
Step 2
To identify which device name the dongle is connected to, you will need to run:
1. ls /dev/cu.*
You should see something like:
1. $ ls /dev/cu.*
2. /dev/cu.Bluetooth-Modem /dev/cu.iPhone-WirelessiAP
3. /dev/cu.Bluetooth-PDA-Sync /dev/cu.usbmodem123456781
The dongle should show up as: /dev/cu.usbmodem123456781 if it shows up with a different
name use that instead.
When starting up, the dongle will open up a COM port for the bootloader for 10 seconds to allow
you to update the firmware (or flash your own application). Unfortunately this is not as of yet
available on Mac. Afterwards it will close that port and open a new port for the Smart USB
Dongle 2.0 so you might need to wait a few seconds before doing the next step.
Step 3
You can either use the Mac OS X built in Terminal and screen or an external communication
program to communicate with the dongle. For this tutorial we will show how to get started using
terminal and screen and also a popular serial communication software called Minicom also via
the terminal.
With Screen:

Figure 1: Terminal and screen.
Simply type:
1. screen /dev/cu.usbmodem123456781 9600
With Minicom:
If you have Homebrew* you can get Minicom by simply running:
1. sudo brew install minicom
(If you don't have Homebrew click here to find out how to install it)
Now you need to setup Minicom by running:
1. minicom -s

Figure 2: Minicom settings.
Go to Serial port setup > Serial Device and type in: /dev/cu.usbmodem123456781 in the field
and press enter. Then Save setup as dfl.
Now, to start using the dongle just run:
1. minicom

Figure 3: Minicom ready to use.
Step 4
Now try typing an AT-Command. For example AT .
If you get an OK response that means the dongle is working.
Done
Great job! You are now ready to start using Smart USB Dongle 2.0!
Now check out the different AT Commands available or how to get started using scripts.

Issues
Showing advertising and/or response data, either when setting or querying, has been
temporarily disabled.

Firmware Updates
Introduction
The Smart USB Dongle 2.0 comes with a bootloader to allow you to update the firmware or
flash your own application to the dongle. To flash the dongle you will need a image file
containing the new firmware or your own application and a host USB loader application (that
you can get
HERE for Windows (host_usb_updater.zip) or
HERE for Linux (host_usb_updaterlinux.zip)).
USB loader application for Mac is unfortunately not available at the moment.
Latest Firmware
[2020-06-30] v1.0.7 Firmware
Version 1.0.7
Download
Release Notes
Older Firmwares
Version 1.0.6
Download
Release Notes
Version 1.0.5
Download
Release Notes
Version 1.0.4
Download
Release Notes
Version 1.0.3
Download
Release Notes

How to update your firmware
Linux side
Run with
sudo ./host_usb_updater /dev/ttyACM0 ./example_firmware.img
means USB-CDC driver of Linux. It can be changed according to test machine.
Sometimes a modemmanager in Linux system like Ubuntu might interrupt the USB-CDC
communication. In that case you can try disabling it.
Windows side
Open the command prompt in the directory where the host_usb_updater.exe is located.
Run with
host_usb_updater.exe 24 example_firmware.img -verbose
- The 24 means COM port number of USB-CDC device. You can see the COM port number on
Windows device manager. COM port number may vary on different machines. - Debug
message can be enabled by -verbose option.
NOTE: For simplicity's sake it is recommended to keep the image-file
and host_usb_updater.exe in the same folder otherwise you will need to provide the path to
where image file is stored relative to the host_usb_updater.exe.

Troubleshooting
General issues
The Smart USB Dongle 2.0 is connected but doesn't show up.
Try another USB port.
Unplug all other devices connected to your USB ports and try connecting the dongle again.
On older machines: Make sure that you have the correct CDC drivers installed.
Try connecting it to another computer.
Bootloader issues
Bootloader fails to upload image file.
Verify that you are trying to upload a valid image file.
Try if you can upload a different image file.
Make sure you are trying to upload the image file during the time window where the bootloader
is open.
Make sure you have closed down anything, like serial communication programs (e. g. TeraTerm
or Minicom), that might be connected to the dongle before trying to upload a new image.
For Linux users: Try disabling the modemmanager. As it may lock up the com port for awhile
and not leaving enough time to use the boodloader before the main app starts up.
Firmware issues
I have flashed my own firmware but it doesn't start.
Make sure you have changed the crystal setup in custom_config_qpsi.h as the Smart USB
Dongle 2.0 doesn’t have a 32KHz crystal:
Change
1.
#define dg_configUSE_LP_CLK LP_CLK_32768 // 32KHz. Usually the default in most
Dialog Semiconductor projects.
To
1. #define dg_configUSE_LP_CLK LP_CLK_RCX // 16Khz.

AT COMMANDS
AT
Basic AT-Command.
Command
Syntax
AT
AT
Example:
1. AT
2. Executing 'AT'...
3.
4. OK
ATI
Device information query. Returns firmware version, hardware type and unique
organization identifier.
Command
Syntax
ATI
ATI
Example:
1. ATI
2. Executing 'ATI'...
3.
4. OK
5. SSD005 Dongle DA14683 v 1.0.1
ATR
Trigger platform reset.
Command
Syntax
ATR
ATR

1. Example:
ATR
2. Executing 'ATR'...
3.
4. OK
AT+ADVDATA
Sets or queries the advertising data. Data must be provided as hex string. The content
will take effect only after advertising is restarted.
If you want to send several data types separate it with a space.
Command
Syntax
AT+ADVDATA
AT+ADVDATA=xx:xx:xx:xx:xx:xx
AT+ADVDATA=(xx:xx:xx:xx) (xx:xx:xx:xx:xx)
Example:
1. AT+ADVDATA=04:09:43:41:54
2. Executing 'AT+ADVDATA=04:09:43:41:54'...
3.
4.
5.
6. OK
AT+ADVDATAI
Sets advertising data in a way that let's it be used as an iBeacon.
Command
Syntax
AT+ADVDATAI
AT+ADVDATAI=(UUID)(MAJOR)(MINOR)(TX)
Example:
1. AT+ADVDATAI=ebbaaf47-0e4f-4c65-8b08-dd07c98c41ca0000000000
2.
3. Executing 'AT+ADVDATAI=ebbaaf47-0e4f-4c65-8b08-dd07c98c41ca0000000000'...
4.
5. OK

AT+ADVSTART
Starts advertising. Advertising interval can optionally be specified in milliseconds (100 to
3000ms). Time_ms controlls how for how long the dongle will advertise. Set to 0 for
unlimited. Returns ERROR if advertising is already active or if the device is in central role.
Command
Syntax
AT+ADVSTART
AT+ADVSTART
AT+ADVSTART=(mode);(intv_min);(intv_max);(time_ms);
Supported modes:
Code
Mode
0:
Non-connectable mode
1:
Undirected mode
2:
Directed mode
3:
Directed Low Duty Cycle mode
Example:
1. AT+ADVSTART=1;200;300;20;
2. Executing 'AT+ADVSTART'...
3.
4. OK
5.
6.
7. ADVERTISING....
AT+ADVSTOP
Table of contents