VictronConnect icon indicating copy to clipboard operation
VictronConnect copied to clipboard

Problems

Open jdrescher2006 opened this issue 4 years ago • 4 comments

Hi,

I have a few problems when running this programm. I try to run it on a Raspberry 3 with a Victron BlueSolar MPPT 75/15. Sometimes the following error occures when starting the program: Traceback (most recent call last): File "victron-bluetooth.py", line 183, in <module> c = charactersistcs["306b0002-b081-4037-83dc-e59fcc3cdfd0"] KeyError: '306b0002-b081-4037-83dc-e59fcc3cdfd0'

I don't really know why this happens, maybe someone can help.

jdrescher2006 avatar May 11 '21 11:05 jdrescher2006

I think the problem is that if the connection can not be established (for some reason) then there is no key in characteristics. It would be goot to subscribe to connect_succeeded. Only if the connection succeeds, continue with further operations.

jdrescher2006 avatar May 12 '21 12:05 jdrescher2006

It might be that the connection succeeds, but that the characteristics are different for your device - hence 306b0002-b081-4037-83dc-e59fcc3cdfd0 does not exist.

I have not had much time to work on this lately, but I might look at the code later to see if there is any way to improve the error handling there.

Olen avatar May 12 '21 12:05 Olen

I discovered that my BLE connection is quite unstable. This is why the connection is not always established. In this case the program crashes with the described error. I have a different device (MPPT 75/15) but if the connection is successful the characteristics are all there:

[x] Service [306b0001-b081-4037-83dc-e59fcc3cdfd0] [x] Characteristic [306b0004-b081-4037-83dc-e59fcc3cdfd0] [x] - 306b0004-b081-4037-83dc-e59fcc3cdfd0 Enabling notifications [x] Characteristic [306b0003-b081-4037-83dc-e59fcc3cdfd0] [x] - 306b0003-b081-4037-83dc-e59fcc3cdfd0 Enabling notifications [x] Characteristic [306b0002-b081-4037-83dc-e59fcc3cdfd0] [x] - 306b0002-b081-4037-83dc-e59fcc3cdfd0 Enabling notifications [x] Service [97580001-ddf1-48be-b73e-182664615d8e] [x] Characteristic [97580006-ddf1-48be-b73e-182664615d8e] [x] Characteristic [97580004-ddf1-48be-b73e-182664615d8e] [x] Characteristic [97580003-ddf1-48be-b73e-182664615d8e] [x] Characteristic [97580002-ddf1-48be-b73e-182664615d8e] [x] Service [68c10001-b17f-4d3a-a290-34ad6499937c] [x] Characteristic [68c10003-b17f-4d3a-a290-34ad6499937c] [x] Characteristic [68c10002-b17f-4d3a-a290-34ad6499937c] [x] Service [00001801-0000-1000-8000-00805f9b34fb] [x] Characteristic [00002a05-0000-1000-8000-00805f9b34fb]

jdrescher2006 avatar May 13 '21 18:05 jdrescher2006

I do have the same SmartSolar MPPT 75/15 and do not receive any data on the characteristic, even though it is clearly available on the device. @jdrescher2006 Did you make any progress on your device?

@Olen Is there some trick to it? I've dumped a BT connection from the VictronConnect App directly on my Mac, however it seems there is no GATT data (except 3 GATT Include Declarations with Attribute Not Found responses) but a lot of ATT data.

jonashoechst avatar Nov 03 '22 20:11 jonashoechst