denverquane / MMM-Teslamate

Magic Mirror Module for the Teslamate utility
MIT License
52 stars 14 forks source link

Not pulling data from MQTT #15

Closed SimonJHudson closed 3 years ago

SimonJHudson commented 3 years ago

Also a newbie - it's 35 years since I wrote any code (so delighted to have got this far). I have Teslamate running on the same RPi as MagicMirror. I can access Teslamate from the RPi IP address and port (192.168.1.95:4000) from both the RPi browser and other network connected PCs, likewise with the Grafana charts. The module loads fine into MagicMirror, but doesn't report any data.

Config includes:

mqttServer: { address: "192.168.1.95", // Server address or IP address of the MQTT broker port: '1883' // Port number if other than default (1883) //user: 'user', // Leave out for no user //password: 'password', // Leave out for no password },

I'm not aware that I set a user name or password for the MQTT. What am I missing?

SimonJHudson commented 3 years ago

I have identified the issue

the code example shows port: '1883'

It works if this is changed to port: 1883

olexs commented 3 years ago

Interesting finding. This might be due to the update to the MQTT dependency that I did a short while ago. In my config it still works with '1883' though... may also depend on Node version/environment somehow? Anyway, the sample config in README should be updated.

Zac-88 commented 3 years ago

I cant get data to come through to my MM, I have managed to install teslamate and can see the server running, and i can also open grafana... dont know if im missing the setup for mqtt server or how to conifigure that? is there more information somewhere? or a walkthrough?

OleTheill commented 3 years ago

Same problem as Zac-88

Probably because I'm a linux newbee.

[22.02.2021 10:40.15.703] [ERROR] WARNING! Could not load config file. Starting with default configuration. Error found: Error: Cannot find module 'mqtt' Require stack:

I have tried with and without ' around the port number.

olexs commented 3 years ago

@OleTheill you need to run "npm install" in the module folder, it's missing the mqtt dependency.

cd /home/pi/MagicMirror/modules/MMM-Teslamate
npm install
OleTheill commented 3 years ago

@OleTheill you need to run "npm install" in the module folder, it's missing the mqtt dependency.

cd /home/pi/MagicMirror/modules/MMM-Teslamate
npm install

YES! That solved everyting.

Thank you.