In a prior blog we discussed how a combination of Raspberry Pi 4, simulation tools and the Triotos IoT platform can be used to dramatically accelerate the development of complete IoT solutions for your business. This blog will go present the approach and how the different parts are used to create a development environment that allows for parallel development of IoT devices with embedded computing and the associated cloud based IoT applications. This architecture diagram shows the development environment setup.
The RaspberryPi 4 is used as the prototype for the embedded environment. In our case we run the commercial Ubuntu 20.04 Linux OS with Python 3 as a development environment and AWS Greengrass as the IoT Gateway agent. This is the environment where all embedded code will be developed. In order to simulate real IoT data the Triotos web-based simulation environment is used. In one instance, this web site is opened on a laptop where it is configured to send IoT data via the USB port to the serial input of the RaspberryPi feeding the real embedded device. The same simulator setup is also used to create virtual embedded devices and sent directly to the Triotos IoT platform where it is used as data in customizing and developing all the IoT applications. Let us take a look at what this simulated data looks like by modeling a real commercial product – in this case an elevator.
Use Case – Elevator
Turning commercial and residential elevators into IoT devices offers many advantages as far as service, reliability, and ability to monitor function and performance. An application use case is service monitoring contracts offering fast response and preventive service. As always with IoT, it is the suppliers and users that best understand what IoT can do for them.
Starting and IoT project means identifying which information is currently available in the product and which additional information is desirable. Next step is to identify the desired web or mobile or messaging applications the project should support. This is information is best summarized in a use case, a one-page document describing what the project should deliver or, to use agile terminology, the story (or epic) for the project. Attachment one to this document is a spreadsheet that lists all the data items used. Data Item, unit, and value range and where it will come from should make up the 5 columns of this list. From this, the data model of the IoT implementation is created. Once completed, this document effectively provides all the use cases and the data associated with them.
The Embedded IoT Development Project
The RaspberryPi 4 is used as the prototype embedded board while developing. It will support all connected sensors and I/O‘s with embedded code (developed using Python?) translating signal or digital data from sensors to what has been described in the data model spread sheet. Before starting this development, it makes sense to bring up the RaspberryPi 4 OS and Greengrass agent and configure it so that it is connected to your Triotos customer instance.
This is done by registering the new device on the Triotos Administration/Provisioning application. When creating a new RaspberryPi gateway, the Triotos application utilizes the information the user inputs and the AWS Greengrass interface to create a device ‘SDK’ file to run on your gateway device. This requires device specific parameters like data transfer method (serial) and for authentication and security the serial number of the specific RaspberryPi.
Required information also include location as well as a unique identifier and contact information used in Monitoring applications. Once completed, the RaspberryPi 4 used for development is provisioned as a unique device on the Triotos IoT application and therefore visible in all Triotos web and mobile applications.
Implementing unique IoT Data Model
The Triotos IoT application supports any number of real IoT devices but also virtual simulated devices that can be used during development or for monitoring and testing. Simulated virtual devices are provisioned using the same Administration/Provisioning UI as real devices. They are created using a device simulator UI where the data model can be replicated, and data items (Numerical & Boolean) can be entered, and simulation statistics selected. For the Elevator use case we have selected Passenger Weight, Temperature, Door Open/Close, Direction Up/Down and Functional Status (F/P/N), Direction, Door Status as simulation parameters.
In real development the simulator ought to reflect all or most items in the data model.
Using Simulated Data for Application Development
Simulated data can be used for both embedded device and application development. In the first instance a laptop with data simulator running is connected via a USB/TTL cable
to the serial input of the RaspberryPi where it is connected to the Greengrass gateway agent. As embedded development gets under way IoT data from sensors is converted to the same data model thereby providing real data from the embedded board. This approach allows Embedded Board and Data Handling development to occur simultaneously.
Application development requires realistic data from a large number of devices. The same data simulator used to provide data to the Raspberry can be provisioned as virtual devices directly on the Triotos platform. This is used in the Administration/Provisioning application used to provision the RaspberryPi. These virtual devices are assigned unique identifiers and location and act the same way as provisioned real devices.
When started, the virtual device simulators are configured to deliver the data model at fixed or exponentially distributed intervals that run continuously during the duration of the development effort. The known statistical properties are helpful in developing the web and mobile applications that come with the Triotos platform or are customized and developed for each business. The result is a live development environment for embedded development and IoT application development for Data/Event Monitoring, Analytics, and IoT System Monitoring.
To learn more about how you can use RaspberryPi 4 and the Triotos IoT platform/services to accelerate your Embedded IoT Product and Application development, please visit www.triotos.com and contact us for a demonstration how it would be used for your specific product and application. In this demo we will with your cooperation show your use case implemented in and end-to-end IoT implementation on a live Triotos instance branded with your company name.