SlideShare uma empresa Scribd logo
1 de 42
Hacking the RaspberryPi with Java8, JavaFX8 and add-
on hardware modules
Hands on Java8 and RaspberryPi
25 June 2014, jug.ch – Pance Cavkovski & Aleksandar Nikov
Netcetera | 2
pance.cavkovski@netcetera.com
Senior Software Engineer @ Netcetera Skopje
aleksandar.nikov@netcetera.com
Head of Software Engineering @ Netcetera Skopje
Pance Cavkovski
Aleksandar Nikov
About the speakers
Netcetera | 3
What will we present
About the session
• Using Java8 and JavaFX8 on Raspberry Pi
• Extending the RasPi with components
• Interfacing with the components via Java code
You should have at the moment:
• RasPi Model B with pre-configured Raspbian on an SD Card
• A set of components (10 resistors, 10 jumper wires, 2 LEDs, 1 LDR)
• Breadboard (with a taster installed on it)
• Arduino UNO/Leonardo
• ITEAD Studio NFC module
Online source at https://github.com/hsilomedus/hands-on-raspi
Netcetera | 4
 Lang: Lambda, Method references, default methods,
repeating annotations …
 Collections: StreamAPI, HashMaps improvements
 Compact profiles, Security and tools improvements
 JavaFX8: bundled with JDK8, UI components, new theme,
WebView, 3D graphics, print, css styling…
 Nashorn javascript engine
 New Date-Time, concurrency extensions, new Java DB…
 Linux ARM v6/v7 Hard Float ABI JDK8
Java8 is out!
Netcetera | 5
Get and use with RasPi and Raspbian
Java8 on ARM devices
- Get from http://www.oracle.com/technetwork/java/javase/downloads
 Specifically Linux ARM v6/v7 Hard Float ABI
- tar xfv jdk-8….tar.gz
- ./jdk1.8.0/bin/java and ./jdk1.8.0/bin/javac
- Need hardware access? Get pi4j: http://pi4j.com/
 Based on WiringPi
 Jar(s) ready for usage
