{"id":69,"date":"2021-10-10T15:13:22","date_gmt":"2021-10-10T18:13:22","guid":{"rendered":"<!-- wp:paragraph -->\n<p>Managing and monitoring a truck fleet is key factor to achieved efficiency in companies and organizations in the delivery process.<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>In this article, we will cover these topics:<\/"},"modified":"2021-12-02T12:58:20","modified_gmt":"2021-12-02T15:58:20","slug":"building-a-gps-fleet-management-solution-using-c-from-visual-studio-with-net-framework","status":"publish","type":"post","link":"https:\/\/miguelorama.com\/blog\/2021\/10\/10\/building-a-gps-fleet-management-solution-using-c-from-visual-studio-with-net-framework\/","title":{"rendered":"Building a GPS Fleet Management solution using C# from Visual Studio with .Net Framework"},"content":{"rendered":"\n<p>Managing and monitoring a truck fleet is key factor to achieved efficiency in companies and organizations in the delivery process.<\/p>\n\n\n\n<p>In this article, we will cover these topics:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Developing Technology<\/li><li>UDP Protocol and Receiving tracking data<\/li><li>Process and Converting the data<\/li><li>Rules and Notification<\/li><li>Live Fleet Viewer<\/li><\/ul>\n\n\n\n<p>This solution is based on 3 simple application:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>UDP Receiver<\/li><li>Extract &amp; Process Data<\/li><li>Live Fleet Viewer<\/li><\/ul>\n\n\n\n<p class=\"has-text-color has-large-font-size\" style=\"color:#1894c9\"><strong><em>Developing Technology<\/em><\/strong><\/p>\n\n\n\n<p>Main technology to build this solution are:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>C# Visual Studio .NET Framework<\/li><li>Entity Framework 5.0 <\/li><li>Microsoft SQL Server 2016<\/li><li>OpenStreetmap<\/li><\/ul>\n\n\n\n<p class=\"has-text-color has-large-font-size\" style=\"color:#1495cc\"><strong><em>UDP Protocol and Receiving tracking data<\/em><\/strong><\/p>\n\n\n\n<p><em>User Diagram Protocol (UPD)<\/em> is a communication protocol that facilitates the exchanges of messages between devices in a network, in this case is 4G LTE cellular network.<\/p>\n\n\n\n<p>All delivery trucks are equipped with a GPS device + active SIM card.<\/p>\n\n\n\n<p>By using <em>UPD protocol<\/em>, GPS devices sends tracking data to the company using UDP Protocol via the cellular network.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><img decoding=\"async\" src=\"https:\/\/miguelorama.com\/blog\/wp-content\/uploads\/2021\/10\/Fig-03-Settings.png\" alt=\"Server settings\" class=\"wp-image-120\"\/><figcaption>Fig 01. Settings<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>The tracking data received by the server has certain structure and it contains:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Device ID<\/li><li>Date<\/li><li>Latitude and Longitude<\/li><li>Bearing<\/li><li>Speed<\/li><li>Altitude<\/li><li>and other related data<\/li><\/ul>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><img decoding=\"async\" src=\"https:\/\/miguelorama.com\/blog\/wp-content\/uploads\/2021\/10\/Fig-00-Receiving-Data.png\" alt=\"UDP Receiver\" class=\"wp-image-117\"\/><figcaption>Fig. 02 &#8211; UDP Receiver<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>GPS devices are set to send tracking data every 1 min, so it was important to build a dedicated application that constantly <em>\u201clisten\u201d <\/em>the incoming port to receive and save the tracking data in th database.<\/p>\n\n\n\n<p> <\/p>\n\n\n\n<p class=\"has-text-color has-large-font-size\" style=\"color:#1495cc\"><strong><em>Process and converting data<\/em><\/strong><\/p>\n\n\n\n<p><br>Once the tracking data is saved in the database, a scheduled routine will process the receiving data and extract the information from the receiving data per vehicle.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/miguelorama.com\/blog\/wp-content\/uploads\/2021\/10\/Fig-01-Extract-GPS-Data.png\" alt=\"Extract and Convert GPS Data\" class=\"wp-image-118\"\/><figcaption>Fig 03 &#8211; Extract and convert GPS Tracking data<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-text-color has-large-font-size\" style=\"color:#1495cc\"><strong><em>Rules and Notification<\/em><\/strong><\/p>\n\n\n\n<p>Being able to \u201capply\u201d or not rules and send email notification with the performance and tracking information of the fleet was an essential requirement for this solution.<\/p>\n\n\n\n<p>Supervisor responsible are notified by email in the case the tracking data analysis meet the rules constrains.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/miguelorama.com\/blog\/wp-content\/uploads\/2021\/10\/Fig-04-Rules-1024x610.png\" alt=\"Rules and Notification\" class=\"wp-image-121\"\/><figcaption>Fig 04 &#8211; Rules and Notification<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-text-color has-large-font-size\" style=\"color:#1495cc\"><strong><em>Live Fleet Viewer<\/em><\/strong><\/p>\n\n\n\n<p>By using the maps controls from OpenStreetMap we are able to <em>\u201ctrack\u201d<\/em> every vehicle from the fleet.<\/p>\n\n\n\n<p>This live view will refresh automatically every 1 minute.<\/p>\n\n\n\n<p>General view or a specific vehicle tracking its possible as well.<\/p>\n\n\n\n<p>This view also display the customer\u2019s location in the map, but this will be topic for another article.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img decoding=\"async\" src=\"https:\/\/miguelorama.com\/blog\/wp-content\/uploads\/2021\/10\/Fig-02-Maps-1024x576.png\" alt=\"Live Fleet Viewer\" class=\"wp-image-119\"\/><figcaption>Fig. 05 &#8211; Live Fleet Viewer<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-text-color has-large-font-size\" style=\"color:#1495cc\"><strong><em>Conclusions<\/em><\/strong><\/p>\n\n\n\n<p>Building a .NET application with C# from Visual Studio IDE .NET Framework it\u2019s so satisfying due the visual tools, components, controls and libraries from .NET Framework.<\/p>\n\n\n\n<p>C# its consider by many, one of the most powerful and capable programming language from .NET Framework highly recommended to almost any king of application development.<\/p>\n\n\n\n<p>For a GPS Fleet Management the solution was 3 different applications and each has a specific functionality in order to meet the requirement:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>UDP Receiver<\/li><li>Extract &amp; Process Data<\/li><li>Live Fleet Viewer<br><br><\/li><\/ul>\n\n\n\n<p>There were challenges during the building and deployment process.<\/p>\n\n\n\n<p>The apps are running from every day long since year 2018.<\/p>\n\n\n\n<p>All the requirement were met.<\/p>\n\n\n\n<p>Supervisor and Management Team rely on the Live Fleet View to monitor the fleet\u2019s status while delivering.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Managing and monitoring a truck fleet is key factor to achieved efficiency in companies and organizations in the delivery process. In this article, we will cover these topics: Developing Technology UDP Protocol and Receiving tracking data Process and Converting the data Rules and Notification Live Fleet Viewer This solution is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-69","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/miguelorama.com\/blog\/wp-json\/wp\/v2\/posts\/69","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/miguelorama.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/miguelorama.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/miguelorama.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/miguelorama.com\/blog\/wp-json\/wp\/v2\/comments?post=69"}],"version-history":[{"count":0,"href":"https:\/\/miguelorama.com\/blog\/wp-json\/wp\/v2\/posts\/69\/revisions"}],"wp:attachment":[{"href":"https:\/\/miguelorama.com\/blog\/wp-json\/wp\/v2\/media?parent=69"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/miguelorama.com\/blog\/wp-json\/wp\/v2\/categories?post=69"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/miguelorama.com\/blog\/wp-json\/wp\/v2\/tags?post=69"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}