RedBear BLE Module

Bluetooth Low Energy (BLE) transceiver board. BLE is a new protocol introduced in the 4.0 revision of the Bluetooth standard. It is a wireless personal area network (PAN) technology aimed at novel applications in the healthcare, fitness, security, and home entertainment industries.  BLE is not backward-compatible with the previous Bluetooth protocol. However it uses the same 2.4 GHz frequency bands but a simpler modulation scheme. The picture below shows the RedBearLab BLE Mini Board.MKRBL2-2T

The module is a combo of a RBT01 BLE module featuring the Ti CC2540 Single chip Bluetooth (SoC) and a breakout board that offers a micro USB connector and a 3.3Volt UART connectors. The main reason this board caught my attention is the fact that it also has solder points for additional GPIOs on the back of the board. These GPIOs can be custom programed. So it should be possible to hook up  I2C or SPI sensors to the board and with a bit of software be able to monitor them.
Using such a BLE board  is not exactly an IoT solution as the connectivity to the cloud would have to be implemented with for example a Wireless enhanced Gallileo. Also the BLE's range is rather limited. However when it comes to power consumption BLE has a leg up as it was specifically designed for very low power.

Spark Core compiler toolchain under cygwin

There are good instructions how to install the local toolchain to compile the Spark Core firmware. I don't want to replicate them here. Go to the Spark Core Github and check the Readme.md or search for a tutorial.
The purpose of this page is to show the steps and pitfalls when installing this toolchain under cygwin on a Windows 7 64 bit computer.

I assume you have at least the base cygwin installation on your machine. For instructions please head over to cygwin.org:

Screenshot 2014-04-07 22.05.40

Make sure you install git and any other goodies you like under cygwin.

  1. GCC for ARM Cortex processors - ARM cross compiler tool chain for Windows
  2. Make - Windows version of gmake
  3. Device Firmware Upgrade (DFU) Utilities - Utility to download the firmware to the Spark Core
  4. Zatig - USB driver for firmware downloads

Now install gcc for ARM and gnu make for Windows. Yes, cygwin also includes gmake. However there is a problem with it around dependencies. The MINGW GCC compiler uses Windows path notation in the *.d dependencies files that gmake under cygwin chokes on. So if you, the second time you try to compile, get an error like this:

it is because we use MINGW GCC under cygwin instead of a native cygwin compiler. You can also checkout a related posts on the Spark Community Board. It is now time to install the firmware. Pull the following three repositories from Github:

These repositories contain all the Spark Core firmware. Once the source code is downloaded, go to the build directory in the firmware folder and start the compile:

If everything went smooth you should now have a core-firmware.bin file.  Run the Zatig program to install the USB driver. The moment has come to flash the firmware into the Spark Core. For this, push the left button to reset the core while holding down the right button. Release the reset button and wait until the RGB-LED is flashing yellow. You can now download the firmware with the following command:

Screenshot 2014-04-08 03.03.57

Note the DFU utility always indicates an error "Error during download get_status" This is normal and as long as you see "File downloaded successfully" everything is fine.

Windows for Galileo

Wintel

According to HotHardware.com there are signs that Microsoft will start supporting Galileo with a new "Windows on Devices" version that targets IoT and other smart devices.  Why is this noteworthy?  Well, this would in fact mean that the PC-era "Wintel" team is entering the Maker scene with their newly paired product offerings supporting an Arduino Maker platform.

This is certainly a welcome move as it broadens the choice of platforms and products Makers have to use in their project.

Spark Core Weather Station

In my previous blog post I described my first encounter with the Spark Core. Today I want to demonstrate a first simple code example. For this I connected the Spark Core to a Weather Shield from Sparkfun. The shield offers sensors for light, humidity, temperature and pressure. It can even be extended with rain and wind sensors as well as GPS.
.Spark Core Weather
The shield comes with a nice set of libraries and examples that I used as a starting point. To keep things really simple, I combine the entire Weather Shield source with the sensor library functions and the setup() and loop() into a single file. This did not take long and compiled quickly. I also removed the wind and rain related functionality as I did not plan to use those. The source code below takes measurements every second and writes the them to the USB serial port.

