lorenzo-deluca / silence-private-server

Self-Hosted solution for Silence and Seat scooter’s Astra GPS module, ensuring data privacy and independence from the manufacturer.
https://buymeacoffee.com/lorenzodeluca
GNU Affero General Public License v3.0
21 stars 2 forks source link

RS232 to USB #4

Closed sugar012 closed 3 months ago

sugar012 commented 3 months ago

Ho to all. Is this 232 to ttl suitable for the job ? Of course connected via USB

Screenshot_2024-07-23-22-18-36-431_com amazon mShop android shopping-edit

noiwid commented 3 months ago

hello, on my side I've used this combinaison of items: 61w8V5GeCwL __AC_SX300_SY300_QL70_ML2_ téléchargement (1) téléchargement

sugar012 commented 3 months ago

hello, on my side I've used this combinaison of items: 61w8V5GeCwL _AC_SX300_SY300_QL70_ML2 téléchargement (1) téléchargement

Ok, i got the same usb-rs232 cable as you. it's the first time i work with terminal so i'm a little lost here. Is this correct? image image image

lorenzo-deluca commented 3 months ago

Hello, check the GND connection to serial port.. have you already try to reverse TX and RX pins?

Let me know ;)

sugar012 commented 3 months ago

Hello, check the GND connection to serial port.. have you already try to reverse TX and RX pins?

Let me know ;)

by swapping i got this. Also settings are 8,1, none and none image

lorenzo-deluca commented 3 months ago

It seems bad serial pin connection.. double check GND and try to revert TX and RX.

sugar012 commented 3 months ago

It seems bad serial pin connection.. double check GND and try to revert TX and RX.

What should the output be like? do you have telegram? Sono italiano cmq

sugar012 commented 3 months ago

It seems bad serial pin connection.. double check GND and try to revert TX and RX.

i swapped GND and TX .. sorry. but it wont connect to the server. port should be open

image

sugar012 commented 3 months ago

i had to tick this box image

sugar012 commented 3 months ago

Hello Lorenzo. I'm maybe at 90%. i can run che python scrypt only without the logger and sql database. i guess that cell voltages nee the db to be showed up in HA?

alpine-docker:~/silence-private-server# python silence-server.py 
Python version: 3.12.3
Silence-Server version: 2024.5.21
Silence-Server - Main Start
Silence-Server Main
Configuration loaded: {'IMEI': 'zzz', 'TCPServer': {'serverPORT': 38955, 'bridgeMode': True, 'silenceHOST': 'api.connectivity.silence.eco', 'silencePORT': 38955, 'SaveToDB': True, 'keepAliveInterval': 15, 'BMScellVoltage_pooling_interval': 600}, 'Logging': {'LogToFile': False, 'LogLevel': 50}, 'MQTT': {'Enabled': True, 'MQTTbroker': '192.168.2.30', 'MQTTport': 1883, 'MQTTuser': 'mqtt', 'MQTTpass': 'AGw&!e*CF7DJ9u', 'TopicPrefix': 'home/silence-server'}}
2024-07-27 15:46:42,625 - [silence-server] - DEBUG - Logged configured
2024-07-27 15:46:42,626 - [silence-server] - INFO - Starting Silence Server
2024-07-27 15:46:42,626 - [SilenceServerService] - INFO - Starting SilenceServerService
2024-07-27 15:46:42,626 - [SilenceServerService] - INFO - Starting DBService
2024-07-27 15:46:42,626 - [DBService] - DEBUG - DBService init
2024-07-27 15:46:42,626 - [DBService] - INFO - DBService Start
2024-07-27 15:46:42,626 - [DBService] - ERROR - Exception in MQTTService start
Traceback (most recent call last):
  File "/root/silence-private-server/services/DBService.py", line 21, in start
    self.DBcon = sqlite3.connect('logs/silenceLOG.db', check_same_thread=False)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sqlite3.OperationalError: unable to open database file
Silence-Server - Exception in main, restart...
'DBService' object has no attribute 'DBcon'

and with the logger active:

alpine-docker:~/silence-private-server# python silence-server.py 
Python version: 3.12.3
Silence-Server version: 2024.5.21
Silence-Server - Main Start
Silence-Server Main
Configuration loaded: {'IMEI': 'zzz', 'TCPServer': {'serverPORT': 38955, 'bridgeMode': True, 'silenceHOST': 'api.connectivity.silence.eco', 'silencePORT': 38955, 'SaveToDB': False, 'keepAliveInterval': 15, 'BMScellVoltage_pooling_interval': 600}, 'Logging': {'LogToFile': True, 'LogLevel': 50}, 'MQTT': {'Enabled': True, 'MQTTbroker': '192.168.2.30', 'MQTTport': 1883, 'MQTTuser': 'mqtt', 'MQTTpass': 'AGw&!e*CF7DJ9u', 'TopicPrefix': 'home/silence-server'}}
Silence-Server - Exception in main, restart...
[Errno 2] No such file or directory: '/root/silence-private-server/logs/silence-server.log'
alpine-docker:~/silence-private-server# 
lorenzo-deluca commented 3 months ago

