Mbed u-blox C027

Overview

The u-blox C027 is a starter kit that allows quick prototyping of a variety of applications for the Internet of Things. The device comes with a cellular module as well as a GPS/GNSS receiver. These enable straightforward development of applications with location-aware communication capability.

u-blox C027

For demonstration purposes, the mbed application shield can be attached to the C027. It provides various sensors, two dials and an LCD display.

mbed application shield

The Cumulocity IoT mbed agent connects the C027 application board to Cumulocity IoT and provides the following features:

Prerequisites

To run the Cumulocity IoT mbed agent, the following items are required:

Setting up and registering the device

To get started

  1. Insert the SIM card into the SIM slot on the backside of the u-blox C027.
  2. Attach the cellular antenna to the board.
  3. For GPS/GNSS capabilities, attach the GPS antenna to the board.
  4. Attach the mbed application shield to the C027.
  5. Connect a USB cable to the C027 and to your computer. The C027 will appear as “MBED” drive on your computer.
  6. Plug in the power supply and connect it to the application board.

Info: The device cannot be flashed without the power supply connected.

Further information is available on https://os.mbed.com/users/ublox/notebook/u-blox-C027-Getting-Started/ and https://os.mbed.com/users/ublox/notebook/u-blox-C027-Downloading/.

To install the agent

  1. Download the firmware to your computer, see table below.
  2. Copy the downloaded file to the “MBED” drive.
  3. Press the reset button on the C027 to start the agent.
Version Release date Download
1.9 18. Feb 2015 download
2.0 06. Mar 2015 download
2.2 10. Aug 2015 download

To register the device to Cumulocity IoT

  1. The C027 will now dial up to the internet. You will see the status “updated” in the LCD display. If the device cannot connect to the internet, it will display an error message. If there is an error message “Wrong APN setting” or “Unknown APN setting”, follow the instructions below in the section Troubleshooting.
  2. On successful connection for the first time, the device shows “Bootstrapping” and below the IMEI of the cellular modem on the LCD display. Info: The IMEI can also be found on the white sticker on the modem chip of the C027.
  3. Log into the Cumulocity IoT platform.
  4. Navigate to the Device Management application using the application switcher at the top right.
  5. To register the device follow the instructions in Device Management > Connecting devices in the User guide.
  6. After successful registration the device will be listed in All devices with the name “Mbed Test Device”.
  7. When the device is connected to Cumulocity IoT, it will show its current status in the LCD display. The first line always displays the tenant name (until there is a message received from the platform, see the section To interact with control operations). The second line shows the signal quality in units of dBm. The third line displays information about which sensor data the u-blox is sending and their corresponding values. In the case of repeatedly sending similar data, the third line remains empty.

Interacting with Cumulocity IoT

The device is now connected to Cumulocity IoT and sends sensor data periodically. You can now browse and process the collected data in the cloud in various ways.

To view measurements

  1. In the Device Management application, click Devices > All Devices in the navigator and then select the “Mbed Test Device” from the device list.
  2. In the Measurements tab of the device, you can browse the collected sensor data:

Measurement Screenshot

The device sends new sensor data only when the sensor values are changing. If the values remain constant, no new values are sent except for a forced sending every 15 minutes in order to retain connectivity with the platform.

To create a dashboard

The representation of sensor data can be customized.

  1. Add the “Mbed Test Device” to a group, see Grouping devices for details.
  2. Switch to the Cockpit application using the application switcher and then navigate to Groups > <Your New Group> where you will find the “Mbed Test Device”.
  3. To create a new dashboard, click the Plus button in the top bar and from the context menu select Add dashboard.

The new dashboard will appear in the top menu bar.

You can set up the dashboard according to your requirements. Using Add widget provides access to numerous predefined widgets.

Try the following examples:

Relay

In the “Relay control” widget, switch the toggle to turn the LED on or off.

Send Message

In the “Message sending” widget, enter a message in the text field, and then click Send. After several seconds, the first line of the LCD display should display the message you sent. This message will be displayed in the first line until you send another message or restart the device.

An example dashboard created for an mbed device is shown below:

Dashboard Screenshot

For details refer to Dashboards and Widgets collection in the User guide.

To interact with control operations

  1. In the Device Management application, click Devices > All Devices in the navigator and select the “Mbed Test Device” from the device list.
  2. In the Configuration tab of the device, the supported configuration parameters are shown with their current values. Currently for the mbed u-blox, the only parameter is “interval” with the default value of 20 minutes, which determines the time period at which Cumulocity IoT will check the availability of the device. It must be set to the same value as in the Required interval in the Info tab.

Interval Screenshot

Tips and tricks for users

Force sending sensor data

Subject to the sensitivity threshold, you may not see frequent sending of sensor data because similar sensor readings are not sent. This effect is especially noticeable for the temperature sensor. However, it is possible to trigger an immediate sensor data sending by manually imposing a change to the sensor readings.

Performing a factory reset

When a u-blox device is already registered under a certain tenant, a factory reset has to be performed to remove the stored credentials so that the device can be re-registered again. The factory reset is performed as follows:

Tips and tricks for developers

Enabling debug mode

By default, the agent runs in production mode, which does not write any information to the serial port. You can enable the debug mode to see a detailed log of the agent running. Prior to version 2.1, in order to enable debug mode, you can either push up the joystick before starting the agent, or at any time after the agent is connected to the cloud and running. Starting from version 2.1, simply push up the joystick at any time to enable the debug mode.

The debug information is printed to the serial port of the device. To view its content, see https://os.mbed.com/handbook/SerialPC for details.

Info (applies only to versions prior to 2.1.): Because the agent only reads the state of the joystick once per several seconds, you may need to push up the joystick and hold it for several seconds to switch on/off debug mode.

When the agent is running in debug mode, many operations will be slowed down by a factor of 2 to 3 because of the large amount of I/O operations. If you want to disable the debug mode and switch back to express mode, simply push down the joystick and hold for several seconds (no holding is required starting from version 2.1).

Changing the agent source code

If you want to change the behaviour of the agent, go to mbed.org and adopt the source code. Here are the steps required to do so:

  1. Sign up for an account in mbed for free.
  2. Log into the mbed.org site and visit the C027 page. Click Add to your mbed Compiler.
  3. Visit Cumulocity MbedSmartRESTMain application and click Import into Compiler to import the agent into your online Mbed IDE.
  4. In the IDE, click Compile. The IDE will download the compiled application to your computer.
  5. Copy the downloaded file to the “MBED” drive.
  6. Press the reset button on the C027 to start the agent.

Changing the reporting interval in the source code

By default the reporting intervals for all sensor values are 15 minutes. You can change the reporting intervals by changing the defined corresponding macros in the source code (all units in second):

Changing the reporting sensitivity threshold in the source code

Due to the jittering nature of the sensor readings, there is a threshold set for all sensor values to avoid constantly reporting false positive sensor reading changes. As the sensitivity of the sensors varies, the thresholds for different sensors vary. These thresholds are defined as a fraction of the last reported sensor values and you can also change them in the corresponding source file (all in real fraction numbers):

Troubleshooting