Archive

Posts Tagged ‘javascript’

Google’s Teachable Machine is a Simple and Fun Way to Understand How Machine Learning Works

October 9th, 2017 4 comments

Artificial intelligence, machine learning, deep learning, neural networks… are all words we hear more and more today, as machines get the ability to recognize objects, answer voice requests / commands, and so on. But many people may not know at all the basics of how machine learning works, and with that in mind, Google launched Teachable Machine website to let people experiment and understand the basics behind machine learning without having to install an SDK or even code.

So I quickly tried it with Google Chrome, as it did not seem to work with Mozilla Firefox. It’s best to have audio on, as a voice explains how to use it.

Basically you connect your webcam, authorize Chrome too use it, and you should see the image in the input section on the left. After you’re being to train the machine in the learning section in the middle with three difference classes. You’ll be asked to wave your hand and keep pressing on the “Train Green” button until you have at least 100 examples. At this stage, the machine will always detect the green class since it’s all that it knows. Then you can train the Purple class by staying still, and again make sure you have at least 100 examples before you release the button. Now the machine should be able to detect when you stay still or move with a varying percentage of confidence. The output section will just show some animated GIFs, or play sound or words depending on what it detects.  It can learn actions (still, wave hands, clap hands) and object detections. My webcam is pretty bad, but if you have a good image, you should be able to also detect feelings like happiness, sadness, anger, anxiousness, etc… Give it a try it’s fun.

The Teacheable Machine has been built with a new open source hardware-accelerated JavaScript library called deeplearn.js,and Google released the source code for the website too.

Getting Started with Espruino & JavaScript on ESP32 with ESPino32 Board

September 11th, 2017 No comments

Venus Supply Co., Ltd, better known as ThaiEasyElec, is a company based in Thailand, selling embedded systems and development board, as well as providing development services based in Thailand. The company sent me their latest board called ESPino32 powered by Espressif ESP-WROOM-32 WiFi and Bluetooth module for evaluation. While the board is supported in Arduino-esp32, I’ve already tested Arduino with ESP32-Bit module & ESP32-T board, so after checking out the hardware, I’ll load it with something different: Espruino, a firmware allowing for JavaScript programming over the serial console, or a Web based IDE.

ESPino32 Unboxing and Soldering

The board shipped with four female headers, and I/O stickers.

Click to Enlarge

The board includes ESP-WROOM-32, exposes I/Os through four 10-pin headers, features CP2104 chip for serial to USB debugging via micro USB port, two buttons (reset and program), a user LED connected to IO16, and a jumper to select between regulated power supply (micro USB or Vin), or battery power (Vbat).

Click to Enlarge

If you’re going to integrate your board in a project, you may want to use it asif without header to save on space, but for prototyping and use with a breadboard, we should start by soldering the four female headers. It’s even a little easier than with other headers, since you can simply place the board on top of the headers to do the soldering.

Click to Enlarge

Once we’re done, we can apply the stickers on all four headers, which will make it easier to play with while connecting the jumper cables.

Now we can insert the board into a breadboard, connect an external 5V LED through pin 16, and connect a micro USB cable to a computer to get power and access the board.

Click to Enlarge

A board with female headers has the advantage of providing two usable rows on each side of the board. With male-only you’d lose that extra row, unless you use a narrower board such as  ESP32 Pico Core board.

That’s the output I get when connecting the board to my Linux computer:

Quick Start Guide for Espruino on ESP32

Espruino has a page about ESP32 support that explains what is working:

  • onewire
  • hardware SPI
  • hardware I2C
  • DAC
  • ADC
  • Serial
  • WIFI – as a client and access point

and what is not (yet):

  • Over-The-Air (OTA) firmware updates.
  • Bluetooth and BLE

So we can’t play with Bluetooth, but WiFi and GPIO should work. There are also some instructions in that page which I will follow and adapt (since some are not working/out of date) below.

First we need to download the latest version of Espruino, in my case Espruino 1.94.

Espruino Firmware for various board – Click to Enlarge

The zip file includes firmware for all supported platforms include the company’s own Espruino boards & Puck.js, Micro::bit, OlimeXino, Raspberry Pi, STM32 discovery boards, and more..

