freeboard-aws-iot-ws-mqtt

1.0.3 • Public • Published

Travis GitHub release MIT License

freeboard-aws-iot-ws-mqtt

Freeboard plugin that allows you to create a datasource to AWS IoT topic by way of websockets and MQTT

Install

npm install -S freeboard-aws-iot-ws-mqtt

Make sure you are in a valid Freeboard project in order for post install to work correctly.

Create

If post install doesn't work you can run:

npm run create

Define specific folder:

npm run create -- ${DIRECTORY}

Manual

Move everything from the ./src folder to the plugins folder in your Freeboard project.

Example

HTML

Modify the index.html file in your Freeboard project.

<script type="text/javascript">
    head.js("js/freeboard_plugins.min.js",
            // **** Load AWS IoT Websockets MQTT
            "plugins/freeboard-aws-iot-ws-mqtt/index.js",
            // *** Load more plugins here ***
            function(){
                $(function()
                { //DOM Ready
                    freeboard.initialize(true);
 
                    var hashpattern = window.location.hash.match(/(&|#)source=([^&]+)/);
                    if (hashpattern !== null) {
                        $.getJSON(hashpattern[2], function(data) {
                            freeboard.loadDashboard(data, function() {
                                freeboard.setEditing(false);
                            });
                        });
                    }
 
                });
            });
</script> 

AWS IoT

  • Create a thing
  • Copy IoT endpoint

AWS IoT Endpoint

Datasource

Start Freeboard project and add Datasource.

  • Add AWS IoT Endpoint
  • Add AWS Region
  • Add AWS Access Key w/ IoT permissions
  • Add AWS Secret Key w/ IoT permissions
  • Add Topic(s) to subscribe to

Add Datasource

Panel

Create a Text panel with 3 columns, and the datasource to datasources["Read Me"].message

Add Panel

Test

In the AWS IoT console go to the Test tab.

Subscribe to a topic.

Subscribe to topic

Publish to the same topic.

Publish to topic

Result

AWS IoT Console

Freeboard Panel

Package Sidebar

Install

npm i freeboard-aws-iot-ws-mqtt

Weekly Downloads

0

Version

1.0.3

License

MIT

Last publish

Collaborators

  • iamfiscus