For debugging I used the Serial Communication link over USB. Windows users have to install a COM driver. However, MAC and Linux support the Spark Core USB functionality out of the box.

I was really pleased to see how well the Spark Core supports Arduino libraries and well written legacy code. With only a few code modifications I had the sensors up and running.

The setup is now streaming values over a USB cable to a PC. There I captured the values with Tera Term and created a Weather Graph from the comma separated values (CVS). The example below shows the pressure curve of a Bay Area Storm passing by at end of February 2014.
CA Storm
This setup is a somewhat trivial example that a basic Arduino can also do. The project really does not take advantage of the Spak Core's connectivity to the internet. So stay tuned for my next blog post where I will add internet connectivity to the setup.

Encounter with a Spark

I have tested several IoT platforms over the last couple of weeks. So I was not too keen to checkout yet another one. However, when I got the annoucement that the Spark Core is shipping I could not resist and ordered one. It arrive in the mail today so I thought I will take it for a spin.

The Spark Core comes in a very stylish little box.

Spark Box

Figure1: Spark Box

To my surprise the box did even includes a breadboard:

spark2spark3

Figure 2: Open Spark Core Box

Overall, the box contains the Spark Core board, a breadboard, a micro-USB cable and Spark sticker.

spark4

Figure 3: Box Content

It is amazingly simple to get the board up and running. By following these few simple steps:

  1. Download the Spark App for iPhone or Android
  2. Setup an account by register at spark.io
  3. Power up the Spark Core over the USB cable
  4. Start Spark App and log into your wireless network

If everything works well you will get rewarded with the RGB-LED on the Spark board flashing in rainbow colors. Once the Spark Core is connected to you WiFi and paired with the Spark cloud, it took me only a few minutes to get an on-board blue LED blinking.

It very quickly becomes obvious that the Spark team has done a great job setting up an entire end-to-end IoT solution consisting of:

  1. Spark Hardware
  2. Cloud based IDE
  3. Arduino compatible API
  4. Free for life cloud back-end service with a RESTful API

All the Spark Core software is open source. The board uses a CC3000 WiFi Module from TI combined with a 32-bit ARM Cortex-M3 powered STM32F103 from ST Microelectronics. The Spark team has come up with a nice integration of this hardware and the cloud server back end. It is based on the CoAP protocol specification and allows for an easy and energy efficient integrated IoT solution.

The cloud API offers over-the-air (OTA) firmware updating where the input can either be c/c++ source code or binaries. For those that don't want to use Spark Builder, their cloud based IDE the web site also promises support for desktop IDEs like Eclipse.

So much for today, I will cover more details in future blogs.

Do you need WiFi Connectivity in your project?

There are a lot of WiFi solutions for Makers out there. However many are either expensive, big or outdated. So it is refreshing to look at the technical data of the little known WiFi module available by the name of RTX4100  from RTX Telecom. You may never have heard of RTX Telecom but this Danish design service company specialized in wireless has been around for many years.  The module is hardly bigger than a Bluetooth module.

RTX_BT1

Figure1: on the left a simple Bluetooth HC-5 module and on the right the RTX4100 WiFi Module.

The RTX41xx uses latest WiFi System in a Package (SiP) technology. It features a Nordic Semiconductors 32-bit ARM Cortex-M3  based low power microcontroller.  The WiFi is based on a AR41xx SiP from one of the leading WiFi chip manufacturer  Qualcomm - Atheros.

The 32-bit application processor is responsible for all the WiFi driver related duties. But an API allows to program custom application into the module. RTX calls the custom programs Co-Located Application or CoLA.  Besides the RTX4100 that offers 24 kBytes flash memory and 3 kBytes RAM for custom applications. RTX also offers a pin compatible RTX4140 that provides much more programmable memory for CoLA applications, 512 kBytes flash and 64 kBytes RAM.