For our use, we need to get into espruino_1v94_espruino, where we’ll find 3 binary files (bootloader.bin, espruino_esp32.bin, and partitions_espruino.bin), as well as README_flash.txt that explains how to do the update in Windows with flash_download_tools_v3.4.4.zip, or in Linux with esptool.py from the ESP-IDF SDK. I’m running Ubuntu 16.04, so I’ll go with the later, but since most people won’t need to install the ESP-IDF SDK, you can instead get esptool from pip for Python 2.7 or 3.4 or newer:

if you’ve used esptool previously for other esp32/esp8266 board(s) before, you can upgrade esptool with:

In my case, I had installed an older version of esptool (v0.4.6) with apt when I played with NodeMCU board, so I removed it:

Now that we have the latest esptool utility installed, we can flash the image we’ve  just extracted:

It worked the first time. Log of successful installation:

At this point, in theory, you can install Espruino Web IDE chrome extension,  click on the connect icon on the left top corner, select /dev/ttyUSB0 port, and program away.

Click to Enlarge

Espruino Web IDE will also show in Ubuntu 16.04 dash. But in practise, there’s a known issue that the first time you won’t be able to connect through the Web IDE, and indeed I could not.. The work around is to first connect using screen or minicom in a terminal window:

We can then run an hello world sample:

That “=undefined” is a little confusing, but Espruino developers explain that is expected :

This is normal and it indicates the result of the last operation, which in this case is the return value of console.log, which is always undefined.

The next step is to configure a WiFi connection to your access point:

Replace “YOUR_SSID” and “YOUR_SSID_PASSWORD” with the value for your WiFi router. If this is successful, you should  see a message like shortly after:

The line wifi.save() will make sure the WiFi connection is permanent, so the board will reconnect to the router automatically after each reboot.

We can now go back to Espruino Web IDE, click on the Setup icon on the top right corner, go to Communications tab, and input the IP address (192.168.0.112 in my case) in the field “Connect over TCP Address“.

Click to Enlarge

You don’t even need to connect the board to your computer at this stage, if you be powered by a battery, or a USB power adapter. If we click on the Connect icon again, we’ll have the option to select TCP/IP: 192.168.0.112.

Click to Enlarge

I wrote a simply LED blink demo in the right part of the window, and clicked on he Upload button (third button in the middle) to upload and start the program:

Click to Enlarge

D16 is connected both the board’s IO16 LED and the LED on the board. IO16 will be turned on when D16 is low, and my LED when D16 is high every half second. I’ve shot a quick demo below.

However, if you reboot or power cycle the board, your program will not automatically start. So if you want the program to be “permanent”, add save command at the end of your code:

The output from the console should look like when you click on Upload button.

I could turn off and on the board, the LED demo resumed automatically without having to upload the code from the IDE.

Note that at this stage, I started to have some strange issues, like failure to connect to the board, and sometimes it would should “module http not found” or “module wiki not found”, as I wrote code for a web server.

It could be you need include the code for a permanent WiFi connection, before running the save command. It was still working sometimes, but I decided to connect through micro USB cable via Espruino Web IDE (it worked at this stage) to carry on with my tests more reliably.

In case you want to use ESPino32 board as small webserver, you can do so by creating a access point, and returning a simple “hello world” with the following code:

I click on Upload button, and I could access web server from Firefox.

The main advantage of Espruino over the Arduino IDE is that it’s much faster to try your code on the target, since there’s no need to compile a binary, upload to the board, and flash to storage during development. Another advantage depends on your skill set, as if you’re a seasoned web developer with a good knowledge of JavaScript, you won’t need to learn C programming used in Arduino IDE.

For other interface (SPI, I2C, ADC…) and more advanced tasks, you may check Espruino ESP32 page, but be forewarned, as the blink and web server samples did not work for me (unknown variable and missing semi-colon) by default. So you may want to read through the API reference in case the samples do not work. The company behind Espruino, Pur3 Ltd, is likely focusing most of the development efforts of their own hardware platforms like Puck.js and Espruino boards, and there’s more activity for those in the forums. So if you are interested in JavaScript on micro-controllers, but don’t want too many issues, ESP32 may not be best platform to learn, but if you like challenges, go ahead! 🙂

I’d like to thank ThaiEasyElec for sending an ESPino32 board sample. The company sells the board locally and globally for respectively 590 THB / ~$16 plus shipping on their website, where you’ll also find some documentation in English and Thai language. If you are based in Thailand, you can get further discount and free shipping if you purchase through LINE app.

