WiFi

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.

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.

// create a global variabled called led,
// and assign pin9 to it
led8 <- hardware.pin8;
led9 <- hardware.pin9;
// configure led to be a digital output
led8.configure(DIGITAL_OUT);
led9.configure(DIGITAL_OUT);
// create a global variable to store current
// state of the LED
state <- 0;
function blink() {
  // invert the value of state:
  // when state = 1, 1-1 = 0
  // when state = 0, 1-0 = 1
  state = 1-state;
  // write current state to led pin #8
  led8.write(state);
  // schedule imp to sleep for .5 seconds.
  imp.sleep(0.5);
  // write current state to led pin #9
  led9.write(state);
  // schedule imp to wakeup in .5 seconds and do it again.
  imp.wakeup(0.5, blink);
}
// start the loop
blink();

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 goes Wireless

The Galileo is a great single board computer. However one thing that makes the board even more attractive is the simple support for WiFi. This blog outlines the steps necessary to get Galileo with WiFi working.
According to post in the Intel forum Galileo will work with the Intel Centrino N135 and N6205. However after reading the great post from Sergy I could not resist the temptation and got a Intel® Centrino® Advanced-N 6235 card from a local computer store. I then also had to get a pair of antennas and the half mPCI card extender.
Here are a few things you need before you start:

  1. A computer with the Arduino IDE for Galileo installed
  2. A network router with a DHCP server running
  3. An Ethernet cable to connect the Galileo board to your network
  4. An empty SD card or USB thumb drive

As my WiFi card is not supported out of the box I had to add the driver and firmware support. Here are the steps to do this:
(Note: instead of booting from a microSD card, you can also use a USB thumb drive and a USB-to-microUSB OTG-adapter cable). This is  not advertised widely, but see Galileo forum post for details

    1. Head over to Wireless Linux site and download the Linux diver for the Intel Centrino Advanced-N 6235. The file name is iwlwifi-6000g2b-ucode-18.168.6.1.tgz
    2. Attach your Galileo to your network router with a standard Ethernet cable
    3. Download the sketch source code below. Modify the MAC address in the sketch to match you Galileo board’s MAC address printed on the label on the Ethernet plug.
      #include SPI.h
      #include Ethernet.h
      // the media access control (ethernet hardware) address for the Galileo:
      byte mac[] = { 0x98, 0x4F, 0xEE, 0x00, 0x08, 0x2D};
      //the IP address for the Galileo:
      byte ip[] = { 192, 168, 0, 2 };
      void setup()
      {
          Serial.begin(9600);
          Serial.println("Attempting to start Ethernet");
          if (Ethernet.begin(mac) == 0) {
              Serial.println("Failed to configure Ethernet using DHCP");
              Serial.println("Attempting to configure Ethernet using Static IP");
              Ethernet.begin(mac, ip);
          }
          Serial.print("Your IP address: ");
          Serial.println(Ethernet.localIP());
      }
      void loop () {}
    4. Compile and upload the sketch.
    5. Open the Serial Console in the Arduino IDE. You should see a Message that reports the IP address assigned by your DHCP server “Attempting to start Ethernet” “Your IP address: 192.168. 1. 49”
    6. Do a full format  of a microSD Card (no Quickformat)
    7. Copy all the files from Prepare the microSD Card
    8. Plug the micro SD card into the SD card slot on the Galileo Board
    9. Boot your Gallileo board by pushing the REBOOT switch and wait until you see the board dectected by your computers USB port.
    10. Use SSH (mindterm or scp) to copy the file iwlwifi-6000g2b-6.ucode WiFI firmware  to the /lib/firmware/ folder of you Galileo
    11. Generate the WPA credentials:
      %wpa_passphrase NETWORK_NAME << EOF > /etc/wpa_supplicant.conf
      > YOUR_PASSWORD
      > EOF
    12. Start the network with:
      %/etc/init.d/networking restart
    13. Shut down the WiFi with:
      %ifdown wlan0
    14. Start up the WiFi
      %ifup wlan0

Using the IP address that the Galileo reported in the Serial Terminal you should be able to telnet into the board. This will give you a Galileo Linux terminal prompt.

Is Edison competing with Galileo

Last summer at the Maker Fair in Rome Intel announced the Galileo single board computer . This week at CES 2014 in Las Vegas Intel followed up with another initiative that carries an inventors name. This time it is Edison. The Edison board is more advanced take on the Quark System on a Chip (SoC) based single board. The board is only the size of an industry standard SD card. So don’t expect to solder it yourself.
edison
However the card is a full featured single board computer that will offer support for multiple operating systems (OS).  The integrated WiFi will turn any device equipped with an Edison into an IoT solution.
Intel also promised to release design files that will make it easy to  integrate Edison into your own project.  Among the tool vendors that will support Edison is Autodesk. The company just announced the  acquisition of circuit.io. This online PCB design tool is now a part of Autodesk’s 123D design suite.
For those that cannot wait and want something today the Electric Imp Wireless SD-CARD is an interesting alternative. This card is clearly not as powerful as an Edison. However given the creativity that innovators have displayed around the meager Arduino 8-bit AVR CPU  it may still be plenty.
El_Imp