Replies: 11 comments 5 replies
-
RP2? what are you using for bluetooth on this? |
Beta Was this translation helpful? Give feedback.
-
I am using a bluetooth dongle. The dongle is finding the BMS, as listed below. Hardware: V11.XW
2024-01-16 22:17:19,718:INFO:__init__:main@214: Solar Device Command Utility, version: 0.15.62
2024-01-16 22:17:19,719:INFO:__init__:main@347: Creating device "unnamed" (type: "mppsolar") on port "20:23:04:32:55:74 (porttype=None)" using protocol "jkv11"
2024-01-16 22:17:19,731:INFO:__init__:get_port@105: Using jkbleio for communications
2024-01-16 22:17:20,233:INFO:__init__:main@407: Looping 1 commands
2024-01-16 22:17:20,234:INFO:__init__:main@417: Getting results from device: mppsolar device - name: unnamed, port: <mppsolar.inout.jkbleio.JkBleIO object at 0x75fdac28>, protocol: JKBMS BLE communication protocol handler software v11.x for command: , tag: , outputs: screen
2024-01-16 22:17:20,235:INFO:device:run_command@50: Running command
2024-01-16 22:17:20,236:INFO:jkabstractprotocol:get_full_command@74: Using protocol b'JKv11' with 3 commands
2024-01-16 22:17:20,236:INFO:device:run_command@78: full command bytearray(b'\xaaU\x90\xeb\x96\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10') for command getCellData
2024-01-16 22:17:20,237:INFO:jkabstractprotocol:get_full_command@74: Using protocol b'JKv11' with 3 commands
2024-01-16 22:17:20,238:INFO:jkbleio:send_and_receive@29: full command bytearray(b'\xaaU\x90\xeb\x96\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10') for command getCellData
2024-01-16 22:17:20,239:INFO:jkbleio:ble_connect@57: Attempting to connect to 20:23:04:32:55:74
Traceback (most recent call last):
File "/usr/local/bin/mpp-solar", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.9/dist-packages/mppsolar/__init__.py", line 420, in main
results = _device.run_command(command=_command)
File "/usr/local/lib/python3.9/dist-packages/mppsolar/devices/device.py", line 89, in run_command
raw_response = self._port.send_and_receive(
File "/usr/local/lib/python3.9/dist-packages/mppsolar/inout/jkbleio.py", line 37, in send_and_rece
ive
response = self.ble_get_data(full_command)
File "/usr/local/lib/python3.9/dist-packages/mppsolar/inout/jkbleio.py", line 88, in ble_get_data
serviceId = self._device.getServiceByUUID(btle.AssignedNumbers.genericAccess)
File "/usr/local/lib/python3.9/dist-packages/bluepy/btle.py", line 490, in getServiceByUUID
raise BTLEGattError("Service %s not found" % (uuid.getCommonName()), rsp)
bluepy.btle.BTLEGattError: Service Generic Access not found |
Beta Was this translation helpful? Give feedback.
-
I checked the bluetooth connection with bluetoothctl. Here, everything looks ok.
|
Beta Was this translation helpful? Give feedback.
-
can you try a debug run, ie |
Beta Was this translation helpful? Give feedback.
-
it kinda looks like theres no generic access service on this device... |
Beta Was this translation helpful? Give feedback.
-
Debug Run: 2024-01-18 13:16:27,405:INFO:__init__:main@214: Solar Device Command Utility, version: 0.15.62
2024-01-18 13:16:27,406:DEBUG:mqttbrokerc:__init__@29: mqttbroker config: {'name': 'localhost', 'port': 1883, 'user': None, 'pass': None}
2024-01-18 13:16:27,407:DEBUG:__init__:main@239: MqttBroker name: localhost, port: 1883, user: None
2024-01-18 13:16:27,407:DEBUG:__init__:main@241: udp port 5555
2024-01-18 13:16:27,408:DEBUG:__init__:main@243: Using Postgres None
2024-01-18 13:16:27,408:DEBUG:__init__:main@246: Using Mongo None with mppsolar
2024-01-18 13:16:27,408:INFO:__init__:main@347: Creating device "unnamed" (type: "mppsolar") on port "20:23:04:32:55:74 porttype=None)" using protocol "jkv11"
2024-01-18 13:16:27,419:DEBUG:__init__:main@351: device_class <class 'mppsolar.devices.mppsolar.mppsolar'>
2024-01-18 13:16:27,419:DEBUG:device:__init__@33: __init__ args ()
2024-01-18 13:16:27,420:DEBUG:device:__init__@34: __init__ kwargs {'name': 'unnamed', 'port': '20:23:04:32:55:74', 'protocol': 'jkv11', 'baud': 2400, 'porttype': None, 'mqtt_broker': <mppsolar.libs.mqttbrokerc.MqttBroker object at 0x7605ab98>, 'udp_port': '5555', 'mongo_url': None, 'mongo_db': 'mppsolar'}
2024-01-18 13:16:27,421:DEBUG:__init__:get_port_type@51: port matches jkble ':'
2024-01-18 13:16:27,421:INFO:__init__:get_port@105: Using jkbleio for communications
2024-01-18 13:16:27,532:DEBUG:__init__:get_protocol@13: Protocol jkv11
2024-01-18 13:16:27,926:DEBUG:device:__init__@38: __init__ name unnamed, port <mppsolar.inout.jkbleio.JkBleIO object at 0x7601fca0>, protocol JKBMS BLE communication protocol handler software v11.x
2024-01-18 13:16:27,927:DEBUG:__init__:main@402: Commands [(<mppsolar.devices.mppsolar.mppsolar object at 0x7605abe0>, '', '', 'screen', None, None)]
2024-01-18 13:16:27,927:INFO:__init__:main@407: Looping 1 commands
2024-01-18 13:16:27,928:INFO:__init__:main@417: Getting results from device: mppsolar device - name: unnamed, port: <mppsolar.inout.jkbleio.JkBleIO object at 0x7601fca0>, protocol: JKBMS BLE communication protocol handler software v11.x for command: , tag: , outputs: screen
2024-01-18 13:16:27,928:INFO:device:run_command@50: Running command
2024-01-18 13:16:27,929:INFO:jkabstractprotocol:get_full_command@74: Using protocol b'JKv11' with 3 commands
2024-01-18 13:16:27,929:DEBUG:jkabstractprotocol:get_command_defn@105: get_command_defn for: getCellData
2024-01-18 13:16:27,929:DEBUG:abstractprotocol:get_command_defn@70: Processing command 'getCellData'
2024-01-18 13:16:27,930:DEBUG:abstractprotocol:get_command_defn@72: Found command getCellData in protocol b'JKv11'
2024-01-18 13:16:27,930:DEBUG:jkabstractprotocol:get_full_command@79: self._command = getCellData
2024-01-18 13:16:27,930:DEBUG:jkabstractprotocol:get_full_command@90: cmd with SOR: bytearray(b'\xaaU\x90\xeb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
2024-01-18 13:16:27,931:DEBUG:jkabstractprotocol:get_full_command@98: cmd with command code: bytearray(b'\xaaU\x90\xeb\x96\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
2024-01-18 13:16:27,931:DEBUG:jkabstractprotocol:get_full_command@100: cmd with crc: bytearray(b'\xaaU\x90\xeb\x96\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10')
2024-01-18 13:16:27,932:INFO:device:run_command@78: full command bytearray(b'\xaaU\x90\xeb\x96\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10') for command getCellData
2024-01-18 13:16:27,932:DEBUG:jkabstractprotocol:get_command_defn@105: get_command_defn for: getCellData
2024-01-18 13:16:27,933:DEBUG:abstractprotocol:get_command_defn@70: Processing command 'getCellData'
2024-01-18 13:16:27,933:DEBUG:abstractprotocol:get_command_defn@72: Found command getCellData in protocol b'JKv11'
2024-01-18 13:16:27,933:INFO:jkabstractprotocol:get_full_command@74: Using protocol b'JKv11' with 3 commands
2024-01-18 13:16:27,934:DEBUG:jkabstractprotocol:get_command_defn@105: get_command_defn for: getCellData
2024-01-18 13:16:27,934:DEBUG:abstractprotocol:get_command_defn@70: Processing command 'getCellData'
2024-01-18 13:16:27,934:DEBUG:abstractprotocol:get_command_defn@72: Found command getCellData in protocol b'JKv11'
2024-01-18 13:16:27,935:DEBUG:jkabstractprotocol:get_full_command@79: self._command = getCellData
2024-01-18 13:16:27,935:DEBUG:jkabstractprotocol:get_full_command@90: cmd with SOR: bytearray(b'\xaaU\x90\xeb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
2024-01-18 13:16:27,936:DEBUG:jkabstractprotocol:get_full_command@98: cmd with command code: bytearray(b'\xaaU\x90\xeb\x96\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
2024-01-18 13:16:27,936:DEBUG:jkabstractprotocol:get_full_command@100: cmd with crc: bytearray(b'\xaaU\x90\xeb\x96\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10')
2024-01-18 13:16:27,937:INFO:jkbleio:send_and_receive@29: full command bytearray(b'\xaaU\x90\xeb\x96\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10') for command getCellData
2024-01-18 13:16:27,937:DEBUG:jkabstractprotocol:get_command_defn@105: get_command_defn for: getCellData
2024-01-18 13:16:27,937:DEBUG:abstractprotocol:get_command_defn@70: Processing command 'getCellData'
2024-01-18 13:16:27,938:DEBUG:abstractprotocol:get_command_defn@72: Found command getCellData in protocol b'JKv11'
2024-01-18 13:16:27,938:DEBUG:jkbleio:send_and_receive@33: expected record type 2 for command getCellData
2024-01-18 13:16:27,938:INFO:jkbleio:ble_connect@57: Attempting to connect to 20:23:04:32:55:74
2024-01-18 13:16:28,196:DEBUG:jkbleio:ble_get_data@82: Command: bytearray(b'\xaaU\x90\xeb\x96\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10')
Traceback (most recent call last):
File "/usr/local/bin/mpp-solar", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.9/dist-packages/mppsolar/__init__.py", line 420, in main
results = _device.run_command(command=_command)
File "/usr/local/lib/python3.9/dist-packages/mppsolar/devices/device.py", line 89, in run_command
raw_response = self._port.send_and_receive(
File "/usr/local/lib/python3.9/dist-packages/mppsolar/inout/jkbleio.py", line 37, in send_and_rece
ive
response = self.ble_get_data(full_command)
File "/usr/local/lib/python3.9/dist-packages/mppsolar/inout/jkbleio.py", line 88, in ble_get_data
serviceId = self._device.getServiceByUUID(btle.AssignedNumbers.genericAccess)
File "/usr/local/lib/python3.9/dist-packages/bluepy/btle.py", line 490, in getServiceByUUID
raise BTLEGattError("Service %s not found" % (uuid.getCommonName()), rsp)
bluepy.btle.BTLEGattError: Service Generic Access not found |
Beta Was this translation helpful? Give feedback.
-
can you try again with version 0.16.18 or later and post the debug |
Beta Was this translation helpful? Give feedback.
-
I managed it. But now connection via bluetooth is not possible.
bluetoothctl can connect. After restart of bluetooth service I try again mpp-solar and no connect.
sudo mpp-solar -p 20:23:04:32:55:74 -P JKV11 -I -D
2024-02-16 ***@***.***: Solar Device Command Utility, version: 0.16.20, python version: 3.11.6
2024-02-16 ***@***.***: mqttbroker config: {'name': 'localhost', 'port': 1883, 'user': None, 'pass': None}
2024-02-16 ***@***.***: MqttBroker name: localhost, port: 1883, user: None
2024-02-16 ***@***.***: udp port 5555
2024-02-16 ***@***.***: Using Postgres None
2024-02-16 ***@***.***: Using Mongo None with mppsolar
2024-02-16 ***@***.***: Creating device "unnamed" (type: "mppsolar") on port "20:23:04:32:55:74 (porttype=None)" using protocol "JKV11"
2024-02-16 ***@***.***: device_class <class 'mppsolar.devices.mppsolar.mppsolar'>
2024-02-16 ***@***.***: __init__ args ()
2024-02-16 ***@***.***: __init__ kwargs {'name': 'unnamed', 'port': '20:23:04:32:55:74', 'protocol': 'JKV11', 'baud': 2400, 'porttype': None, 'mqtt_broker': <mppsolar.libs.mqttbrokerc.MqttBroker o
bject at 0xffffb6f9fd10>, 'udp_port': 5555, 'mongo_url': None, 'mongo_db': 'mppsolar', 'push_url': 'http://localhost:9091/metrics/job/pushgateway'}
2024-02-16 ***@***.***: port matches jkble ':'
2024-02-16 ***@***.***: Using jkbleio for communications
2024-02-16 ***@***.***: Protocol JKV11
2024-02-16 ***@***.***: __init__ name unnamed, port <mppsolar.inout.jkbleio.JkBleIO object at 0xffffb6c60590>, protocol JKBMS BLE communication protocol handler software v11.x
2024-02-16 ***@***.***: Commands [(<mppsolar.devices.mppsolar.mppsolar object at 0xffffb6c60450>, '', '', 'screen', None, None)]
2024-02-16 ***@***.***: Looping 1 commands
2024-02-16 ***@***.***: Getting results from device: mppsolar device - name: unnamed, port: <mppsolar.inout.jkbleio.JkBleIO object at 0xffffb6c60590>, protocol: JKBMS BLE communication protocol hand
ler software v11.x for command: , tag: , outputs: screen
2024-02-16 ***@***.***: Running command
2024-02-16 ***@***.***: Using protocol b'JKv11' with 3 commands
2024-02-16 ***@***.***: get_command_defn for: getCellData
2024-02-16 ***@***.***: Processing command 'getCellData'
2024-02-16 ***@***.***: Found command getCellData in protocol b'JKv11'
2024-02-16 ***@***.***: self._command = getCellData
2024-02-16 ***@***.***: cmd with SOR: bytearray(b'\xaaU\x90\xeb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
2024-02-16 ***@***.***: cmd with command code: bytearray(b'\xaaU\x90\xeb\x96\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
2024-02-16 ***@***.***: cmd with crc: bytearray(b'\xaaU\x90\xeb\x96\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10')
2024-02-16 ***@***.***: full command bytearray(b'\xaaU\x90\xeb\x96\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10') for command getCellData
2024-02-16 ***@***.***: get_command_defn for: getCellData
2024-02-16 ***@***.***: Processing command 'getCellData'
2024-02-16 ***@***.***: Found command getCellData in protocol b'JKv11'
2024-02-16 ***@***.***: Using protocol b'JKv11' with 3 commands
2024-02-16 ***@***.***: get_command_defn for: getCellData
2024-02-16 ***@***.***: Processing command 'getCellData'
2024-02-16 ***@***.***: Found command getCellData in protocol b'JKv11'
2024-02-16 ***@***.***: self._command = getCellData
2024-02-16 ***@***.***: cmd with SOR: bytearray(b'\xaaU\x90\xeb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
2024-02-16 ***@***.***: cmd with command code: bytearray(b'\xaaU\x90\xeb\x96\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
2024-02-16 ***@***.***: cmd with crc: bytearray(b'\xaaU\x90\xeb\x96\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10')
2024-02-16 ***@***.***: full command bytearray(b'\xaaU\x90\xeb\x96\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10') for command getCellData
2024-02-16 ***@***.***: get_command_defn for: getCellData
2024-02-16 ***@***.***: Processing command 'getCellData'
2024-02-16 ***@***.***: Found command getCellData in protocol b'JKv11'
2024-02-16 ***@***.***: expected record type 2 for command getCellData
2024-02-16 ***@***.***: Attempting to connect to 20:23:04:32:55:74
2024-02-16 ***@***.***: Cannot connect to mac 20:23:04:32:55:74 - exceeded 3 attempts
2024-02-16 ***@***.***: Failed to connect to 20:23:04:32:55:74
2024-02-16 ***@***.***: Raw response None
2024-02-16 ***@***.***: Send and Receive Response None
2024-02-16 ***@***.***: response passed to decode: None
2024-02-16 ***@***.***: get_command_defn for: getCellData
2024-02-16 ***@***.***: Processing command 'getCellData'
2024-02-16 ***@***.***: Found command getCellData in protocol b'JKv11'
2024-02-16 ***@***.***: validity check fail: {'validity check': ['Error: Response was empty', '']}
2024-02-16 ***@***.***: Decoded response {'_command': 'getCellData', '_command_description': 'BLE Cell Data inquiry', 'validity check': ['Error: Response was empty', '']}
2024-02-16 ***@***.***: results: {'_command': 'getCellData', '_command_description': 'BLE Cell Data inquiry', 'validity check': ['Error: Response was empty', '']}
2024-02-16 ***@***.***: attempting to create output processor: screen
2024-02-16 ***@***.***: processor.screen __init__ args: (), kwargs: {}
2024-02-16 ***@***.***: Using output filter: None
2024-02-16 ***@***.***: Using output processor: screen
2024-02-16 ***@***.***: kwargs {'data': {'_command': 'getCellData', '_command_description': 'BLE Cell Data inquiry', 'validity check': ['Error: Response was empty', '']}, 'tag': '', 'name': 'unnamed
', 'mqtt_broker': <mppsolar.libs.mqttbrokerc.MqttBroker object at 0xffffb6f9fd10>, 'udp_port': 5555, 'postgres_url': None, 'mongo_url': None, 'mongo_db': 'mppsolar', 'push_url': 'http://localhost:9091/metrics/job/pushgatew
ay', 'mqtt_topic': None, 'filter': None, 'excl_filter': None, 'keep_case': False}
2024-02-16 ***@***.***: displayData: {'validity_check': ['Error: Response was empty', '']}
Command: getCellData - BLE Cell Data inquiry
--------------------------------------------------------------------------------
Parameter Value Unit
validity_check Error: Response was empty
--------------------------------------------------------------------------------
2024-02-16 ***@***.***: Not daemon, so not looping
BlueMail for Android herunterladen
Am 15. Feb. 2024, 22:21, um 22:21, John Blance ***@***.***> schrieb:
…try installing bluepy on its own
`pip install bluepy`
it might be that you need c compilers etc
--
Reply to this email directly or view it on GitHub:
#455 (reply in thread)
You are receiving this because you authored the thread.
Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
yup its failing to connect to the BLE device in a command / terminal window, try $ python
>>> from bluepy import btle
>>> device = btle.Peripheral(None)
>>> device.connect('20:23:04:32:55:74') (dont type the $ or >>>) |
Beta Was this translation helpful? Give feedback.
-
All other devices are not connected to the BMS.
python3
Python 3.11.6 (main, Oct 8 2023, 05:06:43) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more informati
on.
>> from bluepy import btle
>> device = btle.Peripheral(None)
>> device.connect('20:23:04:32:55:74')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.11/dist-packages/bluepy/btle.py", li
ne 445, in connect
self._connect(addr, addrType, iface)
File "/usr/local/lib/python3.11/dist-packages/bluepy/btle.py", li
ne 439, in _connect
raise BTLEDisconnectError("Failed to connect to peripheral %s,
addr type: %s" % (addr, addrType), rsp)
bluepy.btle.BTLEDisconnectError: Failed to connect to peripheral 20
:23:04:32:55:74, addr type: public
BlueMail for Android herunterladen
Am 16. Feb. 2024, 00:22, um 00:22, John Blance ***@***.***> schrieb:
…yup its failing to connect to the BLE device
in a command / terminal window, try
```python
$ python
>>> from bluepy import btle
>>> device = btle.Peripheral(None)
>>> device.connect('20:23:04:32:55:74')
```
(dont type the $ or >>>)
and post what you get
--
Reply to this email directly or view it on GitHub:
#455 (comment)
You are receiving this because you authored the thread.
Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
hmm, not going to get very far if the library doesnt even connect >>> from bluepy import btle
>>> device = btle.Peripheral(None)
>>> device.connect('20:23:04:32:55:74') you could also try |
Beta Was this translation helpful? Give feedback.
-
Hello,
has anyone this combination ? MPP-SOLAR with Raspberry PI2, Bluetooth and BMS JK-BD6A20S8P is not getting any data
Connection via bluetoothctl to the BMS is working.
sudo mpp-solar -p 20:23:04:32:55:74 -I -P jk04
Beta Was this translation helpful? Give feedback.
All reactions