Wio LTE GPS Tracker Board Comes with a 4G Modem, Supports Espruino Firmware (JavaScript Programming)

September 6th, 2017 6 comments

Seeed Studio launched Wio GPS tracker with a 2G GSM module a few months ago, and while it should work in some countries, others are phasing out 2G networks, and only support 3G or 4G. The company has now launched an update with Wio LTE board with the same form factor, and most of the same features except they replaced the 2G/Bluetooth/GNSS module with a 4G LTE/GNSS module, and Atmel SAMD21 ARM Cortex M0+ microcontroller by an STMicro STM32 ARM Cortex-M4F MCU.

Wio LTE board specifications:

  • MCU – STMicro STM32F405RG ARM Cortex M4F MCU @ 168 MHz with 1MB flash, 192+4KB SRAM
  • Storage – micro SD slot
  • Connectivity via Quectel EC21-A (America) module
    • LTE Cat.1 modem:
      • FDD LTE: B2/B4/B12 WCDMA: B2/B4/B5
      • AT Command: 3GPP TS27.007 and enhanced AT Commands
      • Data – LTE-FDD Max 10Mbps(DL) Max 5Mbps (UL)
      • NanoSIM card
      • 2x u.FL antenna connectors
    • GNSS – GPS/BeiDou/GLONASS/Galileo/QZSS with 1x u.FL GNSS antenna connector
  • Audio – 3.5mm audio jack with mic and stereo audio
  • Expansion – 6x Grove Connectors (2x Digital, 2x Analog, 1x UART, 1x I2C)
  • USB – 1x micro USB port for power and firmware update
  • Misc – RGB LED, LTE power button, MCU reset button
  • Power Supply – 5V via micro USB port, 2-pin JST 1.0 header for battery
  • Dimensions – 54.7mm x 48.2mm

When I reviewed Wio GPS Tracker, the instructions provided to use with the Arduino IDE did not work very well. So let’s hope they will come up with a better and up-to-date getting started guide for Wio LTE board in their Wiki. Alternatively, the new board also supports Espruino for JavaScript programming for the I/Os, micro SD card, 4G, SMS, and GPS, and shown in Espruino Wio LTE page.

Seeed Studio is now taking pre-order for Wio LTE US Version for $97.50 plus shipping. Quectel also has other EC21 modules like EC21-E (EMEA, Korea, Thailand, India), EC21-AUT (Australia), and others, so I’d expect Seeed Studio to also launch variants of Wio LTE board that work in other countries.

WebAssembly is a Cross-Platform, Cross-Browser Solution for High Performance Code in Web Browsers

May 31st, 2017 1 comment

Most code running in a web browser runs much slower than native code (C/C++/ assembly), and it’s fine for many applications, but some others requiring higher performance like software video decoding would have to relies on native code, initially provided via browser plugins, but then Google introduced PNaCL (Portable Native Client) allowing to run native code on multiple targets (ARM, Intel, etc..) but in Chrome browser only, and now one of Chrome developers has explained that the community has moved to WebAssembly.

WebAssembly works just as well as PNaCl, and is already natively supported by Chrome and Firefox, with support added to preview versions of Microsoft Edge and Apple Safari browsers.Since it works just as well as PNaCL, and adoption of the later is low enough, Google decided to drop support for PNaCl in the Chrome browser in Q1 2018, except inside Chrome Apps and Extensions.

WebAssembly Unity WebGL Game Demo

To get a feel for the performance and capabilities, you can find a few demos on WebAssembly website:

The latter demo also compares the performance for the same task between WebAssembly and JavaScript, and in the screenshot below we can see WASM (short name for WebAssembly) is 80% faster than JS (JavaScript) while applying “Sunset” filter to the video in Firefox.

Click to Enlarge

You’ll find the source code of the demo in Github. It’s still far from the performance of desktop app, but a big improvement over JavaScript.

If you’ve ever made a native web app relying on PNaCl, Google has provided a set of recommendation to help migration to WASM.

Top Programming Languages & Operating Systems for the Internet of Things

May 19th, 2017 3 comments

