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 shows capability to track GPS location of LinkIt ONE device and further visualization on the map. It performs collection of latitude and longitude values produced by GPS module. Collected data is pushed to Thingsboard for storage and visualization. The purpose of this application is to demonstrate Thingsboard data collection API and visualization capabilities.
The GPS module is built-in module of LinkIt ONE. LinkIt ONE pushes data to Thingsboard server via MQTT protocol by using PubSubClient library for Arduino. Data is visualized using map widget which is part of customizable dashboard. The application that is running on LinkIt ONE is written using Arduino SDK which is quite simple and easy to understand.
Once you complete this sample/tutorial, you will see your device GPS and battery data on the following dashboard.
Prerequisites
You will need to Thingsboard server up and running. Use either Live Demo or Installation Guide to install Thingsboard.
This tutorial was prepared for Windows OS users. However it is possible to run it on other OS (Linux or MacOS).
List of hardware
-
GPS and WIFI Antenna are shipped with board.
Thingsboard configuration
Note Thingsboard configuration steps are necessary only in case of local Thingsboard installation. If you are using Live Demo instance all entities are pre-configured for your demo account. However, we recommend to review this steps because you will still need to get device access token to send requests to Thingsboard.
Provision your device
This step contains instructions that are necessary to connect your device to Thingsboard.
Open Thingsboard Web UI (http://localhost:8080) in browser and login as tenant administrator
- login: [email protected]
- password: tenant
Goto “Devices” section. Click “+” button and create device with name “LinkIt One Demo Device”.
Once device created, open its details and click “Manage credentials”.
Copy auto-generated access token from the “Access token” field. Please save this device token. It will be referred to later as $ACCESS_TOKEN.
Click “Copy Device ID” in device details to copy your device id to clipboard. Paste your device id to some place, this value will be used in further steps.
Provision your dashboard
This step contains instructions that are necessary to provision new dashboard with map widgets to Thingsboard.
Open “Docker Quickstart Terminal” and download file containing demo dashboard JSON:
curl -L https://thingsboard.io/docs/samples/linkit-one/resources/linkit_one_gps_dashboard.json > linkit_one_gps_dashboard.json
Update dashboard configuration with your device Id (obtained in previous step) by issuing the following command:
sed -i "s/{DEVICE_ID}/<your device id>/" linkit_one_gps_dashboard.json
Obtain JWT token by issuing login POST command:
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"username":"[email protected]", "password":"tenant"}' 'http://localhost:8080/api/auth/login'
You will receive response in the following format:
{"token":"$YOUR_JSON_TOKEN", "refreshToken": "$REFRESH_TOKEN"}
copy $YOUR_JSON_TOKEN to some place. Note that it will be valid for 15 minutes by default.
Execute dashboard upload command:
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'X-Authorization: Bearer $YOUR_JSON_TOKEN' -d "@linkit_one_gps_dashboard.json" 'http://localhost:8080/api/dashboard'
Programming the LinkIt One device
If you already familiar with basics of LinkIt One programming using Arduino IDE you can skip the following step and proceed with step 2.
Step 1. LinkIt ONE and Arduino IDE setup.
In order to start programming LinkIt One device you will need Arduino IDE installed and all related libraries. Please follow this guide in order to install the Arduino IDE and LinkIt One SDK:
It’s recommended to update your firmware by following this guide. To try your first LinkIt One sample, please follow this guide.
Step 2. PubSubClient library installation.
Open Arduino IDE and go to Sketch -> Include Library -> Manage Libraries. Find PubSubClient by Nick O’Leary and install it.
Note that this tutorial was tested with PubSubClient 2.6.
Download and open gps_tracker.ino sketch.
Note You need to edit following constants and variables in the sketch:
- WIFI_AP - name of your access point
- WIFI_PASSWORD - access point password
- WIFI_AUTH - choose one of LWIFI_OPEN, LWIFI_WPA, or LWIFI_WEP.
- TOKEN - the $ACCESS_TOKEN from Thingsboard configuration step.
- thingsboardServer - Thingsboard HOST/IP address that is accessable within your wifi network. Specify “demo.thingsboard.io” if you are using live demo server.
resources/gps_tracker.ino |
---|
|
Connect your LinkIt One device via USB cable and select Serial Debug COM port in Arduino IDE. Compile and Upload your sketch to device using “Upload” button.
After application will be uploaded and started it will try to connect to Thingsboard node using mqtt client and upload “latitude” and “longitude” attributes once per second.
Troubleshooting
When application is running you can connect your device to Serial Debug COM port in Arduino IDE and open “Serial Monitor” in order to view debug information produced by serial output.
Data visualization
Finally, open Thingsboard Web UI. You can access this dashboard by logging in as a tenant administrator. Use
- login: [email protected]
- password: tenant
in case of local Thingsboard installation.
Go to “Devices” section and locate “LinkIt One Demo Device”, open device details and switch to “Attributes” tab. If all is configured correctly you should be able to see “latitude”, “longitude” and battery status attributes and theirs latest values in the table.
After, open “Dashboards” section then locate and open “LinkIt One GPS Tracking Demo Dashboard”. As a result you will see the map widget with pointer indicating your device location and battery level widget (similar to dashboard image in the introduction).
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 need to test this software, it is possible to replace this vehicle track system uboro. I started use this for a long time, since I had to control my son. Now I do not have such a need, but it would be in case of force majeure find him.
ReplyDeleteMachine Learning Projects for Final Year machine learning projects for final year
DeleteDeep Learning Projects assist final year students with improving your applied Deep Learning skills rapidly while allowing you to investigate an intriguing point. Furthermore, you can include Deep Learning projects for final year into your portfolio, making it simpler to get a vocation, discover cool profession openings, and Deep Learning Projects for Final Year even arrange a more significant compensation.
Python Training in Chennai Project Centers in Chennai
Reduce Fuel and Maintenance Costs – The average operating cost per vehicle is about $1.50 per mile. A company can reduce at least 25 miles per week for each vehicle with a RMT Rover GPS Tracking System. ELD Mandate
ReplyDeleteThis comment has been removed by the author.
ReplyDeletePretty blog, so many ideas in a single site, thanks for the informative article, keep updating more article.
ReplyDeleteWebdesining course in chennai
I think it's not right! we all have to respect privacy of each other. I like Trump but in this situation I can't agree with this man! Hope, he will decide not to do it. By the way, my good friend told me she wanted to know waht her child do when she is away. And she decided to install this Hoverwatch phone tracker. Good luck!
ReplyDeleteis it possible to add multipel tracking devices on "MAP" and monitoring them??
ReplyDeleteNice post. Thank you for you great article
ReplyDeleteGreat post. thank you.
ReplyDeleteDigital marketing course in chennai
Hi there, I read your blogs on a regular basis. Your humoristic style is witty, keep it up! Thank You for Providing Such a Unique and valuable information, If you
ReplyDeleteare looking for the best Gps Tracker For Kids, then visit Vimel Technology Pty Ltd.I enjoyed this blog post.
Real-time tracking is the main reason for buying a GPS Tracker. Real-time GPS tracking differs from one tracking device to another. Some tracking devices do not offer the ability to manually ping the tracker which allows you to know its exact location at any time and others only offer a location update at pre-defined intervals. Fleet Management Solutions
ReplyDeleteAfter Reading your article about features of GPS Tracker, I get some good knowledge about it. You very well defined about the GPS system which is quite unique. Thanks for sharing such good information. Car GPS Ireland.
ReplyDeleteThe blog was having very informative content and very useful for me. Well done post and keep it up... Thanks for sharing such a Useful info. tableau automation
ReplyDeleteHow do I start to learn how to Hip Hop dance? GPS tracker
ReplyDeleteMany radio broadcasts are overhauling their transmission innovation, with some contribution HD2 multicast channels.ADN GPS
ReplyDeleteYou wrote this post very carefully. The amount of information is stunning and also a gainful article for us. Keep sharing this kind of articles, Thank you. spy software
ReplyDeleteThanks for sharing the post.. parents are worlds best person in each lives of individual..they need or must succeed to sustain needs of the family. www.meridiannorstar.net
ReplyDeleteI was surfing the Internet for information and came across your blog. I am impressed by the information you have on this blog. It shows how well you understand this subject. tracking devices
ReplyDeleteIt is truly a well-researched content and excellent wording. I got so engaged in this material that I couldn’t wait to read. Read more info about car trackers ireland. I am impressed with your work and skill. Thanks.
ReplyDeleteI am impressed with your work and skills visit also Telematics Service
ReplyDeletethanks for all of this. Rip Wheeler Jacket
ReplyDeleteKeep it up. Yellowstone Rip Jacket
ReplyDeleteAmazing really. Very hard work for me. Yellowstone Rip Trucker Jacket
ReplyDeleteClearly, It is an engaging article for us which you have provided here about vessel fleet tracking system. This is a great resource to enhance knowledge about it. Thank you.
ReplyDeleteI like the way you have explained things and I also want to showcase my website Web hosting “Write for us” that provides you information about guest posting.
ReplyDeleteI think this is one of the most significant pieces of information for me about Specialty Pharmacies Medication Tracking . And I'm glad to read your article. Thank you for sharing!
ReplyDeleteNice info, I am very thankful to you for sharing this important knowledge. This information is helpful for everyone. Read more info about truck gps tracker. So please always share this kind of information. Thanks.
ReplyDeleteIt is not always possible to check the inputs using the visual location maps especially if you are driving. So, always pick up a cloud-based GPS option that provides voice instructions and analytics and enables you to keep a tab on the predictive performance of your fleet.
ReplyDeleteElectronic Logging Devices