CC13xx + CC3100 WiFi IoT gateway

This post is how to get your low power CC13xx based LaunchPad/SensorTag published to the cloud; utilizing a CC13xx LaunchPad + CC3100 BoosterPack using PubNub as the publishing agent and Freeboard as the visualization service.

What you will need

  • Free PubNub account. You can create one here.
  • Free account. You can create one here.
  • CC3100 BoosterPack. You can get one here.
  • 2 x CC1310 LaunchPad. You can get them here.
  • IoT gateway and sensor node Sketch. You can get them here.


Setting up PubNub

After you have created an account at PubNub go to the account homepage, and click the “NEW APP +” button. The button is located on the right corner of the screen.

In the dialog that pops up type your desired APP name (e.g. CC13xx IOT Gatway) and click create.

Click the app you just created on your account homepage:

Once in the app click the key info button on the top left of the screen, if you are not already on the key info screen.

On the tab navigation locate “All Keys,” scroll down and select Demo Keyset.


The loT gateway and sensor node sketch should be saved in the Energia Library(Documents->Energia-> libraries). Open Energia and locate EasyLinkRx, it should be in your “Examples” library.

Navigate to the Wifi tab and replace the pubkey and subkey with your keys displayed in the PubNub “Demo Keyset” detail window. Just copy and paste the keys into your Sketch. Still in the WiFi tab replace ssid and password with your WiFi network name and password.


On one of the LaunchPad’s place the CC3100 BoosterPack as per the instructions that came with the BoosterPack (CC31xx Quick Start Guinde pg. 18).

Your Gateway is now setup and ready to go.

Plugin the LaunchPad with the WiFi BoosterPack and upload the EasyLinkRx Sketch.

*Note: Install EasyLink library by following these steps: Sketch->Include Library->Manage Libraries->EasyLink->Install

*Note: Change the baud rate in the UART to match your sketch

Unplug the LaunchPad with the WiFi BoosterPack. Open the EasyLinkTx Sketch, plugin the other CC1310 LaunchPad and press Upload. Now plug the LaunchPad with the WiFi BoosterPack back in. Both LaunchPads should be connected, see below for reference.


The LaunchPad will now connect to WiFi and start receiving data from the sensor node, publishing it to PubNub.

Setting up

Setup your account here. On your account homepage enter a name for your board (e.g. CC1310 IOT) and click the “Create New” button.

On the dashboard that appears, click “ADD” under DATASOURCES.

In the Datasource pop-up select PubNub as the type from the “Select Type” drop down menu.

In the “DATASOURCE” details dialog, fill in the following details:

Name: Any name you want to give it. e.g. “CC1310 Sensors”

Subscribe Key: This is the key you earlier got from PubNub and pasted into the WiFi Sketch.

Channel: hello_world

Once the details are filled in click the “SAVE” button.

Back on the board home screen click the “Add Pane” Button.

In the newly created pane click the “+” sign.

In the Widget dialog select Sparkline.

In the Widget details fill in:

Title: The tile for the sparkline. e.g. Analog

Value: If your CC1310 gateway is already running then by clicking the + Datasource will show you the data sources available. Keep clicking the value that pops up until the value field shows: “datasources[“CC1310 Sensors”][“analog”][0]”

Keep the rest of the fields as they are and click Save.

If your IoT gateway and sensor node are running you should see a nice spark line showing the analog value from the sensor node that is send to the IoT gateway.


WiFithing – Open source Energia IoT platform with rapid deployment option

WiFithing, a UK based start-up, has launched on Kickstarter a new complete IoT platform based on TI MSP430 MCU’s and radios. I have read through their details and I love what they have done, so here are some of the details. Make up your own mind! If you like it, head over to the WiFiThing Kickstarter page.

WiFithing is based on a master and slave system, with the master having a Wi-Fi (CC3100) transceiver and an ISM (868/915 MHz) transceiver (CC1101), powered by an MSPFR5969. Each master can control up to 8 slaves, each of which is based on the CC430F5137 combined processor and transceiver. There is no limit on the number of masters that can be deployed. The slaves are based on the PanStamp NRG2. Masters and slaves are shipped in neat enclosures, ready for use.

You can wire both masters and slaves directly to sensors, relay boards, switches and other devices. At CES, WiFithing showed a home-made, hand held breathalyser which reported alcohol levels to a smartphone. Out of the box, without any wiring, you can read the inbuilt temperature sensors and control up to 10 Orvibo S20 Smart Sockets and up to four groups of FHT8v wireless radiator valves for lighting and heating control.

The benefits of using slaves, are that they:

  • are physically small enough to fit in quite small sensors/controllers,
  • can achieve 12 months plus battery lives whilst still, for example reporting back temperatures every 5 minutes.
  • have great range, like up to 100 metres out of doors
  • are low cost

The masters and slaves are shipped fully tested and flashed with the WiFithing open source firmware. This firmware is essentially an operating system which comprises some 60 in built functions. This allows the devices to be programmed over the air from the WiFithing web app.