The Eclipse foundation has recently done its IoT Developer Survey answered by 713 developers, where they asked  IoT programming languages, cloud platforms, IoT operating systems, messaging protocols (MQTT, HTTP), IoT hardware architectures and more.  The results have now been published. So let’s have a look at some of the slides, especially with regards to programming languages and operating systems bearing in mind that IoT is a general terms that may apply to sensors, gateways and the cloud, so the survey correctly separated languages for different segments of the IoT ecosystem.

Click to Enlarge

C and C++ are still the preferred languages for constrained devices, and developers are normally using more than one language as the total is well over 100%.

Click to Enlarge

IoT gateways are more powerful and resourceful (memory/storage) hardware, so it’s no surprise higher level languages like Java and Python join C and C++, with Java being the most used language with 40.8% of respondents.

Click to Enlarge

When it comes to the cloud with virtually unlimited resources, and no need to interface with hardware in most cases, higher level languages like Java, JavaScript, Node.js, and Python take the lead.

Click to Enlarge

When it comes to operating systems in constrained IoT devices, Linux takes the lead with 44.1%, in front of bare metal (27.6%) and FreeRTOS (15.0 %). Windows is also there in fourth place probably with a mix of Windows IoT core, Windows Embedded, and WinCE.

Click to Enlarge

Linux is the king of IoT gateways with 66.9% of respondent using it far ahead of Windows in second place with 20.5%. They have no chart for the cloud, probably because users just don’t run their own Cloud servers, but relies on providers. They did ask specifically about the Linux distributions used for IoT projects, and the results are a bit surprising with Raspbian taking the lead with 45.5%, with Ubuntu Core following closely at 44.4%.

Click to Enlarge

Maybe Raspbian has been used during the prototyping phase or for evaluation, as most developers (84%) have been using cheap development boards like Arduino, BeagleBone or Raspberry Pi. 20% also claim to have deployed such boards in IoT solutions.

Click to Enlarge

That’s only a few slides of the survey results, and you’ll find more details about Intel/ARM hardware share, messaging & industrial protocols, cloud solutions, wireless connectivity, and more in the slides below.

Via Ubuntu Insights

Samsung JerryScript is a Lightweight Open Source JavaScript Engine for the Internet of Things

August 2nd, 2016 6 comments

In the old days, micro-controller programming was all done in assembly or C, but in recent years higher level languages, included interpreted ones such as Python and JavaScript, have made their ways into MCUs with projects such as MicroPython or Espruino (JS) often running on STMicro STM32 ARM Cortex M micro-controllers, but also other platforms such as ESP8266.

JerryScriptAs I browsed through the Embedded Linux Conference Europe 2016 schedule, I discovered that Samsung worked on it own implementation of a JavaScript engine for the Internet of Things: JerryScript. It is a full implementation of ECMAScript 5.1 standard written in C that can run on micro-controllers with less than 64KB RAM, and less than 200KB storage (160KB footprint with ARM Thumb-2 compilation).

JerryScript is comprised of two main components: Parser and Virtual Machine (VM), with the parser performing translation of input ECMAScript application into byte-code than is then executed by the Virtual Machine that performs interpretation.

 

JerryScript High Level Design

JerryScript High Level Design

Although JerryScript is designed for MCUs, and is said to be running on hundreds of thousands of smartwatches, you can easily build it and try in any machine running Linux:

You can also compile the code for full, compact or minimal implementation, use the C Api to integrate JavaScript support into your program, etc… Many more details can be found on JerryScript website and Github repository. JerryScript is also used in IoT.js framework for the Internet of Things that currently runs on Linux and NuttX RTOS platforms, as well as STM32F4-Discovery + “BB” (Beaglebone Black?) and Raspberry Pi 2, and will soon be ported to Samsung Artik 1 (MIPS), STM32F429-Discovery, STM32F411-Nucleo, and Intel Edison boards.

 

Embedded Linux Conference & IoT Summit Europe 2016 Schedule

August 2nd, 2016 4 comments

Embedded Linux Conference & IoT summit 2016 first took place in the US in April, but the events are now also scheduled in Europe on October 11 – 13 in Berlin, Germany, and the schedule has now been published. Even if you are no going to attend, it’s always interesting to find out more about the topic covered in that type of events, so I had a look, and created my own virtual schedule with some of the sessions.

Embedded_Linux_Conference_Europe_2016Tuesday, October 11

  • 10:40 – 11:30 – JerryScript: An Ultra-lightweight JavaScript Engine for the Internet of Things – Tilmann Scheller, Samsung Electronics

