Skip to content
Philippe Coval edited this page Jul 7, 2019 · 29 revisions

MICRO CONTROLLERS:

INTRODUCTION:

In IoT domain Micro controllers (MCU) are very popular, because of low cost and low consumption.

This page only focus on boards supported by webthing-iotjs:

  • ARTIK05x on TizenRT
  • STM32F on NuttX

Arduino boards are very popular in academics or DiY communities, then API were ported to other micro controllers than Atmel, like espresif ESP8266, ESP32 etc.

Mozilla's is supporting Arduino API for through this SDK project:

The supported language to program MCU webthings is currently C/C++.

Note that IoT.js is also targeting constrained devices (like ARTIK05x on TizenRT or STM32 on NuttX).

mcu

So to recap, MCUs can serve WebThings API for Mozilla Gateway either in native language (C/C++) or using script runtime (IotJs, uPython, enventually Lua too?) but Gateway is too resource consuming for that.

MORE WITH STM32

Update: It's is working for me, I can explain more, ask me at:

IotJs is also supporting NuttX kernel on STM32F7.

Track status at:

More hints shared at:

Hints and work in progress:

git clone -b sandbox/rzr/nuttx/devel https://github.com/rzr/rzr-wip/ ; cd rzr-wip
make nuttx/devel
make iotjs/devel # Enable IoT.js on 2d build

STM32F7

IoTjs is running on Nucleo-f767zi on NuttX OS:

Usage:

mount -t procfs /proc ; mkdir /tmp ; mount -t tmpfs /tmp ; df
ifconfig ; ifdown eth0 ; ifconfig eth0 hw 00:80:E1:34:ff:ff; 
ifconfig ifup eth0; renew eth0; ifconfig
ifconfig ping 8.8.8.8 ; ping ifconfig.me 
cd /tmp/ ; wget http://ifconfig.me/ip ; cat ip
cd /tmp ; echo "console.log(process)" > p.js; iotjs p.js

SUPPORT

  • ADC: ADC0 (=ADC1_3)
  • CAN: TODO
  • GPIO: WIP (LED, TODO: button)
  • I2C: TODO
  • PWM: 4
  • SPI: TODO
  • UART: TODO

Nucleof767ZI

ADC:

PWM:

GPIO:

nsh>  ls -l /dev/gpout1
 crw-rw-rw-       0 /dev/gpout1
nsh> gpio  /dev/gpout1
Driver: /dev/gpout1
  Output pin:    Value=1
nsh> gpio -o 0  /dev/gpout1
Driver: /dev/gpout1
  Output pin:    Value=1
  Writing:       Value=0
  Verify:        Value=0
nsh> gpio -o 1  /dev/gpout1
Driver: /dev/gpout1
  Output pin:    Value=0
  Writing:       Value=1
  Verify:        Value=1
nsh> 

PINOUT:

STM32

STATUS

NUTTX

MISC

MORE WITH TIZEN:RT

TizenRT OS is also targeting lower class devices, currently hardware support is limited to a few platforms like ARTIK05x and a few others plus QEmu.

The key feature for Javascript developers is IoT.js support, this mean code can be portable from on GNU/Linux OS to contrained devices without any rebuild effort, which is is not the case of Arduino compabible devices.

MORE WITH ARDUINO

Arduino is providing a C/C++ framework that would be compared to IotJs.

  • TODO: port iotjs to arduino/ESP boards and compare performance

RESOURCES

LICENSE: CC-BY-SA-4.0

INDEX

Clone this wiki locally