CoLa

The SDK can be downloaded from RTX's web site together with a comprehensive set of documents and CoLA examples.

On the Hardware side the module offers 30 solder pins that support a variety of  I/O functionality:

  • ADC ports, DAC ports
  • GPIO ports
  • UART, SPI, I2C
  • Timers

RTX has also teamed up with some cloud services. The currently supported cloud partners are: 2lemetryExositeNabto and Sensinode.

For simple applications like WiFi sensors or actors that require a limited set of IOs and CPU/Memory resources RTX41xx modules can be used stand alone. They are also a great choice for embedded projects based on Arduino that need WiFi.  Similar to some of the popular Bluetooth modules you only need a spare UART or SPI interface to talk to the RTX4100.

Unlike Electric Imp that offers you a fully integrated platform form the module all the way up to the cloud, RTX is a much more open and flexible platform where you retain control. However this control also comes at the price that you have to do more software work. The good news is that you don't have to start from scratch, RTX supports you with quite a bit of Software.

Another IoT Platform - WICED

Broadcom is also jumping on the IoT wagon with the WICED  platform.  The platform is targeting Bluetooth and WiFi applications. The WiFi modules feature the BCM43362 WiFi chip integrated into a System in a Package (SiP) module. The Image below shows a WiFI WICED PCB module with a Murata WiFi SiP Module and a STM32F205 microcontroller. Murata also offers SiP modules that have the ARM microcontroller built in.

wiced_BCM943362WCD4

On the software side the platform is supported by a feature rich SDK and support for OSs:

  • WICED Application Framework including bootloader, flash storage API, over-the-air (OTA) upgrades, factory reset, and system monitor.
  • An open source build system and toolchain based on GNU make (native IAR support coming soon!).
  • A GUI Development Environment based on Eclipse CDT that seamlessly integrates with a JTAG programmer and single-step, thread-aware debugger based on OpenOCD and gdb.
  • A software stack with a choice of several RTOS/TCP stack options including ThreadX/NetXThreadX/NetX Duo and FreeRTOS/LwIP.
  • Support for security and networking features such as SSL/TLS, IPv4/IPv6 networking, and mDNS (Bonjour) device discovery.
  • Simple out-of-box device setup using Apple-licensed MFi technology or via a web browser and softAP/web server.

Broadcom also make a set of software examples available that help getting started quickly:

  • Production ready sample applications.
  • Lots of application snippets demonstrating how to use the rich WICED API feature set.
  • Various test applications to aid manufacturing and certification.
  • All documentation included inside the WICED SDK.

The next Electric Imp

Yesterday evening Hugo Fiennes, CEO and Co-founder of Electric Imp gave a talk at the Mountain View Hacker Dojo.

Hugo did a great job explaining the Electric Imp platform to a packed room. Besides a M&M candy dispenser that he controlled over the internet he also brought a board with the next generation Electric Imp on it.

20140129_201910

The Electric Imp is the silver module on the left. The tiny size gives an idea of how small of a form factor internet connectivity will be available. Hugo also shared his excitement about the reduction in power consumption and the ability to power IoT devices from batteries.

First Steps with the Electric Imp

At the CES 2014 Intel announced the Edison platform that is intended to enable IoT applications.  As pointed out in my earlier blog, there is a pretty similar solution out there. It goes by the name of Electric Imp.

El_Imp

cloudgraphic

The Electric Imp is a platform that consist of several parts:

  • The SD-Card size Electric Imp
  • A web based IDE
  • A cloud service that integrates with the Electric Imp hardware
  • The BlinkUp cell phone app to pair the Imp Hardware with your local network and Electric Imp web services