JerryScript is a lightweight JavaScript engine designed to bring the success of JavaScript to small IoT devices like lamps, thermometers, switches and sensors. This class of devices tends to use resource-constrained microcontrollers which are too small to fit a large JavaScript engine like V8 or JavaScriptCore.

JerryScript is heavily optimized for low memory consumption and runs on platforms with less than 64KB of RAM and less than 200KB of flash memory. Despite the low footprint, JerryScript is a full-featured JavaScript engine implementing the entire ECMAScript 5.1 standard. It is actively used in production and runs already on hundreds of thousands of smartwatches!

JerryScript is an open source project and has been released under the Apache License 2.0. The talk will include a demo showing JavaScript code executing on top of JerryScript on a resource-constrained microcontroller.

  • 11:40 – 12:30 – Read-only rootfs: Theory and Practice – Chris Simmonds, 2net

Configuring the rootfs to be read-only makes embedded systems more robust and reduces the wear on flash storage. In addition, by removing all state from the rootfs it becomes easier to implement system image updates and factory reset.

In this presentation, Chris shows how to identify components that need to store some state, and to split it into volatile state that is needed only until the device shuts down and non-volatile state that is required permanently. He gives examples and shows various techniques of mapping writes onto volatile or non-volatile storage. To show how this works in practice, he uses a standard Yocto Project build and shows what changes you have to make to achieve a real-world embedded system with read-only rootfs. In the last section, Chris considers the implications for software image update. Expect a live demonstration.

  • 14:00 – 14:50 – Comparison of Linux Software Update Technologies – Matt Porter, Konsulko

The update of software in an embedded Linux system has always been an important part of any product. In the past, however, planning and design for software update was often an afterthought in system design. Further, software update mechanisms for embedded Linux products were typically implemented as ad hoc one-off projects within each product company. As the requirements for products have matured to include security updates at a frequent intervals, software update strategy has become a focal point of product development. This session will explore a number of different Linux software update technologies that are FOSS projects, comparing each for their strengths and weaknesses. In order to better understand the applicability of these technologies, we will also deep dive into both common and uncommon use cases that drive requirements for these software update mechanisms.

  • 15:00 – 15:50 – Building a Micro HTTP Server for Embedded System – Jian-Hong Pan

Apache HTTP Server, NGINX .. are famous web servers in the world. More and more web server frameworks come and follow up, like Node.js, Bottle of Python .., etc. All of them make us have the abilities to get or connect to the resources behind the web server. However, considering the limitations and portability, they may not be ported directly to the embedded system which has restricted resources. Therefore, we need to re-implement an HTTP server to fulfill that requirement.

Jian-Hong will introduce how he used the convenience of Python to implement a Micro HTTP Server prototype according to RFC 2616/HTTP 1.1. Then, re-write the codes in C to build the Micro HTTP Server and do the automated testing with Python Unit Testing Framework. Finally, he’ll explain how he combined the Micro HTTP Server with an RTOS, and lit the LEDs on an STM32F4-Discovery board.

  • 16:10 – 17:00 – Stuck in 2009 – How I Survived – Will Sheppard, Embedded Bits Limited

When developing Linux based products it’s desirable to use the latest version of the Linux kernel – however this is not always possible. In this presentation Will Sheppard will enlighten you with his experiences in developing a product based on a 2.6.28 kernel. Throughout the presentation he will share with you the reasons why you can be stuck with an old kernel, the issues this causes and the surprising and unexpected benefits that also arise. The presentation will also give you an indication as to how far the kernel has developed since 2009 and perhaps some hope if you too are also stuck working in the past.

  • 17:10 – 18:00 – Power Management Challenges in IoT and How Zephyr RTOS Meets Them – Ramesh Thomas, Intel

An OS that runs on tiny IoT devices is already meeting several challenges. These challenges are due to the limited resources in these devices and the diverse nature of the applications and the ecosystem. These same reasons make adding an effective power management infrastructure extremely complex. These devices that run on tiny batteries for extensive periods, mostly unattended, have a very critical need to conserve power.

Zephyr is a RTOS from Intel, designed for IoT and wearable devices. It is open source and supports x86, ARM and ARC SoC platforms. It has a small footprint and can run with very less memory. Power management is built in the core of its scheduling and idling design. It exports infrastructure for PM services to implement custom power policies.

