Posts Tagged ‘open source’

$55 OpenMV Cam M7 Open Source Computer Vision Board is Powered by an STM32F7 Cortex-M7 MCU

January 2nd, 2017 6 comments

I wrote about Jevois-A33 computer vision camera based on Allwinner A33 quad core Cortex A7 processor last week, and today, I’ve come across OpenMV Cam M7 open source computer vision board based on a much less powerful STMicro STM32F7 ARM Cortex M7 micro-controller, but with the advantage of consuming less power, and exposing some extra I/Os.

openmv-cam-m7OpenMV Cam M7 board specifications & features:

  • MCU – STMicro STM32F765VI ARM Cortex M7 @ up to 216 MHz with 512KB RAM, 2 MB flash.
  • External Storage – micro SD slot
  • Camera
    • Omnivision OV7725 image sensor supporting 640×480 8-bit grayscale images or 320×240 16-bit RGB565 images at 30 FPS
    • 2.8mm lens on a standard M12 lens mount
  • USB – 1x micro USB port (Virtual COM Port and a USB Flash Drive)
  • Expansion – 2x 8-pin headers with SPI, I2C CAN bus, asynchronous serial bus (Tx/Rx), 12-bit ADC, 12-bit DAC, 3x I/Os for servo control; interrupts and PWM on all I/O pins; 3.3V (5V tolerant)
  • Misc – RGB LED and 2x 850nm IR LEDs
  • Power Supply – 5V via micro USB port, 3.6 to 5V via VIN pin
  • Power Consumption (@ 3.3V) – Idle: 110mA;  active no μSD Card: 190mA; active with μSD Card: 200mA
  • Dimensions – 45 x 36 x 30 (H) mm
  • Weight – 16 grams
Click to Enlarge

Click to Enlarge

The camera board supports frame differencing (motion detection), marker tracking, face detection, eye tracking, color tracking (up to 32 colors at the same time), optical flow, edge/line detection, template matching, image capture (BMP/JPG/PPM/PGM), and video recording (MJPEG/GIF). Programming is done in OpenMV IDE using MicroPython language. You’ll find more details in OpenMV Cam’s documentation, and watch a description of the board and a QR code detection demo in the video below.

The computer vision board can be pre-ordered now for $55 on the product page with shipping scheduled for March 2017.

How to Build and Flash ESPurna Open Source Firmware to Sonoff POW Wireless Switch

December 3rd, 2016 33 comments

ITEAD Studio Sonoff family is comprised of various inexpensive ESP8266 WiFi power switch, and the company sent me two of their latest CE certified models with Sonoff TH16 + external temperature & humidity probe, and Sonoff POW to measure power consumption. I checked the hardware is the first part of the review, and used Sonoff TH16 to control a water pump with the stock firmware and Ewelink Android app in the second part. It works reasonably well, but it relies on the cloud, so if you lose your Internet connection or the service closed, you can’t control the relay manually anymore. Luckily, the UART pins are exposed on Sonoff switches so you can solder a 4-pin header and connect a USB to TTL to flash your own firmware.

Click to Enlarge

Click to Enlarge

Please don’t connect Sonoff devices to the mains when programming them, it’s very dangerous, instead the USB to TTL board will power the system, and will allow you to program the board safely. Later you’ll be able to update the firmware, if needed, over the network.

The next step is to select the firmware you want to use, and I’ve been advised two firmware for ESP8266, namely ESPurna specifically designed for Sonoff devices, and ESPEasy with a larger community of users. The latter may be usable to control the relay, but it has yet to support HLW8012 chip used to measure power consumption in Sonoff POW, so I decided to go with ESPurna.

That’s the description of the firmware from its bitbucket page:

