Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OK, I'm out of ideas. Any help would be amazing #38

Open
mdefrancesco opened this issue Dec 30, 2023 · 7 comments
Open

OK, I'm out of ideas. Any help would be amazing #38

mdefrancesco opened this issue Dec 30, 2023 · 7 comments

Comments

@mdefrancesco
Copy link

This has been baking my noodle for weeks. Being able to monitor the Tesla was a huge reason I started this project and it's literally the last module i need to get working correctly.

I'm using MMM-Teslamate on my MagicMirror and no matter what I try I cant connect to the Tesla data. I think my problem is the mosquitto as I'm guessing I didnt install correctly and not exactly sure how to.

Teslamate is properly installed on my Synology and I can access locally so see the little graphic at http://192.168.1.182:20002/ & the dashboards at http://192.168.1.182:20003. I have yet to get this working on the MM properly so I didnt realize that a Tesla update in mid-november stopped all data being captured. I had to go back to my original install notes and redeploy the stacks again which seemed to fix it

So now I have a working Teslamate that I can access through a web browser but I cant for the life of me connect it to the Mirror.

I'm looking for any help anyone can give. I'm not even sure where exactly to start. I think some help getting my mosquitto straightened out would be amazing. I suspect the issue is the MQTT broker.
so thanks in advance!

@denverquane
Copy link
Owner

Do you have the MQTT port exposed on your teslamate deployment?

There's a section in the docker-compose.yml of teslamate that looks like the following:

# ports:
    #   - 1883:1883

Those lines need to be uncommented before the MQTT broker can be accessed from services other than Teslamate itself (like this Magic Mirror module)

@mdefrancesco
Copy link
Author

so docker, portainer and teslamate are running on my synology NAS and MMM-Teslamate is running on my Ras Pi

Where exactly would i find that?

@mdefrancesco
Copy link
Author

mdefrancesco commented Dec 30, 2023

when i open portainer on my NAS and select Teslamate and look at the logs this is what I'm seeing. Not sure what it tells us. I changed out the private stuff for 11111111111