sorry, my fault in the default configuration.json, put

"LogToFile": false

sugar012 commented 3 months ago

Ok, and what about the database? the cell voltage seems to be not working also?

2024-07-27 16:09:03,096 - [MQTTService] - DEBUG - Publishing scooter status: {'status': {'value': 0.0, 'MQTT_topic': 'status'}, 'movementAlarm': {'value': 0, 'MQTT_topic': 'movementAlarm'}, 'batteryIn': {'value': 1, 'MQTT_topic': 'batteryIn'}, 'astraBatterySOC': {'value': 98.0, 'MQTT_topic': 'astraBatterySOC'}, 'latitude': {'value': xxx, 'MQTT_topic': 'latitude'}, 'longitude': {'value': xxx, 'MQTT_topic': 'longitude'}, 'batterySOC': {'value': 99.0, 'MQTT_topic': 'SOCbatteria'}, 'batteryTempMax': {'value': 32.0, 'MQTT_topic': 'BatteryTempMax'}, 'batteryTempMin': {'value': 31.0, 'MQTT_topic': 'BatteryTempMin'}, 'batteryVoltage': {'value': 57.6, 'MQTT_topic': 'VOLTbatteria'}, 'batteryCurrent': {'value': 0.0, 'MQTT_topic': 'batteryCurrent'}, 'motorTemp': {'value': 'None', 'MQTT_topic': 'motorTemp'}, 'inverterTemp': {'value': 'None', 'MQTT_topic': 'inverterTemp'}, 'speed': {'value': 'None', 'MQTT_topic': 'speed'}, 'range': {'value': 102.0, 'MQTT_topic': 'range'}, 'chargedEnergy': {'value': 327.1, 'MQTT_topic': 'chargedEnergy'}, 'RegeneratedEnergy': {'value': 24.128611111111113, 'MQTT_topic': 'RegeneratedEnergy'}, 'DischargedEnergy': {'value': 317.15527777777777, 'MQTT_topic': 'DischargedEnergy'}, 'ambientTemp': {'value': 'None', 'MQTT_topic': 'ambientTemp'}, 'odo': {'value': 4469.0, 'MQTT_topic': 'odo'}, 'VIN': {'value': None, 'MQTT_topic': 'VIN'}, 'Cell1Voltage': {'value': None, 'MQTT_topic': 'Cell1Voltage'}, 'Cell2Voltage': {'value': None, 'MQTT_topic': 'Cell2Voltage'}, 'Cell3Voltage': {'value': None, 'MQTT_topic': 'Cell3Voltage'}, 'Cell4Voltage': {'value': None, 'MQTT_topic': 'Cell4Voltage'}, 'Cell5Voltage': {'value': None, 'MQTT_topic': 'Cell5Voltage'}, 'Cell6Voltage': {'value': None, 'MQTT_topic': 'Cell6Voltage'}, 'Cell7Voltage': {'value': None, 'MQTT_topic': 'Cell7Voltage'}, 'Cell8Voltage': {'value': None, 'MQTT_topic': 'Cell8Voltage'}, 'Cell9Voltage': {'value': None, 'MQTT_topic': 'Cell9Voltage'}, 'Cell10Voltage': {'value': None, 'MQTT_topic': 'Cell10Voltage'}, 'Cell11Voltage': {'value': None, 'MQTT_topic': 'Cell11Voltage'}, 'Cell12Voltage': {'value': None, 'MQTT_topic': 'Cell12Voltage'}, 'Cell13Voltage': {'value': None, 'MQTT_topic': 'Cell13Voltage'}, 'Cell14Voltage': {'value': None, 'MQTT_topic': 'Cell14Voltage'}}

lorenzo-deluca commented 3 months ago

good, very well done! :) cell voltages is valued only when scooter inverter is ON. have you try to travel?

sugar012 commented 3 months ago

good, very well done! :) cell voltages is valued only when scooter inverter is ON. have you try to travel?

yep, as soon as i switched it on (remotely of course :)) all mqqt are published. One last thing, i hope. Where do you think this "none" got in the way instead of "silence" ?

image

lorenzo-deluca commented 3 months ago

simply, with this new integration we have decided to put all the values that cannot be obtained at that time into None.

sugar012 commented 3 months ago

simply, with this new integration we have decided to put all the values that cannot be obtained at that time into None.

i tried re-configure the mqtt broker but same result. that's strange because some values where correct before. i think you should do the HACS integration aswell for this private server. of course for the future noobs like me. Thanks for your time Lorenzo