SlideShare a Scribd company logo
BAREMETALJAVASCRIPT
C o n n e c t e d s o l u t i o n s & d i g i t a l s e r v i c e s
Frederik Vannieuwenborg – 29/10/2015
IN LINUX
& GPIO PROGRAMMING
WHO AM I?
Frederik Vannieuwenborg
Technical Partner Aptus
Media & Communication Technology
Zwevegem
@vannieuwenborgf
What we do?
We combine hardware (electronics) and software (embedded software, cloud, mobile and web
applications) with connectivity solutions to help connect devices and people and processes.
HARDWARE
PROTOTYPE
WIRELESS COMM.
ELECTRONICS
MICROCONTROLLER
A BRIDGE BETWEEN THE PHYSICAL
AND DIGITAL WORLD
INTERACTION BETWEEN INTERNET,
THINGS AND DATA
DATA
Internet
Things
CLOUD
BIG DATA
EMBEDDED
SOFTWARE
MOBILE APPS
HTML5/CSS3/JS
DEVICES & MACHINES
ENVIRONMENTS
PEOPLE
Sensor networks
Indoor positioning
LPWAN
Wearables
RFID/NFC
BARE METAL
JAVASCRIPT
It’s all about using JavaScript
on micro-controller boards or
single-board computers
Agenda
NodeJS FrameworksHardware Frameworks FrameworksDemo
- Server-side JavaScript runtime
- Built on Chrome's V8 JavaScript engine
- Non-blocking I/O
- Single threaded
- Event driven
- Async
Node.js
BlockingI/O
Non-blockingI/O
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello Worldn');
}).listen(1337, "127.0.0.1");
console.log('Server running at http://127.0.0.1:1337/');
Basic examples
var fs = require('fs');
fs.readFile(‘somefile.txt', 'utf8', function(err, contents) {
console.log(contents);
});
Application JavaScript Code
Node.js JavaScript built-in library
Node.js C++ Layer
libuv OpenSSL zlib c-ares
The Node.jsinternals
The Node.jssystem
APPLICATION
V8
(JAVASCRIPT ENGINE)
NODE.JS
BINDINGS
(NODE API)
JAVASCRIPT
OS
OPERATION
LIBUV
(ASYNCHRONOUS I/O)
EVENT
QUEUE
WORKER
THREADS
FILE SYSTEM
NETWORK
PROCESS
EVENT
LOOP
BLOCKING
OPERATION
EXECUTE
CALLBACK
Don’tuse Node.js for…
- CPU intensive tasks
- Long running CPU tasks will block the whole server
- File-processing
- Multi-threaded processing
- You can run multiple Node processes running in
parallel though
Command line utility to install Node.js packages, do version
management and dependency management of Node.js packages.
HARDWARE
IntelEdison
IntelEdison
- 32-bit Intel® Atom™ Processor @ 500 MHz
- 1 GBRAM LPDDR3 memory
- 4 GB storage
- Wireless Dual-band (2.4 and 5 GHz) & Bluetooth
- Connector 70-pin Hirose
- USB 2.0 1 OTG controller
- I/O 40 general purpose GPIO
- 4 capable of PWM
IntelEdison – Arduino breakout Kit
IntelEdison – Sparkfun block
// Load Grove module
var groveSensor = require('jsupm_grove');
// Create the button object using GPIO pin 0 var
button = new groveSensor.GroveButton(0);
// Read the input and print, waiting one second
between readings
function readButtonValue() {
console.log(button.name() + " value is " +
button.value());
}
setInterval(readButtonValue, 1000);
var LEDBar = require("jsupm_my9221");
var myLEDBar = new LEDBar.MY9221(2, 3);
var directionBool = true;
var myInterval = setInterval(function() {
show_LED(1, directionBool);
}, 1000 );
function show_LED(level, direction) {
if (level <= 10) {
myLEDBar.setBarLevel(level, directionBool);
setTimeout(show_LED, 50, ++level, directionBool);
} else directionBool = !directionBool;
}
process.on('SIGINT', function() {
myLEDBar.setBarLevel(0, true);
clearInterval(myInterval);
console.log("Exiting..."); process.exit(0);
});
var groveSensor = require('jsupm_grove'); var
led = new groveSensor.GroveLed(2);
console.log(led.name());
var i = 0;
var waiting = setInterval(function() {
if ( i % 2 == 0 ) {
led.on();
} else {
led.off();
} i++;
if ( i == 20 ) clearInterval(waiting);
}, 1000);
Tessel.io
Tessel.io
- 2 Module ports
- 2 USB ports
- Wifi & Ethernet
- 580MHz Mediatek MT7620n
- 64 MB RAM & 32 MB Flash
- 48MHz Atmel SAMD21 co-
processor
- microUSB
Beaglebone black
Beaglebone black
- Produced by Texas Instruments in association with Digi-
Key and Newark element14
- AM335x 1GHz ARM® Cortex-A8 & 512MB DDR3 RAM
- 4GB 8-bit eMMC on-board flash storage
- 3D graphics accelerator
- 2x PRU 32-bit microcontrollers
- USB client host
- Ethernet & HDMI
- 2x 46 pin headers
Beaglebone black
- Debian
- Android
- Ubuntu
- Cloud9 IDE on Node.js w/ BoneScript library
BoneScript is a Node.js library specifically optimized
for the Beagle family and featuring familiar Arduino
function calls, exported to the browser.
Cloud9IDE
http://elinux.org/Beagleboard:BeagleBone_Capes
Raspberry PI
Raspberry PI
- Low cost credit-card sized computer
- 900MHz quad-core ARM Cortex-A7 CPU
- 1GB RAM
- 4 USB ports
- Full HDMI port, Ethernet port
- Combined 3.5mm audio jack and composite video
- Camera interface (CSI) & Display interface (DSI)
- Micro SD card slot
- VideoCore IV 3D graphics core
Raspberry PI
- Default: Debian
- The Raspberry Pi Internet of Things Framework
- http://webiopi.trouch.com/
- The ThingBox Project
- Use Internet of Things technologies without any
technical knowledge and for free
- http://thethingbox.io/
FRAMEWORKS
var five = require("johnny-five");
var board = new five.Board();
board.on("ready", function() {
// Create a standard `led` instance
var led = new five.Led(13);
// "blink" the led in 500ms
led.blink(500);
});
*The JavaScript program is executed on a host machine that runs node.js
Cylon.js is a JavaScript framework for robotics,
physical computing, and the Internet of Things. It
makes it incredibly easy to command robots and
devices.
Cylon.js
- Connects 36 platforms
- Raspberry PI, Arduino, Pebble, …
- Drivers for General Purpose
Input/Output hardware
- LED, buttons, sensors, …
- Node based
Cyclon.js - demo
- Push button
- Log “Push button”
- Toggle LED
- Run “ToggleLed”
- Log “ToggleLed”
- Toggle LED
Node-RED is a tool for wiring together hardware
devices, APIs and online services in new and
interesting ways.
http://flows.nodered.org/
Node-REDflows
De geldfretter
Architectuur
Raspbian
NodeJS
Node-RED
LDR
LED
SERVO
Node-REDinstallation
http://nodered.org/docs/hardware/raspberrypi.html
*No support for node 4.x
curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash
DOWNLOAD INSTALL SCRIPT
sudo apt-get install -y build-essential python-dev python-rpi.gpio nodejs
INSTALLATION
nodejs
START NODEJS
npm cache clean
sudo npm install -g node-red
INSTALL NODE-RED
sudo node-red
START NODE-RED
http://pi.gadgetoid.com/pinout
Raspberry PI – I/O Pinout
Light-EmittingDiode
Light-dependent resistor (LDR)
Servo
Servo for dummies
T’ligtgeldip,incaseern zeggek! (hands-on)
OH..
ONE MORE THING
Help us,we need your support!
Aptus HQ
Veldkant 33b
2550 Kontich
Aptus Offices
Stedestraat 51
8530 Harelbeke
Frederik Vannieuwenborg
http://twitter.com/WeAreAptus
http://www.aptus.be
Let’s talk!

