Hackster.io “Secure Everything” Hardware Box

Several months ago, the Hackster.io “Secure Everything with Azure Sphere” contest concluded. I didn’t win any prizes, but unexpectedly, I received an email saying that I was one of 20 winners for a box filled with “miscellaneous hardware” worth up to $200. I did not remember signing up for this raffle (neither did other contestants), but I was happy to get the hardware. About a month and a half later, the box showed up at my doorstep with the following parts:

  • Intel Edison with Arduino Breakout Board
  • Grove Starter Kit: IoT Edition
  • Ti Launchpad MSP-ESP432E401Y
  • Avnet SmartEdge Agile with Brainium
  • 3D Magnetic Sensor 2Go TLE493D A2B6
  • mikroBus ClickShield with unsoldered headers
  • Adafruit extra-length Arduino Shield headers
  • MikroElektronika Relay Click Board
  • CoolMOS MOSFET

I had predicted that some of the parts would probably be stock clearance, and Googling some of the parts, it appears that this is somewhat the case. The Intel Edison was discontinued in 2017, the Ti Launchpad is still for-sale (but has a 2017 copyright date on the box), and the Grove IoT Edition was built for the Edison (more on that later). Other parts, like the SmartEdge Agile are new, and the 3D Magnetic Sensor appears quite recent. This blog post is going to be a long guide to everything I learned about these parts in about 24 hours to save you the research if you are using any of these parts in your kit.

Naturally, I first opened up the Edison and plugged the module into the Edison board. It looks like a really powerful Arduino (and indeed has Arduino-compatible headers).

After putting the hardware together, then it came time to research how to get it to do something. I didn’t know much about the Edison, so I got researching and found some useful general information:

  • The Intel Edison runs an Intel x86 processor, running at 500mhz, running an OS called Yocto Poky Linux.
  • The board can be programmed using the Arduino IDE, including the latest release, as an Arduino.
  • The board oddly requires two microUSB cables for programming and flashing. One impersonates a 750MB flash drive for some reason, while the other shows the debug and Serial interface.
  • The barrel jack is Arduino-compatible. I used a 12V 2.5A adapter from a wireless router until I discovered the included one.

My first initiative was to set up the board using Intel’s guide, which sadly is significantly out of date. The main problem is that Intel’s Easy Setup tool was broken due to broken download URLs, which makes the whole setup process unnecessarily difficult. Here’s a rough list of what I did, and all instructions for Windows 10 1909.

Firstly, download IntelEdisonDriverSetup1.2.1.exe and run. This will set up the USB Drivers, even if Intel’s Setup tool won’t recognize it (more on that later).

Secondly, we need to update the board’s firmware. The following instructions are a simplified version of Intel’s instructions. Download the latest Yocto Poky image for the Edison. Unzip to a folder. Next, go to this address and download dfu-util.exe and libusb-1.0.dll, and place them in the same folder as the unzipped Poky image.

Chose the “File” menu in File Explorer, then choose “Open in new PowerShell window.” Run the following commands:

cmd
flashall.bat

This will flash the latest firmware, which will take several minutes.

Example of running the flashall script
Image from https://software.intel.com/en-us/flashing-firmware-on-your-intel-edison-board-windows

Now that the board is updated, you need to download latest Edison Configuration tool and run. First, make sure the Edison is fully connected like the image below:

This installer is partially broken, as it will not detect the USB drivers you set up earlier. However, it will present a window which looks something like this:

Of course, on your window, the password won’t be set and the board won’t be online. Paradoxically, the installer will be able to set up your password, SSH, and networking for your Edison despite saying that it isn’t detected and doesn’t have USB drivers. 🤷‍♀️ So, obviously, set up your network, password, and enable SSH, then exit the installer.

Now, open the Windows Device Manager, and look under COM/LPT. You should see something like this:

Make a note of that COM numbers next to USB Serial Port and Intel Edison Virtual Com Port. In my case, it’s COM7 and COM4, but yours may vary. Close Device Manager.

Now, download and install PuTTY. This will allow us to login to the Yocto Poky OS installed on your board. Open PuTTY and make the main window look something like this:

