Skip to content

Latest commit

 

History

History
87 lines (64 loc) · 3.45 KB

MQTT.md

File metadata and controls

87 lines (64 loc) · 3.45 KB

PIXELIX

PIXELIX

License

Plugin development

MQTT

Pixelix is a MQTT client which can be connected to a MQTT broker. The MQTT broker URL is configued in the settings via webinterface.

Format: [mqtt://][<USER>:<PASSWORD>@]<URI>

Examples:

Overview Mindmap

topic-handling-minmap

MQTT Topics

Birth and last will

Pixelix supports birth and last will messages.

After the successful connection establishment to the MQTT broker, Pixelix will send "online" to the <HOSTNAME>/status topic. In any disconnect case, "offline" will be sent to the <HOSTNAME>/status topic.

Plugin base URI

The base URI to access plugin related topics can be setup with the plugin UID or the plugin alias:

  • <HOSTNAME>/uid/<PLUGIN-UID>/...
  • <HOSTNAME>/alias/<PLUGIN-ALIAS>/...

Topic name

The complete topic name can be derived from the REST API documentation.

Example: JustTextPlugin

The REST API URL looks like the following: http://<HOSTNAME>/rest/api/v1/display/uid/<PLUGIN-UID>/text?text=<TEXT>

  1. Replace the http://<HOSTNAME>/rest/api/v1/display part with <HOSTNAME> --> <HOSTNAME>/uid/<PLUGIN-UID>/text?text=<TEXT>
  2. Every URL parameter, which is in this case show=<TEXT> must be sent in JSON format.
{
    "text": "<text>"
}

Sending a bitmap

The JSON data must have two keys:

  • fileName: The name of the file which to upload.
  • file: The file itself in BASE64 encoded.

Example: IconTextPlugin

{
    "fileName": "hacker.bmp",
    "file": "Qk32AAAAAAAAADYAAAAoAAAACAAAAAgAAAABABgAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAzEg/AAAAAAAAAAAAzEg/zEg/AAAAAAAAAAAAzEg/zEg/zEg/zEg/AAAAAAAAAAAAAAAAzEg/AAAAAAAAAAAAAAAAJBztJBztAAAAzEg/AAAAzEg/zEg/zEg/AAAAJBztAAAAAAAAzEg/AAAAAAAAAAAAAAAAJBztAAAAAAAAAAAAzEg/zEg/AAAAAAAAJBztAAAAAAAAAAAAzEg/zEg/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
}

Issues, Ideas And Bugs

If you have further ideas or you found some bugs, great! Create a issue or if you are able and willing to fix it by yourself, clone the repository and create a pull request.

License

The whole source code is published under the MIT license. Consider the different licenses of the used third party libraries too!

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, shall be licensed as above, without any additional terms or conditions.