Sorry, you need to enable JavaScript to visit this website.

You are here

Control your IoT Device remotely with SMS commands

BY Michelle Telstra 08 April 2021

Developing with the Internet of Things is fun. It’s challenging. It’s frustrating at times.

But it’s also an opportunity to change the world with code! And you don’t need 5 years R&D or an engineering degree to do it. In this blog I’ll go through some quick weekend hackathon projects you can put together to bring your IoT idea to life.

 

Consider that the IoT is made up of 3 key elements:

  • The Devices,
  • The Network,
  • The Applications.
  •  

Network connectivity is a critical element of the IoT ecosystem, being able to send sensor data reliably and efficiently between devices and applications. Then there’s the messaging alerts for real time emergency notifications and communication that the network can also provide.

 

Here’s a couple of projects that harness TelstraDev’s network capabilities for IoT prototypes that address some key local and global issues. If you want to see more detail on each one, check out the GitHub repos: https://github.com/MichelleHowie

 

Control your IoT device remotely with SMS commands

Some IoT devices can actuate (i.e action on data it receives) based on specific inputs. For example, streetlights that turn on depending on the time of day or if someone walks past and triggers a people counter.

In this quick prototype, I set up an Arduino MKR NB 1500 with Telstra LTE-M connectivity, so that when I send “ON” in a text message to my virtual mobile number, it turns the LED on the Arduino board on. Sending “OFF” in an SMS turns it off.

The fun part here, was that I also had the virtual mobile number that controlled my mate Steve’s Arduino device, so we could send messages across Australia to control each other’s IoT device lights. Awesome potential here, but also very real security and control considerations.

Here’s the high-level process flow that made it possible:  

Simple, yet effective!

We used Node-RED, a programming tool for wiring together hardware devices, APIs and online services. It was quick and easy to set up the Watson IoT and Messaging API nodes, and you can copy the whole flow directly from our GitHub repo! Just add in your own user credentials.

In Node-RED, we set up a http endpoint (we call that NotifyURL) that any SMS can come to. With Telstra Messaging API, we then created a virtual mobile number (aka Subscription) that can receive SMS. Now the Node-RED http endpoint can show any inbound messages to the your new virtual mobile number.

Any SMS command from your Telstra Mobile (connected to 4G or 5G) to that virtual mobile number, where a function in Node-RED validates the message payload input and decides if it should trigger 1 of 3 possible device events:

  1. light ON if it sees "ON"
  2. light OFF if it sees "OFF"
  3. or do nothing if you send anything else!

 

The message to change the state of the LED is published to your IoT broker, where the Arduino is listening. The sketch running on your Arduino knows what to do when it sees ON or OFF, and voila!

For more details see the GitHub ReadMe or recorded tutorial of this prototype, which includes an introduction to IoT brokers and the open source low-code software we used to put this together in just a few hours.

GitHub Repo + ReadMe: https://github.com/MichelleHowie/TelstraDevArduinoNodeRedBlink

 

See this workshop in action at Call For Code, May 2020 so you can follow along with me and DeveloperSteve Coochin:

 

 

This demo uses Telstra’s Messaging API. You can explore your own SMS and MMS use cases with our free trial today.

Check out part 2 of this series for how to request Environmental Sensor Data via SMS from your remote IoT device.

Related Blogs

's picture

By Michelle Telstra

10/4/20

  • iot
  • arduino

Changes to our IoT Developer Kit Offer

Telstra is a leading IoT provider, but when building great technology solutions, sometimes less is
's picture

By Michelle Telstra

10/4/20

  • MessagingAPI
  • airquality

SMS alerts for hazardous air quality during bushfire season

I woke up one morning in January 2020 and discovered that the air quality in Melbourne had dropped
's picture

By Michelle Telstra

10/4/20

  • iot

Unlocking the Internet of Things with telco APIs: Telstra’s...

Originally posted on the Teleco Application Developer (TAD) 2021 Summit Blog: https://blog.
's picture

By Michelle Telstra

10/4/20

  • iot
  • DIY

Home IoT Project using Azure

In this blog series, I’m going to write about how Internet of Things (IoT) enabled my
's picture

By Michelle Telstra

10/4/20

  • arduino
  • iot

Hands On: Long Range IoT Arduino MKR NB 1500 over the...

We put the Arduino MKR NB 1500 to the test using the Telstra network and show you how to
's picture

By Michelle Telstra

10/4/20

  • hackathon
  • iot

Data Driven IoT Insights for sustainable communities:...

In the second TelstraDev challenge for GovHack 2020 (part 1 on Communication APIs here), we asked:
's picture

By Michelle Telstra

10/4/20

  • hackathon
  • MessagingAPI

Connecting our community in an emergency with mobile...

What do you get when you give 700 Hackers, Hustlers and Hipsters across Australia and New Zealand,
's picture

By Michelle Telstra

10/4/20

  • iot
  • captis

Capture more insights with our new Captis Data Loggers!

Calling all IoT makers and innovators, there’s a new device on our IoT Marketplace! It
's picture

By Michelle Telstra

10/4/20

  • hackathon
  • innovation

Telstra Innovation Hackathon 2020

Calling all startups, Telstra partners and GCC employees; Registrations are now open for Telstra
's picture

By Michelle Telstra

10/4/20

  • iot
  • nbiot

What's the Difference Between Cat-M1 and NB-IoT?

Here’s what our previous CFO said which is good: https://exchange.telstra.com.au/telstra-
's picture

By Michelle Telstra

10/4/20

  • iot
  • platform

Telstra's IoT Platform

The Internet of Things (IoT) is a network of physical objects which collects data from the
's picture

By Michelle Telstra

10/4/20

  • iot
  • developer

Wireless Application Developers Guidelines for IoT

The Internet of Things (IoT) is an all-encompassing suite of technologies, with dozens of options