Thingsboard is an open-source server-side platform that allows you to monitor and control IoT devices. It is free for both personal and commercial usage and you can deploy it anywhere. If this is your first experience with the platform we recommend to review what-is-thingsboard page and getting-started guide.
This sample application will allow you to control GPIO of your Raspberry Pi device using Thingsboard web UI. We will observe GPIO control using Led connected to one of the pins. The purpose of this application is to demonstrate Thingsboard RPC capabilities.
Raspberry Pi will use simple application written in Python that will connect to Thingsboard server via MQTT and listen to RPC commands. Current GPIO state and GPIO control widget is visualized using built-in customizable dashboard.
The video below demonstrates the final result of this tutorial.
Prerequisites
You will need to Thingsboard server up and running. Use either Live Demo or Installation Guide to install Thingsboard.
List of hardware and pinouts
-
Raspberry Pi - we will use Raspberry Pi 3 Model B but you can use any other model.
-
Led and corresponding resistor
-
2 female-to-male jumper wires
Wiring schema
Since our application will allow to control state of all available GPIO pins, we recommend to attach some LEDs to those pins for visibility. You can use this basic instruction or another one to wire some LEDs.
Programming the Raspberry Pi
MQTT library installation
Following command will install MQTT Python library:
sudo pip install paho-mqtt
Application source code
Our application consists of single python script that is well commented. You will need to modify THINGSBOARD_HOST constant to match your Thingsboard server installation IP address or hostname. Use “demo.thingsboard.io” if you are using live demo server.
The value of ACCESS_TOKEN constant corresponds to sample Raspberry Pi device in pre-provisioned demo data. If you are using live demo server - get the access token for pre-provisioned “Raspberry Pi Demo Device”.
resources/gpio.py |
---|
|
Running the application
This simple command will launch the application:
python gpio.py
Data visualization
In order to simplify this guide we have included “Raspberry PI GPIO Demo Dashboard” to the demo data that is available in each thingboard installation. Of course, you can modify this dashboard: tune, add, delete widgets, etc. You can access this dashboard by logging in as a tenant administrator. Use
- login: [email protected]
- password: tenant
in case of local Thingsboard installation.
Once logged in, open Dashboards->Raspberry PI GPIO Demo Dashboard page. You should observe demo dashboard with GPIO control and status panel for your device. Now you can switch status of GPIOs using control panel. As a result you will see LEDs status change on device and on the status panel.
Below is the screenshot of the “Raspberry PI GPIO Demo Dashboard”.
Next steps
Browse other samples or explore guides related to main Thingsboard features:
- Device attributes - how to use device attributes.
- Telemetry data collection - how to collect telemetry data.
- Using RPC capabilities - how to send commands to/from devices.
- Rule Engine - how to use rule engine to analyze data from devices.
- Data Visualization - how to visualize collected data.
I used raspberry pi in my final semester project, this raspberry is amazing and remarkable, just like you i am also a blogger and i recently publish e commerce websites in pakistan blog you can also read this blogpost too.
ReplyDeleteI was struggling with paraphrasing my dissertation, and the paraphrasing service uk
ReplyDeleteteam was a lifesaver! They helped me to reword my work effectively without compromising the meaning or quality. The turnaround time was quick, and the final product was fantastic. I highly recommend this service to any student struggling with paraphrasing their work!
Thanks for share this information to us !!!
ReplyDeleteMyCCPay Log In
Thank you very much for the information; I will make an effort to learn more about it. Continue to propose posts like these and share posts that are as informative as they are. receiptify
ReplyDeleteI am extremely grateful for the information that you have provided; I will make an attempt to find out more about it. Maintain the practise of suggesting topics such as these and sharing posts that are equally as informative as these.
ReplyDeletecfa home
Sure, you can control Raspberry Pi GPIO via MQTT using Thingsboard. Explore features like automation and monitoring with Beetv APK for enhanced functionality.
ReplyDeleteI appreciate your message. We would be happy to help. So, please tell us briefly what the problem is that you're having. If you have any other questions, please let us know. krowd darden
ReplyDeleteThat is all the helpful information I needed. I appreciate you sharing.
ReplyDeleteVampire Survivors
The problem of video streams being split into little files when recording is discussed in "Recording Video Streams (Movies) are Split into Small Files." This sometimes happens when recording video streams like movies or TV shows with specific programmes or equipment.
ReplyDeleteThe recording programme or file format may impose restrictions that necessitate the video stream being split into multiple files. To make video streams more manageable or to circumvent problems with high file sizes, certain recording applications may split them into many files. It's possible that the file format being used necessitates the splitting of video streams into multiple files.
disney hub login
The ThingsBoard blog is a source for knowledge and analysis on the ThingsBoard open-source Internet of Things (IoT) platform. It provides IoT-related training, news, can police officer file protective order virginiaand debates to assist users get the most out of the platform for their IoT projects.
ReplyDeleteThis is a fantastic guide for setting up IoT device control using Thingsboard and a Raspberry Pi. The clear instructions and sample code make it accessible even for beginners. IoT enthusiasts will find this immensely helpful in their projects.
ReplyDeleteDivisión de el Activos Divorcio Nueva York
Casos de Divorcio en Nueva York
Everyone has something in their mind, so am I. ขาย ปลีก ส่ง บุหรี่ไฟฟ้า
ReplyDeleteOnline GRE test help Ethical considerations are a crucial aspect, and reputable services prioritize academic integrity.
ReplyDeleteA really great stuff! Keep it up. Dog likes best
ReplyDeleteThe purpose of the sample app is to connect Raspberry Pi GPIO to Thingsboard via MQTT for IoT control. Deploy and customize Thingsboard for tailored IoT solutions liteblue
ReplyDeletebandle offers a dynamic multiplayer experience where you can compete with friends or random opponents. This feature not only enhances the fun but also helps improve your word-forming abilities as you learn from others.
ReplyDeleteI love that they nail republic source their ingredients locally.
ReplyDeleteThis is a great inspiring article.I am pretty much pleased with your good work. ฝากจอดรถยนต์อุบล You put really very helpful information. Keep it up.
ReplyDelete