2023-12-30 00:07:37.089 [warning] MQTT publishing failed: :timeout
2023-12-30 00:07:37.090 [warning] MQTT publishing failed: :timeout
2023-12-30 00:07:37.090 [warning] MQTT publishing failed: :timeout
2023-12-30 00:08:07.959 [warning] MQTT publishing failed: :timeout
2023-12-30 00:08:07.960 [warning] MQTT publishing failed: :timeout
2023-12-30 00:08:07.960 [warning] MQTT publishing failed: :timeout
2023-12-30 00:08:38.527 [warning] MQTT publishing failed: :timeout
2023-12-30 00:08:38.527 [warning] MQTT publishing failed: :timeout
2023-12-30 00:08:38.527 [warning] MQTT publishing failed: :timeout
2023-12-30 00:08:48.892 [info] GET /geo-fences
2023-12-30 00:08:48.897 [info] Sent 200 in 5ms
2023-12-30 00:09:08.949 [warning] MQTT publishing failed: :timeout
2023-12-30 00:09:08.949 [warning] MQTT publishing failed: :timeout
2023-12-30 00:09:08.949 [warning] MQTT publishing failed: :timeout
2023-12-30 00:09:39.362 [warning] MQTT publishing failed: :timeout
2023-12-30 00:10:11.080 [warning] MQTT publishing failed: :timeout
2023-12-30 00:10:41.419 [warning] MQTT publishing failed: :timeout
2023-12-30 00:11:11.837 [warning] MQTT publishing failed: :timeout
2023-12-30 00:11:11.837 [warning] MQTT publishing failed: :timeout
2023-12-30 00:11:11.837 [warning] MQTT publishing failed: :timeout
2023-12-30 00:11:42.243 [warning] MQTT publishing failed: :timeout
2023-12-30 00:12:13.361 [warning] MQTT publishing failed: :timeout
2023-12-30 00:12:13.361 [warning] MQTT publishing failed: :timeout
2023-12-30 00:12:13.362 [warning] MQTT publishing failed: :timeout
2023-12-30 00:12:13.362 [warning] MQTT publishing failed: :timeout
2023-12-30 00:12:43.773 [warning] MQTT publishing failed: :timeout
2023-12-30 00:13:47.292 [warning] MQTT publishing failed: :timeout
2023-12-30 00:14:17.691 [warning] MQTT publishing failed: :timeout
2023-12-30 00:14:48.116 [warning] MQTT publishing failed: :timeout
2023-12-30 00:15:49.468 [warning] MQTT publishing failed: :timeout
2023-12-30 00:16:50.309 [warning] MQTT publishing failed: :timeout
2023-12-30 00:17:51.192 [warning] MQTT publishing failed: :timeout
2023-12-30 00:18:21.656 [warning] MQTT publishing failed: :timeout
2023-12-30 00:18:21.656 [warning] MQTT publishing failed: :timeout
2023-12-30 00:18:52.237 [warning] MQTT publishing failed: :timeout
2023-12-30 00:19:22.760 [warning] MQTT publishing failed: :timeout
2023-12-30 00:19:53.176 [warning] MQTT publishing failed: :timeout
2023-12-30 00:20:54.981 [warning] MQTT publishing failed: :timeout
2023-12-30 00:21:55.936 [warning] MQTT publishing failed: :timeout
2023-12-30 00:23:27.510 [warning] MQTT publishing failed: :timeout
2023-12-30 00:24:28.855 [warning] MQTT publishing failed: :timeout
2023-12-30 00:26:00.162 [warning] MQTT publishing failed: :timeout
2023-12-30 00:28:02.476 [warning] MQTT publishing failed: :timeout
2023-12-30 00:29:34.578 [warning] MQTT publishing failed: :timeout
2023-12-30 00:30:08.702 [info] GET https://owner-api.teslamotors.com/api/1/vehicles/111111111111111111/vehicle_data -> 408 (9123.164 ms)
2023-12-30 00:30:08.702 [warning] TeslaApi.Error / %{"error" => "{"error": "timeout"}", "error_description" => "", "response" => nil}
2023-12-30 00:30:08.702 car_id=1 [error] Error / :unknown
2023-12-30 00:31:41.583 [warning] MQTT publishing failed: :timeout
2023-12-30 00:33:17.254 [info] GET /
2023-12-30 00:33:17.258 [info] Sent 200 in 3ms
2023-12-30 00:33:48.011 [warning] MQTT publishing failed: :timeout
2023-12-30 00:34:22.140 [info] GET https://owner-api.teslamotors.com/api/1/vehicles/111111111111111/vehicle_data -> 408 (9129.058 ms)
2023-12-30 00:34:22.140 [warning] TeslaApi.Error / %{"error" => "{"error": "timeout"}", "error_description" => "", "response" => nil}
2023-12-30 00:34:22.140 car_id=1 [error] Error / :unknown
2023-12-30 00:35:49.378 [warning] MQTT publishing failed: :timeout
2023-12-30 00:38:22.880 [warning] MQTT publishing failed: :timeout
2023-12-30 00:41:27.374 [warning] MQTT publishing failed: :timeout
2023-12-30 00:44:31.281 [warning] MQTT publishing failed: :timeout
2023-12-30 00:46:35.571 [warning] MQTT publishing failed: :timeout
2023-12-30 00:46:35.572 [warning] MQTT publishing failed: :timeout
2023-12-30 00:46:35.572 [warning] MQTT publishing failed: :timeout
2023-12-30 00:47:38.992 [warning] MQTT publishing failed: :timeout
2023-12-30 00:51:17.047 [warning] MQTT publishing failed: :timeout
2023-12-30 00:52:54.428 [info] GET https://owner-api.teslamotors.com/api/1/vehicles/11111111111111/vehicle_data -> 408 (9122.660 ms)
2023-12-30 00:52:54.428 [warning] TeslaApi.Error / %{"error" => "{"error": "timeout"}", "error_description" => "", "response" => nil}
2023-12-30 00:52:54.428 car_id=1 [error] Error / :unknown
2023-12-30 00:55:23.930 [warning] MQTT publishing failed: :timeout
2023-12-30 00:59:07.977 [info] GET /
2023-12-30 00:59:07.980 [info] Sent 200 in 3ms
2023-12-30 00:59:10.853 [info] GET /settings
2023-12-30 00:59:10.861 [info] Sent 200 in 7ms
2023-12-30 01:00:05.702 [warning] MQTT publishing failed: :timeout
2023-12-30 01:04:41.534 [warning] MQTT publishing failed: :timeout
2023-12-30 01:05:38.552 [info] MQTT connection has been established
2023-12-30 01:05:38.561 [error] GenStateMachine {Tortoise.Registry, {Tortoise.Connection.Inflight, "TESLAMATE_1111111111111"}} terminating
** (exit) {:protocol_violation, :unknown_identifier}
(stdlib 5.1.1) gen_statem.erl:1506: :gen_statem.loop_state_callback_result/11
(stdlib 5.1.1) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
2023-12-30 01:06:21.464 [info] GET /
2023-12-30 01:06:21.468 [info] Sent 200 in 3ms
2023-12-30 01:06:35.597 [info] GET /settings
2023-12-30 01:06:35.602 [info] Sent 200 in 5ms
2023-12-30 01:06:43.554 [warning] MQTT Client has been terminated with reason: {:function_clause, [{TeslaMate.Mqtt.Handler, :connection, [:terminated, []], [file: ~c"lib/teslamate/mqtt/handler.ex", line: 7]}, {Tortoise.Handler, :execute, 2, [file: ~c"lib/tortoise/handler.ex", line: 340]}, {Tortoise.Connection.Controller, :handle_info, 2, [file: ~c"lib/tortoise/connection/controller.ex", line: 215]}, {:gen_server, :try_handle_info, 3, [file: ~c"gen_server.erl", line: 1077]}, {:gen_server, :handle_msg, 6, [file: ~c"gen_server.erl", line: 1165]}, {:proc_lib, :init_p_do_apply, 3, [file: ~c"proc_lib.erl", line: 241]}]}
2023-12-30 01:06:43.555 [error] GenServer {Tortoise.Registry, {Tortoise.Connection, "TESLAMATE_11111111111111111"}} terminating
** (stop) :ping_timeout
Last message: :ping
2023-12-30 01:06:43.555 [error] GenServer {Tortoise.Registry, {Tortoise.Connection.Supervisor, "TESLAMATE_1111111111"}} terminating
** (stop) :ping_timeout
Last message: {:EXIT, #PID<0.2579.0>, :ping_timeout}
2023-12-30 01:06:43.557 [info] MQTT connection has been established
2023-12-30 01:11:52.383 [info] GET /
2023-12-30 01:14:28.054 [info] GET https://owner-api.teslamotors.com/api/1/vehicles/11111111111111111/vehicle_data -> 408 (9203.145 ms)
2023-12-30 01:14:28.054 [warning] TeslaApi.Error / %{"error" => "{"error": "timeout"}", "error_description" => "", "response" => nil}
2023-12-30 01:14:28.054 car_id=1 [error] Error / :unknown
2023-12-30 04:27:24.686 [info] Refreshing access token ...
2023-12-30 04:27:24.951 [info] POST https://auth.tesla.com/oauth2/v3/token -> 200 (264.641 ms)
2023-12-30 04:27:25.032 [info] Scheduling token refresh in 6 h
2023-12-30 05:54:32.186 [info] GET https://owner-api.teslamotors.com/api/1/vehicles/111111111111111111/vehicle_data -> 408 (9115.189 ms)
2023-12-30 05:54:32.186 [warning] TeslaApi.Error / %{"error" => "{"error": "timeout"}", "error_description" => "", "response" => nil}
2023-12-30 05:54:32.186 car_id=1 [error] Error / :unknown

@denverquane
Copy link
Owner

I don't have any portainer experience really, but typically you'd need to expose the port that a service runs on before it can be accessed by other machines/services outside of that deployment. It looks like you might be having general problems with your MQTT broker service, but those might be old logs, or just unrelated.

@mdefrancesco
Copy link
Author

So is this module working for you? How do you have it set up?
Ive been self teaching how to make the custom.css and config.js work for me in tweaking other modules but this dealing with portainer and docker and this whole side of things is quite the struggle.

i can see everything when i use a windows browser and there is a ton of valuable data to access but the MQTT broker service baffles me and I'm not sure where to even start to look or who to ask

@denverquane
Copy link
Owner

Unfortunately I haven't had a functional MagicMirror in a few months. I still run Teslamate in the same fashion, though, which is using docker-compose as the recommended deployment method in their wiki, and the MQTT port exposed.

Do you have experience in Portainer? I would assume there's some way to expose a service's ports so that it can be accessed from other machines/services, and you haven't indicated if you've done that. It wouldn't be related to whether or not the Teslamate App is viewable from your browser; here we're talking about viewing that MQTT data from other applications besides Teslamate, which is an additional step outside of a normal Teslamate installation.

It would also probably be a good idea to run MagicMirror in debug mode to help diagnose if there's a connectivity problem or the like. It's been a while since I've done this, but I think it's something like the steps detailed here on MagicMirror's installation/usage docs page

@mdefrancesco
Copy link
Author

thanks, i'll definitely try that.

while the mirror is running i keep getting this in the terminal. Honestly I cant seem to find a straight answer anywhere on the internet about what my Mosquitto host server IP should be. It's currently on my Synology which is 192.168.1.182 but clearly thats not working

Now i'm just trying to throw stuff at the wall to see what works. I need a translator for this stuff, but even with the frustation i do enjoy the process ;-)

Not sure if this screenshot gives any more info...
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants