Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

TeslaMate [megathread]

This site may earn commission on affiliate links.
Not sure if anyone can help.

Got Pi zero installed with Raspbian, did the usual update and installed docker and docker-compose. Wrote the yml file and it started to run the script and said done to the 4 bits.

They tried to connect to the IP:4000 from my laptop to get the Tesla credentials and errors out. Reboot Pi and typed docker-compose up -d and now get this error:

pi@raspberrypi:~ $ docker-compose up -d
Starting pi_grafana_1 ...
pi_database_1 is up-to-date
pi_mosquitto_1 is up-to-date
pi_teslamate_1 is up-to-date
Starting pi_grafana_1 ... error

ERROR: for pi_grafana_1 Cannot start service grafana: driver failed programming external connectivity on endpoint pi_grafana_1 (08907c46997b3b03e5c260d91337a430962018dc9a0cd67aeb06774f308c68c4): Bind for 0.0.0.0:3000 failed: port is already allocated

ERROR: for grafana Cannot start service grafana: driver failed programming external connectivity on endpoint pi_grafana_1 (08907c46997b3b03e5c260d91337a430962018dc9a0cd67aeb06774f308c68c4): Bind for 0.0.0.0:3000 failed: port is already allocated
ERROR: Encountered errors while bringing up the project.

Any suggestions or help would be appreciated :)
 
If the port is already allocated, there's another service using it. Are you perhaps trying to start Teslamate twice?

You can run the command "netstat -ltpn" to check which process is currently using each port.

Thanks with the tip. Typed the command in and shows this

pi@raspberrypi:~ $ netstat -ltpn
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp6 0 0 :::22 :::* LISTEN -
tcp6 0 0 :::3000 :::* LISTEN -
tcp6 0 0 :::1883 :::* LISTEN -

Not sure on what it's telling me
 
Can you run that again as root? The output is incomplete, apologies I should've specified that in my earlier message.

"sudo netstat -ltpn"
Here you go

pi@raspberrypi:~ $ sudo netstat -ltpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 341/sshd
tcp6 0 0 :::22 :::* LISTEN 341/sshd
tcp6 0 0 :::3000 :::* LISTEN 702/docker-proxy
tcp6 0 0 :::1883 :::* LISTEN 923/docker-proxy
 
  • Like
Reactions: Roy W.
Okay, so then as expected there's already an instance of teslamate running - which is why it's throwing the error you're seeing when you attempt to restart it. You mentioned in your earlier message you've already tried restarting your Pi, but I presume you have a script which is starting your docker containers on boot.

