Posted on

Data Communications and Flow: Focus on What You Need

Illustration: © IoT For All

When visualizing a new IoT application; carefully consider not what data flows you want, but what data flows your application needs to be successful.

Data flows are one of the key constraints in the design of any IoT application. Data flows drive not just communications cost, but also indirectly control communication technology selection, power needs, and the actual paradigm of an application’s functionality. As you begin visualizing your new IoT application, think carefully about the data and communication patterns that support your planned features.

IoT is a confluence of smart and connected in a remote device. I assume that if you’re reading this you have a “device” side and a “user” application side that you are thinking about connecting.  Your devices could be in near proximity of your user, their home/office, or anywhere. The user application where the device data lands initially could be a smartphone, or in many cases a cloud platform. Throughout the discussion, chances are the connection will be over a wireless link. This is by far the predominant pattern for typical IoT (non-IIOT/non-manufacturing use cases).

First, let’s differentiate between “data” and “data flows.

Data: what is measured

Data Flows: what is communicated.

Sure, increased data is likely to ramp up the amount of data sent to/from your device, but more data is not a linear predictor of how much data an application needs to communicate with a user. As the power of IoT device MCU chips increases, there is a steady ability to do more processing on the device and only communicate a summary of relevant events and periodic data points.

Communications are power-hungry compared with computation and memory on an IoT device. The more you can keep your radio turned off, the more battery life that remains. There are power light wireless technologies like Bluetooth Low Energy (BLE) for near distance communications, but what if your device is far away? Radios vary in their performance profile and there are numerous articles out there about WiFi vs. LoRa vs. LTE. Know your communications stack. Next, I lay out some concepts that should be considered regardless of which type of radio is in your device.

Most IoT projects fall into two broad categories. These two patterns dictate many aspects of the data flows your application will need to perform and when your communications hardware needs to be turned on.

Interactive

Interactive applications place the user and device in virtual proximity, with physical distance ranging from a few feet to miles to wherever. The communication flows, bridge that physical distance. This application pattern is the most demanding from a communications perspective.

Communications that are interactive require that a device radio stays on to listen for user input. This could be constrained to a specific interval of interest, rather than 24 hours a day. Maybe the communications channel can be predictably enabled during “business hours” or only during predicted device “usage” times.  The key point, radio on all the time increases power consumption considerably. This in turn increases challenges for off-grid or solar applications to have enough power harvesting and storage.

Being that the interactive application pattern is so demanding that you may find variations necessary to make things work. Consider maybe delaying user input by minutes or even hours, opening times for user control of the device.

Remote Monitoring

From a communication and power budget perspective, this application pattern is much easier to implement. Devices can wake up occasionally, gather and locally store data, assess the situation, and then decide if communication is required. The radio stays off until it is needed to send data to the user before it’s back to sleep for the communications.

The remote monitoring pattern can be integrated with an interactive application by making use of when the radio is already turned on. When you periodically send data, check for user directives. This approach is standardized in LoRaWAN Class A devices which listens for user input 1 and 2 seconds after transmitting its data.

IoT applications typically use protocols such as MQTT or HTTP to package their data while in transit. MQTT, HTTP, AMQP and other IoT communication protocols add protocol data to the total amount of IoT device payload data being transmitted between the device and the user. The amount of data communicated typically increases in two ways: framing overhead and keepalives.

Framing overhead is the extra data that is sent along with an application’s data to make communications more robust and reliable. Think of protocol framing as the envelope you put your physical correspondence in. In the case of MQTT, to send data, the overhead is 6 characters + the MQTT topic name your device is publishing to. This can add up and, in some cases, exceed the size of the payload data you are sending to the user side. It is important to note that while MQTT transmits these extra characters with your message payload, MQTT is more efficient than AMQP and HTTP; which is why MQTT is so often used in IoT systems.

The other protocol tax is keepalive messaging (sometimes referred to as heartbeats). MQTT implementations typically perform a keepalive action every 1-4 minutes, this time period is referred to as the keepalive interval. Keepalives are not required if data transmission has been performed recently. To keep communications active, MQTT sends a 2-character long PING when the keepalive interval ends. The keepalive interval is reset with each transmission, for either a PING or payload data.

