Chibald / maestrogateway

Manage MCZ pellet stoves that are equipped with Maestro technology
GNU General Public License v3.0
38 stars 13 forks source link

installation bugs #12

Closed deSteini closed 3 years ago

deSteini commented 3 years ago

Hi @Chibald, during installtion I encountered some small bugs. I wanted to directly create a PR, but hadn't right to do so. So here the things I found:

Add copy of the "config.py" file to the "install" and "update_daemon" file: add "cp config.py /opt/maestro " to line 19 of "install" and "update_daemon" file.

Change the "maestro.service" file to use python3 instead of python2. After the installing process the script had an error, that the "enum" module could not be found. After googling I found that in python 2 this had to be installed additionally whereas in python3 its included in the std lib. After I changed the "maestro.service" to use python3 instead of the default python2, it worked.

change in maestro.service: old: ExecStart=/usr/bin/python '/opt/maestro/maestro.py' new: ExecStart=/usr/bin/python3 '/opt/maestro/maestro.py'

Hope that helps others =)

knielen commented 3 years ago

Thanks a lot! Did the trick for me.

Schmide-github commented 3 years ago

Hi,

after install and start service, the following error comes.

System: Ubuntu 20.04.1 LTS \n \l

Installation des dépendances Requirement already satisfied: paho-mqtt in /usr/local/lib/python3.8/dist-packages (1.5.1) Requirement already satisfied: websocket-client in /usr/local/lib/python3.8/dist-packages (0.57.0) Requirement already satisfied: six in /usr/lib/python3/dist-packages (from websocket-client) (1.14.0) Copie des fichiers necessaires Starting Maestro Daemon Connection in progress to the MQTT broker (IP:192.168.180.3 PORT:1883) MQTT: Subscribed to topic "SUBmcz" Websocket: Establishing connection to server (IP:192.168.120.1 PORT:81) Websocket: Connected MQTT: Connected to broker. 0 MQTT: Message recieved: 34,1 Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner self.run() File "/usr/lib/python3.8/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.8/dist-packages/paho/mqtt/client.py", line 3452, in _thread_main self.loop_forever(retry_first_connection=True) File "/usr/local/lib/python3.8/dist-packages/paho/mqtt/client.py", line 1779, in loop_forever rc = self.loop(timeout, max_packets) File "/usr/local/lib/python3.8/dist-packages/paho/mqtt/client.py", line 1181, in loop rc = self.loop_read(max_packets) File "/usr/local/lib/python3.8/dist-packages/paho/mqtt/client.py", line 1572, in loop_read rc = self._packet_read() File "/usr/local/lib/python3.8/dist-packages/paho/mqtt/client.py", line 2310, in _packet_read rc = self._packet_handle() File "/usr/local/lib/python3.8/dist-packages/paho/mqtt/client.py", line 2936, in _packet_handle return self._handle_publish() File "/usr/local/lib/python3.8/dist-packages/paho/mqtt/client.py", line 3216, in _handle_publish self._handle_on_message(message) File "/usr/local/lib/python3.8/dist-packages/paho/mqtt/client.py", line 3444, in _handle_on_message self.on_message(self, self._userdata, message) File "/opt/maestro/maestro.py", line 81, in on_message_mqtt res = json.loads(str(message.payload.decode())) File "/usr/lib/python3.8/json/init.py", line 357, in loads return _default_decoder.decode(s) File "/usr/lib/python3.8/json/decoder.py", line 340, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 1 column 3 (char 2)

Websocket: Send C|RecuperoInfo MQTT: publish to Topic "PUBmcz", Message : {"Stove_State": 15, "Fan_State": 6, "DuctedFan1": 3.0, "DuctedFan2": 3.0, "Fume_Temperature": 59, "Ambient_Temperature": 19.0, "Puffer_Temperature": 127.5, "Boiler_Temperature": 0.0, "NTC3_Temperature": 127.5, "Candle_Condition": 0, "ACTIVE_Set": 220, "RP

no mqtt messages.

what can i do? Thanks

Chibald commented 3 years ago

during installtion I encountered some small bugs. I wanted to directly create a PR, but hadn't right to do so.

Thanks. I think if you want to contribute / make a PR you should fork my code and then make a PR from your fork to my code.

Chibald commented 3 years ago

Your're sending this:

MQTT: Message recieved: 34,1

probably to power on the stove(?). My script uses Json objects, so for power on iit should be:

{ "Command": "Power", "Value": 1} and off again { "Command": "Power", "Value": 0}

Schmide-github commented 3 years ago

the problem was the mqtt server, i reinstalled it. Now it works Thanks.