Skip to content

Latest commit

 

History

History
33 lines (28 loc) · 1.46 KB

README.md

File metadata and controls

33 lines (28 loc) · 1.46 KB

IoT Engineering

Hands-on of lesson 7

For slides and example code, see lesson 7

Note: Do not work on this repository right away.
Check existing forks to find the specific repository for your class.

a) MQTT command line, 10'

  • Install the mqtt CLI tool on the Raspberry Pi.
  • Connect to the broker test.mosquitto.org
  • Subscribe to the topic fhnw-iot/names
  • Send your name to the same topic.
    (Open a second terminal)

b) MQTT pub/sub clients, 10'

  • Install the mqtt Node.js library on the Raspberry Pi.
  • Run the previous MQTT pub/sub client examples.
  • Use the .js link on each page or check the main repo.
  • To run a Node.js program my.js, type: $ node my.js

c) Local MQTT broker, 15'

  • Install and run the mosquitto broker on Raspberry Pi:
    $ sudo apt-get update
    $ sudo apt-get install mosquitto # port 1883
  • Test with the ESP8266 publisher/subscriber clients.
  • Check $SYS/broker/clients/connected on the Pi.
  • Which use cases would profit from a local broker?

d) Data formats, 15'

  • Choose one of the Grove sensors listed in the Wiki.
  • Define a suitable JSON format to transmit its data.
  • Translate the format into a Protobuf .proto file.
  • Done? Build the parser for Node.js or Arduino.