Comments (9)
Did some more troubleshooting this AM. Tried just running an MQTT server in the same docker-compose as the ABRP container and the rest of the Teslamate stack. This time it looks like ABRP container connects to MQTT (result code 0
), but still no car updates.
In both cases, (local MQTT / remote MQTT ), the logging in the beginning of the python output show that no variables are being passed to python (e.g. CAR_NUMBER: None
) and that MQTT authentication (-a
) is False
?
{'--model': None,
'-a': False,
'-h': False,
'-l': False,
'-p': False,
'CAR_NUMBER': None,
'MQTT_PASSWORD': None,
'MQTT_SERVER': None,
'MQTT_USERNAME': None,
'USER_TOKEN': None}
3long_awd19
Connected with result code 0
2022-04-06 12:28:06: Car is (unknown state), not sending any update to ABRP.
2022-04-06 12:28:07: Car is (unknown state), not sending any update to ABRP.
2022-04-06 12:28:08: Car is (unknown state), not sending any update to ABRP.
2022-04-06 12:28:09: Car is (unknown state), not sending any update to ABRP.
2022-04-06 12:28:10: Car is (unknown state), not sending any update to ABRP.
2022-04-06 12:28:11: Car is (unknown state), not sending any update to ABRP.
tried with or without specifying the model (m3 LR AWD 2018 w/ 19inch wheels). When I don't specify the model, it doesn't look like the car is detected:
TeslaMate_ABRP | Car model automatically determined as:
Not sure if any of this helps. Will keep troubleshooting.
from teslamate-abrp.
Hey @johnny2678,
- First thing I would check, if you haven't done so yet, is that TeslaMate is indeed publishing the data to the MQTT server. Preferably, do this from the same machine you are trying to run teslamate-abrp from. MQTT Explorer is a great cross-platform tool for that. This will confirm that TeslaMate data is indeed being published to the MQTT server and that the machine running teslamate-abrp indeed has access to that data.
- I can't see anything wrong in your config right now.
In both cases, (local MQTT / remote MQTT ), the logging in the beginning of the python output show that no variables are being passed to python (e.g. CAR_NUMBER: None) and that MQTT authentication (-a) is False?
- That's normal: this debug output is only for the variables passed through the CLI. If you are using ENV vars (which is the case with docker-compose), they will not be displayed here. What you could do is add a "print(interesing var)" before line 70. You can actually see that your car model var is being passed correctly since "3long_awd19" is being printed (from line 69), which is actually a line that shouldn't be here in the first place ;).
tried with or without specifying the model (m3 LR AWD 2018 w/ 19inch wheels). When I don't specify the model, it doesn't look like the car is detected:
- Your car is a "special config" for which I have no reference (hence the script being unable to set it automatically). Could you provide me with the "trim_badging" being published to ABRP? I'd gladly add it to the list of automatically detected cars !
took a stab at just running in python, but getting an error there too. Would prefer docker so only including this in case (again) I misconfigured something obvious:
- That shouldn't happen. I'll take a look at this later to see if I can reproduce.
Anyhow, let's make sure everything is working properly with MQTT (with point 1.) and work out from there.
from teslamate-abrp.
4. Could you provide me with the "trim_badging" being published to ABRP? I'd gladly add it to the list of automatically detected cars !
I was able to get MQTT/ABRP containers to work when running as part of the same local docker-compose stack - I forgot to update the main TESLAMATE MQTT settings and it was configured to send data to my external MQTT server while the ABRP container was trying to read from the local one... silly mistake on my part.
2022-04-08 11:19:36: Car is asleep, updating every 30s.
TeslaMate_ABRP | Data object sent: {'utc': 1649416776, 'soc': '90', 'power': 0, 'speed': 0, etc........
Still getting an Connected with result code 5
when trying with my external MQTT server. Confirmed that the TESLAMATE container is sending car data to the external MQTT server with MQTT explorer successfully:
added my teslamate section of the docker-compose if it helps. Teslamate is able to connect and send MQTT data, but for some reason ABRP container can't read them with the same settings
services:
teslamate:
image: teslamate/teslamate:latest
restart: always
environment:
- ENCRYPTION_KEY=abc123
- DATABASE_USER=teslamate
- DATABASE_PASS=teslamate
- DATABASE_NAME=teslamate
- DATABASE_HOST=database
- MQTT_HOST=192.168.1.20
- MQTT_USERNAME=bob
- MQTT_PASSWORD=bobspassword
# - MQTT_HOST=mosquitto
ports:
- 4000:4000
volumes:
- ./import:/opt/app/import
cap_drop:
- all
ABRP:
container_name: TeslaMate_ABRP
image: fetzu/teslamate-abrp:latest
restart: always
environment:
- MQTT_SERVER=192.168.1.20
# - MQTT_SERVER=mosquitto
- MQTT_USERNAME=bob
- MQTT_PASSWORD=bobspassword
- USER_TOKEN=xyz987
- CAR_NUMBER=1
# - CAR_MODEL=3long_awd19 #NOTE: This is optional, see below
volumes:
teslamate-db:
teslamate-grafana-data:
mosquitto-conf:
mosquitto-data:
Anyways - thanks for looking at this. At least I have it working when running MQTT locally. Let me know if I can provide any more troubleshooting.
from teslamate-abrp.
Thanks for providing the info regarding the trim. In this case (when everything works) your car should actually be detected as 3long_awd if no model is provided (which is only half-correct in this case). Unfortunately, since I am missing all the possible reported trim/wheels combination, I am unable to fully implement this. You are better off setting the model car through the env variables.
Connected with code 5 means connection refused. Looking at the code, I see where the error is: I fudged up and the logic for an authenticated connection with env vars is just plain wrong. I will fix this ASAP and report back here, so you can re-pull the image and try it again. Sorry about that !
from teslamate-abrp.
I just implemented a fix, but I have no way to easily test it out (don't forget to re-pull the latest image). I'll re-open the issue and let you test it out and tell me it worked !
from teslamate-abrp.
Nope. It's a big mess. I'm reverting my changes and will have to take a better look at it another time. Sorry.
from teslamate-abrp.
Also interested in a fix here. Busy in the next few days, but might take a crack at resolving this in some spare time as I have some experience with the paho-mqtt library
from teslamate-abrp.
Should be OK now (hopefully 😅). Let me know if it is working on your end and close as needed.
I might get around to implement a better error handling at some point.
from teslamate-abrp.
Should be OK now
looks good! thanks for looking at this. will close and reopen if i have any issues. Cheers!
from teslamate-abrp.
Related Issues (20)
- Car is in unknown state HOT 4
- Better handling of MQTT connection response codes
- Improve findCarModel() HOT 2
- Name does not resolve HOT 1
- docker-compose setup: needs privileged mode on raspberry pi HOT 2
- Losing connection + issue in error handling HOT 1
- Connection refused for MQTT HOT 6
- ERROR: No such service: -d HOT 1
- Not sending updates to ABRP HOT 12
- How to check if this actually works? HOT 2
- Suggestion to change the initial temperature of the vehicle HOT 2
- ABRP API status - Not authorized HOT 4
- Car is (unknown state), not sending any update to ABRP. HOT 1
- ERROR: no matching manifest for unknown in the manifest list entries HOT 6
- ABRP API issue? HOT 5
- SoC 0%
- SoC is at 0% in ABRP HOT 3
- API Timeouts stop data being uploaded to ABRP HOT 1
- SoC not the usable SoC is sent to the Iternio API HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from teslamate-abrp.