Seite 3 von 4

Re: Open Source Silence Server Project! :)

Verfasst: Do 30. Mai 2024, 22:49
von Gerold
I have found the reason for the misbehavior of the parser. I have changed the protocol-mask of the $PROT command to a higher value in order to receive more data from the module to my private Astra Opengts server. When changing back the protocol-mask to his original value ( 55968794727) the parser works fine.

Code: Alles auswählen

2024-05-30 14:10:29,420 - [MQTTService] - DEBUG - Publishing on topic [mySilence/35xxxx/status/status] value: 2.0
2024-05-30 14:10:29,420 - [MQTTService] - DEBUG - Publishing on topic [mySilence/35xxxx/status/movementAlarm] value: 0
2024-05-30 14:10:29,420 - [MQTTService] - DEBUG - Publishing on topic [mySilence/35xxxx/status/batteryIn] value: 1
2024-05-30 14:10:29,420 - [MQTTService] - DEBUG - Publishing on topic [mySilence/35xxxx/status/astraBatterySOC] value: 90.0

Re: Open Source Silence Server Project! :)

Verfasst: Fr 31. Mai 2024, 14:55
von lorenzo.deluca
Gerold hat geschrieben:
Do 30. Mai 2024, 22:49
I have found the reason for the misbehavior of the parser. I have changed the protocol-mask of the $PROT command to a higher value in order to receive more data from the module to my private Astra Opengts server. When changing back the protocol-mask to his original value ( 55968794727) the parser works fine.

Code: Alles auswählen

2024-05-30 14:10:29,420 - [MQTTService] - DEBUG - Publishing on topic [mySilence/35xxxx/status/status] value: 2.0
2024-05-30 14:10:29,420 - [MQTTService] - DEBUG - Publishing on topic [mySilence/35xxxx/status/movementAlarm] value: 0
2024-05-30 14:10:29,420 - [MQTTService] - DEBUG - Publishing on topic [mySilence/35xxxx/status/batteryIn] value: 1
2024-05-30 14:10:29,420 - [MQTTService] - DEBUG - Publishing on topic [mySilence/35xxxx/status/astraBatterySOC] value: 90.0
Ok, perfect!
Yes, the messages from module to server are in binary format and it's quite "tricky" to decode this.
If you want you can improve the project and add more decoding for other informations.
What extra information were you able to get with this protocol?

Re: Open Source Silence Server Project! :)

Verfasst: Fr 31. Mai 2024, 15:24
von Pfriemler
The known protocol modules refer to the usual $PROT mask. If detailed information to the other protocol modules are secret, at least an information on how many bytes they use would enable the parser to skip them.

Re: Open Source Silence Server Project! :)

Verfasst: Fr 14. Jun 2024, 00:45
von SpeedCore
I moved from script-based to docker today but I keep getting an error with the mqtt service:

Code: Alles auswählen

2024-06-13 22:41:14,868 - [silence-server] - INFO - Starting Silence Server
2024-06-13 22:41:14,868 - [SilenceServerService] - INFO - Starting SilenceServerService
2024-06-13 22:41:14,869 - [SilenceServerService] - INFO - Starting DBService
2024-06-13 22:41:14,869 - [DBService] - DEBUG - DBService init
2024-06-13 22:41:14,869 - [DBService] - INFO - DBService Start
2024-06-13 22:41:14,869 - [DBService] - DEBUG - Subscribing to socket
2024-06-13 22:41:14,870 - [CommandService] - DEBUG - CommandService init
2024-06-13 22:41:14,870 - [CommandService] - DEBUG - Subscribing to command_received
2024-06-13 22:41:14,871 - [CommandService] - INFO - CommandService Started
2024-06-13 22:41:14,871 - [silence-server] - INFO - Starting MQTT
2024-06-13 22:41:14,871 - [MQTTService] - DEBUG - MQTT Service initialized
2024-06-13 22:41:14,871 - [MQTTService] - INFO - Start MQTT Service
2024-06-13 22:41:14,871 - [SilenceServerService] - INFO - socket created on port 31337
2024-06-13 22:41:14,871 - [SilenceServerService] - INFO - waiting for clients
2024-06-13 22:41:14,873 - [MQTTService] - ERROR - Exception in MQTTService start
Traceback (most recent call last):
  File "/app/services/MQTTService.py", line 58, in start
    self.client.connect(self.broker, self.port, 60)
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 914, in connect
    return self.reconnect()
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1044, in reconnect
    sock = self._create_socket_connection()
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3685, in _create_socket_connection
    return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source)
  File "/usr/local/lib/python3.9/socket.py", line 844, in create_connection
    raise err
  File "/usr/local/lib/python3.9/socket.py", line 832, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
