Upload
-
View
43
Download
1
Embed Size (px)
Citation preview
Introduction to IoT Foosball
2
Electrical circuit
3
Gate A
Gate B
Arduino Firmware
4
Table modification
5
Platform IO
6
Introduction to Smart Foosball
7
Firebase - backend as service
8
Firebase Authentication
9
Firebase Realtime Database
10
Firebase Storage
11
Android app
12
Android and Firebase
13
1 public interface ChildEventListener { 2 void onChildAdded(DataSnapshot var1, String var2); 3 4 void onChildChanged(DataSnapshot var1, String var2); 5 6 void onChildRemoved(DataSnapshot var1); 7 8 void onChildMoved(DataSnapshot var1, String var2); 9 10 void onCancelled(DatabaseError var1); 11 }
1 DatabaseReference database; 2 database = FirebaseDatabase.getInstance().getReference(); 3 DatabaseReference databaseReference = database.getRef().child("/games/");
… … …
30 databaseReference.addChildEventListener(childEventListener);
Slackbot
14
Digital Ocean
15
Let’s Encrypt
16
Botkit
17
1 var Botkit = require(‘botkit'); 2 3 var slackBot = Botkit.slackbot({ 4 debug: false 5 }); 6 7 slackBot.spawn({ 8 token: process.env.token 9 }).startRTM(function(err) { 10 if (err) { 11 throw new Error(err); 12 } 13 }); 14 15 slackBot.hears(['game', 'play'], ['direct_message', 'direct_mention'], function (bot, message) { 16 bot.reply(message, "Cool, I'm in!"); 17 });
Node.js and Firebase
18
1 var Firebase = require('firebase'); 2 var firebaseDatabase = Firebase.database(); 3 4 firebaseDatabase.ref('/games/').on('value', function (snapshot) { 5 console.log("Value is:"); 6 console.log(JSON.stringify(snapshot.val(), "", 4)); 7 }); 8 9 firebaseDatabase.ref('/games/').on('child_added', function (snapshot) { 10 console.log("New child was added:"); 11 console.log(JSON.stringify(snapshot.val(), "", 4)); 12 });
Summary
Arduino app
Android Smart
Foosball IoTFirebase Slackbot
19
Hardware part
Links
20
github - Smart Foosball IoT - https://github.com/handsomecode/smart-foosball-iot
Firebase - https://firebase.google.com
Platrom IO - http://platformio.org/
Digital Ocean - https://www.digitalocean.com/ (5 $ referral https://m.do.co/c/d7d609569ff4)
github - botkit - https://github.com/howdyai/botkit
Let’s encrypt - https://letsencrypt.org/
github - firebase autovalue - https://github.com/mattlogan/auto-value-firebase
Yandex speechkit - https://tech.yandex.com/speechkit/