Giter VIP home page Giter VIP logo

Comments (9)

johnny2678 avatar johnny2678 commented on September 17, 2024

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.

fetzu avatar fetzu commented on September 17, 2024

Hey @johnny2678,

  1. 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.
  2. 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?

  1. 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:

  1. 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:

  1. 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.

johnny2678 avatar johnny2678 commented on September 17, 2024

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 !

looks like 74D
image

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:
image

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.

fetzu avatar fetzu commented on September 17, 2024

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.

fetzu avatar fetzu commented on September 17, 2024

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.

fetzu avatar fetzu commented on September 17, 2024

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.

peaster avatar peaster commented on September 17, 2024

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.

fetzu avatar fetzu commented on September 17, 2024

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.

johnny2678 avatar johnny2678 commented on September 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.