Netcetera | 6
Java library for full access to the Raspberry Pi
pi4j
• JNI to the WiringPi C library
• Features
• Export & unexport GPIO pins
• Configure and Control GPIO pins for both input and output
• Interrupt-based listeners
• RS232 communication
• I2C and SPI support
• Extensions …
• Both managed and direct access to WiringPi
Netcetera | 7
JavaFX8
JavaFX is a set of graphics and media packages that enables developers to design,
create, test, debug and deploy rich client applications that operate consistently across
diverse platforms (tl;dr: Java framework for building RIA / Desktop apps)
• Java APIs, fully integrated in JavaSE
• Declarative in FXML or explicit in Java
• Swing interoperability
• CSS stylable UI components library, Modena theme
• 3D features, hardware acceleration, web view, high-performance media engine
• Canvas & printing API, rich text support
Netcetera | 8
A glimpse into the architecture
• Stage, Scene, Layouts
• Nodes, states, effects
• Hardware/software rendering
• JavaFX, Prism and Media separate threads
• Async elements update via Pulse
Netcetera | 9
UI
• Layouts
• Transformations
• Effects
• CSS Styling
• Event Handlers
Netcetera | 10
Layout and place Components
JavaFX8 - How To
primaryStage.setTitle("JavaFX Welcome");
GridPane grid = new GridPane();
grid.setAlignment(Pos.CENTER);
grid.setHgap(10);
grid.setVgap(10);
grid.setPadding(new Insets(25, 25, 25, 25));
Scene scene = new Scene(grid, 300, 275);
primaryStage.setScene(scene);
Label userName = new Label("User Name:");
grid.add(userName, 0, 1);
TextField userTextField = new TextField();
grid.add(userTextField, 1, 1);
Button btn = new Button("Sign in");
HBox hbBtn = new HBox(10);
hbBtn.setAlignment(Pos.BOTTOM_RIGHT);
hbBtn.getChildren().add(btn);
grid.add(hbBtn, 1, 4);
btn.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent e) {
actiontarget.setFill(Color.FIREBRICK);
actiontarget.setText(
"Sign in button pressed");
}
});
primaryStage.show();
Netcetera | 11
Style with CSS
JavaFX8 - How To
scene.setStyle(“-fx-background-image:
url(‘background.jpg’);”);
userName.setStyle(“-fx-font-size: 12px;” +
“-fx-font-weight: bold;” +
“-fx-text-fill: #333333; ” +
“-fx-effect: dropshadow( gaussian ,
rgba(255,255,255,0.5) , 0,0,0,1 );”);
//OR:
scene.getStylesheets().add
(Login.class.getResource("Login.css").toExternalFo
rm());
.root {
-fx-background-image: url("background.jpg");
}
.label {
-fx-font-size: 12px;
-fx-font-weight: bold;
-fx-text-fill: #333333;
-fx-effect: dropshadow( gaussian ,
rgba(255,255,255,0.5) , 0,0,0,1 );
}
Netcetera | 12
Declarative
JavaFX8 - How To
Parent root = FXMLLoader.load(getClass().getResource("fxml_example.fxml"));
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<GridPane fx:controller="fxmlexample.FXMLExampleController"
xmlns:fx="http://javafx.com/fxml" alignment="center" hgap="10" vgap="10">
<padding><Insets top="25" right="25" bottom="10" left="25"/></padding>
<Label text="User Name:"
GridPane.columnIndex="0" GridPane.rowIndex="1"/>
<TextField
GridPane.columnIndex="1" GridPane.rowIndex="1"/>
</GridPane>
Netcetera | 13
However…
The ARM devices are slower. Be careful
• RasPi has a 700MHz v7 ARM processor with 512MB ram.
• The Embedded Full Size Operating System are still catching on
• Runs in FrameBuffer and not in X
Not really plug & play:
• - sudo jdk1.8.0/bin/java –cp ./:pi4j-core.jar:jdk1.8.0/jre/lib/jfxrt.jar*
–Djavafx.platform=eglfb* Main
*(not needed in the last Raspbian version)
Netcetera | 14
RasPi GPIO header
Netcetera | 15
RasPi GPIO header
Netcetera | 16
RasPi GPIO header cobbler and protoboard
Netcetera | 17
Examples
• LED Blink
• Taster + LED Blinker
• Serial Comm + Arduino + Light Sensor + LED
• NFC Reader
• JavaFX LED and Taster
• Examples stored as git branches
• Source code available at https://github.com/hsilomedus/hands-on-raspi
Netcetera | 18
Checkout
LED Blink
Open terminal
• cd hands-on-raspi/
• git checkout master
• Open the Main source file for inspection
• [ leafpad | vi | nano ] src/Main.java
Netcetera | 19
LED Blink
Netcetera | 20
Connect the breadboard
Netcetera | 21
LED Blink
Netcetera | 22
Build and run
LED Blink
• ./build.sh
• Create/clean target dir
• Copy libs
• Execute javac with added pi4j into classpath
• ./run.sh
• Sudo execute java with added pi4j into classpath
Netcetera | 23
Taster + LED Blinker (git checkout taster)
Netcetera | 24
Taster + LED Blinker
Netcetera | 25
Extend
Taster + two blinkers
• Use RaspiPin.GPIO_02
• Connect jumper cable + another 220 Ohms + Green LED in serial
• Code
• Make the LEDs to blink alternativelly
• Make the green LED to light up while the taster is down.
Netcetera | 26
Serial Comm + Arduino + Light Sensor + LED
• Arduino
• Open-source electronics prototyping platform
• Programmable IC on board with header pins
• Serial Communication
• Lightweight two-way communication between two devices
• Needs two connections: Rx1 to Tx2 and Rx2 to Tx1
• Needs compatible baud-rate (9600bps), data/stop/parity bits (8-N-1) and voltage
• Light Sensor
• Variable resistor based on light
• <1K on intense light, ~4k7 on daylight, > 70K on dark
Netcetera | 27
Serial Comm (git checkout serial) - Arduino code
Netcetera | 28
Serial Comm (git checkout serial) – pi4j code
Netcetera | 29
Serial Comm (board connect)
Netcetera | 30
Serial Comm (board connect)
Netcetera | 31
Serial Comm (board connect)
Netcetera | 32
Serial Comm (board connect)
Netcetera | 33
Serial Comm (board connect)
Netcetera | 34
Execute
Serial Comm
• Build & run
• Inspect the standard output
• Illuminate the sensor with your phone
• Cover the sensor with your finger
• Alternative:
• RasPi will recognize input < 1 V as a logical zero, > 2V as a logical one
• “Calculated” voltage divider can do the trick
Netcetera | 35
ITEAD PN532 NFC Module
NFC Reader
• http://imall.iteadstudio.com/im130625002.html
• 13.56 MHz Near Field Communication
• Onboard antenna
• Up to 3 CM effective distance
• Compatible with ISO14443 Type A and B
• Supports SPI, I2C and UART interface
• With exact RasPi GPIO layout
• Connects with the same ribbon cable
• Provided Arduino and RasPi libraries (in C)
Netcetera | 36
git checkout nfc-serial
NFC Reader
• Inspect Main.java, PN532.java and PN532Spi.java
• Follows strict protocol on byte level
• Begin()
• Init wiringPi and wiringPiSpi with channel and speed
• Wakeup()
• Fire up CS falling edge
• Write Command()
• Send boxed command, data, computed checksum, wait for and check ACK
• ReadResponse()
• Read bytes and store in internal buffer
Netcetera | 37
git checkout nfc-serial
NFC Reader
• Various commands
• getFirmwareVersion() [0x02]
• SAMConfig() [0x14, 0x01, 0x14, 0x01]
• readPassiveTargetID [0x4A, 0x01, baudrate]
• Auth/read/write Block (not implemented)
• Used non-managed pi4j approach
• Gpio.wiringPiSetup()
• Gpio.wiringPiSPISetup(SPICHANNEL, SPISPEED)
• Gpio.pinMode(pin, INPUT/OUTPUT) and Gpio.digitalWrite(pin, HIGH/LOW)
• Spi.wiringPiSPIDataRW(SPICHANNEL, dataToSend, 1);
Netcetera | 38
NFC Reader
• Connect
• Build & Run
• Observe
Netcetera | 39
TasterFX (git checkout taster-fx)
Netcetera | 40
TasterFX
Netcetera | 41
Execute
TasterFX
• Build & run
• Click on the button
• Click the taster
• Exit and see what happens
Netcetera | 42
Q & A
• https://twitter.com/hsilomedus
• http://hsilomedus.me/
• pance.cavkovski@netcetera.com