This presentation will give an insight into the Zephyr power management design and the philosophies behind it.

  • 18:10 – 19:00 – BoF: Linux Device Performance Framework – Michael Turquette, BayLibre

Complex system-on-chip processors provide performance levels for their devices and peripherals. The same chips also provide interconnects with performance knobs connecting these devices. For years, Linux has not provided a way to express the relationship between a device and its performance states, nor a uniform method for drivers to change these states. There are many solutions to this in downstream vendor trees. Let’s fix that.

The purpose of this BoF is to start a discussion around the topic with a wide audience, solicit feedback on the currently proposed approach and move forward with consensus. This BoF will discuss the types of performance states that need to be modeled, existing Linux driver frameworks that can be re-used, new code that needs to be written and how Device Tree plays a role. Will we write a new DVFS or Interconnect Framework? Attend and find out!

Wednesday, October 12

  • 09:00 – 09:50 – Supporting the Camera Interface on the C.H.I.P – Maxime Ripard, Free Electrons

Every modern multimedia-oriented ARM SoC usually has some kind of camera interface to be able to capture a video (or photo) stream from an external camera. The framework of choice to support these controllers in Linux is the Video4Linux subsystem, also called v4l2.

This talk will walk through the v4l2 stack, the architecture of a v4l2 driver and the interaction between the SoC driver and its camera’s. The presentation is based on the work Free Electrons has done to develop such a driver for the Allwinner SoCs, as part of enabling the C.H.I.P platform with the upstream Linux kernel.

  • 10:00 – 10:50 – How to Develop the ARM 64bit Board, Samsung TM2 with Exynos5433 – Chanwoo Choi, Samsung Electronics

In the last period of twenty years ARM has been undisputed leader for processor’s architecture in the embedded and mobile industry. With its 64 bit platform, ARM widens up its field of applicability. The ARMv8 introduces a new register set, it is compatible with its 32 bit predecessor ARMv7 and suits best those system that try to be amongst the high end performance devices. Tizen OS is an open multi profile platform that can run on TV, mobile, cars and wearables. Samsung TM2 board based on Exynos5433, which patches has been recently posted to mainline, is an ARM 64-bit board supported by Tizen 64-bit. However, during the bring-up, the kernel developers have faced many challenges that will be presented in this session. The presentation will go through a number of issues and the way they have been solved in order to make Tizen run on a 64 bit platform.

  • 10:45 – 11:35 – Devicetree Hardware Autoconfiguration – Hans de Goede, Red Hat

One can buy 7″ android tablets for around $35 now, assuming one gets the standard Q8 Allwinner based model, these are actually supported by the mainline linux kernel now. These tablets use a standard case + SoC + display, which get paired with a different touchscreen-controller, accelerometer and wifi chip for every other batch.

This talk will outline my experience in making a single devicetree file covering all variants using an in kernel hardware auto-detection module which creates and applies devicetree changesets depending on the detected hardware. This talk will give the audience an idea what is and is not possible wrt dynamic devicetree usage as well as give does and don’ts for people who want to use dynamic devicetree themselves.

  • 11:45 – 12:35 – Wyliodrin STUDIO: An Open Source Tool for IoT Development – Alexandru Radovici, Wyliodrin

Have you been using your development board (like the Raspberry pi for example) as a glorified computer? Are you tired of needing to hookup your boards to a display and keyboard any time you want to program them?

Wyliodrin STUDIO is a software development tool especially created for the design of IoT projects. It comes as an open source Chrome extension so that programmers can use it independently of their specific OS platform and with little setup overhead.

Wyliodrin STUDIO abstract away many of the issues regarding setting up your development boards and allows programmers to directly focus on their projects. It offers a friendly programming environment with many of the features of advanced IDEs, like Eclipse. For beginners, Wyliodrin STUDIO offers a large range of tutorials to help people take their first steps in IoT development. MagPi gave Wylidorin STUDIO a 5/5 rating.

  • 14:00 – 14:50 – ASoC: Supporting Audio on an Embedded Board – Alexandre Belloni, Free Electrons

ASoC, which stands for ALSA System on Chip, is a Linux kernel subsystem created to provide better ALSA support for system-on-chip and portable audio codecs. It allows to reuse codec drivers across multiple architectures and provides an API to integrate them with the SoC audio interface.