More Related Content

What's hot

Show & Tell.- Introduction
Show & Tell.- IntroductionShow & Tell.- Introduction
Show & Tell.- Introduction
zvikapika
 

What's hot (20)

Introduction to Internet of Things Hardware
Introduction to Internet of Things HardwareIntroduction to Internet of Things Hardware
Introduction to Internet of Things Hardware
 
Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!
 
Esp32 cam arduino-123
Esp32 cam arduino-123Esp32 cam arduino-123
Esp32 cam arduino-123
 
Raspberry Pi 2 + Windows 10 IoT Core + Node.js
Raspberry Pi 2 + Windows 10 IoT Core + Node.jsRaspberry Pi 2 + Windows 10 IoT Core + Node.js
Raspberry Pi 2 + Windows 10 IoT Core + Node.js
 
DIY Science using the Intel IoT Developer Kit
DIY Science using the Intel IoT Developer KitDIY Science using the Intel IoT Developer Kit
DIY Science using the Intel IoT Developer Kit
 
Interacting with Intel Edison
Interacting with Intel EdisonInteracting with Intel Edison
Interacting with Intel Edison
 
IOT Talking to Webserver - how to
IOT Talking to Webserver - how to IOT Talking to Webserver - how to
IOT Talking to Webserver - how to
 