Replace the Serial Line option with whatever number you found for USB Serial Port, which in my case should be COM7 (though I typed COM4 incorrectly in the screenshot). Click Open. You will see an empty black window, this is normal. Press ENTER and you will see a login prompt. Sign in with the username root and the password you set earlier. You will now have a Linux command prompt.

This will come in handy later. For now, we want to program this thing like an Arduino. Download and install the latest Arduino IDE, and open it. Go to Tools menu > Boards > Boards Manager, and install the Intel i686 Boards package.

Next, choose Tools menu > Boards > Intel Edison. Then, under port, choose the port that you wrote down for Intel Edison Virtual Com Port. This is not the same port as you used earlier! That was the USB Serial Device port, this is a different one. In my case, it should be COM4. Finally, choose File > Examples > Basics > Blink.

Choose Upload. If everything goes well, your Edison’s onboard LED will begin blinking. Happy to have made it this far?

From this point, you should check out the Edison examples underneath the File menu, as there are examples for Ethernet, microSD cards, and other unique Edison functionality. But I soon ran into a problem. Due to a glitch with the latest (and last) release, Arduino sketches don’t automatically run when you reboot the Edison! Time to fix that, using more thorough instructions based on Intel’s defunct guide.

Using the PuTTY window, enter in the following commands (except for the stuff in <>s):

cd /etc/init.d
vi automateSketch.sh
<PRESS the S key on your keyboard>
#!/bin/sh
exec /sketch/sketch.elf /dev/ttyGS0 /dev/ttyGS0
<Press the ESC key on your keyboard>
:wq <ENTER>
<You should be back at the prompt. If you made a typo, press ESC and type :quit! to exit without saving.>
chmod +x /etc/init.d/automateSketch.sh
update-rc.d automateSketch.sh defaults

With those commands, the sketch should automatically load on boot. One problem I have not solved is that the sketch, when running on power and not connected to the computer, will freeze after exactly 5 minutes or 300 seconds. There are some online forum postings about this (use Google), but I will update this page once I get that fixed myself.

With that, the Edison is fully set up and ready to be used like an Arduino. It’s time for the Grove Kit!

The Grove kit: IoT edition was actually designed for use with the Intel Edison using a program called the Intel XDK. The Intel XDK looked like an impressive piece of software when it was available: It let you easily write smartphone apps which could react to the sensors that were attached to the Edison. This was all built in, and if you browse around in the Edison PuTTY window, you can find evidence of this with the multitude of files with “xdk” in the name.

 Intel® XDK
Image from https://intel-xdk.en.softonic.com

Alas, Intel shuttered the XDK in 2017, and I actually could not find any copies of the XDK online. All I could find were a few dead XDK installers which didn’t work due to broken links. So, I had to make do without the XDK, and wondered how one could use the Grove kit with the Arduino IDE.

It turned out easier than I had anticipated. Grove is well supported within the Arduino ecosystem, and so I could control each sensor using just the IDE and some libraries, which the Arduino IDE can easily install.

After some browsing (it was surprisingly hard to find this page), but I found the SeeeD Wiki for the Base Shield V2. It contains the code and diagrams for wiring together a simple circuit which uses a buzzer and button. It’s an excellent read, and the only change needed to the guide is that instead of using the Seeeduino (a Chinese Arduino clone), just use the Edison!

enter image description here
Image from http://wiki.seeedstudio.com/Base_Shield_V2/

I was surprised that after you snap on the base shield, you can just directly access some simple sensors without using any library:

const int button = 2;       // connect a button
const int buzzer = 3;       // connect a buzzer
void setup()
{
    pinMode(button, INPUT); //set button as an INPUT device
    pinMode(buzzer, OUTPUT);   //set LED as an OUTPUT device
}
void loop()
{
    int btn = digitalRead(button); //read the status of the button
    digitalWrite(buzzer, btn);
    delay(10);
}

The button is in slot 2, the buzzer in slot 3. Despite all of the pins and complications of the Base Shield, there’s no library needed for these simple sensors. What about something fancier though, like the included LCD?

