Skip to content

Control an LED traffic light from anywhere using Raspberry Pi and AWS IOT

Notifications You must be signed in to change notification settings

zjwhitehead/traffic-iot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Traffic-IOT

Control a 3 LED traffic light

Uses AWS IOT SDK

Setup

$ npm install Optional: $ npm install forever -g (may require sudo)

Place certificate and key in project directory and rename to TrafficLight.private.key and TrafficLight.cert.pem Replace clientId with thing ID from AWS IOT console.

Running

$ node app.js To run continuously in the background: $ forever start app.js Stop the forever process: $ forever stop app.js

The app expects a boolean value for green, yellow, and red. For example, to set the desired state using the AWS IOT thing rest API

{
   "state":{
      "desired":{
         "red":true,
         "yellow":false,
         "green":false
      }
   }
}

Note: each LED can be toggled independently

About

Control an LED traffic light from anywhere using Raspberry Pi and AWS IOT

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published