Multi-Hackers


Multi-Tech's All Star Hacking Team!

2015 ATT Government Solutions Hackathon

/media/uploads/mfiore/img_1469.jpg

Introduction

Welcome to the MultiTech wiki page for the 2015 ATT Government Solutions Hackathon! This page is the perfect starting point if you're using the MultiTech Dragonfly + UDK + Sensors bundle as a part of your solution.

Getting Started

If you're asking yourself "what the heck is mbed?" take a look at the mbed getting started page. Otherwise, follow the steps below to help your development process go smoother.

  • Go to the mbed developer site and create an account.
  • Go to the MultiTech Dragonfly platform page and click the "add to your mbed compiler" button. After you do this you can build applications for the Dragonfly in your online compiler.
  • Make sure the STLink firmware on your UDK is up to date by following the steps on the Nucleo Firmware page.
  • Get a terminal emulator so you can see debug output from your Dragonfly.
  • The SerialPC page has more info about how to view debug output from your Dragonfly on your PC.

Examples

MultiTech has put together an example application that demonstrates how to use the Dragonfly + UDK + sensors setup.

Note!

If your kit doesn't include the ST MEMs sensor shield (the top shield in the picture), use the second example program!

Import programMultiTech_Dragonfly_2015_ATT_Gov_Solutions_Hackathon_Example

Example program for MultiTech Dragonfly using ST MEMs sensor shield, Grove moisture sensor, and Grove button.

Import programMultiTech_Dragonfly_2015_ATT_Simple_Gov_Solutions_Hackathon_Example

Example program for MultiTech Dragonfly using Grove moisture sensor and Grove button.

This program reads sensor data, displays it on the debug port, sends a SMS message containing sensor data when the button is pressed (configuration required), and posts sensor data to the AT&T M2X cloud platform (configuration required). The program uses three libraries to accomplish these tasks.

Import librarymtsas

Complete library supporting MultiConnect Dragonfly and SocketModem Arduino Shield devices.

The MTSAS library provides an easy-to-use API to the cellular radio on the Dragonfly. Instead of sending AT commands and parsing the responses yourself, let MTSAS do the dirty work for you.

Import libraryX_NUCLEO_IKS01A1

Firmware Library for X-NUCLEO-IKS01A1 (MEMS Inertial & Environmental Sensors) Expansion Board

The X_NUCLEO_IKS01A1 library provides an API to all of the sensors on the ST MEMs board. With a few function calls, you can be reading the temperature, humidity, and pressure, as well as getting motion and position data from the magnetometer, accelerometer, and gyroscope.

Import libraryMbedJSONValue

Minimalist JSON parser and serializer (inspired by picojson). Used by MbedJSONRpc.

Instead of formatting JSON data for a HTTP POST yourself, let MbedJSONValue do it for you.

Troubleshooting

  • I don't see any output from the debug port.
    • Make sure you're using the correct COM/tty port. See this link for more information about communicating with your PC from your Dragonfly (including debug).
    • If you're using Windows, you need to install a driver to make the debug serial port enumerate as a COM port on your machine.
    • Make sure your baud rates match! The default baud rate for the debug port is 9600 - if you haven't changed it, your terminal emulator needs to be set to that speed as well.
    • Make sure your micro USB cable is connected to the correct USB header - it should look like the image below. Note that the micro USB cable is connected to the header on the UDK board, NOT the header on the Dragonfly!

usb

  • Serial settings are correct. Did my Dragonfly lock up?
    • If your application is doing something naughty like dereferencing a NULL pointer, it may have locked up. Try adding some more logging in your application - if you always see one message but never see the next one, chances are your culprit is between them.
    • Are you using RTOS? The MTSAS library isn't currently compatible with the RTOS library. Attempting to use both together might cause problems.
    • Add a Ticker that blinks an LED so you can easily look and see if your application is still running. The following program demonstrates how to use a Ticker.

Import programDragonfly-Ticker

blink D3 LED on UDK2 board

  • My Dragonfly can't connect to the network.
    • Make sure the antenna is screwed tightly onto the connector and that the antenna wire is securely connected to the main antenna plug on the Dragonfly - the one labeled "M".
    • Check your signal strength: Cellular::getSignalStrength(). The cellular radio might have a hard time connecting if it's less than 10. If your Dragonfly reports very low signal strength, try moving to an area with better reception.
    • Try running the Cellular Connect Example to make sure other parts of your application aren't interfering with MTSAS establishing the cellular connection.
    • Make sure the SIM card is properly inserted in the Dragonfly. See the image below for proper SIM insertion.

sim

  • My Dragonfly can't send a SMS message.
    • Make sure the SIM card is properly inserted in the Dragonfly. See image above.
    • Make sure the phone number is formatted correctly. MTSAS needs the phone number to have a 1 in front of it. For example, if your phone number is (460) 867-5309, your phone number variable should look like this:

std::string phone_number = "14608675309";
  • Stop by if you have additional questions! Have fun hacking!

All wikipages