Bandung IoT Maker Day #3 - Maker Movement
Bandung IoT Maker Day #3 - Maker MovementBandung IoT Maker Day #3 - Maker Movement
Bandung IoT Maker Day #3 - Maker Movement
 
GDG Dev Fest - Develop with Firebase and IoT
GDG Dev Fest - Develop with Firebase and IoTGDG Dev Fest - Develop with Firebase and IoT
GDG Dev Fest - Develop with Firebase and IoT
 
Arduino vs Raspberry Pi | Which Board to Choose for IoT Projects | IoT Device...
Arduino vs Raspberry Pi | Which Board to Choose for IoT Projects | IoT Device...Arduino vs Raspberry Pi | Which Board to Choose for IoT Projects | IoT Device...
Arduino vs Raspberry Pi | Which Board to Choose for IoT Projects | IoT Device...
 
IoT Getting Started with Intel® IoT Devkit
IoT Getting Started with Intel® IoT DevkitIoT Getting Started with Intel® IoT Devkit
IoT Getting Started with Intel® IoT Devkit
 
Get in Touch with Internet of Things
Get in Touch with Internet of ThingsGet in Touch with Internet of Things
Get in Touch with Internet of Things
 
Internet of Things - Technological Perspective
Internet of Things - Technological PerspectiveInternet of Things - Technological Perspective
Internet of Things - Technological Perspective
 
Ruby Arduino (RubyConfIndia 2013)
Ruby Arduino (RubyConfIndia 2013)Ruby Arduino (RubyConfIndia 2013)
Ruby Arduino (RubyConfIndia 2013)
 
GeoDC Maker Talks: GPS-Enabled Sensor Platforms using Arduino
GeoDC Maker Talks:  GPS-Enabled Sensor Platforms using ArduinoGeoDC Maker Talks:  GPS-Enabled Sensor Platforms using Arduino
GeoDC Maker Talks: GPS-Enabled Sensor Platforms using Arduino
 
Show & Tell.- Introduction
Show & Tell.- IntroductionShow & Tell.- Introduction
Show & Tell.- Introduction
 
The Rise of Maker Movement in Indonesia
The Rise of Maker Movement in IndonesiaThe Rise of Maker Movement in Indonesia
The Rise of Maker Movement in Indonesia
 
Microsoft's view of the Internet of Things (IoT) by Imran Shafqat
Microsoft's view of the Internet of Things (IoT) by Imran ShafqatMicrosoft's view of the Internet of Things (IoT) by Imran Shafqat
Microsoft's view of the Internet of Things (IoT) by Imran Shafqat
 
Arduino1.0 RC
Arduino1.0 RCArduino1.0 RC
Arduino1.0 RC
 
Getting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer KitGetting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer Kit
 

Viewers also liked

áZsia(2)+ani (nx power lite)
áZsia(2)+ani (nx power lite)áZsia(2)+ani (nx power lite)
áZsia(2)+ani (nx power lite)
VarganeAnny
 
Interestingstuff 140324102450-phpapp02
Interestingstuff 140324102450-phpapp02Interestingstuff 140324102450-phpapp02
Interestingstuff 140324102450-phpapp02
jolehidy6
 
Astek Academy SEO Bootcamp Checklist 2/25/12
Astek Academy SEO Bootcamp Checklist 2/25/12Astek Academy SEO Bootcamp Checklist 2/25/12
Astek Academy SEO Bootcamp Checklist 2/25/12
Astek Consulting
 