Mais conteúdo relacionado

Mais procurados

Micro control idsecconf2010
Micro control idsecconf2010Micro control idsecconf2010
Micro control idsecconf2010idsecconf
 
Tech Days 2015: Embedded Product Update
Tech Days 2015: Embedded Product UpdateTech Days 2015: Embedded Product Update
Tech Days 2015: Embedded Product UpdateAdaCore
 
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/LinuxIoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/LinuxSamsung Open Source Group
 
BUD17-104: Scripting Languages in IoT: Challenges and Approaches
BUD17-104: Scripting Languages in IoT: Challenges and ApproachesBUD17-104: Scripting Languages in IoT: Challenges and Approaches
BUD17-104: Scripting Languages in IoT: Challenges and ApproachesLinaro
 
Andrea De Gaetano - An Adventure with ESP8266 firmwares and IOT
Andrea De Gaetano - An Adventure with ESP8266 firmwares and IOTAndrea De Gaetano - An Adventure with ESP8266 firmwares and IOT
Andrea De Gaetano - An Adventure with ESP8266 firmwares and IOTCodemotion
 
LAS16-507: LXC support in LAVA
LAS16-507: LXC support in LAVALAS16-507: LXC support in LAVA
LAS16-507: LXC support in LAVALinaro
 
Tech Days 2015: ARM Programming with GNAT and Ada 2012
Tech Days 2015: ARM Programming with GNAT and Ada 2012Tech Days 2015: ARM Programming with GNAT and Ada 2012
Tech Days 2015: ARM Programming with GNAT and Ada 2012AdaCore
 
Kernel Recipes 2018 - Zinc: minimal lightweight crypto API - Jason Donenfeld
Kernel Recipes 2018 - Zinc: minimal lightweight crypto API - Jason DonenfeldKernel Recipes 2018 - Zinc: minimal lightweight crypto API - Jason Donenfeld
Kernel Recipes 2018 - Zinc: minimal lightweight crypto API - Jason DonenfeldAnne Nicolas
 
Las16 309 - lua jit arm64 port - status
Las16 309 - lua jit arm64 port - statusLas16 309 - lua jit arm64 port - status
Las16 309 - lua jit arm64 port - statusLinaro
 
Build a Deep Learning App with Tensorflow & Redis by Jayesh Ahire and Sherin ...
Build a Deep Learning App with Tensorflow & Redis by Jayesh Ahire and Sherin ...Build a Deep Learning App with Tensorflow & Redis by Jayesh Ahire and Sherin ...
Build a Deep Learning App with Tensorflow & Redis by Jayesh Ahire and Sherin ...Redis Labs
 
LAS16-211: Using LAVA V2 for advanced KVM testing
LAS16-211: Using LAVA V2 for advanced KVM testingLAS16-211: Using LAVA V2 for advanced KVM testing
LAS16-211: Using LAVA V2 for advanced KVM testingLinaro
 
Emanuele Faranda - Creating network overlays with IoT devices using N2N
Emanuele Faranda - Creating network overlays with IoT devices using N2NEmanuele Faranda - Creating network overlays with IoT devices using N2N
Emanuele Faranda - Creating network overlays with IoT devices using N2Nlinuxlab_conf
 

Mais procurados (20)

JerryScript on RIOT
JerryScript on RIOTJerryScript on RIOT
JerryScript on RIOT
 
Micro control idsecconf2010
Micro control idsecconf2010Micro control idsecconf2010
Micro control idsecconf2010
 
Framework for IoT Interoperability
Framework for IoT InteroperabilityFramework for IoT Interoperability
Framework for IoT Interoperability
 
Tech Days 2015: Embedded Product Update
Tech Days 2015: Embedded Product UpdateTech Days 2015: Embedded Product Update
Tech Days 2015: Embedded Product Update
 
Development Boards for Tizen IoT
Development Boards for Tizen IoTDevelopment Boards for Tizen IoT
Development Boards for Tizen IoT
 
webthing-floss-iot-20180607rzr
webthing-floss-iot-20180607rzrwebthing-floss-iot-20180607rzr
webthing-floss-iot-20180607rzr
 
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/LinuxIoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
 
BUD17-104: Scripting Languages in IoT: Challenges and Approaches
BUD17-104: Scripting Languages in IoT: Challenges and ApproachesBUD17-104: Scripting Languages in IoT: Challenges and Approaches
BUD17-104: Scripting Languages in IoT: Challenges and Approaches
 