If you run "docker ps" you will see the instances currently running (and the ports they're using), you can force them to stop by running "docker kill xxx" where xxx is the container ID shown in the "docker ps" output. You can then try re-starting it using "docker-compose up -d".
 
  • Helpful
Reactions: Roy W.
Okay, so then as expected there's already an instance of teslamate running - which is why it's throwing the error you're seeing when you attempt to restart it. You mentioned in your earlier message you've already tried restarting your Pi, but I presume you have a script which is starting your docker containers on boot.

If you run "docker ps" you will see the instances currently running (and the ports they're using), you can force them to stop by running "docker kill xxx" where xxx is the container ID shown in the "docker ps" output. You can then try re-starting it using "docker-compose up -d".
Brilliant, many thanks, will have a go at that and see what I can get going
 
I've had this problem sporadically, since I've owned my TM3, through all the sorts of firmware updates. Anybody notice that their TM3 stays awake for an unbelievably long time (8 hours after a very short drive yesterday) sometimes (and I've checked that all the doors, etc... are closed)??? I'm not blaming TeslaMate, it just allows me to easily see it happening instead of walking to the garage and hearing the car lightly humming.

upload_2020-5-1_8-29-50.png
 
I've had this problem sporadically, since I've owned my TM3, through all the sorts of firmware updates. Anybody notice that their TM3 stays awake for an unbelievably long time (8 hours after a very short drive yesterday) sometimes (and I've checked that all the doors, etc... are closed)??? I'm not blaming TeslaMate, it just allows me to easily see it happening instead of walking to the garage and hearing the car lightly humming.

upload_2020-5-1_14-44-45.png


Seems excessive, mine is online two hours after most drives then sleeps. Occasionally quicker but 8 hours never. I take it you are locking the car (or autolocking) and not using sentry mode?
 
View attachment 537709Seems excessive, mine is online two hours after most drives then sleeps. Occasionally quicker but 8 hours never. I take it you are locking the car (or autolocking) and not using sentry mode?

Typically mine will sleep after 20 minutes or so, but lately I've seen more of these very long times, taking from 4-8 hours to sleep. I just verified that all 4 doors (and trunks) are fully shut and locked. Sentry is automatically turned OFF at home, so I received no "HAL Warnings" when I tested the locked doors. It's annoying as I'm losing several miles here...
 
Last edited:
Hi all

I'm very interested in this topic.
I don't have my model 3 yet but this looks like something I really going to install once I have it. I do have a question though.
When you install TeslaMate on a Raspberry Pi with the easiest installation, I do understand that you only can access it via the home WiFi where the Raspberry Pi is connected to.
If I would like to connect it from everywhere, I see that you need 2 URL's. So I would need to buy myself a domain (and there I can make a subdomain to have the 2 URL's I suppose)
Now the question really is: Should I buy only the domain and link these to the IP address of the Pi, or is it possible to use a domain name I already have? This domain name is bought with webhosting included. So not only the domain name but also web hosting and things combined.

Is it possible to use the already owned domain name but both link to the Raspberry and the already existing webhost from the company I bought the domain name from. Or should I really buy a new domain name for the TeslaMate?

Thanks a lot for the help!
 
Hi all

I'm very interested in this topic.
I don't have my model 3 yet but this looks like something I really going to install once I have it. I do have a question though.
When you install TeslaMate on a Raspberry Pi with the easiest installation, I do understand that you only can access it via the home WiFi where the Raspberry Pi is connected to.
If I would like to connect it from everywhere, I see that you need 2 URL's. So I would need to buy myself a domain (and there I can make a subdomain to have the 2 URL's I suppose)
Now the question really is: Should I buy only the domain and link these to the IP address of the Pi, or is it possible to use a domain name I already have? This domain name is bought with webhosting included. So not only the domain name but also web hosting and things combined.

Is it possible to use the already owned domain name but both link to the Raspberry and the already existing webhost from the company I bought the domain name from. Or should I really buy a new domain name for the TeslaMate?

Thanks a lot for the help!
You don't need to buy a domain you need either a static IP of a Dynamic DNS supplier (I use Remote Access with Dynamic DNS - 100% DNS Uptime - No-IP)
I'd recommend set your Pi as a VPN server too (most ISP routers don't have a VPN) and you remote into Home from anywhere
 
I've not used Telamate, but suspect you are over complicating matters.

All a domain does it map to an IP address. I would imaging that it would be a major shortfall if you could not access it via IP address on its own. You would also need a static IP address if hosting on your home network if using a domain name, but if just referencing via IP, its not so important as you can just use the new IP address - its very possible that the IP addresses will not change so frequently for this to be a headache, but it would be if using domain name as DNS would take a significant amount of time to update.

An alternative is a service like dns2go, but I do not know if they exist anymore, but suspect alternatives will.

Of course, home hosting with external access would also need your router to be configured either for port forwarding, or to be put in a DMZ or setup a VPN.
 
Is it possible to use the already owned domain name but both link to the Raspberry and the already existing webhost from the company I bought the domain name from. Or should I really buy a new domain name for the TeslaMate?

Actually, you can get away with just one, and have grafana live under /grafana on your main teslamate domain.

The details are in this issue comment: [Safari BUG] Persistent refresh with latest Safari 13.1 due to Basic Auth · Issue #643 · adriankumpf/teslamate

You just alter the GF_SERVER_ROOT_URL env variable and add GF_SERVER_SERVE_FROM_SUB_PATH=true.

In fact that whole comment is gold - I've used it to switch to form auth (from basic auth), so that hopefully I'll be able to access teslamate from the in-car browser.
 
You only need to buy a domain name if you’re planning to access it over the internet, which I presume you aren’t with a Pi? At least not at the moment anyway.

If you do want to access it over the Internet you’ll need to open to access on your broadband router etc.

For what it’s worth if you already have a domain the Google Cloud Platform solution posted earlier works perfectly, and is free.

You basically just need to do this:
  1. How to set up a free micro VPS on Google Cloud Platform
    (make sure you choose the option to create the HTTP and HTTPS firewall rules when creating the VM, otherwise you’ll have to do it afterwards)
  2. https://docs.teslamate.org/docs/guides/traefik
  3. Edit your domain DNS to point teslamate.domain.com A record to your GCP VM external IP, and grafana.domain.com CNAME to the above subdomain. Really you can use whatever subdomains you want as long as the config file reflects it.
Its not totally straightforward, you do need to install Docker and Docker Compose on the fresh f1-micro VM, but it was smooth sailing for me after I’d created the three files in step 2 above.

Even though the “always free” VM has to be hosted in us1-Iowa, it’s still plenty fast enough to use here in the UK.
 
You only need to buy a domain name if you’re planning to access it over the internet

Really?
So, example 1. I have a static (public IP facing) at home eg 123.123.123.123 forward port 80 on the router to 80 on the Pi and you'll get whatever you are running on http port on the pi

http://123.123.123.123

example 2. dynamic IP (most domestic ISPs free) I register myrandomhomename.noip.com and set my router to push my public facing IP to NOIP.com, as per above forward 80 on router to 80 on pi only this time

http://myrandomhomename.noip.com

et voila I access my Pi's port 80.

The above is best, safest done over a VPN to the Pi
 
Sorry, yes, you’re correct in that you can use one of the many dynamic DNS services as well.

I’m not sure example 1 will work with the default config, since it expects you to set up two FQDN for teslamate and grafana.
 
Sorry, yes, you’re correct in that you can use one of the many dynamic DNS services as well.

I’m not sure example 1 will work with the default config, since it expects you to set up two FQDN for teslamate and grafana.

Personally Im going to be using a VPN (and prefer the look of TeslaLogger) and with a local DNS would access it my name with either 1. or 2.

Again personally I only have the time to look at this stuff when at home.

As a side note I wonder if static IPs will be the norm one day as I understand the ISP benefit is having a narrow pool of IPs in ye olde days when internet connected on demand. Wonder when my IP last changed?