ESPurna (“spark” in Catalan) is a custom C firmware for ESP8266 based smart switches. It was originally developed with the ITead Sonoff in mind. Features:

  • Asynchronous WebServer for configuration and simple relay toggle with basic authentication
  • Communication between webserver and webclient via websockets with secure ticket check
  • Flashing firmware Over-The-Air (OTA)
  • Up to 3 configurable WIFI networks, connects to the strongest signal
  • MQTT support with configurable host and topic
  • Manual switch ON/OFF with button (single click the button)
  • AP mode backup (double click the button)
  • Manual reeset the board (long click the button)
  • Visual status of the connection via the LED
  • Alexa integration (Amazon Echo or Dot) by emulating a Belkin WeMo switch
  • Support for automatic over-the-air updates through the NoFUSS Library
  • Support for DHT22 sensors
  • Support for the HLW8012 power sensor present in the Sonoff POW
  • Support for current monitoring through the EmonLiteESP Library using a non-intrusive current sensor (requires some hacking)
  • Command line configuration

I could not find firmware release for ESPurna, but Xose Pérez – the developer – has provided some basic instructions to build and flash the firmware to Sonoff. Those are not really detailed however, and it took me nearly a full day to successfully build and flash the firmware to Sonoff POW, mostly because I was not quite familiar with most of the tools used. So I’ve reproduced the step I went through in Ubuntu 16.04, and hopefully this can help people getting things done more quickly.

Let’s retrieve the source code, and enter the code directory first:

You can build the project with PlatformIO or the Arduino IDE. The instructions are for PlatformIO so that’s what I used. There are two ways to build the code with the project wither using Platform IDE for Atom and the command line, or simply using the command line. With insights, I ended up using the command line, but I’ll show both methods.

Setup PlatformIO IDE for Atom to build ESPurna

First, you’ll need to download PlatformIO IDE for Atom for your operating systems, and install it. For Ubuntu 16.04, I selected “Download .deb” for Linux and installed it through through Ubuntu Software program. Alternatively, after download, you can install it from the command line:

You can now start Atom program in Ubuntu dash, select Open Project, and browse for espurna/code directory to load the project we’ve just gotten from Bitbucket.

Click to Enlarge

Click to Enlarge

The tick button on the top left corner is to build the project, and the right button just under is to upload the firmware to the target board. But if we try to build the firmware now it will fail with an error about “espressif8266_stage”. That’s because we need to install Espressif 8266 (Stage) development platform. First we need to enable Developer mode in the IDE by going to the top menu to select PlatformIO->Settings->PlatformIO IDE, and checking “Use development version of PlatformIO“.


Click to Enlarge

Now install PlatformIO shell commands from either a system Terminal, or PlatformIO IDE terminal (PlatformIO->Terminal->New Terminal):

and finally install ESP8266 development platform:

At this point you can click on the tick icon to build the default “node-debug” environment, a build output window will show in the IDE, and quickly disappear if the build is successful.

Setup PlatformIO via Command Line to Build ESPurna

If instead we want to use the command line we can install the latest pip version, the developer version of PlatformIO, and the staging version of ESP8266 development platform:

You can check the build environment is set properly by running the following command in espurna/code directory:

It will automatically download, build and install all dependencies and build for “node-debug” firmware for NodeMCU board. If it is successful, it will end as follows:

So I find the command line option much more easy and straightforward.

Build ESPurna for Sonoff POW

However, we are not using NodeMCU board here, but Sonoff POW, and there are two environments defined just for that:

  • sonoff-pow-debug – Build firmware to flash over serial
  • sonoff-pow-debug-ota – Build OTA firmware to upgrade the firmware over the network

The parameters for each environment are all defined in platformio.ini. First we need to build sonoff-pow-debug environment:

But it failed with an error message related to hlw8012 library:

I reported the issue on Bitbucket, but the main developer could not reproduce the issue. Eventually I found out that it could be a PlatformIO bug, as the system does not recursively checking for includes outside of main.ino. So I added <hlw8012.h> in the main.ino as follows:

and the build could complete:

Since we’ve already changed the code, you may also consider changing “#define ADMIN_PASS  fibonacci” in code/src/config/general.h to use a different default password. The password can also be changed in the web interface, but this makes sure you won’t have a device somewhere with the default password common to most users.

