GithubHelp home page GithubHelp logo

ehabqadah / sbs-iot-data-generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aws-samples/sbs-iot-data-generator

0.0 1.0 0.0 5 KB

Script to locally generate simulated data stream that mimics IoT data from Simple Beer Service (https://github.com/awslabs/simplebeerservice)

License: Other

Python 100.00%

sbs-iot-data-generator's Introduction

Sample Data Generator for AWS IoT Simple Beer Service

This is the code repository for sample code to locally generate IoT device data similar to what is generated by the AWS Simple Beer Service devices, and feed it to AWS IoT service.

Pre-requisites

Script Details

The script generates random values (within a reasonable range) for each of the four parameters- Flow, Temperature, Humidity and Sound. You can tweak the values by changing the random.randint(min, max) values corresponding to each parameter.

The script is set to generate messages of each of the four types in a fixed percentage. If you want more or less messages of a particular parameter, you can change the values of rnd in the if...else part of the code.

Running Example

$ python sbs.py

Run the script on Amazon EC2 Instance

If for some reason you are unable to run this script on your local machine, or prefer to host it externally, you can run it from an Amazon EC2 instance. Follow these steps:

  1. Create an IAM role with a policy that gives access to IoT (example: AWSIoTFullAccess)
  2. Launch a new EC2 instance and assign it the IoT IAM role at launch
  3. Login to the EC2 instance and change to root user sudo su
  4. Set your default region and output format in aws configure
  5. Upload sbs.py file to EC2, or nano sbs.py, copy the entire script, save and exit
  6. Make sure you have boto3 installed. If not, type pip install boto3
  7. Run python sbs.py

sbs-iot-data-generator's People

Contributors

deskaran avatar hyandell avatar jpeddicord avatar

Watchers

Ehab Qadah avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.