scooterhacking / NinebotCrypto

An implementation of the NinebotCrypto protocol by majsi.
GNU Affero General Public License v3.0
42 stars 15 forks source link

packets seem to encode/decode correctly but ES4 BLE v1.0.9(edit) fails to respond to second pairing packet #6

Open UncleAnti opened 2 years ago

UncleAnti commented 2 years ago

Bare in mind I have ported from the C# code to C (with mbedtls)

I eventually figured out that name is actually the device name (NBScooter0204 for me) and that there is no checksum (maybe the README needs updated to make this clearer)

So I set the name to 'NBScooter0204' (and zero pad to 16 bytes) encode and send 3E215B00 to the dash receive and decode 213E5B01 + bleKey + Serial Number

But when I encode and send 3E215C00 + 16x random bytes The dash fails to respond.

Has anyone had success/traps/failures with this?

Obviously I figured I had mis-ported something, so have spent hours comparing my C version with the C#/Swift/Kotlin and it appears to be functionally the same.

IAP successfully connects, and I have compared it's packet log with mine, and it all decode successfully.

I'm happy to push the C port now/once its working. (just let me know how)

nopbxlr commented 2 years ago

Wait... BLE151 for ESx?

UncleAnti commented 2 years ago

ah, brain fart.. BLE v1.0.9, ESC v1.5.1

UncleAnti commented 2 years ago

FYI, I've forked and pushed my C port to: https://github.com/UncleAnti/NinebotCrypto