Andrea De Gaetano - An Adventure with ESP8266 firmwares and IOT
Andrea De Gaetano - An Adventure with ESP8266 firmwares and IOTAndrea De Gaetano - An Adventure with ESP8266 firmwares and IOT
Andrea De Gaetano - An Adventure with ESP8266 firmwares and IOT
 
Using FPGA in Embedded Devices
Using FPGA in Embedded DevicesUsing FPGA in Embedded Devices
Using FPGA in Embedded Devices
 
LAS16-507: LXC support in LAVA
LAS16-507: LXC support in LAVALAS16-507: LXC support in LAVA
LAS16-507: LXC support in LAVA
 
Tech Days 2015: ARM Programming with GNAT and Ada 2012
Tech Days 2015: ARM Programming with GNAT and Ada 2012Tech Days 2015: ARM Programming with GNAT and Ada 2012
Tech Days 2015: ARM Programming with GNAT and Ada 2012
 
Easy IoT with JavaScript
Easy IoT with JavaScriptEasy IoT with JavaScript
Easy IoT with JavaScript
 
Janus & docker: friends or foe
Janus & docker: friends or foe Janus & docker: friends or foe
Janus & docker: friends or foe
 
Kernel Recipes 2018 - Zinc: minimal lightweight crypto API - Jason Donenfeld
Kernel Recipes 2018 - Zinc: minimal lightweight crypto API - Jason DonenfeldKernel Recipes 2018 - Zinc: minimal lightweight crypto API - Jason Donenfeld
Kernel Recipes 2018 - Zinc: minimal lightweight crypto API - Jason Donenfeld
 
Las16 309 - lua jit arm64 port - status
Las16 309 - lua jit arm64 port - statusLas16 309 - lua jit arm64 port - status
Las16 309 - lua jit arm64 port - status
 
Build a Deep Learning App with Tensorflow & Redis by Jayesh Ahire and Sherin ...
Build a Deep Learning App with Tensorflow & Redis by Jayesh Ahire and Sherin ...Build a Deep Learning App with Tensorflow & Redis by Jayesh Ahire and Sherin ...
Build a Deep Learning App with Tensorflow & Redis by Jayesh Ahire and Sherin ...
 
LAS16-211: Using LAVA V2 for advanced KVM testing
LAS16-211: Using LAVA V2 for advanced KVM testingLAS16-211: Using LAVA V2 for advanced KVM testing
LAS16-211: Using LAVA V2 for advanced KVM testing
 
Emanuele Faranda - Creating network overlays with IoT devices using N2N
Emanuele Faranda - Creating network overlays with IoT devices using N2NEmanuele Faranda - Creating network overlays with IoT devices using N2N
Emanuele Faranda - Creating network overlays with IoT devices using N2N
 
Introduction to IoT.JS
Introduction to IoT.JSIntroduction to IoT.JS
Introduction to IoT.JS
 

Semelhante a Hands on Java8 and RaspberryPi

Peripheral Programming using Arduino and Python on MediaTek LinkIt Smart 7688...
Peripheral Programming using Arduino and Python on MediaTek LinkIt Smart 7688...Peripheral Programming using Arduino and Python on MediaTek LinkIt Smart 7688...
Peripheral Programming using Arduino and Python on MediaTek LinkIt Smart 7688...MediaTek Labs
 
Quick prototyping using Gadgeteer, Raspberry Pi + Fez Cream
Quick prototyping using Gadgeteer, Raspberry Pi + Fez CreamQuick prototyping using Gadgeteer, Raspberry Pi + Fez Cream
Quick prototyping using Gadgeteer, Raspberry Pi + Fez CreamMif Masterz
 
DIY OFDM Session
DIY OFDM SessionDIY OFDM Session
DIY OFDM SessionNutaq
 
Presentation 3 software developer in rfid
Presentation 3 software developer in rfidPresentation 3 software developer in rfid
Presentation 3 software developer in rfidMouhanad Alkhaldi
 
LEGaTO Heterogeneous Hardware
LEGaTO Heterogeneous HardwareLEGaTO Heterogeneous Hardware
LEGaTO Heterogeneous HardwareLEGATO project
 
Micro & mobile
Micro & mobileMicro & mobile
Micro & mobileNetcetera
 
Codasip application class RISC-V processor solutions
Codasip application class RISC-V processor solutionsCodasip application class RISC-V processor solutions
Codasip application class RISC-V processor solutionsRISC-V International
 
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023Peter Gallagher
 
Web e device in real time con asp.net Signal R
Web e device in real time con asp.net Signal RWeb e device in real time con asp.net Signal R
Web e device in real time con asp.net Signal RLuca Zulian
 
Software Network Data Plane - Satisfying the need for speed - FD.io - VPP and...
Software Network Data Plane - Satisfying the need for speed - FD.io - VPP and...Software Network Data Plane - Satisfying the need for speed - FD.io - VPP and...
Software Network Data Plane - Satisfying the need for speed - FD.io - VPP and...Haidee McMahon
 
