Difference: MQTTAndCayenne (7 vs. 8)

Revision 82019-05-22 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="WorkshopSlides"

Start Presentation

Slide 1: Setting up an IoT

Line: 74 to 74
 
  • Message “LED on”
  • Message “LED off”
Added:
>
>

Changed Callback

changedCallback.png

Missing functions in IoT

  • MQTT broker should be globally reachable
  • GUI to easily visualize sensor measurements
  • GUI elements to easily control actuators
  • GUI should be accessible through a WEB interface
  • GUI should be accessible through smart phone app
This is what Cayenne supplies

Cayenne functionality

  • MQTT broker is accessible at mqtt.mydevices.com

  • Supplies GUI
cayenneFunctionality.png

Signing up for Cayenne

Sign up at
https://mydevices.com/cayenne/signup

cayenneSignup.png

Cayenne Start

cayenneStart.png

Cayenne Doc

You find the documentation at

https://mydevices.com/cayenne/docs/intro

Contains short introductory video clips, information of Cayenne on Raspberry Pi and Arduino but also how to use Cayenne on any device.

Pointers to the Cayenne MQTT Libraries and their API

cayenneDoc.png

Installing Cayenne on the Raspberry PI

cayenneRPI.png

Installing Cayenne on the Raspberry Pi manually

cayenne_RPI_ManualInstallation.png

Register your Controller Single Board Computers

cayenneRegisterRPI.png

Run Cayenne on the Arduino

cayenneArduinoInstall.png

Basic Arduino Sketch for the Arduino

cayenneArduinoSketch.png

Cayenne Credentials

cayenneCredentials.png

Cayenne network layers

cayenneNetLayers.png

The Cayenne credentials are integrated into the MQTT topic string

Value and units are integrated into the payload string

Cayenne and Python

This falls under “bring your own thing” !

Having a look at the Arduino sketch you can see that it uses the

Arduino Cayenne C++ library.

Cayenne MQTT libraries are available in

  • C, C++
  • Python
  • Java
and probably a few other languages

Cayenne and Micropython

The Python Cayenne Client library depends on the Eclipse Paho MQTT library

Micropython uses its own, stripped down “umqtt” (micro mqtt) library

such that the standard Cayenne Client does not work on Micropython

but …

The Python Cayenne Client is Open Source and can be adapted to umqtt, which is what I did for you.

The adapted Client library uses the same API as the original one,

which means that the example programs work unchanged.

The Cayenne Client

When creating a Cayenne Client Class it

  • Initializes its internal variables
  • Checks if the OLED display is connected and if yes, initializes it
  • The Cayenne Client has has a begin method which
  • Connects to WiFi
  • Connects to the Cayenne MQTT broker at mqtt.mydevices.com
  • Subscribes to commands send by Cayenne
  • Displays its internal state on the OLED display

The code to connect to Cayenne

cayenneConnectCode.png

Connecting to Cayenne

cayenneConnect.png

The empty Cayenne dashboard

cayenneEmptyDashboard.png

 %SLIDESHOWEND%

-- Uli Raich - 2019-05-14

Line: 94 to 222
 
META FILEATTACHMENT attachment="mqttDummySensorDemo.png" attr="" comment="" date="1558377647" name="mqttDummySensorDemo.png" path="mqttDummySensorDemo.png" size="76145" user="UliRaich" version="1"
META FILEATTACHMENT attachment="subscribeDemo.png" attr="" comment="" date="1558377918" name="subscribeDemo.png" path="subscribeDemo.png" size="80206" user="UliRaich" version="1"
META FILEATTACHMENT attachment="callbackResult.png" attr="" comment="" date="1558528264" name="callbackResult.png" path="callbackResult.png" size="146144" user="UliRaich" version="1"
Added:
>
>
META FILEATTACHMENT attachment="changedCallback.png" attr="" comment="" date="1558541165" name="changedCallback.png" path="changedCallback.png" size="15715" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneFunctionality.png" attr="" comment="" date="1558541341" name="cayenneFunctionality.png" path="cayenneFunctionality.png" size="138918" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneStart.png" attr="" comment="" date="1558541708" name="cayenneStart.png" path="cayenneStart.png" size="149818" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneSignup.png" attr="" comment="" date="1558541709" name="cayenneSignup.png" path="cayenneSignup.png" size="125087" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneDoc.png" attr="" comment="" date="1558542080" name="cayenneDoc.png" path="cayenneDoc.png" size="162100" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneRegisterRPI.png" attr="" comment="" date="1558542243" name="cayenneRegisterRPI.png" path="cayenneRegisterRPI.png" size="151833" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneRPI.png" attr="" comment="" date="1558542245" name="cayenneRPI.png" path="cayenneRPI.png" size="154438" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenne_RPI_ManualInstallation.png" attr="" comment="" date="1558542615" name="cayenne_RPI_ManualInstallation.png" path="cayenne_RPI_ManualInstallation.png" size="194412" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneArduinoInstall.png" attr="" comment="" date="1558542775" name="cayenneArduinoInstall.png" path="cayenneArduinoInstall.png" size="131451" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneCredentials.png" attr="" comment="" date="1558542983" name="cayenneCredentials.png" path="cayenneCredentials.png" size="112327" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneArduinoSketch.png" attr="" comment="" date="1558542958" name="cayenneArduinoSketch.png" path="cayenneArduinoSketch.png" size="195823" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneNetLayers.png" attr="" comment="" date="1558543535" name="cayenneNetLayers.png" path="cayenneNetLayers.png" size="35297" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneConnectCode.png" attr="" comment="" date="1558543962" name="cayenneConnectCode.png" path="cayenneConnectCode.png" size="58160" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneConnect.png" attr="" comment="" date="1558543971" name="cayenneConnect.png" path="cayenneConnect.png" size="141182" user="UliRaich" version="1"
META FILEATTACHMENT attachment="cayenneEmptyDashboard.png" attr="" comment="" date="1558543976" name="cayenneEmptyDashboard.png" path="cayenneEmptyDashboard.png" size="153778" user="UliRaich" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback