Code a Service to Remotely Control an IoT Device

  • Overview
  • Resources
  • Transcript

In this video, we will create a service that will allow us to remotely control IoT Devices.

Hi, I'm Daniel Holmlund. In this video, we will create a service that will allow us to remotely control IoT devices. First, load the required libraries, including the file system, HTTPS, and Express Libraries and then declare an express object. The Express Library provides an easy way to create HTTPS servers. And the body parts of the library allows us to declare that the server will use the JSON format. 

Next, load the private key and certificate. Load the UPN LCD library and create an LCD object. Instantiate the backlight and text variables which hold the value of the text displayed on the LCD, then turn the backlight off. We'll create two HTTPS endpoints to get data from the LCD. Get LCD backlight and get LCD text. 

Next, we'll create two HTTPS endpoints, post LCD backlight, and post LCD texts. These change the value of the backlight and the text on the LCD. Lastly, we'll create two HTTPS endpoints. Delete LCD backlight and delete LCD text, which of course, clear the text and turn off the backlight. 

Now that we've defined all the HTTPS endpoints, we'll instantiate the service and have it listed on a port. Now we built a restful HTTPS service to control the LCD screen. The Intel IoT gateway or other devices on the IoT network can use this service to display messages on the LCD screen to the user. 

Thanks for watching. To learn more, follow the links provided. Don't forget to like this video and subscribe to the Intel Software YouTube Channel.