Coder Social home page Coder Social logo

joeljosephchalakudy / node-async-device Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 13 KB

The main purpose of this repository is to emulate asynchronous serial communication of a IoT device communicate to driver.

License: MIT License

JavaScript 100.00%

node-async-device's Introduction

Nodejs App to emulate a IoT device

The main purpose of this project is to emulate asynchronous communication of a IoT device to driver.

Link to the Driver version of APP

  • Development time taken project
30 minutes for brainstorming
1.5 hours for Developement

Pre-reqs

To build and run this app locally you will need a few things:

Getting started

  • Clone the repository
git clone --depth=1 https://github.com/JOELJOSEPHCHALAKUDY/node-async-device.git
  • Install dependencies
cd <project_name>
npm install
  • Configure your env file
# create a .env file in the root folder and copy the content below
 intMQUsername=''

 intMQPassword=''

 intMQClientId=''

 intMQHost='mqtt://test.mosquitto.org'

 intMQPort=1883

  • Run the project
nodemon

OR

npm start
  • Device response to request from driver
Device is online : Sat Jul 17 2021 14:07:06 GMT+0530 (India Standard Time)
Listening...
Received request from driver as ASCII:   123 34 112 97 114 97 109 95 110 97 109 101 34 58 34 116 101 109 112 101 114 97 116 117 114 101 34 44 34 114 101 113 117 101 115 116 95 116 121 112 101 34 58 34 99 111 109 109 97 110 100 34 125
Received request from driver as string:  {"param_name":"temperature","request_type":"command"}
Received : { param_name: 'temperature', request_type: 'command' }
param_name temperature
Initating a 3 second delay to emulate slow network...
Sending resonse to driver...

Note! Make sure you have already have installed nodemon as global dependency or dev dependency npm install -g nodemon othewise you may encounter following error:- nodemon is not recognized as internal or external command, operable program or batch file

Finally,

Deploying the app

There are many ways to deploy an Node app, and in general, nothing about the deployment process changes here

node-async-device's People

Contributors

joeljosephchalakudy avatar

Watchers

James Cloos avatar  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.