Arany kezek(9)+ani (nx power lite)
Arany kezek(9)+ani (nx power lite)Arany kezek(9)+ani (nx power lite)
Arany kezek(9)+ani (nx power lite)
VarganeAnny
 
'00s sunday night series
'00s sunday night series'00s sunday night series
'00s sunday night series
adaglas
 
보건산업안전학과 2009180929김준수1
보건산업안전학과 2009180929김준수1보건산업안전학과 2009180929김준수1
보건산업안전학과 2009180929김준수1
준수 김
 
Лекции по УЭРу 5 курс 9 семестр ПГУПС
Лекции по УЭРу 5 курс 9 семестр ПГУПСЛекции по УЭРу 5 курс 9 семестр ПГУПС
Лекции по УЭРу 5 курс 9 семестр ПГУПС
Sergey Shmakov
 
簡樸使我富足
簡樸使我富足簡樸使我富足
簡樸使我富足
chengchunhao
 
4 q10 presentation
4 q10 presentation4 q10 presentation
4 q10 presentation
Equatorial
 
Presentacióncondiapositivas
PresentacióncondiapositivasPresentacióncondiapositivas
Presentacióncondiapositivas
santigramajosanpa
 

Viewers also liked (20)

Part 3 - Case studies
Part 3 - Case studiesPart 3 - Case studies
Part 3 - Case studies
 
Wat is nitric oxide slidshare heart health presentatie
Wat is nitric oxide slidshare heart health presentatieWat is nitric oxide slidshare heart health presentatie
Wat is nitric oxide slidshare heart health presentatie
 
áZsia(2)+ani (nx power lite)
áZsia(2)+ani (nx power lite)áZsia(2)+ani (nx power lite)
áZsia(2)+ani (nx power lite)
 
Interestingstuff 140324102450-phpapp02
Interestingstuff 140324102450-phpapp02Interestingstuff 140324102450-phpapp02
Interestingstuff 140324102450-phpapp02
 
Astek Academy SEO Bootcamp Checklist 2/25/12
Astek Academy SEO Bootcamp Checklist 2/25/12Astek Academy SEO Bootcamp Checklist 2/25/12
Astek Academy SEO Bootcamp Checklist 2/25/12
 
Arany kezek(9)+ani (nx power lite)
Arany kezek(9)+ani (nx power lite)Arany kezek(9)+ani (nx power lite)
Arany kezek(9)+ani (nx power lite)
 
Grey matters final
Grey matters finalGrey matters final
Grey matters final
 
'00s sunday night series
'00s sunday night series'00s sunday night series
'00s sunday night series
 
보건산업안전학과 2009180929김준수1
보건산업안전학과 2009180929김준수1보건산업안전학과 2009180929김준수1
보건산업안전학과 2009180929김준수1
 
Лекции по УЭРу 5 курс 9 семестр ПГУПС
Лекции по УЭРу 5 курс 9 семестр ПГУПСЛекции по УЭРу 5 курс 9 семестр ПГУПС
Лекции по УЭРу 5 курс 9 семестр ПГУПС
 
Let's guess the name of the hidden animals
Let's guess the name of the hidden animalsLet's guess the name of the hidden animals
Let's guess the name of the hidden animals
 
Vastgoed sales cycle
Vastgoed sales cycleVastgoed sales cycle
Vastgoed sales cycle
 
簡樸使我富足
簡樸使我富足簡樸使我富足
簡樸使我富足
 
Module 1: The role of online services
Module 1: The role of online servicesModule 1: The role of online services
Module 1: The role of online services
 
4 q10 presentation
4 q10 presentation4 q10 presentation
4 q10 presentation
 
I amable sixty second tv psa script draft
I amable sixty second tv psa script draftI amable sixty second tv psa script draft
I amable sixty second tv psa script draft
 
Jimini deck
Jimini deckJimini deck
Jimini deck
 
Presentacióncondiapositivas
PresentacióncondiapositivasPresentacióncondiapositivas
Presentacióncondiapositivas
 
肝臟
肝臟肝臟
肝臟
 
Nganh oto 140716_dnse
Nganh oto 140716_dnseNganh oto 140716_dnse
Nganh oto 140716_dnse
 