Such an impressive combination promised some fun, so I was curious how well all the components would work together.  To try it out I got myself an Electric Imp and the related Imp Arduino Shield from Sparkun. In order to use it with Arduino Shields or Arduino Boards you have to also order the headers and solder them on the board. I use the Arduino Stackable Header Kit . The stackable header allow you to use the Imp as a "WiFi Shield" to an Arduino Single Board Computer (SBC) as well as being a standalone SBC. If you only use you Electric Imp as a SBC you won't need any stackable headers. Also make sure you order the headers that fits your Arduino board. There are different revisions out there. The R3 version has additional pins and will not fit an original Arduino board.

Once the headers are soldered down you can plug the Electric Imp Shield on top of an Arduino board. Signup for an account on http://electricimp.com and download the BlinkUp app to your smartphone. Fire-up the app and log into your Electric Imp account with your credentials. It's time to power up the Arduino-Imp combo. Hold your Phone screen flush with the front edge of the Electric Imp card and start the pairing process. The phone screen flashes for a while. Once the flashing stops the Electric Imps status light should turn green. You can get detail instructions on the Electric Imp web site or on Sparkfun. So far not a lot of challenges.

Time has come to whip together some code that brings this combo to life. To test the Electric Imp I used some modify code from their web site.

The code above let's the two LEDs on the Electric Imp Shield blink alternatively for half a second each. So if you see the LEDs blinking, you know that the IDE properly compiled it and downloaded it over the internet into the Electric Imp card where it gets properly executed. Well Done! Stay tuned, in my next installment I will try to get the Electric Imp talk to the Arduino.

Galileo in the Doghouse?

In one of my previous blogs I compared the Galileo board against the Raspberry Pi  Today we are looking at how the Galileo board compares to the affordable Beaglebone Black board. The Beaglebone is an initiative by Texas Instruments (TI). Unlike the Raspberry PI the Beaglebone board is all open source. Anyway let's look at the key technical data:

Beaglebone Black Intel Galileo
Target price: US$45 US$69
SoC: Texas Instruments Sitara AM3359 Intel Quark X1000
CPU: 1GHz ARM® Cortex-A8, NEON floating-point accelerator, 2x PRU 32-bit microcontrollers 400MHz 32-bit x86 Pentium Class CPU
GPU: SGX530 3D graphics accelerator none
Memory (DRAM): 512MB DDR3 RAM 256 Mbyte
PCIe ports: none PCIe 2.0
USB 2.0 ports: 1 Host,
1 Device
1 Host,
2 Device
Video input: none
Video outputs: HDMI (rev 1.3 & 1.4) none
Audio outputs: stereo via HDMI none
Onboard storage: 2GB 8-bit eMMC on-board flash storage
SD/MMC/SDIO 3.3V card slot
SD/MMC/SDIO 3.3V card slot
Onboard network: 10/100 Ethernet 10/100 Ethernet
Low-level peripherals: Power 5V, 3.3V , VDD_ADC(1.8V)
3.3V I/O on all signals
McASP0, SPI1, I2C, GPIO(69 max), LCD, GPMC, MMC1, MMC2, 7 AIN(1.8V MAX), 4 Timers, 4 Serial Ports, CAN0, EHRPWM(0,2),XDMA Interrupt, Power button, Expansion Board ID
16 × GPIO,
UART, I²C bus, SPI
Power ratings: 210-460 mA @ 5V 550 mA (1.9-2.2W)
Power source: 5 Volt 5 Volt
Size: 86.36 mm x 53.34 mm (3.4 in x 2.1 in) 106.68 mm x 71.12 mm (4.2 in x 2.8 in)

Both boards offer pretty similar technical data. One of the main difference is the absence of a graphics engine and HDMI interfaces in the Galileo's X1000 Quark processor. This obviously makes the Galileo less of a choice for graphics application. The Beaglebone also offers a higher CPU clock speed which will give you additional punch. However, if you need a miniPCIe slot Galileo is the way to go.

To close the triangle  I also recommend the detailed comparison  of the Raspberry Pi vs. the Beaglebone published in Make Magazine.