Most implementations afford the ability to lengthen the keepalive interval (reduce the number of keepalives sent), each system will typically impart some upper limit for the keepalive interval. Azure IoT Hub uses MQTT extensively and limits the keepalive interval to a maximum of 1177 seconds or once every 19 minutes, 37 seconds (Understand Azure IoT Hub MQTT  Support).

When reviewing data and deciding what to send back and forth, think about ways to eliminate or reduce application data flows. When reviewing data flows, take note of how big each one is, how often data is sent, and what is going on with your communications channel when nothing is happening.

There are tools online (IoT Bandwidth Estimation Tool) to help visualize your data budget and be proactive in planning your data communications.

Time adds up… fast! Sending 500 characters of data every 20 seconds:

180 times / hour                           90KB / hour

4,320 times / day                          2,160MB / day

30,240 times / week                   17,120MB / week

129,600 times / month              64,800MB / month

Remember every character you send can increase costs and draws down your device’s battery.

Some Ideas…

  • After sampling remote data, look for ways to summarize prior to sending. For example: consider sending maximum, minimum, average, and number of data points over a specific period.
  • Similarly, once a maximum and minimum are established, consider sending data only when a new outlying maximum or minimum has been observed.
  • For remote sensing consider only sending data once a day or even once a week. But send data events when something significant has been observed at the device.
  • Consider building normal limits in your device software. When the data being sensed leaves these limits, then communicate and report the event to the user.
  • Log your data locally on the device and send a block of data (a day or weeks’ worth) at one time. Once the radio is on using it, then shut it off. Every time the radio is turned on/off, power is wasted before/after when data is sent.

Only you can determine when a piece of data being sent is valuable. Is that piece of data something you want… or is it something you need?

Read More

Posted on

How To Use IoT For Smart Parking Solution Development

Illustration: © IoT For All

Smart parking is a practical IoT application that can dramatically improve everyone’s life.

Imagine, you arrive at your destination twenty minutes early for a very important meeting. You have plenty of time as long as you can find a place to park.

The parking lot for the building is full. You drive around desperately looking for a space on the street but do not find one. You try the underground parking lot of the building across the street. Driving in, you suddenly have to stop. There is plenty of traffic ahead of you trying to do the same thing. You attempt to call the meeting to say you will be late and there is no cell phone signal in the underground parking garage.

It takes a half-hour to find a space. When you finally arrive at the office for the meeting, you are sweating profusely and out of breath. The receptionist tells you that everybody already left. Your meeting was canceled and you have to deal with serious losses.

You are not alone. An average driver in the US wastes $345 per year, that results in over $70 billion annually nationwide.

Moreover, 40% of drivers surveyed said that they choose not to visit brick-n-mortar shops due to the hassle of finding a parking space.

Recent research is predicting that up to 68% of the people in the world will live in major metropolitan cities by 2050. This could have a direct impact on how car owners park in cities.

So, what can be done to improve parking in cities?

How IoT Smart Parking Works

Innovative smart parking technology combined with IoT connectivity helps solve this problem. Installed IoT sensors determine where empty parking spaces are located. This IoT data is transmitted over a wireless connection to a cloud server. All the data from the parking lot is collected and analyzed in real-time to produce a map of available spaces made available to those looking for a space.

Drivers looking for a parking space can refer to the real-time smart parking map and be guided to the nearest vacant space. Advanced systems can reserve these spaces and take electronic payments from the drivers.

In the case study for IoT smart parking solution development, the technical components include an ultrasonic sensor HC-SR04 that measures physical distances using ultrasonic waves, and a ESP8266 microcontroller. Both are installed at every parking space.

The IoT device sends a periodic update by wireless signal using the MQTT protocol to a cloud server running AWS IoT services. The cloud server assembles data about all parking slots. This shows users via a web or mobile application the available parking spots to let them choose one.

How IoT Sensors Detect Free Parking Space

IoT sensors use an ultrasonic wave to detect the distance to something. Each sensor is embedded in the parking space surface and detects the distance to the undercarriage of a vehicle if the parking space is occupied.

3 Possible Detection Conditions

  1. Space is Occupied: Distance detected to an object by the sensor is in the range of 10 to 50 centimeters (about four to 20 inches).
  2. Space is Free: Distance detected to an object by the sensor is more than 50 centimeters (about 20 inches).
  3. Space is Dirty: Distance detected to an object by the sensor is less than 10 centimeters (about four inches).

If the condition is “dirty” the sensor may be covered by something or blocked and the device needs to be checked.