Similar to Bare metal Javascript & GPIO programming in Linux

Similar to Bare metal Javascript & GPIO programming in Linux (20)

IoT on Raspberry Pi
IoT on Raspberry PiIoT on Raspberry Pi
IoT on Raspberry Pi
 
How To Electrocute Yourself using the Internet
How To Electrocute Yourself using the InternetHow To Electrocute Yourself using the Internet
How To Electrocute Yourself using the Internet
 
Hack the Real World with ANDROID THINGS
Hack the Real World with ANDROID THINGSHack the Real World with ANDROID THINGS
Hack the Real World with ANDROID THINGS
 
IoT on Raspberry PI v1.2
IoT on Raspberry PI v1.2IoT on Raspberry PI v1.2
IoT on Raspberry PI v1.2
 
Physical Computing and IoT
Physical Computing and IoTPhysical Computing and IoT
Physical Computing and IoT
 
Internet of Things (IoT) reference architecture using Azure -MIC - Lahore
Internet of Things (IoT) reference architecture using Azure -MIC - LahoreInternet of Things (IoT) reference architecture using Azure -MIC - Lahore
Internet of Things (IoT) reference architecture using Azure -MIC - Lahore
 
Android Things in action
Android Things in actionAndroid Things in action
Android Things in action
 
Intel IoT Edge Computing 在 AI 領域的應用與商機
Intel IoT Edge Computing 在 AI 領域的應用與商機Intel IoT Edge Computing 在 AI 領域的應用與商機
Intel IoT Edge Computing 在 AI 領域的應用與商機
 
Controlando windows like a boss com Intel Real Sense SDK
Controlando windows like a boss com Intel Real Sense SDKControlando windows like a boss com Intel Real Sense SDK
Controlando windows like a boss com Intel Real Sense SDK
 
Securing Firmware Updates [FOTA/OTA DFU]
Securing Firmware Updates [FOTA/OTA DFU]Securing Firmware Updates [FOTA/OTA DFU]
Securing Firmware Updates [FOTA/OTA DFU]
 
Internet of Things Conference - Bogor city
Internet of Things Conference - Bogor cityInternet of Things Conference - Bogor city
Internet of Things Conference - Bogor city
 
.Net Gadgeteer
.Net Gadgeteer .Net Gadgeteer
.Net Gadgeteer
 
RAHUL NASKAR IOT.ppt
RAHUL NASKAR IOT.pptRAHUL NASKAR IOT.ppt
RAHUL NASKAR IOT.ppt
 
Fullstack IoT Development
Fullstack IoT DevelopmentFullstack IoT Development
Fullstack IoT Development
 
Taller IoT en la Actualidad
Taller IoT en la ActualidadTaller IoT en la Actualidad
Taller IoT en la Actualidad
 
Introduction to Things board (An Open Source IoT Cloud Platform)
Introduction to Things board (An Open Source IoT Cloud Platform)Introduction to Things board (An Open Source IoT Cloud Platform)
Introduction to Things board (An Open Source IoT Cloud Platform)
 
IoT ppt(004).pptx
IoT ppt(004).pptxIoT ppt(004).pptx
IoT ppt(004).pptx
 
Internet of things - The Present & The Future
Internet of things - The Present & The FutureInternet of things - The Present & The Future
Internet of things - The Present & The Future
 
Windows 10 IoT Core, a real sample
Windows 10 IoT Core, a real sampleWindows 10 IoT Core, a real sample
Windows 10 IoT Core, a real sample
 
CV_Arshad_21June16
CV_Arshad_21June16CV_Arshad_21June16
CV_Arshad_21June16
 

More from Alexander Vanwynsberghe

More from Alexander Vanwynsberghe (9)

The future of HealthCare is digital
The future of HealthCare is digitalThe future of HealthCare is digital
The future of HealthCare is digital
 
Healthcare is shifting gears
Healthcare is shifting gearsHealthcare is shifting gears
Healthcare is shifting gears
 
Eindwerk Social Media Consultant - SBM Case
Eindwerk Social Media Consultant - SBM CaseEindwerk Social Media Consultant - SBM Case
Eindwerk Social Media Consultant - SBM Case
 
