+ All Categories
Home > Software > Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

Date post: 21-Jan-2018
Category:
Upload: johann-romefort
View: 226 times
Download: 0 times
Share this document with a friend
30
Supply Chain Management on the Blockchain Johann Romefort Tech Evangelist @Stylight
Transcript
Page 1: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

Supply Chain Management on the Blockchain

Johann RomefortTech Evangelist @Stylight

Page 2: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

I’m Johann● Tech Evangelist @Stylight

● 7 years in San Francisco● Since 3 years in Munich

● Organize many meetups..● Organizer of DAHO.AM conference

● Twitter: @romefort ● [email protected]

Page 3: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

GitHub Repo

https://github.com/romefort/techfest2017

Page 4: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

GOAL

Building a simple system capable of tracking an asset on a supply chain with immutable traceability

Page 5: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

Why Blockchain forSupply Chain Management?

● Distributed Ledger● Guarantees Immutability● Publicly available● Enable product traceability at each

step of the supply chain● Tracking of important information:

○ Temperature○ Quality of goods○ Shipment and delivery dates○ Safety certifications of facilities.

Page 6: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

Application examples

● Food supply chain : Fraud up to $40B / year, globally ○ Traceability at each step can allow fast tracking of food

poisoning ○ Walmart, Nestlé, Unliver...are deploying prototypes on

the blockchain (using Hyperledger)● Traceability of luxury goods from one owner to the

next● Container transportation management● Traceability of diamonds● Traceability in Pharma industry (10% to 30% of drugs

in dev. Countries are fake.

Page 7: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

Building our prototype

What do we need?

Page 8: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

Technologies involved

ESP8266 (NodeMCU) RFID Scanner (MFRC522)

Azure IoT hub BigchainDB

Page 9: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

10000 feet view

Page 10: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

Caveats● RFID can be cloned● Prototype built in 48h with disregard for

security ● Some things are hardcoded ;-)● Want industrial secure system?

○ https://www.riddleandcode.com/

Page 11: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

ESP8266 / NodeMCU● Cheap ($2)● WIFI on board ● Low-power● Programmable on Arduino

● On TECHFEST: ○ You need to register your mac address

to access the wifi network○ Serial.println(WiFi.macAddress());

Page 12: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

Install ESP8266 inside Arduino http://arduino.esp8266.com/stable/package_esp8266com_index.json

Page 13: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

MFRC522

● Low Cost Scanner ($1)● Tags are cheap and come in various

forms: Cards, fobs, stickers● Stickers are small and can easily added

to any product

Page 14: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

Using MFRC522 on NodeMCUMFRC522 Pins NodeMCU pins

SDA D8

SCK D5

MOSI D7

MISO D6

IRQ -

GND GND

RST D3

3.3V 3.3V

● Connect pins =>● Add the MFRC522

○ Sketch > Include Libraries > Manage Libraries○ Search MFRC522○ Install

● Verify working setup○ File > Example > MFRC522 > DumpInfo○ #define RST_PIN D3

#define SS_PIN D8○ Scan a tag and verify you get its UID

Page 15: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

Reading an RFID Tag

github.com/romefort/techfest2017/nodemcu-mfrc522/TestMFRC522.ino

Page 16: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

Azure IoT Hub

● Connect devices● Send/Receive data with

HTTP/MQTT● Execute Azure

Functions● Store data in Azure

Storage● Analytics...

Page 17: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

Connecting to Azure IoT Hub

1/ Register your device

Page 18: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

Connecting to Azure IoT

Hub

2/ Get your connection

string

Page 19: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

Connecting to Azure IoT Hub3/ Get your SAS Token

1. $ npm install iothub-explorer -g2. $ iothub-explorer login “*connection _string*” (see previous slide)3. $ iothub-explorer sas-token *registered_device_name* -d 600000

Page 20: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

Connecting To Azure

IoT Hub

4/ Arduino Sketch

MQTT using PubSub Client

Page 21: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

Connecting to Azure IoT Hub5/ Verify that messages are going through

$ iothub-explorer monitor-events *your_registered_device* --login "*your_connection_string"

Page 22: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

What do we have so far?

● An IoT device capable of scanning code, connecting to WIFI and communicating with the outside world through MQTT

Page 23: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

What are we missing?

Receiving MQTT messages

Creating transactions on BigchainDB

Seeing transaction on a user-friendly UI

Page 24: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

Getting MQTT messages from Azure IoT hub

Page 25: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

Create a Transaction in BigchainDB

Page 26: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

Transfering an asset in BigChainDB

Page 27: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

Listening to transactions on BigchainDB

Page 28: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

Run an express server and forward incoming transactions to the frontend with socket.io

Page 29: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

It’s showtime!

Page 30: Supply Chain Management on the blockchain with Iot, Azure, BigchainDB, VueJS

Thank You!

https://github.com/romefort/techfest2017

@romefort


Recommended