For that, a library is needed, and it’s really best to just look up the part exactly as named on the Seeed Wiki. For the LCD, that’s available here.

The are only two things I’d add to the wiki: The first is that the wiki shows how to download the code from GitHub and add it to the IDE. This works, but there’s a simpler way. Go to Sketch > Include Library > Library Manager, and then search for “Grove.” Simply find your sensor in the list (in this case, the Grove LCD library) and choose Install. After that, just copy-paste an example sketch and try it out.

The second thing I’d add is that the Base Shield V2 comes with a voltage switch for 3.3V or 5V, and is set to 3.3V by default. The LCD and some other sensors require 5V, and so the LCD is blank (even though the backlight is illuminated) if the switch is on 3.3V. That had me confused for a while.

So, overall, that’s the Intel Edison and Grove Kit. I haven’t got to the mikroBus shield yet or the Relay Click board, but I assume that if it’s for the Arduino Uno, there’s probably a good library for it.

Time to shift gears: What about the Texas Instruments Launchpad board? To be honest, I had no idea what to do with it. I first installed the MSP432 SDK, then the Code Composer SDK. I used the On-Demand installer, chose “Custom Install,” and installed only the MSP432 components.

After installing these essential components, I opened up Code Composer, and tried reading Texas Instruments’ guide to making a Hello World program, but… it’s a mess for a hobbyist. It’s like C++, and it’s really, really complex. If this was a professional system, it would be great, but it’s just absolute overkill for almost any hobbyist.

Image from https://processors.wiki.ti.com/index.php/File:CCSv4_IDE_Debug.jpg

Upset, I started looking for anything simpler and found out about Energia. Energia lets you program the Ti board like a really fancy Arduino, and I was instantly sold. I downloaded it and tried it, and… it didn’t work.

It turns out that my board, the Ti MSP432E401Y, isn’t really supported correctly by Energia without some hacking. Using a pile of forum posts, I’ve figured out what needs to be done.

First, download the latest Energia release for Windows. Open Energia, and then choose Tools > Board > Boards Manager. Install the MSP432E Ethernet Red Boards package and the Energia TivaC Boards package. Close the Boards Manager.

Next, open File Explorer and navigate to the following address:

C:\Users\YOURUSERNAME\AppData\Local\Energia15\packages\energia\hardware\msp432e\5.19.0

Edit platform.txt by replacing the contents with the code at my GitHub gist: https://gist.github.com/gjsman/83ef53f1c91d74989a5d403246021489

(I’ve also filed a Pull Request to fix support for the MSP-EXP432E401Y in Energia, but no telling when it will get merged.)

Finally, open Device Manager again, and find the COM port for your Ti Launchpad. The Launchpad oddly has two COM ports, one main and one auxiliary. Both, I believe, should work.

Going back to Energia, change the Board under the Tools menu to Launchpad /w MSP432E (120mhz), and the COM port to your Launchpad. Click the “Open” button, go to “Examples > 10.Multitasking > MultiBlink.”

Click Run, and if luck is on your side, the code will run on your Ti Launchpad. You will notice that three LEDs will be flashing on the Launchpad different rates. One will be flashing 5 times per second, one twice per second, and one once per second. This is a neat demo of the Launchpad’s abilities: It’s actually three separate sketches, each with the similar code to the standard Arduino Blink example, running simultaneously! Each tab in the sketch pile runs simultaneously with the other tabs. Awesome!

And after all of that, I think that is the end to this unnecessarily long blog post. I didn’t touch the Avnet Brainium system, or the Click Shield, or figure out what the MOSFET is for, or the Magnetic sensor, but I hope that this will help those who received the kit to get started and to make some great projects. 🙂

Read Part Two

Published by Gabriel Sieben

Gabriel Sieben is an 18-year-old college student from St. Paul, MN, who enjoys experimenting with computers and loves to share his various technology-related projects. He owns and runs this blog, and is a devout traditional Catholic. In his free time (when not messing with computers), he enjoys hiking, fishing, and board games.

Join the Conversation

3 Comments

Leave a comment

Your email address will not be published. Required fields are marked *