This talk will present the typical hardware architecture of audio devices on embedded platforms, present the ASoC API and how to use it for machine drivers, which are used to glue audio codecs with the processor audio interface. Examples, common issues and debugging tips will also be discussed.

  • 15:00 – 15:50 – Cameras in Embedded Systems: Device Tree and ACPI View – Sakari Ailus, Intel

Cameras in embedded systems are often collections of different components rather than monolithic devices such as USB webcams. They consist of sensors, lenses, LED or xenon flashes and ISPs, each of which are individual devices with their specific drivers.

Once the prevalent solution for supporting hardware variation between different ARM based systems was platform data. Since around 2011 new platform data files have had hard time getting to mainline, the preferred solution being the Device tree. However, Device tree support in the V4L2 framework was not around until over a years after that, additionally help from the V4L2 async framework is also required in order to achieve the same functionality as with platform data.

This talk shows how the frameworks are used in drivers and Device tree source, reviews the status of ACPI and discuss potential future developments.

  • 16:30 – 17:20 – Swapping and Embedded: Compression is the Key – Vitaly Wool

Ever since Linux started running on embedded devices, having a swap for such had been considered a misconfiguration rather than a method for overcoming RAM shortage or performance booster. This attitude started to change with the spread of Android devices which usually don’t have a problem utilizing virtually any amount of memory. An with the introduction of ZRAM the usage of a compressed swap in RAM became more useful and more popular. This talk will give a comprehensive description of ZRAM and its counterpart, zswap, a summary of pros and cons of both. This talk will also cover a brand new z3fold compressed memory allocator which can be used for both zswap and ZRAM, of course presenting measurement results for these, obtained on various devices, ranging from set top boxes to laptops, not to forget Android phones.

Thursday, October 14

  • 09:00 – 09:50 – Time is Ready for the Civil Infrastructure Platform – Yoshitake Kobayashi, Corporate Software Engineering Center & Urs Gleim, Seimens

The Civil Infrastructure Platform (CIP) – launched in April – CIP defined and started to realize a super long-term supported open source “base layer” for industrial grade software. This base layer aims to be used for current and future industrial systems which supports machine-to-machine connectivity for digital future. This kind of systems, being the field for decades, should have long-term support for security and robustness reasons. In this talk, we will show the first steps on CIP development. This includes initial set of components for the base layer and its maintainers. Are you ready? It’s time to start your development with and for the CIP.

  • 10:00 – 10:50 – Introduction to Memory Management in Linux – Alan Ott, Signal 11 Software

All modern non-microcontroller CPUs contain a memory management unit and utilize the concept of virtual memory. This presentation will describe the different types of virtual memory spaces and mappings used in the Linux kernel, the cases in which they are useful, how they are implemented in the kernel, and how they differ from user space memory. Concepts such as the hardware memory-management unit (MMU) and translation lookaside buffer (TLB) will be discussed, as well as software concepts like kernel page tables. User space concepts such as growable stacks, memory paging, memory mapping, page faults, exceptions, and other memory-related conditions will be covered as well.

  • 11:15 – 12:15 – MinnowBoard Delta: Fishing for Easy IoT Hardware – David Anders, Intel

With the introduction of the Zephyr Project, a small scalable real-time operating system for use on resource-constrained systems, the need for an easy to use platforms to enable Internet of Things development has grown. With the idea of enabling both hardware and software developers to quickly prototype and develop proof-of-concept, as well as transitioning directly to product, the MinnowBoard Delta was designed as an open source hardware platform to highlight the Zephyr Project. This presentation will cover design considerations as well as implementation methods for creating open source hardware specifically for open source software.

  • 12:15 – 13:05 – Cloud Platforms for the Internet of Things: How Do They Stack Up? – Koustabh Dolui, Politecnico di Milano

With the advent of the Internet of Things (IoT), there has been a recent surge in the number of cloud platforms offering their services for data collection and processing from IoT devices. These platforms, open-source and closed, are diverse in terms of ease of use, architecture, data storage, privacy, security and communication protocols. However, how these cloud platforms measure up against each other, given the set of tradeoffs that they present, remains quite unexplored in existing literature. In this presentation, Koustabh will present a detailed study on the architecture that these platforms are based on and how the open source platforms compare against closed platforms. Koustabh will compare the platforms based on a real data-set generated from a sensor network deployed at the heritage site of Circo Massimo, Rome, as a part of an ongoing project at Politecnico di Milano, Italy.

  • 14:30 – 15:20 – GPIO for Engineers and Makers – Linus Walleij
