Monsters, brievenbussen en andere onzin @ Amsterdam University of Applied Sciences

Monsters, brievenbussen en andere onzin @ Amsterdam University of Applied Sciences

Monsters, mailboxes and other non-sense. A talk about about combining sensors, switches and displays with different technologies to solve problems that don't really exist and more importantly just to have fun with IoT and make geeky stuff. This talk contains monsters, and lots of them.

De023a9aff4c7a5ede3a81e8c76f17b5?s=128

Niels Leenheer

April 11, 2017
Tweet

Transcript

  1. monsters, brievenbussen en andere onzin

  2. None
  3. None
  4. een nieuw huis

  5. None
  6. None
  7. 10 meter

  8. het huis 
 van de toekomst

  9. None
  10. IoT is zo ongelofelijk saai

  11. 433MHz

  12. None
  13. None
  14. None
  15. None
  16. mesh networking

  17. afstand mesh rechtstreeks 2-weg standaard ̣ ✔ ✔ ✔ ̣̣

    ✱ ✔ ✔ ✔ 433 MHz ̣̣̣ ✱ ̣̣̣̣ ✔ ✔ ✱ ̣̣̣̣ ✔ ✔ ✔
  18. raspberry pi met domoticz

  19. None
  20. None
  21. kippenverwarming

  22. brrrr!

  23. kippenwaterdrinkbak

  24. kippenwaterdrinkbakverwarmingselement

  25. kippenwaterdrinkbakverwarmingselementschakelaar

  26. kippenwaterdrinkbakverwarmingselementschakelaarthermometer

  27. None
  28. rfxcom

  29. elke 30 seconden een “ping” met de temperatuur

  30. temperatuur onder nul, zet de verwarming aan

  31. zet klikaanklikuit schakelaar aan

  32. None
  33. The “S” in IoT stands for security

  34. None
  35. de vurige 
 heksenpot

  36. Doe-het-zelf IoT

  37. brains (oftewel microcontrollers)

  38. Arduino Uno
 ATmega238
 16 Mhz
 2 KB RAM
 32 KB

    Flash
  39. ESP-01
 ESP 8266 
 80 Mhz
 128 KB RAM
 512

    KB Flash

  40. NodeMCU
 ESP 8266
 80 Mhz
 128 KB RAM
 4 MB

    Flash

  41. NodeMCU

  42. Neopixel
 24 serieel 
 geschakelde 
 WS2812 RGB 
 LEDs

  43. #include <Adafruit_NeoPixel.h> #define PIN D1 #define PIXELS 24 Adafruit_NeoPixel strip

    = Adafruit_NeoPixel(PIXELS, PIN, NEO_GRB + NEO_KHZ800); void setup(void) { strip.begin(); strip.setBrightness(255); strip.setPixelColor(0, strip.Color(0, 0, 255)); strip.show(); } void loop(void) { }
  44. int i = 0; void setup(void) { strip.begin(); strip.setBrightness(255); }

    void loop(void) { i = (i + 1) % PIXELS; strip.setPixelColor(i % PIXELS, strip.Color(0, 0, 0)); strip.setPixelColor((i + 1) % PIXELS, strip.Color(0, 0, 63)); strip.setPixelColor((i + 2) % PIXELS, strip.Color(0, 0, 127)); strip.setPixelColor((i + 3) % PIXELS, strip.Color(0, 0, 195)); strip.setPixelColor((i + 4) % PIXELS, strip.Color(0, 0, 255)); strip.show(); delay(8); }
  45. ?! JavaScript? En C?
 Zo'n beetje hetzelfde. Ongeveer.
 Niet helemaal.

    Nee.
  46. IKEA SOMMAR 2017 theelichthouder

  47. None
  48. None
  49. None
  50. None
  51. WiFi is vast heel moeilijk…

  52. const char* ssid = "........"; const char* password = "........";

    ESP8266WebServer server(80); void setup(void) { WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) delay(500); server.on("/on", [](){ server.send(200, "text/plain", "on"); }); server.on("/off", [](){ server.send(200, "text/plain", "off"); }); server.begin(); } void loop(void) { server.handleClient(); }
  53. http:/ /sparkle.local/api?command=power&status
 command=power&on
 command=power&off command=brightness&status
 command=brightness&set=50 command=color&status
 command=color&set=f34d0d

  54. homebridge homebridge-better-http-rgb

  55. siri

  56. pixel monsters

  57. Prolight 12W plafondlamp

  58. None
  59. Neopixel
 64 serieel 
 geschakelde 
 WS2812 RGB 
 LEDs

  60. None
  61. SD card Opslag van monsters Buzzer Piepjes voor een notificatie

    Lichtgevoelige weerstand Nachtstand
  62. None
  63. None
  64. None
  65. None
  66. progressive
 web app

  67. http:/ /pixel.local

  68. http:/ /pixel.local

  69. None
  70. editor.addEventListener('touchstart', handleTouch); editor.addEventListener('touchmove', handleTouch); function handleTouch(e) { for (var i

    = 0; i < e.changedTouches.length; i++) { let elem = document.elementFromPoint( e.changedTouches[i].pageX, e.changedTouches[i].pageY ); if (elem.tagName && elem.tagName == 'TD' && 
 editor.contains(elem)) 
 { drawPixel(elem); } } e.preventDefault(); }
  71. editor.addEventListener('touchstart', handleTouch); editor.addEventListener('touchmove', handleTouch); function handleTouch(e) { for (var i

    = 0; i < e.changedTouches.length; i++) { let elem = document.elementFromPoint( e.changedTouches[i].pageX, e.changedTouches[i].pageY ); if (elem.tagName && elem.tagName == 'TD' && 
 editor.contains(elem)) 
 { drawPixel(elem); } } e.preventDefault(); }
  72. let socket = new WebSocket( "ws://" + window.location.host + "/ws"

    ); function drawPixel(elem) { if (elem.dataset.color != currentColor) { elem.dataset.color = currentColor; elem.style.backgroundColor = '#' + currentColor; socket.send(JSON.stringify({ command: "draw", x: elem.dataset.x, y: elem.dataset.y, color: currentColor })); } }
  73. let socket = new WebSocket( "ws://" + window.location.host + "/ws"

    ); function drawPixel(elem) { if (elem.dataset.color != currentColor) { elem.dataset.color = currentColor; elem.style.backgroundColor = '#' + currentColor; socket.send(JSON.stringify({ command: "draw", x: elem.dataset.x, y: elem.dataset.y, color: currentColor })); } }
  74. {
 "command": "draw",
 "x": 5,
 "y": 5,
 "color": "ffffff"
 }

  75. {
 "command": "draw",
 "x": 5,
 "y": 5,
 "color": "ffffff"
 }

  76. None
  77. None
  78. socket.onmessage = function(msg) { let data = JSON.parse(msg.data); if (data.command

    == "draw") { let elem = document.querySelector( 'td[data-x=' + data.x + ']' + 
 '[data-y=' + data.y + ']' ); elem.dataset.color = data.color; elem.style.backgroundColor = '#' + data.color }; } }
  79. socket.onmessage = function(msg) { let data = JSON.parse(msg.data); if (data.command

    == "draw") { let elem = document.querySelector( 'td[data-x=' + data.x + ']' + 
 '[data-y=' + data.y + ']' ); elem.dataset.color = data.color; elem.style.backgroundColor = '#' + data.color }; } }
  80. demo

  81. het mysterie 
 van de 
 spookbrievenbus

  82. brieven bus

  83. magneetcontact

  84. bij openen van de deksel een signaal

  85. http:/ /pixel.local/api?command=notify&icon=mailbox

  86. None
  87. None
  88. None
  89. oplossing #1 magneetcontact
 combineren met een 
 bewegingsdetector?

  90. oplossing #2 magneetcontact
 uitzetten bij 
 harde westenwind?

  91. oplossing #3

  92. de wispelturige
 wasmachine

  93. None
  94. None
  95. Standby verbruik
 4,6 watt Wasmachine uit
 0,3 watt Begin programma


    24,9 watt
  96. None
  97. De was is klaar!

  98. De was is klaar! De was is klaar! De was

    is klaar! De was is klaar!
  99. None
  100. 2000 watt

  101. 20 - 200 watt

  102. 2 - 5 watt

  103. De was is klaar! De was is klaar! De was

    is klaar! De was is klaar!
  104. None
  105. commandArray = {} if (uservariables['WasmachineBezig'] == 2) then s =

    uservariables_lastupdate['WasmachineBezig'] lastUpdate = os.time{ year=string.sub(s, 1, 4), month=string.sub(s, 6, 7), day=string.sub(s, 9, 10), hour=string.sub(s, 12, 13), min=string.sub(s, 15, 16), sec=string.sub(s, 18, 19) } difference = os.difftime (os.time(), lastUpdate) if (difference > 300) then commandArray['Variable:WasmachineBezig'] = '0' commandArray['OpenURL'] = 'pixel.local/api?command=notify&icon=shirt' end end return commandArray
  106. De was is klaar!

  107. None
  108. None
  109. vragen?