TMC is an independent, primarily volunteer organization that relies on ad revenue to cover its operating costs. Please consider whitelisting TMC on your ad blocker or making a Paypal contribution here: paypal.me/SupportTMC

Web Based Model S Interface

Discussion in 'Model S: User Interface' started by apacheguy, Aug 23, 2014.

  1. apacheguy

    apacheguy Sig 255, VIN 320

    Joined:
    Oct 21, 2012
    Messages:
    3,718
    Location:
    So Cal
    A few weeks ago folks expressed interest in my PHP/MySQL based web app for the Model S. I created it mostly because I was tired of Tesla's refusal to cache data and make it available when the car sleeps. Thus, you only need to wake the car from the iOS app when you need real time feedback (climate control, unlocking doors, etc).

    I released the source code on GitHub a couple days ago. More info below, but please have at least a basic idea of how to deal with MySQL dbs and have a basic understanding of some programming language before installing this on your webserver. I myself am an amateur programmer with zero formal training. The code is messy, yet functional. Cleaning it up has not been one of my priorities so I am releasing it as is.

    From github:

    This is a web accessable package written in PHP/MYSQL used to retrieve data and set parameters on a compatible Model S (remote access enabled).


    Features:
    - Track SOC data over time and monitor vampire losses (logger.php)
    - View offline range without having to wake the car
    - Set the desired charger % without having to wake the car
    - Calculates corresponding rated miles for given SOC % using real data!
    - View the car's last known location without having to wake the car
    - Track a supercharge or any other charge session
    - View streaming data in real-time


    The beauty is that all of these features output to the browser instead of having to launch a program on your desktop.


    Setup:
    - Configure an appropriate MYSQL db
    - logger.php will need to be executed by cron or task scheduler in 30 min increments


    Note:
    - Graphing features will require a PHP graphing library (i.e. PHPGraphLib)
    - I am an amateur programmer with ZERO formal training. Use at your own risk!

    apach3guy/Tesla-Mobile-Web-App · GitHub

    Screens:

    image.jpg
    image.jpg
     
  2. AnOutsider

    AnOutsider S532 # XS27

    Joined:
    Apr 3, 2009
    Messages:
    11,923
    Very nice, thanks for sharing!
     
  3. Olen

    Olen Member

    Joined:
    Oct 9, 2013
    Messages:
    97
    Have you looked at teslams (also on github)? It is a node.js implmentation. I do fully understand the interest in exploring the car with your own code, but I hope we will get a lot of cooperation between these various projects, so we can get the best of all worlds.
    That said, this looks great, and I am myself more familiar with php and mysql than with nodejs and mongodb (which teslams uses).
    All I want is to keep some kind of datalogger runing locally on my own server, and a nice GUI to view trips, charge speeds, compare data from different periods and so on.
     
  4. apacheguy

    apacheguy Sig 255, VIN 320

    Joined:
    Oct 21, 2012
    Messages:
    3,718
    Location:
    So Cal
    @Olen - I was aware of TeslaMS, but was looking for something that would more easily integrate with my existing server (I don't have a nodejs). Also, AFAIK it is command line based and I wanted better cross platform integration and easy access. I use my app on my iPhone, desktop, as well as the Model S touchscreen itself.
     
  5. Torpedo Ted

    Torpedo Ted Member

    Joined:
    Oct 14, 2013
    Messages:
    71
    Location:
    Norway
    Thanks! But I couldn't find the MySQL DB config? (table names etc.)
     
  6. Olen

    Olen Member

    Joined:
    Oct 9, 2013
    Messages:
    97
    @apacheguy I know what you mean, and have been looking to create something myself, but now I will probably look a bit more closely at what you have done and see if it fits. The only thing I want to be cli-based (or rather actually a deamon) is a logger.
    But if I can integrate teslams logger with this app, that would be really great.
     
  7. apacheguy

    apacheguy Sig 255, VIN 320

    Joined:
    Oct 21, 2012
    Messages:
    3,718
    Location:
    So Cal
    I updated the script on Git. See if it works now.
     
  8. hans

    hans P631

    Joined:
    Sep 27, 2012
    Messages:
    1,123
    Location:
    Menlo Park
    The "visualize" gui in teslams is all HTML and works on iOS, Android, desktop browsers, and the tesla console.

    Node.js is a simple download from nodejs.org and runs on windows, mac, linux, and even raspberry pi.
     
  9. apacheguy

    apacheguy Sig 255, VIN 320

    Joined:
    Oct 21, 2012
    Messages:
    3,718
    Location:
    So Cal
    Huh, I not aware of that implementation. Good to know.

    Personally I still prefer my app. The visualize function would be good for the streaming component of my app, but it does much more than just that. I have the ability to work with a sleeping car and set parameters without waking it. I also have the ability to monitor vampire losses. Also, you would still need to build a php script to execute visualize.js from the command line. It is not a native web sever app.
     

Share This Page