We will go over the changes to the GPIO subsystem in the recent years, including GPIO descriptor refactoring, new support for things like open drain, some words on device tree and ACPI hardware descriptions, and we will discuss the new userspace character device ABI for GPIO chips and how use cases such as those presented by the maker community or industrial control clients can benefit from it. We will also talk a bit about the future direction of the subsystem.
  • 15:30 – 16:20 – FDO: Magic ‘Make My Program Faster’ Compilation Option? – Pawel Moll, ARM

Feedback Driven Optimisation (FDO), also known as Profile Guided Optimisation (PGO) is a well known code optimisation technique, employed by compilers since mid XX century, yet not widely used in the wild these days. It relies on providing runtime-captured information about code execution (eg. “branch taken or not?”) during next code compilation, improving quality of decisions made by compiler heuristics.

To be fair, there were good reasons for its demise which I hope to discuss, mainly time and complexity overhead and deployment difficulties, but there is some hope on the horizon, coming with new approach, called AutoFDO and originating at Google, based on statistical profiling (namely Linux perf + extra tools) and source code level attribution. I’ll discuss existing support for it available in mainline GCC and LLVM and give examples of real-life, successful deployments.

If you’d like to attend the event, you can do so by registering online, and paying the entry fee:

  • Early Registration Fee: US$550 (through August 1, 2016)
  • Standard Registration Fee: US$650 (August 2, 2016 – September 3, 2016)
  • Late Registration Fee: US$850 (September 4, 2016 – Event)
  • Student Registration Fee: US$175 (valid student ID required)
  • Hobbyist Registration Fee: US$175

Puck.js Bluetooth 5.0 Ready Beacon is Programmable with JavaScript (Crowdfunding)

July 13th, 2016 2 comments

I first found out about Bluetooth LE tags in 2012 with SticknFind project, and since then many other companies have designed their own Bluetooth beacon mostly to find objects such as your keys or pets. Puck.js is also a Bluetooth 4.2 LE beacon, but has many more features including compatibility with the upcoming Bluetooth 5.0 standard, and some GPIOs programmable with JavaScript (Espruino implementation), and corresponding visual programming editor.

Puck.jsPuck.js hardware specifications:

  • Bluetooth Smart SoC – Nordic Semi nRF52832 ARM Cortex-M4F micro-controller @ 64 MHz
  • Connectivity
    • Bluetooth 4.2 LE/smart, Bluetooth 5.0 Ready; up to 80 meters range in open space
    • On-chip NFC support
  • Expansion – 8x through holes with 6x GPIOs, and 2x power signals
  • Sensors – MAC3110 magnetometer, on-chip temperature sensor
  • Misc – 1x tactile button, 4x LEDs (R, G, B, IR)
  • Battery – CR2032 210mAh battery good for about a year (application dependent)
  • Dimensions – 35mm diameter, 10mm thick; water-resistant silicon rubber cover

Puck.js beacon supports Google’s Eddystone and Apple’s iBeacon to advertise itself to other devices, as well as Web Bluetooth currently supported by Chrome, but with other browser soon to follow. The beacon also supports both slave and master modes. You can program the device by going to Espruino website with Chrome browser, connecting your Puck.js, and start programming by dragging blocks around, or directly using JavaScript, using one of ~100 example projects or from scratch.

Espruino Programming: Visual Blocks or JavaScript

Espruino Programming: Visual Blocks or JavaScript

Possible applications include lost/found tag, reminder button, IR remote button, motion detection, enabling common tasks with your smartphone such as starting to play music without touching your phone… The I/Os, and LEDs can also be controlled from a mobile app, and it can be embedded into electronics projects such as simple robots. Multiple Puke.js can also be arranged in a mesh interacting with each other.

The project is now fully funded on Kickstarter with 23 days to go. A single Puke.js beacon will require a 28 GBP ($37 US) pledge, but other rewards include up to 50 beacons at a lower price per unit. Shipping adds 2 GBP to the UK, and 4 GBP to the rest of the world for the single unit pledge. Delivery is scheduled for December 2016.

Via Adafruit