The web app allows users to select from a range of 50 or so “Simple set-up” options such as “Control smart socket using daily timer and thermostat on slave”. A couple of clicks to select which slave and what locations and resource (such as Kitchen Heating) and then click “Publish”. This will then send the program in the form of a number of tables in a very compact byte stream to the master and onto the slave.

If users wish to build a more specialised application, the web app provides an advanced set-up page which gives users the power to create much more complex apps, by choosing functions and setting parameters, but still using drop-downs rather than writing code. By way of demonstrations, WiFithing also showed at Showstoppers/CES, how the system could implement a weather station which reported rainfall, wind speed and direction, temperature, humidity and pressure to the web site.

Once users have published their settings, they can then navigate to their main menu on their PC/smartphone and they will see that their personalised web site has been built for them automatically, giving them full control.

WiFithing do propose to charge a hosting fee for the use of their web app of $18 per annum (unlimited masters and slaves for each house/site). If users would prefer to use their own web site (and not pay the hosting fee), then WiFithing provides the code and protocol information necessary to set up their own. Alternatively, if users wish to build their own desktop or web app, but still use the WiFithing security and data infrastructure, then they can use the WiFithing secure API.

In addition to allowing set-up over the air, WiFithing allows automatic firmware updates over the air to both masters and slaves. And by setting a flag, users can send their own firmware to their devices.

WiFithing boasts a range of other features, which makes this a very complete platform:

  • Full SSL and AES encryption (masters and slaves are registered securely by using a QR scanner on their smartphone)
  • A range of low power modes, and automatic signal strength adjustment to preserve battery life
  • Full web site data logging and alerts, all set up by dropdowns
  • Multiple houses/sites. For example, a sensor in London could trigger an alarm in San Francisco
  • Comprehensive diagnostics (signal strength, battery life, time of last communication and logging)
  • An open source device and API emulator for debugging master/web communications (c#)
  • Comms are initiated by a configurable UDP tick from the master (with TCP back-up), so secure and no need to make holes in your firewall
  • Using the FR5969/CC3100 combination gives the users the benefit of TI’s FRAM technology (and the device will hold its settings and firmware even if power is lost)
  • Coin cell battery to maintain clock in event of power failure
  • Access to web server on device, for control in the event of internet connection failure (to be implemented)

Edward Forwood, Co-founder of WiFithing, said to us “We developed something that we want to use ourselves. Our goal was to allow non-technical users to set up a range of useful applications in minutes, whilst allowing experts to save a huge amount of time in setting up the comms and security infrastructure, allowing them to spend that time on developing really interesting applications”.

WiFithing tell me that they are keen for their platform to be adopted by, and improved by the Energia community. They have set up a forum with a number of example projects, and hope that others will add to them. The code will be on Github when they have finished documentation.

Inside Rekam1 (dyslexic(1maker))

Rekam1 is a rapid prototyping virtual machine written in Energia which enables rapid prototyping with your smartphone. This platform is designed to accelerate the development of three types of applications:

Sensor Controlled Actuators (temperature/light/etc. controlled doors/lights/motors/gadgets)
Smartphone Controlled Actuators (speech/accelerometer/UI controlled doors/lights/motors/gadgets)
Sensor Controlled Smartphones (temperature/light/etc. alerts/logging on your phone)

In this blog we’re going to talk about a smartphone controlled actuator application recently demoed an World Maker Faire: the “Rekam1 Clay Thrower” and how Energia rekam1 code was used to enable this.

The Clay Thrower uses a speech or UI push button trigger to sling clays hundreds of feet into space. It does this through a solenoid. Because the solenoid draws 2.5 Amps of current, a power FET is connected to the MSP430 to energize the launch.

Power FETs have a drain, gate, and source. The source pin in this example is connected to ground(GND) while the gate pin is connected to pin 19 of the micro-controller. The drain pin is connected to one terminal of the solenoid and the other pin is connected to the positive terminal of a LIPO battery I’m using. In this example, rekam1 is used as a “command interpreter”. This means it immediately executes whatever command it receives over the UART. If you are using an MSP430G2553 Launchpad, you can see in the picture below how you would connect your board.


You can find the rekam1 sketch in Energia under File->Examples->Communications->rekam1. In order to build rekam1 for this platform, simply comment out the #define for G2553 and comment the Wi-Fi include lines and CCX #define as shown below. Ensure you’re building for the MSP430G2553 and hit the build button.

When you connect a battery, Power FET, and solenoid to your Launchpad, your setup should look like below. You can now activate and deactivate your solenoid through a serial port window inside energia by simply typing: put 19 100 and put 19 0 a second or so later. Make sure that you have setup your terminal window to 9600bps with a new line sent when you hit the “send” button.

In the video below, you can see how fun this little gadget can be. In this case, we used google speech recognition and a simple “pull” button in Android to send these two commands. If you’re interested in learning more about how to use rekam1, you can visit my blog at<>