Flashing Firmware to Sonoff POW

Now that we’ve made sure the firmware could build, it’s time to flash it to the device.

First we need to setup some udev rules to allow flashing over serial:

Now connect the USB to TTL to a USB port on your computer, press the button (connected to GPIO0) on Sonoff POW for several seconds until both LEDs are off to make sure you are in bootloader mode, and start flashing with:

Success! Great. If you have your own firmware to flash it may be useful to know the actual command used to flash the firmware was:

Building and Flashing the ESPurna filesystem

Wait! We’ve just flashed the firmware, isn’t it all? Nope, as the webserver files are stored in another partitions, and compressed in a single index.html.gz file for better performance. The exact reasons why are further explained here.

We’ll need Node.js and gulp command line client:

Now inside espurna/code folder , we can check if building the file systems works with two commands:

Here my successful gulp attempt:

Finally, we can run the following (which also runs the two commands above) to flash the file system to the board, after entering bootloader mode by pressing the button:

Now that’s done.

A Quick look at ESPurna Web Interface

ESPurna firmware and filesystem has now been flashed to Sonoff POW. But does it work?

Click to Enlarge

Click to Enlarge

I can see a new SONOFF_POW_XXXXX access point, so that does look good. I can connect using the default password “fibonacci”, then go to my web browser to access, and login again with admin/fibonacci credentials.

Click to Enlarge

Click to Enlarge

ESPURNA 1.03 interface goes to the status menu first, and there I can turn on and off the relay remotely, and check the power consumption in watts, which remains at 0 watt since I have not connected it to the mains yet. It’s also possible to turn the relay on and off with the button, and there an option to select whether to turn on or off the relay at boot time, which is great since I need it on at all times.

The web interface also allows you to change general parameters including the hostname and password, as well as enable or disable the HTTP API (disabled by default). The WiFi section is used to connect to up to 3 wireless routers, the MQTT section lets you configure an MQTT (Mosquito) broker, and the power section is used to calibrate the power monitoring device.

If you just intend to check the current power consumption and turn on and off the switch with your phone, you don’t have to do anything else. But I’d like to find some ways to draw daily, weekly, monthly charts of my office power consumption using either MQTT or the HTTP API. I’ll have to study how to do that, and that will hopefully be the topic of my next post about Sonoff POW.

Sonoff POW can be purchased on ITEAD Studio for $10.50 plus shipping, but is currently out of stock with the company manufacturing a third batch soon.

Hack Autonomous Driving into Your Car with Open Source Hardware Comma Neo and Open Pilot Software

December 1st, 2016 4 comments

George Hotz setup company and worked on a commercial project called Comma One to add autonomous driving to some car models, but then the US highway authorities started to ask questions and promised ever increasing fines if he could not comply with some specific safety regulations/requirements, and eventually he decided to cancel the project due to the regulatory burden. A few weeks passed since the cancellation, and he has now released Open Pilot auto-pilot software and Comma NEO a work-in-progress open source hardware platform connecting to Qualcomm Snapdragon 820 powered OnePlus 3 smartphone to run the software.

Comma NEO

Comma NEO

The system is said to implement “Adaptive Cruise Control (ACC) and Lane Keeping Assist System (LKAS) for Hondas and Acuras”, and performs about the same as “Tesla Autopilot at launch, and better than all other manufacturers”.

Open Pilot currently only supports the Acura ILX 2016 with AcuraWatch Plus and the Honda Civic 2016 Touring Edition, but since the software is open source, it should be possible to adapt it to other Honda and Acura models with some tinkering, and other car manufacturers could also be added to the list but would require much more work. The system leverages the cars’ cruise control system which becomes disabled at lower speed, so self-driving only works at higher speeds, 18+ mph or 25+ mph depending on the car’s model.

The video above should be using Open Pilot software, but I’m unclear which exact hardware it is using (Comma One or Comma NEO).