Python version: 3.9.19
Silence-Server version: 2024.5.21
Silence-Server - Main Start
Silence-Server Main
Configuration loaded: {...}
Silence-Server - Exception in main, restart...
Exception in MQTTService start

Re: Open Source Silence Server Project! :)

Verfasst: Mo 17. Jun 2024, 15:22
von lorenzo.deluca
SpeedCore hat geschrieben:
Fr 14. Jun 2024, 00:45
I moved from script-based to docker today but I keep getting an error with the mqtt service:

Code: Alles auswählen

2024-06-13 22:41:14,868 - [silence-server] - INFO - Starting Silence Server
2024-06-13 22:41:14,868 - [SilenceServerService] - INFO - Starting SilenceServerService
2024-06-13 22:41:14,869 - [SilenceServerService] - INFO - Starting DBService
2024-06-13 22:41:14,869 - [DBService] - DEBUG - DBService init
2024-06-13 22:41:14,869 - [DBService] - INFO - DBService Start
2024-06-13 22:41:14,869 - [DBService] - DEBUG - Subscribing to socket
2024-06-13 22:41:14,870 - [CommandService] - DEBUG - CommandService init
2024-06-13 22:41:14,870 - [CommandService] - DEBUG - Subscribing to command_received
2024-06-13 22:41:14,871 - [CommandService] - INFO - CommandService Started
2024-06-13 22:41:14,871 - [silence-server] - INFO - Starting MQTT
2024-06-13 22:41:14,871 - [MQTTService] - DEBUG - MQTT Service initialized
2024-06-13 22:41:14,871 - [MQTTService] - INFO - Start MQTT Service
2024-06-13 22:41:14,871 - [SilenceServerService] - INFO - socket created on port 31337
2024-06-13 22:41:14,871 - [SilenceServerService] - INFO - waiting for clients
2024-06-13 22:41:14,873 - [MQTTService] - ERROR - Exception in MQTTService start
Traceback (most recent call last):
  File "/app/services/MQTTService.py", line 58, in start
    self.client.connect(self.broker, self.port, 60)
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 914, in connect
    return self.reconnect()
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1044, in reconnect
    sock = self._create_socket_connection()
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3685, in _create_socket_connection
    return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source)
  File "/usr/local/lib/python3.9/socket.py", line 844, in create_connection
    raise err
  File "/usr/local/lib/python3.9/socket.py", line 832, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
Python version: 3.9.19
Silence-Server version: 2024.5.21
Silence-Server - Main Start
Silence-Server Main
Configuration loaded: {...}
Silence-Server - Exception in main, restart...
Exception in MQTTService start
Mmmmh, which MQTT broker IP Address have you set?
Of course if you're on Docker you cannot put 127.0.0.1 but you've have put MQTT server address (192.168.xxx.xxx) right?

Re: Open Source Silence Server Project! :)

Verfasst: Mo 17. Jun 2024, 18:56
von SpeedCore
Thanks for the hint - still had "localhost" in my config from pre-docker times :)
Changed that to the host ip address for the docker0 interface and it works:

Code: Alles auswählen

2024-06-17 16:54:30,990 - [MQTTService] - INFO - Connected to broker with result code 0
2024-06-17 16:54:30,990 - [MQTTService] - DEBUG - MQTT Sub to home/silence-server/8608730xxxxxxxx/command/+

Re: Open Source Silence Server Project! :)

Verfasst: Mo 17. Jun 2024, 19:21
von SpeedCore
Is anyone working on a web frontend with the features the Silence App had like "my trips" and some buttons for opening seat etc?

Re: Open Source Silence Server Project! :)

Verfasst: Mo 17. Jun 2024, 22:47
von lorenzo.deluca
SpeedCore hat geschrieben:
Mo 17. Jun 2024, 19:21
Is anyone working on a web frontend with the features the Silence App had like "my trips" and some buttons for opening seat etc?
I use Home Assistant for status/commands and Traccar for gps tracking 😉

Re: Open Source Silence Server Project! :)

Verfasst: Mi 26. Jun 2024, 11:25
von SpeedCore
I just noticed that there's a protocol x parser by astra telematics available at npmjs: https://www.npmjs.com/package/astra-protocol-x-parser
Maybe this comes in handy when it comes to handling protocol x messages from the scooter.

Re: Open Source Silence Server Project! :)

Verfasst: Mi 26. Jun 2024, 20:39
von Gerold
Further information about the astra protocol x can be found here: https://github.com/traccar/traccar/issues/5342