irmo-de / 9UnBot

2 stars 0 forks source link

Unable to pair #3

Open ealmiladi opened 2 weeks ago

ealmiladi commented 2 weeks ago

Hi, thanks for the great work on this.

I'm trying to pair with my Ninebot MAX G2. I'm able to get Received pingAck1 or pingAck2, breaking the loop, but I never end up receiving the, Received pair Ack, breaking the loop - we can now send messages to scooter message.

I can't seem to figure out why it wont actually pair; do you happen to have any ideas as to how to get past this?

EDIT: Seems like hitting the power button twice will lead to the scooter eventually being paired, but then it seemingly disconnects immediately:


2024-09-22 15:13:01.189 15752-15831 NB_BLE                  de.irmo.a9unbot                      I  Received pair Ack, breaking the loop - we can now send messages to scooter
2024-09-22 15:13:06.246 15752-15831 nb_ble                  de.irmo.a9unbot                      I  Disconnected from BLE device
2024-09-22 15:13:06.256 15752-15836 BluetoothGatt           de.irmo.a9unbot                      D  cancelOpen() - device: E2:5D:08:39:46:F7
2024-09-22 15:13:06.263 15752-15761 BluetoothGatt           de.irmo.a9unbot                      D  onClientConnectionState() - status=0 clientIf=6 device=E2:5D:08:39:46:F7
2024-09-22 15:13:06.268 15752-15761 BluetoothGatt           de.irmo.a9unbot                      D  setCharacteristicNotification() - uuid: 6e400003-b5a3-f393-e0a9-e50e24dcca9e enable: false
2024-09-22 15:13:06.283 15752-15761 nb_ble                  de.irmo.a9unbot                      E  Error in setupNotification: Disconnected from MAC='XX:XX:XX:XX:XX:XX' with status 0 (GATT_SUCCESS)```
irmo-de commented 1 week ago

Look for this entry: private void performBluetoothOperations(BleUartCommunication uartCommunication) throws Exception { ProtocolNinebot NbProtocol = new ProtocolNinebot("NBScooter1777"); And change it to match your scooters bluetooth name

ealmiladi commented 1 week ago

Look for this entry: private void performBluetoothOperations(BleUartCommunication uartCommunication) throws Exception { ProtocolNinebot NbProtocol = new ProtocolNinebot("NBScooter1777"); And change it to match your scooters bluetooth name

I’ve taken that step already. I suspect either the encryption has changed in the latest BLE firmware for the G2, or that the protocol has changed slightly.

irmo-de commented 1 week ago

Oh I see, you could try this python implementation and see if you can connect. https://github.com/dnandha/miauth

irmo-de commented 1 week ago

There is a bug fix for: app/src/main/java/de/irmo/a9unbot/ProtocolNinebot.kt not sure if this will fix your issue.

ealmiladi commented 1 week ago

I applied that bugfix too. Unfortunately, no result. But thanks!