The software also has the following disclaimer “THIS IS ALPHA QUALITY SOFTWARE FOR RESEARCH PURPOSES ONLY. THIS IS NOT A PRODUCT. YOU ARE RESPONSIBLE FOR COMPLYING WITH LOCAL LAWS AND REGULATIONS. NO WARRANTY EXPRESSED OR IMPLIED”. But if it does not bother you, George has put together a step by step guide showing exactly how to buy all parts (~$700) from 6 different shops, solder the components to NEO Rev A board, wire and test the board, and assemble the case.

Via Arstechnica and Nanik.

$59 HiFive1 Arduino Compatible Board is Powered by Sifive Open Source RISC-V MCU (Crowdfunding)

November 30th, 2016 8 comments

Royalty-free RISC-V instruction sets has been getting in the news in the last few years with various MMU designs from companies or projects like lowRISC, PULPino, and SiFive, and recently there are been rumors that Samsung may use RISC-V in their future IoT SoCs. Many projects are still in progress, and while you can get involved in OnChip Open-V MCU crowdfunding campaign to their get the MCU or a development board, the cost for the MCU ($49) and development board ($99) is a little on the high side, and delivery is expected in 2018 for most rewards. SiFive appears to have a more interesting open source RISC-V solution with HiFive1 Arduino compatible board going for $59 and slated to ship between December 2016 and February 2017.

HiFive1 Board

HiFive1 Board

HiFive1 development board specifications:

  • MCU – SiFive Freedom E310 (FE310) 32-bit RV32IMAC processor @ up to 320+ MHz (1.61 DMIPS/MHz)
  • Storage – 128 Mbit SPI flash
  • I/Os
    • 19x Digital I/O Pins
    • 19x external interrupt pins
    • 1x external wakeup pin
    • 9x PWM pins
    • 1/3 SPI Controllers/HW CS Pins
    • I/O Voltages –  3.3V or 5V supported
  • USB – 1x micro USB port for power, programming and debugging
  • Power Supply – 5 V via USB or 7 to 12V via DC Jack; Operating Voltage: 3.3 V and 1.8 V
  • Dimensions – 68 mm x 51 mm
  • Weight – 22 g


The company’s Freedom SDK with the RTL files for Freedom E310 (and U500) MCUs will allow you to actually play and/or modify the MCU on an FPGA platform, which can be useful for education or if you want to create your own MCU based on SiFive design. If you don’t have the know-how the company’s “chips-as-a-service” offering can customize FE310/U500 MCU to meet your needs.

 Most users will probably just program the board with the Arduino IDE, and many of the usual development tools have already been ported to RISC-V architecture. The processor is also quite faster than our typical Arduino, being about 10 times faster than Intel Curie and Atmel SAMD21G18 used in respectively Arduino 101 and Arduino Zero.


Power efficiency (@ 200 MHz) appears to be much higher compared to Atmel AVR and Intel Quark. However, based on ARM Cortex M0 product brief (I could not find data for M0+), 10DMIPS/mW can be achieved using 180ULL process, and 75 DMIPS/mW with 65LP process.

If you are interested, you can get the board on Crowdsupply with the HiFive1 devkit going for $59 and shipping in February 2017, but if you want to have a piece of history, you may consider HiFive1 Founder Edition for $79 with SiFive Founding Team’s Signature on the silkscreen and shipping at the end of December 2016. Shipping is free to the US, and $15 to the rest of the world.

RISC-V could be a serious competitor to ARM and MIPS in the MCU/IoT space in the years ahead, as it’s royalty-free, and the RISC-V foundation has many players including some heavy weights such as Google, AMD, Microsemi, Qualcomm, Nvidia and more…

Thanks to noone for the tip.

$49 Dashbot Car Dashboard Assistant is Powered by C.H.I.P Pro Allwinner GR8 Module (Crowdfunding)

November 18th, 2016 2 comments

Most companies specializing in development boards may sell a few accessories for their boards, but usually leave product design to their customers. Next Thing Co. does that too, but the company also produces some products like PocketCHIP portable Linux computer & retro game console, and more recently Dashbot, a voice controller assistant for your car’s dashboard powered by CHIP Pro module.


