MMM-TracCar



  • Description

    MMM-TracCar is a new module for tracking moving objects through Traccar.org APIs over google maps. This is based on a websocket connection to the Traccar.org server over which locations of all the registered users are received upon any new event. Not only the markers are updated but also the map’s center & zoom level. Plus all online users have a green icon, rest are red. Error handling is built in too. Feel free to amend it as per your need and let me know of issues.

    Btw, there are free servers available on Traccar.org. 🙂

    Happy coding!
    😉

    Screenshot

    thats how it shows

    Download



  • Please add some more pics showing how this integrated with the resto f the MM modules



  • Hello,

    I try to use this Module that seams amazing !

    For the field “gmapid”, I created an accound on Google Cloud Platform (with credit card number…), but it is not working. Could you please give more infos about the value requested by your module and the way to configure it ?
    The key I got looks like (I change some letters of course !) :
    ApybZyXX5ou0t-XZXSnj3w_J_lmtw6v5xxVV5U9

    Also it seams that now Google Map API key will not be free anymore (from mid-july), it there still a way to make this plugin work without paying Google ?

    Thanks a lot,
    AgP



  • @agp42 thanks for trying… as far as I know, Google changed their policy but it still provides developers with $200 worth of free monthly usage… so you may continue using it… anyhow, for the time, kindly share your log (console log)…



  • Yes, they said it will be free minimum 12 month, so let’s see !

    In fact with the auto-start I didn’t see the log initially…
    To have clear logs only with TracCar I keep only this module on my config.js file and here are the console logs accordingly :

    pi@raspberrypi:~/MagicMirror $ npm start
    
    > magicmirror@2.4.1 start /home/pi/MagicMirror
    > sh run-start.sh
    
    Starting MagicMirror: v2.4.1
    Loading config ...
    Loading module helpers ...
    Initializing new module helper ...
    Module helper loaded: MMM-TracCar
    All module helpers loaded.
    Starting server on port 8080 ...
    Server started ...
    Connecting socket for: MMM-TracCar
    Starting NodeHelper for MMM-TracCarmodule.
    Sockets connected & modules started ...
    Whoops! There was an uncaught exception...
    { Error: listen EADDRINUSE 0.0.0.0:8080
    at Object._errnoException (util.js:1024:11)
    at _exceptionWithHostPort (util.js:1046:20)
    at Server.setupListenHandle [as _listen2] (net.js:1351:14)
    at listenInCluster (net.js:1392:12)
    at doListen (net.js:1501:7)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:685:11)
    at startup (bootstrap_node.js:196:16)
    at bootstrap_node.js:622:3
    code: 'EADDRINUSE',
    errno: 'EADDRINUSE',
    syscall: 'listen',
    address: '0.0.0.0',
    port: 8080 }
    MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
    If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
    Launching application.
    

    The internet connection is working fine (all others modules can connect).
    But it’s true that I had to change the internet configuration of the MagicMirror in order to use Remote-Control module.

    To be sure this is not the cause of the error on your module, I re-use the inital config.js file, but still not working (but with different IP adresse on the log…) :

    pi@raspberrypi:~/MagicMirror $ npm start
    
    > magicmirror@2.4.1 start /home/pi/MagicMirror
    > sh run-start.sh
    
    Starting MagicMirror: v2.4.1
    Loading config ...
    Loading module helpers ...
    No helper found for module: alert.
    Initializing new module helper ...
    Module helper loaded: updatenotification
    No helper found for module: clock.
    Initializing new module helper ...
    Module helper loaded: MMM-TracCar
    All module helpers loaded.
    Starting server on port 8080 ...
    Server started ...
    Connecting socket for: updatenotification
    Connecting socket for: MMM-TracCar
    Starting NodeHelper for MMM-TracCarmodule.
    Sockets connected & modules started ...
    Whoops! There was an uncaught exception...
    { Error: listen EADDRINUSE 127.0.0.1:8080
    at Object._errnoException (util.js:1024:11)
    at _exceptionWithHostPort (util.js:1046:20)
    at Server.setupListenHandle [as _listen2] (net.js:1351:14)
    at listenInCluster (net.js:1392:12)
    at GetAddrInfoReqWrap.doListen [as callback] (net.js:1501:7)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:97:10)
    code: 'EADDRINUSE',
    errno: 'EADDRINUSE',
    syscall: 'listen',
    address: '127.0.0.1',
    port: 8080 }
    MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
    If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
    Launching application.
    

    And here is my module configuration :

    {
    module: 'MMM-TracCar',
    position: 'bottom_right',
    config: {
    url: "demo5.traccar.org", // Traccar Server URL (free server @ http://demo5.traccar.org )
    username: "blabla@blabla.org", // Traccar Account username (email) (btw, there is a free account option too!) :)
    pass: "passworddddd", // Traccar Account Password
    gmapid: "keyxxxxxx", // 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_shadow_color: "POWDERBLUE", // shadow color of the border element (optional)
    }
    },
    

    Maybe the error is coming from this line ? :

    url: "demo5.traccar.org", // Traccar Server URL (free server @ http://demo5.traccar.org )
    

    But impossible to write the full URL due to the “//”…

    Also of course when I connect from my PC to the http://demo5.traccar.org with my username and password, I can see correctly the location of my phone (so the “TracCar” part is well configured)

    I hope I gave you enough infos 😁

    Thanks a lot !



  • Solved ! 😳

    Oups…

    I “just” try with the full server address, including the http://, and it perfectly run…

    So my mistake, sorry !



  • @AgP42

    Haha… glad your solved it yourself. Please give a thumbs-up on the git page…



  • @asimhsidd done ! 🙂



  • Great module - thank you for sharing.

    Is there anyway to start the Map in Satellite View as default and also adjust the default Zoom level. I want it to be a wider zoom from the current default.

    Thanks,
    G



  • Bump - Is there a way adjust the default zoom level. I find that it is too zoomed in most cases.