The social (r)evolution introduced by Generation Y
The social (r)evolution introduced by Generation YThe social (r)evolution introduced by Generation Y
The social (r)evolution introduced by Generation Y
 
The future of work with Office 365
The future of work with Office 365The future of work with Office 365
The future of work with Office 365
 
Taking your version control to a next level with TFS and Git
Taking your version control to a next level with TFS and GitTaking your version control to a next level with TFS and Git
Taking your version control to a next level with TFS and Git
 
TFS on azure in 10 minutes
TFS on azure in 10 minutesTFS on azure in 10 minutes
TFS on azure in 10 minutes
 
Improved software testing using Visual Studio and TFS 2010
Improved software testing using Visual Studio and TFS 2010 Improved software testing using Visual Studio and TFS 2010
Improved software testing using Visual Studio and TFS 2010
 
Techdays 2011 - Things I will remember
Techdays 2011 - Things I will rememberTechdays 2011 - Things I will remember
Techdays 2011 - Things I will remember
 

Recently uploaded

Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 

Recently uploaded (20)

AI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in Michelangelo
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Studiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting softwareStudiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting software
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning Framework
 
Agnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in KrakówAgnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in Kraków
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfA Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 

Bare metal Javascript & GPIO programming in Linux

  • 1. BAREMETALJAVASCRIPT C o n n e c t e d s o l u t i o n s & d i g i t a l s e r v i c e s Frederik Vannieuwenborg – 29/10/2015 IN LINUX & GPIO PROGRAMMING
  • 2. WHO AM I? Frederik Vannieuwenborg Technical Partner Aptus Media & Communication Technology Zwevegem @vannieuwenborgf
  • 3. What we do? We combine hardware (electronics) and software (embedded software, cloud, mobile and web applications) with connectivity solutions to help connect devices and people and processes. HARDWARE PROTOTYPE WIRELESS COMM. ELECTRONICS MICROCONTROLLER A BRIDGE BETWEEN THE PHYSICAL AND DIGITAL WORLD INTERACTION BETWEEN INTERNET, THINGS AND DATA DATA Internet Things CLOUD BIG DATA EMBEDDED SOFTWARE MOBILE APPS HTML5/CSS3/JS
  • 7. It’s all about using JavaScript on micro-controller boards or single-board computers
  • 9.
  • 10. - Server-side JavaScript runtime - Built on Chrome's V8 JavaScript engine - Non-blocking I/O - Single threaded - Event driven - Async Node.js
  • 11.
  • 14. var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello Worldn'); }).listen(1337, "127.0.0.1"); console.log('Server running at http://127.0.0.1:1337/'); Basic examples var fs = require('fs'); fs.readFile(‘somefile.txt', 'utf8', function(err, contents) { console.log(contents); });
  • 15. Application JavaScript Code Node.js JavaScript built-in library Node.js C++ Layer libuv OpenSSL zlib c-ares The Node.jsinternals
  • 16. The Node.jssystem APPLICATION V8 (JAVASCRIPT ENGINE) NODE.JS BINDINGS (NODE API) JAVASCRIPT OS OPERATION LIBUV (ASYNCHRONOUS I/O) EVENT QUEUE WORKER THREADS FILE SYSTEM NETWORK PROCESS EVENT LOOP BLOCKING OPERATION EXECUTE CALLBACK
  • 17. Don’tuse Node.js for… - CPU intensive tasks - Long running CPU tasks will block the whole server - File-processing - Multi-threaded processing - You can run multiple Node processes running in parallel though
  • 18. Command line utility to install Node.js packages, do version management and dependency management of Node.js packages.
  • 21. IntelEdison - 32-bit Intel® Atom™ Processor @ 500 MHz - 1 GBRAM LPDDR3 memory - 4 GB storage - Wireless Dual-band (2.4 and 5 GHz) & Bluetooth - Connector 70-pin Hirose - USB 2.0 1 OTG controller - I/O 40 general purpose GPIO - 4 capable of PWM
  • 22.
  • 23. IntelEdison – Arduino breakout Kit
  • 25.
  • 26.
  • 27. // Load Grove module var groveSensor = require('jsupm_grove'); // Create the button object using GPIO pin 0 var button = new groveSensor.GroveButton(0); // Read the input and print, waiting one second between readings function readButtonValue() { console.log(button.name() + " value is " + button.value()); } setInterval(readButtonValue, 1000);
  • 28. var LEDBar = require("jsupm_my9221"); var myLEDBar = new LEDBar.MY9221(2, 3); var directionBool = true; var myInterval = setInterval(function() { show_LED(1, directionBool); }, 1000 ); function show_LED(level, direction) { if (level <= 10) { myLEDBar.setBarLevel(level, directionBool); setTimeout(show_LED, 50, ++level, directionBool); } else directionBool = !directionBool; } process.on('SIGINT', function() { myLEDBar.setBarLevel(0, true); clearInterval(myInterval); console.log("Exiting..."); process.exit(0); });
  • 29. var groveSensor = require('jsupm_grove'); var led = new groveSensor.GroveLed(2); console.log(led.name()); var i = 0; var waiting = setInterval(function() { if ( i % 2 == 0 ) { led.on(); } else { led.off(); } i++; if ( i == 20 ) clearInterval(waiting); }, 1000);
  • 31. Tessel.io - 2 Module ports - 2 USB ports - Wifi & Ethernet - 580MHz Mediatek MT7620n - 64 MB RAM & 32 MB Flash - 48MHz Atmel SAMD21 co- processor - microUSB
  • 32.
  • 33.
  • 34.
  • 36. Beaglebone black - Produced by Texas Instruments in association with Digi- Key and Newark element14 - AM335x 1GHz ARM® Cortex-A8 & 512MB DDR3 RAM - 4GB 8-bit eMMC on-board flash storage - 3D graphics accelerator - 2x PRU 32-bit microcontrollers - USB client host - Ethernet & HDMI - 2x 46 pin headers
  • 37. Beaglebone black - Debian - Android - Ubuntu - Cloud9 IDE on Node.js w/ BoneScript library BoneScript is a Node.js library specifically optimized for the Beagle family and featuring familiar Arduino function calls, exported to the browser.
  • 41. Raspberry PI - Low cost credit-card sized computer - 900MHz quad-core ARM Cortex-A7 CPU - 1GB RAM - 4 USB ports - Full HDMI port, Ethernet port - Combined 3.5mm audio jack and composite video - Camera interface (CSI) & Display interface (DSI) - Micro SD card slot - VideoCore IV 3D graphics core
  • 42. Raspberry PI - Default: Debian - The Raspberry Pi Internet of Things Framework - http://webiopi.trouch.com/ - The ThingBox Project - Use Internet of Things technologies without any technical knowledge and for free - http://thethingbox.io/
  • 43.
  • 44.
  • 46.
  • 47. var five = require("johnny-five"); var board = new five.Board(); board.on("ready", function() { // Create a standard `led` instance var led = new five.Led(13); // "blink" the led in 500ms led.blink(500); }); *The JavaScript program is executed on a host machine that runs node.js
  • 48. Cylon.js is a JavaScript framework for robotics, physical computing, and the Internet of Things. It makes it incredibly easy to command robots and devices.
  • 49. Cylon.js - Connects 36 platforms - Raspberry PI, Arduino, Pebble, … - Drivers for General Purpose Input/Output hardware - LED, buttons, sensors, … - Node based
  • 50. Cyclon.js - demo - Push button - Log “Push button” - Toggle LED - Run “ToggleLed” - Log “ToggleLed” - Toggle LED
  • 51. Node-RED is a tool for wiring together hardware devices, APIs and online services in new and interesting ways.
  • 55. Node-REDinstallation http://nodered.org/docs/hardware/raspberrypi.html *No support for node 4.x curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash DOWNLOAD INSTALL SCRIPT sudo apt-get install -y build-essential python-dev python-rpi.gpio nodejs INSTALLATION nodejs START NODEJS npm cache clean sudo npm install -g node-red INSTALL NODE-RED sudo node-red START NODE-RED
  • 59. Servo
  • 63. Help us,we need your support!
  • 64. Aptus HQ Veldkant 33b 2550 Kontich Aptus Offices Stedestraat 51 8530 Harelbeke Frederik Vannieuwenborg http://twitter.com/WeAreAptus http://www.aptus.be Let’s talk!

Editor's Notes

  1. It’s all about using JavaScript on micro-controller boards or single-board computers
  2. Agenda: baremetal javascript
  3. Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world.
  4. Frameworks