Wednesday, 3 May 2017

Udoo X86 Power On / Off via BLE on Arduino 101

I finally received my UDOO X86, I backed on Kickstarter on April 2016!

To give a little of context, it is a board designed by UDOO sporting an Intel x86 CPU (64bit, different depending if you have a BASIC, ADVANCED or ULTRA), 2/4/8GB or RAM (soldered) and a LOT of peripherals and I/O.
To mention some of them:
  • M.2 Key E port
  • Gigabit Ethernet
  • 3x USB 3 Ports
  • 1 HDMI and 2x DisplayPort
  • GPIO
  • 2x COM ports
  • RTC
  • I2C

In addition, they managed to put on the same board a Genuino/Arduino 101 board (Intel Curie), with BLE and 6 axis accelerometer & gyroscope.
Everything on a board more or less twice the size of the RaspberryPi.

More details can be checked on the official documentation page on the UDOO site.

I am writing this tutorial from the board itself and I can tell it can be used as desktop/HTPC without any major issues.

One cool feature of the Arduino 101 is it is able to Power On/Off the main CPU via Interrupt!

I am going to tell you how to be able to remotely power on and off the main CPU via BLE.

I am using LUbuntu 16.04 as OS, but those instructions should work pretty well on any operating system, even MS Windows.

Grant Power management to Intel Curie


Verify the BIOS/EFI settings are as shown in this page.

Prepare the Arduino environment


Install the Arduino IDE from the official site and install the Intel Curie Arduino 101 Libraries & Tools. You could do the same with PlatformIO, but I am not quite sure about the Intel Curie support.

Check you select the correct board type, programmer and serial port in the Tools menu.


Remember to give your user the rights to write to the serial port executing:

sudo usermod -a -G dialout

You have to logout to make those changes taken into account.

In addition to that, it could be necessary to execute the following script:

wget -O - https://raw.githubusercontent.com/01org/corelibs-arduino101/master/scripts/create_dfu_udev_rule | sudo bash

This is required to make the Arduino capable of resetting the board to put it in programming mode.

Check everything works fine uploading a simple example sketch (pick the Basic/Blink one).

The blinking led is the one close to the HDMI port

Upload the sketch to receive commands from BLE

Let's start with a skeleton sketch Intel prepared for us.

Choose the example from CurieBLE/Peripheral/CallbackLED.

Upload it to the board.

Follow the instructions shown on this page to configure the Android application.

All you need to do is to pair to the Arduino101 BLE device, which will be shown as LEDCB.
Once you're connected, you'll be able to write 0 or 1 to a variable exposed by the service implemented in the sketch.
The variable will power on and off the LED depending on the value of the variable.

Adapt the sketch to send a Power signal to the main board


We need to add a simple function to send a LOW digital signal for 20ms on the PIN number 9, followed by a HIGH digital level.
This generated wave will be caught by an intermediary SMT32, which will send the power interrupt to the Intel Atom/Celeron/Pentium.



The whole board will react on the interrupt, including the Arduino 101, which will be restarted, losing any unsaved state.
It means everything which follows the execution of the function sendPowerSignal is actually useless, as the Arduino 101 will reboot.

Issues (2 May 2017)


I am unable to fully verify it is working since on shutdown the board actually gets powered on.
Possible root cause:

  • BLE is interacting with the PIN number 9
  • When the Arduino 101 is reset, the PIN 9 goes again low triggering a power on


Those facts seem not impacting just my board, as I found a forum post you can check here where another user faced the same problem.

I can also confirm that if I suspend the system, the Arduino 101 is no more visible on Bluetooth, so it means it gets powered off.

UPDATE (3 May 2017)!

I've been in touch with UDOO team and they'll provide a solution probably by the end of this week.
I'll keep you posted!
Post a Comment