Basic Design Flow for Field Programmable Gate Arrays
Basic Design Flow for Field Programmable Gate ArraysBasic Design Flow for Field Programmable Gate Arrays
Basic Design Flow for Field Programmable Gate ArraysUsha Mehta
 
Kernel Recipes 2017 - The Serial Device Bus - Johan Hovold
Kernel Recipes 2017 - The Serial Device Bus - Johan HovoldKernel Recipes 2017 - The Serial Device Bus - Johan Hovold
Kernel Recipes 2017 - The Serial Device Bus - Johan HovoldAnne Nicolas
 
Edje Project: The Software Foundation for IoT Devices
Edje Project: The Software Foundation for IoT DevicesEdje Project: The Software Foundation for IoT Devices
Edje Project: The Software Foundation for IoT DevicesMicroEJ
 
MediaTek Linkit Smart 7688 Webinar
MediaTek Linkit Smart 7688 WebinarMediaTek Linkit Smart 7688 Webinar
MediaTek Linkit Smart 7688 WebinarMediaTek Labs
 
Labview1_ Computer Applications in Control_ACRRL
Labview1_ Computer Applications in Control_ACRRLLabview1_ Computer Applications in Control_ACRRL
Labview1_ Computer Applications in Control_ACRRLMohammad Sabouri
 
Internet of Things, Mobility & .Net Micro Framework SydMobNet March 2014
Internet of Things, Mobility & .Net Micro Framework SydMobNet March 2014Internet of Things, Mobility & .Net Micro Framework SydMobNet March 2014
Internet of Things, Mobility & .Net Micro Framework SydMobNet March 2014Alec Tucker
 
Overview of the Intel® Internet of Things Developer Kit
Overview of the Intel® Internet of Things Developer KitOverview of the Intel® Internet of Things Developer Kit
Overview of the Intel® Internet of Things Developer KitIntel® Software
 
Tech Days 2015: AdaCore Roadmap
Tech Days 2015: AdaCore RoadmapTech Days 2015: AdaCore Roadmap
Tech Days 2015: AdaCore RoadmapAdaCore
 

Semelhante a Hands on Java8 and RaspberryPi (20)

Peripheral Programming using Arduino and Python on MediaTek LinkIt Smart 7688...
Peripheral Programming using Arduino and Python on MediaTek LinkIt Smart 7688...Peripheral Programming using Arduino and Python on MediaTek LinkIt Smart 7688...
Peripheral Programming using Arduino and Python on MediaTek LinkIt Smart 7688...
 
Quick prototyping using Gadgeteer, Raspberry Pi + Fez Cream
Quick prototyping using Gadgeteer, Raspberry Pi + Fez CreamQuick prototyping using Gadgeteer, Raspberry Pi + Fez Cream
Quick prototyping using Gadgeteer, Raspberry Pi + Fez Cream
 
DIY OFDM Session
DIY OFDM SessionDIY OFDM Session
DIY OFDM Session
 
Presentation 3 software developer in rfid
Presentation 3 software developer in rfidPresentation 3 software developer in rfid
Presentation 3 software developer in rfid
 
LEGaTO Heterogeneous Hardware
LEGaTO Heterogeneous HardwareLEGaTO Heterogeneous Hardware
LEGaTO Heterogeneous Hardware
 
Micro & mobile
Micro & mobileMicro & mobile
Micro & mobile
 
Codasip application class RISC-V processor solutions
Codasip application class RISC-V processor solutionsCodasip application class RISC-V processor solutions
Codasip application class RISC-V processor solutions
 
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023
 
Vlsi lab
Vlsi labVlsi lab
Vlsi lab
 
Web e device in real time con asp.net Signal R
Web e device in real time con asp.net Signal RWeb e device in real time con asp.net Signal R
Web e device in real time con asp.net Signal R
 
Software Network Data Plane - Satisfying the need for speed - FD.io - VPP and...
Software Network Data Plane - Satisfying the need for speed - FD.io - VPP and...Software Network Data Plane - Satisfying the need for speed - FD.io - VPP and...
Software Network Data Plane - Satisfying the need for speed - FD.io - VPP and...
 
Basic Design Flow for Field Programmable Gate Arrays
Basic Design Flow for Field Programmable Gate ArraysBasic Design Flow for Field Programmable Gate Arrays
Basic Design Flow for Field Programmable Gate Arrays
 
Kernel Recipes 2017 - The Serial Device Bus - Johan Hovold
Kernel Recipes 2017 - The Serial Device Bus - Johan HovoldKernel Recipes 2017 - The Serial Device Bus - Johan Hovold
Kernel Recipes 2017 - The Serial Device Bus - Johan Hovold
 
Edje Project: The Software Foundation for IoT Devices
Edje Project: The Software Foundation for IoT DevicesEdje Project: The Software Foundation for IoT Devices
Edje Project: The Software Foundation for IoT Devices
 
nios.ppt
nios.pptnios.ppt
nios.ppt
 