The application runs on AWS IoT and AWS Lambda and shows a driver free spaces in green, occupied spaces in red, and sensor malfunctions as yellow.

IoT Based Smart Parking System Configuration

The amount of parking spaces in a parking lot determines the software and hardware requirements for IoT configuration and system architecture. For large parking lots, it’s better to use gateway and the LPWAN protocol for the sensors.

LoRaWAN standard adoption is one of the current IoT trends and the way to increase the operating hours of an autonomous system by reducing power usage. According to the specifications of the LoRa Alliance, this reduces the need to replace the batteries. Battery life is extended up to five years before needing replacement.

Sensors for IoT Based Smart Parking

Smart parking sensor types include ultrasonic, electromagnetic field detection, and infrared.

  • Ultrasonic: The accuracy of the sensing is improved by using ultrasound for measurement detection. The disadvantage of this type of sensor is a potential blockage by dirt.
  • Electromagnetic Field Detection: This sensor detects small changes in the magnetic field when metal things come close to the sensor.
  • Infrared: This type of sensor measures changes in the surrounding temperature and detects motion.

Parking 4.0: Future and Opportunities in Smart Cities

Deployment of smart parking systems is expected to continue to increase because the technology is extremely useful and makes helpful improvements in daily life. The following advanced features can be added to the system to turn it into a highly multi-functional management tool.

  • Parking demand management and space optimization
  • Personalized parking guidance
  • Parking reservation systems
  • Dynamic parking prices and policy optimization
  • Detection of parking zones, fees, and overstay violations.

For large-scale parking lots, augmented reality technology may create a mapping function overlay on top of real images captured by a smartphone. These AR-based outdoor and indoor navigation systems can guide drivers with a virtual path to their parked cars.

Another innovation uses visual image processing to capture the license number of a vehicle to recognize it with the help of Optical Character Recognition technology. Then, it automatically opens the gate to the parking lot and the system guides the driver to a suitable parking space.

The future seems to be quite promising for smart parking systems. Technologies lying behind this solution are IoT, Artificial Intelligence, Machine Learning, Augmented Reality–the same ones that are driving digital transformation for businesses under the “Industry 4.0” term. Leveraging these innovations, Parking 4.0 will increase parking systems efficiency by solving urbanization challenges.

Written by Viktor Gubochkin, IoT Lead Solution Architect at MobiDev.

Read More

Posted on

How Will the Emergence of 5G Affect Federated Learning?

Illustration: © IoT For All

As development teams race to build out AI tools, it is becoming increasingly common to train algorithms on edge devices. Federated learning, a subset of distributed machine learning, is a relatively new approach that allows companies to improve their AI tools without explicitly accessing raw user data.

Conceived by Google in 2017, federated learning is a decentralized learning model through which algorithms are trained on edge devices. In regard to Google’s “on-device machine learning” approach, the search giant pushed their predictive text algorithm to Android devices, aggregated the data and sent a summary of the new knowledge back to a central server. To protect the integrity of the user data, this data was either delivered via homomorphic encryption or differential privacy, which is the practice of adding noise to the data in order to obfuscate the results.

Generally speaking, with federated learning, the AI algorithm is trained without ever recognizing any individual user’s specific data; in fact, the raw data never leaves the device itself. Only aggregated model updates are sent back. These model updates are then decrypted upon delivery to the central server. Test versions of the updated model are then sent back to select devices, and after this process is repeated thousands of times, the AI algorithm is significantly improved—all while never jeopardizing user privacy.

This technology is expected to make waves in the healthcare sector. For example, federated learning is currently being explored by medical start-up Owkin. Seeking to leverage patient data from several healthcare organizations, Owkin uses federated learning to build AI algorithms with data from various hospitals. This can have far-reaching effects, especially as it’s invaluable that hospitals are able to share disease progression data with each other while preserving the integrity of patient data and adhering to HIPAA regulations. By no means is healthcare the only sector employing this technology; federated learning will be increasingly used by autonomous car companies, smart cities, drones, and fintech organizations. Several other federated learning start-ups are coming to market, including Snips, S20.ai, and Xnor.ai, which was recently acquired by Apple.

Potential concerns

Man-In-The-Middle Attacks