Dashbot hardware specifications:

  • CPU Module – CHIP Pro with Allwinner GR8 ARM Cortex A8 processor @ 1.0 GHz, 512MB NAND flash, 256 DDR3 RAM, 802.11 b/g/n WiFi, Bluetooth 4.2
  • External Storage – micro SD slot
  • Display – Red LED display
  • Audio – 32-bit audio DSP for beamforming & noise suppression; fairfield audio pre-processor with 24-bit ADC; high fidelity MEMS microphone array (106 dB dynamic range)
  • USB – 1x USB host port
  • Power Supply – 5V via USB port or 12V via power port (aka cigarette lighter) + backup LiFePo4 battery
  • Dimensions – 84 x 60 x 28 mm

The bot runs mainline Linux, source code will be available, as well as hardware design files making open source hardware (likely minus CHIP Pro module itself). Once you’ve stuck the magnetic adhesive mount to the dashboard, and placed Dashbot on top, you can connect it to your car stereo via Bluetooth or your car’s auxiliary jack. Wait what?  My car does not have any of those two connection methods… But no problem as the company also offers a Retro Pack adding an FM transmitter and cassette adapter for older cars.

dashbot-connection-guideThe main goal of Dashbot is to keep your smartphone in your pocket, and control it with your voice in order to keep your eyes on the road. But you’ll still need your phone, and after installing Dashbot app on your Android 5.0+ or iOS 10+ smartphones, you’ll be able to tell Dashbot to start playing music from online services like Spotify, Soundcloud, Google Play Music, and others, or tell it to “go home” and it will show the directions from Google Maps on the red LED display, and of course you can also answer phone calls, and reply to SMS.

Dashbot “AI powered hands-free car kit” launched on Kickstarter a few hours ago, has already raised over $50,000, and I’m confident it will surpass its $100,000 funding target. A $49 pledge should get you Dashbot, a power port for your cigarette lighter and an AUX cable, but if you have a car with a stereo that does not come with Bluetooth nor an AUX IN jack, you can get the Retro Pack for $65 with an FM radio/cassette player adapter. They also have rewards with an OBD-II dongle, and bundles with multiple Dashbots. Shipping adds $9 or more depending on rewards and destination, and delivery is planned for July 2017.

GR-LoRa is a Reverse-Engineered Open Source Implementation of LoRa PHY

November 15th, 2016 8 comments

LPWAN standards such as LoRa or Sigfox allow you to transmit data over long distance, at ultra low power (up to 10 years on a AA battery), and for free if your use your own network (P2P or gateway), or a few dollars per years if you go through a network provider. The low cost is possible since those standards rely on 900 MHz ISM bands, meaning nobody has to pay millions of dollars to the government to obtain a license fee. Matt Knight looked at LoRa, and while Level 2 and 3 of the protocol (LoRaWan) has public documentation, Level 1 (LoRa PHY) is proprietary and the standard is proprietary.

microchip-rm2903-ettus-b210-sdrSo he decided to reverse-engineer LoRa PHY using Microchip RN2903 based LoRa Technology Mote and Ettus B210 USB software defined radio, and software packages and tools such as Python and GNU Radio to successfully deliver GR-LoRa open source “GNU Radio OOT module implementing the LoRa PHY”.  He presented his work at GNU Radio Conference 2016 on September 15, and the video is worth a watch. He first explains why LPWAN IoT standards are awesome, the motivation about reverse-engineering work (mostly security), the hurdle (e.g. lies in documentation), the results, and work to be done.

You’ll find the presentation and the research paper on Github.

Thanks to Emanuele for the tip.

RabbitMax Flex IoT & Home Automation Board and Kit for Raspberry Pi

October 7th, 2016 5 comments

RabbitMax Flex is an add-on board for the Raspberry Pi boards with 40-pin headers, namely Raspberry Pi Model A+ and B+, Raspberry Pi 2, Raspberry Pi 3 and Raspberry Pi 0, destined to be used for Internet of Things (IoT) and home automation applications thanks to 5x I2C headers, a relay, an LCD interface and more.