MediaTek Linkit Smart 7688 Webinar
MediaTek Linkit Smart 7688 WebinarMediaTek Linkit Smart 7688 Webinar
MediaTek Linkit Smart 7688 Webinar
 
Labview1_ Computer Applications in Control_ACRRL
Labview1_ Computer Applications in Control_ACRRLLabview1_ Computer Applications in Control_ACRRL
Labview1_ Computer Applications in Control_ACRRL
 
Internet of Things, Mobility & .Net Micro Framework SydMobNet March 2014
Internet of Things, Mobility & .Net Micro Framework SydMobNet March 2014Internet of Things, Mobility & .Net Micro Framework SydMobNet March 2014
Internet of Things, Mobility & .Net Micro Framework SydMobNet March 2014
 
Overview of the Intel® Internet of Things Developer Kit
Overview of the Intel® Internet of Things Developer KitOverview of the Intel® Internet of Things Developer Kit
Overview of the Intel® Internet of Things Developer Kit
 
Tech Days 2015: AdaCore Roadmap
Tech Days 2015: AdaCore RoadmapTech Days 2015: AdaCore Roadmap
Tech Days 2015: AdaCore Roadmap
 

Mais de Pance Cavkovski

Jprofessionals co create the future of your city
Jprofessionals co create the future of your cityJprofessionals co create the future of your city
Jprofessionals co create the future of your cityPance Cavkovski
 
Gluing the IoT world with Java and LoRaWAN (Jfokus 2018)
Gluing the IoT world with Java and LoRaWAN (Jfokus 2018)Gluing the IoT world with Java and LoRaWAN (Jfokus 2018)
Gluing the IoT world with Java and LoRaWAN (Jfokus 2018)Pance Cavkovski
 
Gluing the iot world (ICT)
Gluing the iot world (ICT)Gluing the iot world (ICT)
Gluing the iot world (ICT)Pance Cavkovski
 
Gluing the IoT world with Java and LoRaWAN
Gluing the IoT world with Java and LoRaWANGluing the IoT world with Java and LoRaWAN
Gluing the IoT world with Java and LoRaWANPance Cavkovski
 
VDB16 - DIY Java & Kubernetes
VDB16 - DIY Java & KubernetesVDB16 - DIY Java & Kubernetes
VDB16 - DIY Java & KubernetesPance Cavkovski
 
Connected hardware for Software Engineers 101
Connected hardware for Software Engineers 101Connected hardware for Software Engineers 101
Connected hardware for Software Engineers 101Pance Cavkovski
 
Micro and moblile: Java on the Raspberry Pi
Micro and moblile: Java on the Raspberry PiMicro and moblile: Java on the Raspberry Pi
Micro and moblile: Java on the Raspberry PiPance Cavkovski
 

Mais de Pance Cavkovski (9)

Jprofessionals co create the future of your city
Jprofessionals co create the future of your cityJprofessionals co create the future of your city
Jprofessionals co create the future of your city
 
Gluing the IoT world with Java and LoRaWAN (Jfokus 2018)
Gluing the IoT world with Java and LoRaWAN (Jfokus 2018)Gluing the IoT world with Java and LoRaWAN (Jfokus 2018)
Gluing the IoT world with Java and LoRaWAN (Jfokus 2018)
 
Gluing the iot world (ICT)
Gluing the iot world (ICT)Gluing the iot world (ICT)
Gluing the iot world (ICT)
 
Gluing the IoT world with Java and LoRaWAN
Gluing the IoT world with Java and LoRaWANGluing the IoT world with Java and LoRaWAN
Gluing the IoT world with Java and LoRaWAN
 
VDB16 - DIY Java & Kubernetes
VDB16 - DIY Java & KubernetesVDB16 - DIY Java & Kubernetes
VDB16 - DIY Java & Kubernetes
 
DIY Java & Kubernetes
DIY Java & KubernetesDIY Java & Kubernetes
DIY Java & Kubernetes
 
Connected hardware for Software Engineers 101
Connected hardware for Software Engineers 101Connected hardware for Software Engineers 101
Connected hardware for Software Engineers 101
 
Micro and moblile: Java on the Raspberry Pi
Micro and moblile: Java on the Raspberry PiMicro and moblile: Java on the Raspberry Pi
Micro and moblile: Java on the Raspberry Pi
 
Web sockets in Java
Web sockets in JavaWeb sockets in Java
Web sockets in Java
 

