Upgrade to Pro — share decks privately, control downloads, hide ads and more …

TTNF 19 januari - Corné

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →
Avatar for Hans Donner Hans Donner
January 19, 2016
49

TTNF 19 januari - Corné

Technische sessie The Things Network Flevoland, presentatie Corné

Avatar for Hans Donner

Hans Donner

January 19, 2016

Transcript

  1. Opbouw van typische node • Sensor(en) • Microprocessor / Controller

    • LoRa Radiomodule – Gebaseerd op Semtech SX127x – 2 varianten: • Met LoRaWAN stack (Microchip RN2483) • SX127x + RF circuit (HopeRF RFM9x, Dorji, Modtronix inAir9, …)
  2. Thermo- koppel MAX6675 Licht Sensor BH1750 Radio Module Voorbeeld Node

    Micro Processor / Controller Temperatuur Sensor DS18B20 SX127x RF Circuit SPI 1-Wire Analoog A/D conv. Firmware LoraWAN Stack Antenne UART SPI A/D conv. A/D conv. Accelero- meter ADXL335 I2C A/D conv.
  3. Voorbeeld sensoren • Temperatuur / Luchtvochtigheid – DS18B20 (1-Wire temp)

    – DHT11 / DHT22 (temp + luchtvochtigheid) • Licht / UV intensiteit – BH1750FVI (Lux) – ML8511 (UV) • Beweging / versnelling – MPU-6050 – ADXL335 • Locatie (GPS / Wifi) – Ublox NEO-6M/7M • Nabijheid (Infrarood / Acoustisch) – HC-SR04 • Aan/uit of vol/leeg detectie • …
  4. Voorbeelden microprocessoren • Atmel (ATMega168/328/2560/32U4/SAM) https://www.arduino.cc/en/Products/Compare • Microchip PIC (8/16/32

    bit, PIC18F46K22) • Texas Instruments (MSP430, TM4C123 launchpads) • Espressif ESP8266 • Overige Arm based (b.v. Raspberry) Eisen / wensen • Energiezuinig! • GPIO poorten (UART, SPI, 1-Wire, Analoog)
  5. Overwegingen Radio Module • Complete LoRaWAN stack (RN2483) – Vereenvoudigt

    software – Minder krachtige microprocessor nodig – Iets hogere kosten (ca € 10-12) – RF gecertificeerd • Overige (RFM95, Dorji, Dapu) – € 6 - 10
  6. Ontwikkelomgevingen (Nodes) • Arduino ontwikkelomgeving (AVR, ARM, ….) • Atmel

    Studio (AVR, ARM) • MPLAB-X (Microchip PIC) • Keil (ARM, TI) • Energia (TI MSP430, TM4C, C2000) • Eclipse + ARM Eclipse plugins • Meest gebaseerd op C / C++
  7. TTN Backend - nu • Croft • Leest Gateway berichten

    op UDP poort 1700 • Extraheert informatie uit Gateway berichten • Gateway status • Ontvangen node paketten (t.b.v. applicatie) • RabitMQ: AMQP Publisher (Publish/Subscribe) • Jolie • RabitMQ: AMQP Subscriber • Slaat ontvangen informatie op in een database • Gateway status + ontvangen node paketten • Biedt een MQTT interface aan voor gebruiker applicaties op UDP poort 1883 (default) • Biedt een JSON Web API aan op poort 80
  8. Use case: Meten van Dekking • Benodigdheden: – GPS •

    locatie bepalen – RN2483 + antenne • Data verzenden naar TTN – Microprocessor: • Raspberry Pi / Windows Tablet – Software • Python
  9. Meten van Dekking - Software • Software (Python) – 1

    proces / thread leest GPS data • update laatste positie in gedeeld geheugen • Maak gebruik van open source library (pynmea2) – 1 thread verzend periodiek data via RN2483 • Gebruikt laatste positie in gedeeld geheugen • Implementeert zelf interface naar RN2483 – Probeert automatisch juiste seriële poorten te detecteren voor GPS + RN2483 (Windows + Linux)
  10. Meten van Dekking – data verwerken • Data ophalen via

    JSON API: – http://thethingsnetwork.org/api/v0/nodes/02014A01/ – Interessante data: • "gateway_eui": "B827EBFFFF2FD5DB" • "data_plain": "301,52.71536,5.73654" • "rssi": -90 • "snr": 6.0 • "datarate": "SF12BW125“ – Omzetten naar “kaart” (heatmap), Python naar Google heatmap.
  11. Meten van Dekking – populair • Kaart van Paul Dekkers:

    http://pade.nl/lora/ • Forum artikel: http://forum.thethingsnetwork.org/t/measuring-coverage-gateway/1051/25 • Node maken: – Microprocessor (Arduino achtige) – Compacte GPS (Ublox) – RN2483 + Antenne – In één behuizing • Software naar: – één centrale database – Dynamische kaart (zelf kiezen zendvermogen, SF, gateway)
  12. Use case 2: Temperatuur meter • Gebruikte componenten – Teensy

    LC (€ 11,95) – DS18B20 temperatuur sensor (€ 2,20) – RFM95 (€ 10,98) • Prototype fase 1! – Breadboard – Naar prototype PCB + behuizing • http://thethingsnetwork.org/api/v0/nodes/02014A03/
  13. Temperatuur meten - tooling • Software Arduino IDE – Libraries

    • TTN LoraWAN (lmic + hal) • SPI (communicationto RFM95) • OneWire + DallasTemperature – Klein programma (ca. 200 regels) • Gebaseerd op “thethingsnetwork-send” voorbeeld – Gebruik “Seriële monitor” tbv debugging
  14. Applicatie interfaces • Huidige TTN infrastructuur: – JSON Web API

    • Status van alle gateways • Alle applicatie data van nodes / sensoren • Te gebruiken voor historische data (t/m “nu”) – MQTT Publish / Subscribe interface • Handig voor ontvangen van “real-time” updates • Live updates tonen • Nieuwe TTN infrastructuur: Hans
  15. Handige tools / talen • Volgen van updates eigen nodes

    – MQTT Client (Android) • Ontwikkelen Eigen Nodes – Arduino + Libraries • NodeRed • Ontwikkeling op backend – Python / Node.js – Taal van eigen keuze • PHP, Golang, C++, C#, Java – Google maps / Openstreetmap (OSM) – Websockets + MQTT: realtime updates in browser!
  16. Nodes TTN Flevoland use cases • 1e instantie “zelfbouw” t.b.v.

    prototypes – Geen / weinig kant en klare sensoren verkrijgbaar • Naar professionele sensoren van leveranciers – Dacom (www.dacom.nl) – Confed (www.confed.eu) – Sodaq (www.sodaq.net) – Mogelijk sensorbouwers in Flevoland? • Eigen ontwikkelde sensoren “industrialiseren”?