Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/asimhsidd/MMM-TracCar
A MagicMirror module for tracking moving objects through Traccar.org APIs.
https://github.com/asimhsidd/MMM-TracCar
Last synced: 22 days ago
JSON representation
A MagicMirror module for tracking moving objects through Traccar.org APIs.
- Host: GitHub
- URL: https://github.com/asimhsidd/MMM-TracCar
- Owner: asimhsidd
- License: mit
- Created: 2018-05-03T06:15:46.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-05T11:05:01.000Z (about 6 years ago)
- Last Synced: 2024-08-04T10:03:16.464Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 42 KB
- Stars: 10
- Watchers: 2
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-mmm - **MMM-TracCar**
README
# MMM-TracCar
A [MagicMirror²](https://github.com/MichMich/MagicMirror/) module for tracking moving objects through [Traccar.org](http://www.traccar.org) on a map. A single map (default size: 300x400, can be changed through config settings) is built inside the module, no iframe is used. The best position is bottom left, although it depends upon the user. The map may have nice rounded and shadow borders which adds a nice aesthetic sense to the overall MM. All these settings are adjustable through config settings.This module is based upon Traccar.org so you must have their server running (you may use their free servers too, if you are okay with your location saved on their server). For the maps, this module uses Google Maps API. It takes Traccar.org login credentials, server url and Google Maps API key as configuration input.
Upon load, the model initiates contact with the Traccar.org server using HTTP Request. Once contact is successful, it extracts information regarding all the devices that are listed on the server for constant location updates. Then the module formulate a socket connection with the Traccar.org server to receive real-time location updates as and when they are received from the respective devices. Each device is then shown on the map as an individual marker (green for online, red for offline devices) with the respective device name in the popup above each marker. These markers are moved on the map as location updates are received i.e. when a respective device is moving.
The module is built with error handling procedures where it attempts to reconnect with the server after every 15 seconds.
![picture](Capture.JPG)
## Using the module
* Navigate to the modules directory via the follow command: `cd MagicMirror/modules`
* Clone the module from github: `git clone https://github.com/asimhsidd/MMM-TracCar.git`
* Navigate to the MMM-TracCar directory: `cd MMM-TracCar`
* Install the dependencies: `npm install`
* Add the following configuration to the modules array in the `config/config.js` file:
```js
modules: [
{
module: 'MMM-TracCar',
position: 'top_left',
config: {
url: "", // Traccar Server URL (free server @ http://demo5.traccar.org )
username: "", // Traccar Account username (email) (btw, there is a free account option too!) :)
pass: "", // Traccar Account Password
gmapid: "", // Google Apps key
map_width: "300", // width of the map element
map_height: "400", // height of the map element
map_border_radius: "10", // border radius of the map element (optional)
map_zoom: "15", // zoom level of the map (optional)
map_shadow_color: "POWDERBLUE", // shadow color of the border element (optional)
}
}
]
```## Configuration options for MMM-TracCar
| Option | Required? | Description |
|:------------- |:--------- |:----------- |
| `position` | :red_circle: | The position of the screencast window.
**Options:** `['bottomRight', 'bottomCenter', 'bottomLeft', 'center', 'topRight', 'topCenter', 'topLeft']`
**Type:** `string`
**Note:** This module config actual sets the location, not the magic mirror position config. |
| `url` | :red_circle: | The URL of the [Traccar Server](https://www.traccar.org/demo-server/) |
| `username` | :red_circle: | Your Traccar Username (email) |
| `pass` | :red_circle: | Your Traccar Password |
| `gmapid` | :red_circle: | Your Google API key |
| `map_width` | :red_circle: | The Width of the map element |
| `map_height` | :red_circle: | The Height of the map element |
| `map_border_radius` | :white_circle: | The Border radius of the map element |
| `map_zoom` | :white_circle: | The Zoom level of the map element |
| `map_shadow_color` | :white_circle: | The Shadow color of the border element |