Último

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Último (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Hands on Java8 and RaspberryPi

  • 1. Hacking the RaspberryPi with Java8, JavaFX8 and add- on hardware modules Hands on Java8 and RaspberryPi 25 June 2014, jug.ch – Pance Cavkovski & Aleksandar Nikov
  • 2. Netcetera | 2 pance.cavkovski@netcetera.com Senior Software Engineer @ Netcetera Skopje aleksandar.nikov@netcetera.com Head of Software Engineering @ Netcetera Skopje Pance Cavkovski Aleksandar Nikov About the speakers
  • 3. Netcetera | 3 What will we present About the session • Using Java8 and JavaFX8 on Raspberry Pi • Extending the RasPi with components • Interfacing with the components via Java code You should have at the moment: • RasPi Model B with pre-configured Raspbian on an SD Card • A set of components (10 resistors, 10 jumper wires, 2 LEDs, 1 LDR) • Breadboard (with a taster installed on it) • Arduino UNO/Leonardo • ITEAD Studio NFC module Online source at https://github.com/hsilomedus/hands-on-raspi
  • 4. Netcetera | 4  Lang: Lambda, Method references, default methods, repeating annotations …  Collections: StreamAPI, HashMaps improvements  Compact profiles, Security and tools improvements  JavaFX8: bundled with JDK8, UI components, new theme, WebView, 3D graphics, print, css styling…  Nashorn javascript engine  New Date-Time, concurrency extensions, new Java DB…  Linux ARM v6/v7 Hard Float ABI JDK8 Java8 is out!
  • 5. Netcetera | 5 Get and use with RasPi and Raspbian Java8 on ARM devices - Get from http://www.oracle.com/technetwork/java/javase/downloads  Specifically Linux ARM v6/v7 Hard Float ABI - tar xfv jdk-8….tar.gz - ./jdk1.8.0/bin/java and ./jdk1.8.0/bin/javac - Need hardware access? Get pi4j: http://pi4j.com/  Based on WiringPi  Jar(s) ready for usage
  • 6. Netcetera | 6 Java library for full access to the Raspberry Pi pi4j • JNI to the WiringPi C library • Features • Export & unexport GPIO pins • Configure and Control GPIO pins for both input and output • Interrupt-based listeners • RS232 communication • I2C and SPI support • Extensions … • Both managed and direct access to WiringPi
  • 7. Netcetera | 7 JavaFX8 JavaFX is a set of graphics and media packages that enables developers to design, create, test, debug and deploy rich client applications that operate consistently across diverse platforms (tl;dr: Java framework for building RIA / Desktop apps) • Java APIs, fully integrated in JavaSE • Declarative in FXML or explicit in Java • Swing interoperability • CSS stylable UI components library, Modena theme • 3D features, hardware acceleration, web view, high-performance media engine • Canvas & printing API, rich text support
  • 8. Netcetera | 8 A glimpse into the architecture • Stage, Scene, Layouts • Nodes, states, effects • Hardware/software rendering • JavaFX, Prism and Media separate threads • Async elements update via Pulse
  • 9. Netcetera | 9 UI • Layouts • Transformations • Effects • CSS Styling • Event Handlers
  • 10. Netcetera | 10 Layout and place Components JavaFX8 - How To primaryStage.setTitle("JavaFX Welcome"); GridPane grid = new GridPane(); grid.setAlignment(Pos.CENTER); grid.setHgap(10); grid.setVgap(10); grid.setPadding(new Insets(25, 25, 25, 25)); Scene scene = new Scene(grid, 300, 275); primaryStage.setScene(scene); Label userName = new Label("User Name:"); grid.add(userName, 0, 1); TextField userTextField = new TextField(); grid.add(userTextField, 1, 1); Button btn = new Button("Sign in"); HBox hbBtn = new HBox(10); hbBtn.setAlignment(Pos.BOTTOM_RIGHT); hbBtn.getChildren().add(btn); grid.add(hbBtn, 1, 4); btn.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { actiontarget.setFill(Color.FIREBRICK); actiontarget.setText( "Sign in button pressed"); } }); primaryStage.show();
  • 11. Netcetera | 11 Style with CSS JavaFX8 - How To scene.setStyle(“-fx-background-image: url(‘background.jpg’);”); userName.setStyle(“-fx-font-size: 12px;” + “-fx-font-weight: bold;” + “-fx-text-fill: #333333; ” + “-fx-effect: dropshadow( gaussian , rgba(255,255,255,0.5) , 0,0,0,1 );”); //OR: scene.getStylesheets().add (Login.class.getResource("Login.css").toExternalFo rm()); .root { -fx-background-image: url("background.jpg"); } .label { -fx-font-size: 12px; -fx-font-weight: bold; -fx-text-fill: #333333; -fx-effect: dropshadow( gaussian , rgba(255,255,255,0.5) , 0,0,0,1 ); }
  • 12. Netcetera | 12 Declarative JavaFX8 - How To Parent root = FXMLLoader.load(getClass().getResource("fxml_example.fxml")); <?import javafx.geometry.*?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <?import javafx.scene.text.*?> <GridPane fx:controller="fxmlexample.FXMLExampleController" xmlns:fx="http://javafx.com/fxml" alignment="center" hgap="10" vgap="10"> <padding><Insets top="25" right="25" bottom="10" left="25"/></padding> <Label text="User Name:" GridPane.columnIndex="0" GridPane.rowIndex="1"/> <TextField GridPane.columnIndex="1" GridPane.rowIndex="1"/> </GridPane>
  • 13. Netcetera | 13 However… The ARM devices are slower. Be careful • RasPi has a 700MHz v7 ARM processor with 512MB ram. • The Embedded Full Size Operating System are still catching on • Runs in FrameBuffer and not in X Not really plug & play: • - sudo jdk1.8.0/bin/java –cp ./:pi4j-core.jar:jdk1.8.0/jre/lib/jfxrt.jar* –Djavafx.platform=eglfb* Main *(not needed in the last Raspbian version)
  • 14. Netcetera | 14 RasPi GPIO header
  • 15. Netcetera | 15 RasPi GPIO header
  • 16. Netcetera | 16 RasPi GPIO header cobbler and protoboard
  • 17. Netcetera | 17 Examples • LED Blink • Taster + LED Blinker • Serial Comm + Arduino + Light Sensor + LED • NFC Reader • JavaFX LED and Taster • Examples stored as git branches • Source code available at https://github.com/hsilomedus/hands-on-raspi
  • 18. Netcetera | 18 Checkout LED Blink Open terminal • cd hands-on-raspi/ • git checkout master • Open the Main source file for inspection • [ leafpad | vi | nano ] src/Main.java
  • 20. Netcetera | 20 Connect the breadboard
  • 22. Netcetera | 22 Build and run LED Blink • ./build.sh • Create/clean target dir • Copy libs • Execute javac with added pi4j into classpath • ./run.sh • Sudo execute java with added pi4j into classpath
  • 23. Netcetera | 23 Taster + LED Blinker (git checkout taster)
  • 24. Netcetera | 24 Taster + LED Blinker
  • 25. Netcetera | 25 Extend Taster + two blinkers • Use RaspiPin.GPIO_02 • Connect jumper cable + another 220 Ohms + Green LED in serial • Code • Make the LEDs to blink alternativelly • Make the green LED to light up while the taster is down.
  • 26. Netcetera | 26 Serial Comm + Arduino + Light Sensor + LED • Arduino • Open-source electronics prototyping platform • Programmable IC on board with header pins • Serial Communication • Lightweight two-way communication between two devices • Needs two connections: Rx1 to Tx2 and Rx2 to Tx1 • Needs compatible baud-rate (9600bps), data/stop/parity bits (8-N-1) and voltage • Light Sensor • Variable resistor based on light • <1K on intense light, ~4k7 on daylight, > 70K on dark
  • 27. Netcetera | 27 Serial Comm (git checkout serial) - Arduino code
  • 28. Netcetera | 28 Serial Comm (git checkout serial) – pi4j code
  • 29. Netcetera | 29 Serial Comm (board connect)
  • 30. Netcetera | 30 Serial Comm (board connect)
  • 31. Netcetera | 31 Serial Comm (board connect)
  • 32. Netcetera | 32 Serial Comm (board connect)
  • 33. Netcetera | 33 Serial Comm (board connect)
  • 34. Netcetera | 34 Execute Serial Comm • Build & run • Inspect the standard output • Illuminate the sensor with your phone • Cover the sensor with your finger • Alternative: • RasPi will recognize input < 1 V as a logical zero, > 2V as a logical one • “Calculated” voltage divider can do the trick
  • 35. Netcetera | 35 ITEAD PN532 NFC Module NFC Reader • http://imall.iteadstudio.com/im130625002.html • 13.56 MHz Near Field Communication • Onboard antenna • Up to 3 CM effective distance • Compatible with ISO14443 Type A and B • Supports SPI, I2C and UART interface • With exact RasPi GPIO layout • Connects with the same ribbon cable • Provided Arduino and RasPi libraries (in C)
  • 36. Netcetera | 36 git checkout nfc-serial NFC Reader • Inspect Main.java, PN532.java and PN532Spi.java • Follows strict protocol on byte level • Begin() • Init wiringPi and wiringPiSpi with channel and speed • Wakeup() • Fire up CS falling edge • Write Command() • Send boxed command, data, computed checksum, wait for and check ACK • ReadResponse() • Read bytes and store in internal buffer
  • 37. Netcetera | 37 git checkout nfc-serial NFC Reader • Various commands • getFirmwareVersion() [0x02] • SAMConfig() [0x14, 0x01, 0x14, 0x01] • readPassiveTargetID [0x4A, 0x01, baudrate] • Auth/read/write Block (not implemented) • Used non-managed pi4j approach • Gpio.wiringPiSetup() • Gpio.wiringPiSPISetup(SPICHANNEL, SPISPEED) • Gpio.pinMode(pin, INPUT/OUTPUT) and Gpio.digitalWrite(pin, HIGH/LOW) • Spi.wiringPiSPIDataRW(SPICHANNEL, dataToSend, 1);
  • 38. Netcetera | 38 NFC Reader • Connect • Build & Run • Observe
  • 39. Netcetera | 39 TasterFX (git checkout taster-fx)
  • 41. Netcetera | 41 Execute TasterFX • Build & run • Click on the button • Click the taster • Exit and see what happens
  • 42. Netcetera | 42 Q & A • https://twitter.com/hsilomedus • http://hsilomedus.me/ • pance.cavkovski@netcetera.com