An open API service indexing awesome lists of open source software.

https://github.com/autodesk-platform-services/mqtt-publisher


https://github.com/autodesk-platform-services/mqtt-publisher

iot iot-device

Last synced: 12 months ago
JSON representation

Awesome Lists containing this project

README

          

# MQTT Publisher Sample

![platforms](https://img.shields.io/badge/platform-windows%20%7C%20osx%20%7C%20linux-lightgray.svg)
[![node.js](https://img.shields.io/badge/Node.js-16.16-blue.svg)](https://nodejs.org)
[![npm](https://img.shields.io/badge/npm-8.11-blue.svg)](https://www.npmjs.com/)
[![license](https://img.shields.io/:license-mit-green.svg)](https://opensource.org/licenses/MIT)

[Autodesk Platform Services](https://aps.autodesk.com) application built to demonstrate publishing data to MQTT broker, which can be consumed by any subscriber.

## Development

### Prerequisites

- [Node.js](https://nodejs.org) (we recommend the Long Term Support version)
- Terminal (for example, [Windows Command Prompt](https://en.wikipedia.org/wiki/Cmd.exe)
or [macOS Terminal](https://support.apple.com/guide/terminal/welcome/mac))
- MQTT broker and publisher credentials

### Setup & Run

- Clone this repository
- Install dependencies: `yarn install` or `npm install`
- Setup environment variables:
- `APS_CLIENT_ID` - your APS application client ID
- `APS_CLIENT_SECRET` - your APS application client secret
- `MQTT_URL` - your mqtt broker connection url
- `MQTT_CLIENT` - your mqtt client id, this can be created dynamically as well
- `MQTT_USERNAME` - your mqtt publisher username
- `MQTT_PASSWORD` - your mqtt publisher password
- Run the server: `yarn install` or `npm start`

> When using [Visual Studio Code](https://code.visualstudio.com),
you can specify the env. variables listed above in a _.env_ file in this
folder, and run & debug the application directly from the editor.

## Troubleshooting

Please contact us via https://forge.autodesk.com/en/support/get-help.

## License

This sample is licensed under the terms of the [MIT License](http://opensource.org/licenses/MIT).
Please see the [LICENSE](LICENSE) file for more details.