Seeing as these AI algorithms are worth a great deal of money, it’s expected that these models will be a lucrative target for hackers. Nefarious actors will attempt to perform man-in-the-middle attacks. However, as mentioned earlier, by adding noise and aggregating data from various devices and then encrypting this aggregate data, companies can make things difficult for hackers.

Model Poisoning

Perhaps more concerning are attacks that poison the model itself. A hacker could conceivably compromise the model through his or her own device, or by taking over another user’s device on the network. Ironically, because federated learning aggregates the data from different devices and sends the encrypted summaries back to the central server, hackers who enter via a backdoor are given a degree of cover. Because of this, it is difficult, if not impossible, to identify where anomalies are located.

Bandwidth and Processing Limitations

Although on-device machine learning effectively trains algorithms without exposing raw user data, it does require a ton of local power and memory. Companies attempt to circumvent this by only training their AI algorithms on the edge when devices are idle, charging, or connected to Wi-Fi; however, this is a perpetual challenge.

The Impact of 5G

As 5G expands across the globe, edge devices will no longer be limited by bandwidth and processing speed constraints. According to a recent Nokia report, 4G base stations can support 100,000 devices per square kilometer; whereas, the forthcoming 5G stations will support up to 1 million devices in the same area. With enhanced mobile broadband and low latency, 5G will provide energy efficiency, while facilitating device-to-device communication (D2D). In fact, it is predicted that 5G will usher in a 10-100x increase in bandwidth and a 5-10x decrease in latency.

When 5G becomes more prevalent, we’ll experience faster networks, more endpoints, and a larger attack surface, which may attract an influx of DDoS attacks. Also, 5G comes with a slicing feature, which allows slices (virtual networks) to be easily created, modified, and deleted based on the needs of users. According to a research manuscript on the disruptive force of 5G, it remains to be seen whether this network slicing component will allay security concerns or bring a host of new problems.

To summarize, there are new concerns from both a privacy and a security perspective; however, the fact remains: 5G is ultimately a boon for federated learning.

Read More

Posted on

WiFi for Enterprise IoT: Why You Shouldn’t Use It

Illustration: © IoT For AllSo you’re building an IoT solution and you’re ready to select your connectivity approach. Should you use Bluetooth? WiFi? LoRa? Cellular? Satellite? As I’ve explored in a previous post, the connectivity approach you choose ultimately comes down to the specific needs of your …

Read More

Posted on

The State of Indoor Positioning and Asset Tracking Using BLE and LoRa

Illustration: © IoT For AllThe indoor positioning and asset tracking space remains the wild west despite many companies working towards developing a robust, cost-effective, scalable solution. BLE, WiFi, Ultra Wide Band, RFID, and Ultrasonic, to name a few, have been used in the past to develop Indoor Positioning and Asset …

Read More

Posted on

Cellular IoT: Poised to Hit Consumer Product Market

Illustration: © IoT For AllWith 2020 underway, I’d like to toss my hat in the ring with others who have penned predictions for IoT in 2020. I’ll get right to it; I predict the wide-spread introduction of IoT products with embedded cellular connectivity to the consumer market.To date, IoT …

Read More

Posted on

An Introduction to a Full 5G System

Illustration: © IoT For All5G will be here soon, and it will be much more than faster cell phone speeds. There are three application spaces designated for 5G– eMBB, the replacement of 4G mobile networks with faster 5G networks; URLCC, low latency high-reliability data transfer; and mMTC, low-cost massive …

Read More

Posted on

3 Reasons Why Your IoT Initiatives Need SD-WAN

Illustration: © IoT For AllWe’re living in an era of fast-paced digital transformation that’s only accelerating thanks to the Internet of Things (IoT). From agriculture and retail to transportation, healthcare, and the factory floor, IoT systems are delivering new business insights and much more efficient ways of working. …

Read More

Posted on

MQTT vs SSE: A Comparison

Illustration: © IoT For AllBuilding a real-time web or mobile application is a bit more challenging than building a standard service. That’s because the protocol you choose to deliver data from the server to the client— and back—will have a significant impact on the overall experience.When you …

Read More

Posted on

7 IoT Certifications to Enhance Your Career Prospects in 2020

Illustration: © IoT For AllAs a software engineer, computer engineer, full-stack developer or any other IT professional, new career opportunities mean better income, perks, growth and a more satisfying job experience. But some opportunities don’t come easily unless you have the right certifications.In 2017, Gartner forecasted the creation of 1.4 …

Read More