I’ve received a small kit with RabbitMax Flex boards, a BMP180 temperature & barometric pressure I2C sensor, and a 16×2 LCD display.

Click to Enlarge

Click to Enlarge


RabbitMax Flex specifications:

  • Relay – Songle SRD-05VDC-SL-C supporting 125V/250VAC up to 10A, 30VDC up to 10A
  • Storage – EEPROM with some system information for identification
  • IR – IR LED, IR receiver
  • Misc – Buzzer, Button, RGB LED
  • Expansion
    • Header for LCD character display + potentiometer for backlight adjustment
    • 5x 4-pin headers for I2C sensors
  • Dimensions – Raspberry Pi HAT compliant
Click to Enlarge

Click to Enlarge

The assembly of the kit is child’s play as you don’t even need tools. First insert the HAT board on top of your Raspberry Pi board, add the LCD display, and whatever I2C sensors you please.

Click to Enlarge

Click to Enlarge

I’ve done so on my Raspberry Pi 2 board and battery kit. I have not tried the software part yet, but the platform has been tested on Raspbian, with a custom Linux OS built with the Yocto Project coming soon. Currently three sensors are supported including a temperature and barometric pressure sensor (BPM180), a temperature and humidity sensor (HTU21) and a light sensor (BH1750), but you could also connect any other I2C sensors provided you work on the code to enable support.

You’ll find documentation, software, example projects, tools, and soon KiCAD files on RabbitMax github’s account, and some extra info on website. RabbitMax Flex board is now sold for $49.90 on, but if you are patient enough, you should be able to buy it for a significantly lower price via an upcoming crowdfunding campaign.

BeagleBone Black Wireless Board Gets WiFi and Bluetooth 4.1 LE, Drops Ethernet

September 27th, 2016 No comments

The BeagleBone Black is still one of the most popular development boards around, but in a world going more and more wireless, it only comes with a wired Ethernet interface. Seeed Studio BeagleBone Green Wireless and Neuromeka BeagleBone Air already provided BeagleBone compatible boards with WiFi and Bluetooth LE, as well as Zigbee for the latter, but now themselves have launched BeagleBone Black Wireless with WiFi and Bluetooth 4.1 LE based on Octavo Systems OSD3358 System-in-Package with Texas Instrument Sitara AM3358 processor, 512 MB RAM, TI LDO and PMIC, and many passive components.

Click to Enlarge

Click to Enlarge

BeagleBone Black Wireless specifications:

  • SoC – Texas Instruments Sitara AM3358 Cortex A8 @ 1 GHz with PowerVR SGX530 GPU
  • System Memory – 512 MB DDR3L
  • Storage – 4GB eMMC flash + micro SD slot
  • USB – 1x mini USB client port for power & communication, 1x USB host port
  • Connectivity – 802.11 b/g/n WiFi + Bluetooth 4.1 LE with 2x u.FL antenna connectors
  • Video & Audio Output – micro HDMI up to 1280×1024 resolution.
  • Expansion Connectors – 2x 46-pin headers
  • Misc – LEDs for WiFi, Bluetooth, Power, and 4x user LEDs; Reset, boot, and power buttons
  • Debugging – JTAG header, serial console
  • Power – mini USB, DC Jack, or 5VDC via expansion header
  • Dimensions – 86.4 x 53.4 mm

The board is preloaded with Debian with Cloud9 IDE on Node.js with BoneScript.js library, and also support other Android and Linux based operating systems support by other BeagleBone boards. Cadsoft Eagle schematics and PCB layout have already been released on github. BeagleBone Black Wireless drops the Ethernet port just like BeagleBone Green Wireless, but keeps the micro HDMI port, which on Seeed Studio’s port is replaced by 4x USB ports and Grove connectors.

You’ll find some more details on Black Wireless page, and can purchase the board on Mouser (Part #: BBBWL-SC-562) for $68.75.