Skip to content

Use bleak-retry-connector to handle connections#141

Merged
alistair23 merged 2 commits intomainfrom
alistair/bleak_retry_connector
Sep 18, 2025
Merged

Use bleak-retry-connector to handle connections#141
alistair23 merged 2 commits intomainfrom
alistair/bleak_retry_connector

Conversation

@alistair23
Copy link
Owner

Use bleak-retry-connector for automatic retry logic and better error handling.

Use bleak-retry-connector for automatic retry logic and
better error handling.

Signed-off-by: Alistair Francis <alistair@alistair23.me>
Instead of manually managing the request/response loop Let's just
rely on bleak-retry-connector to maintain a connection.

Signed-off-by: Alistair Francis <alistair@alistair23.me>
@alistair23 alistair23 force-pushed the alistair/bleak_retry_connector branch from e7e34d2 to 5a783db Compare September 15, 2025 11:46
@alistair23
Copy link
Owner Author

Currently untested as I'm unable to test, if anyone else can test this against a real mower that would be great

@andyb2000
Copy link
Contributor

will give this a go later today and let you know

@andyb2000
Copy link
Contributor

Initial connect looks good using the in-built mower.py and also using my own script utilising this as a library.
I'll leave my script running the rest of today to watch for errors/reconnect or connection drops issues and report back.

root@home-garden:/usr/src/AutoMower-BLE-test/AutoMower-BLE/automower_ble# python3 ./mower.py --address 60:98:66:XX:XX:XX --pin 1234
2025-09-15 13:07:05,674 automower_ble.protocol INFO: starting scan...
2025-09-15 13:07:05,674 automower_ble.protocol INFO: connecting to device...
2025-09-15 13:07:06,887 automower_ble.protocol INFO: connected
2025-09-15 13:07:06,887 automower_ble.protocol INFO: pairing device...
2025-09-15 13:07:06,890 automower_ble.protocol INFO: paired
2025-09-15 13:07:06,890 automower_ble.protocol INFO: [Service] 98bd0001-0b0e-421a-84e5-ddbf75dc6de4 (Handle: 9): Unknown
2025-09-15 13:07:07,076 automower_ble.protocol INFO: [Service] 00001801-0000-1000-8000-00805f9b34fb (Handle: 8): Generic Attribute Profile
2025-09-15 13:07:12,179 automower_ble.protocol INFO: Writing: b'02fd160000000000002e14b63b6047000000004d61696e001203'
2025-09-15 13:07:12,245 automower_ble.protocol INFO: Received: b'02fd0d0000000000006315b63b6047b603'
2025-09-15 13:07:12,246 automower_ble.protocol INFO: Final response: b'02fd0d0000000000006315b63b6047b603'
2025-09-15 13:07:12,247 automower_ble.protocol INFO: Writing: b'02fd0a00b63b6047008f08012803'
2025-09-15 13:07:12,343 automower_ble.protocol INFO: Received: b'02fd0b00b63b604700b20901011403'
2025-09-15 13:07:12,344 automower_ble.protocol INFO: Final response: b'02fd0b00b63b604700b20901011403'
2025-09-15 13:07:12,391 automower_ble.protocol INFO: Writing: b'02fd1200b63b604701db00af3812040002009805cc03'
2025-09-15 13:07:13,464 automower_ble.protocol INFO: Received: b'02fd1100b63b6047019c01af38120400000000ab'
2025-09-15 13:07:13,465 automower_ble.protocol INFO: Received: b'03'
2025-09-15 13:07:13,467 automower_ble.protocol INFO: Final response: b'02fd1100b63b6047019c01af38120400000000ab03'
2025-09-15 13:07:13,468 automower_ble.protocol INFO: Writing: b'02fd1000b63b604701a100af5a1209000000b703'
2025-09-15 13:07:13,561 automower_ble.protocol INFO: Received: b'02fd1300b63b604701e601af5a1209000002001e'
2025-09-15 13:07:13,563 automower_ble.protocol INFO: Received: b'051b03'
2025-09-15 13:07:13,564 automower_ble.protocol INFO: Final response: b'02fd1300b63b604701e601af5a1209000002001e051b03'
Mower manufacturer: Flymo
2025-09-15 13:07:13,566 automower_ble.protocol INFO: Writing: b'02fd1000b63b604701a100af421202000000d903'
2025-09-15 13:07:13,658 automower_ble.protocol INFO: Received: b'02fd1100b63b6047019c01af421202000000006f'
2025-09-15 13:07:13,660 automower_ble.protocol INFO: Received: b'03'
2025-09-15 13:07:13,661 automower_ble.protocol INFO: Final response: b'02fd1100b63b6047019c01af421202000000006f03'
2025-09-15 13:07:13,662 automower_ble.protocol INFO: Writing: b'02fd1000b63b604701a100af5a1209000000b703'
2025-09-15 13:07:13,756 automower_ble.protocol INFO: Received: b'02fd1300b63b604701e601af5a1209000002001e'
2025-09-15 13:07:13,757 automower_ble.protocol INFO: Received: b'051b03'
2025-09-15 13:07:13,759 automower_ble.protocol INFO: Final response: b'02fd1300b63b604701e601af5a1209000002001e051b03'
Mower model: Easilife Go 500
2025-09-15 13:07:13,760 automower_ble.protocol INFO: Writing: b'02fd1000b63b604701a100af0a10150000003003'
2025-09-15 13:07:13,853 automower_ble.protocol INFO: Received: b'02fd1200b63b604701db01af0a10150000010000'
2025-09-15 13:07:13,854 automower_ble.protocol INFO: Received: b'4803'
2025-09-15 13:07:13,856 automower_ble.protocol INFO: Final response: b'02fd1200b63b604701db01af0a101500000100004803'
Mower is not charging
2025-09-15 13:07:13,857 automower_ble.protocol INFO: Writing: b'02fd1000b63b604701a100af0a1014000000bf03'
2025-09-15 13:07:13,951 automower_ble.protocol INFO: Received: b'02fd1200b63b604701db01af0a10140000010064'
2025-09-15 13:07:13,952 automower_ble.protocol INFO: Received: b'7b03'
2025-09-15 13:07:13,953 automower_ble.protocol INFO: Final response: b'02fd1200b63b604701db01af0a101400000100647b03'
Battery is: 100%
2025-09-15 13:07:13,954 automower_ble.protocol INFO: Writing: b'02fd1000b63b604701a100afea11020000006a03'
2025-09-15 13:07:14,048 automower_ble.protocol INFO: Received: b'02fd1200b63b604701db01afea11020000010002'
2025-09-15 13:07:14,050 automower_ble.protocol INFO: Received: b'6403'
2025-09-15 13:07:14,052 automower_ble.protocol INFO: Final response: b'02fd1200b63b604701db01afea110200000100026403'
Mower state: STOPPED
2025-09-15 13:07:14,053 automower_ble.protocol INFO: Writing: b'02fd1000b63b604701a100afea1103000000e503'
2025-09-15 13:07:14,146 automower_ble.protocol INFO: Received: b'02fd1200b63b604701db01afea11030000010000'
2025-09-15 13:07:14,148 automower_ble.protocol INFO: Received: b'ef03'
2025-09-15 13:07:14,149 automower_ble.protocol INFO: Final response: b'02fd1200b63b604701db01afea11030000010000ef03'
Mower activity: NONE
2025-09-15 13:07:14,149 automower_ble.protocol INFO: Writing: b'02fd1000b63b604701a100af321201000000c903'
2025-09-15 13:07:14,243 automower_ble.protocol INFO: Received: b'02fd1500b63b6047016801af321201000004006c'
2025-09-15 13:07:14,245 automower_ble.protocol INFO: Received: b'3bd1680c03'
2025-09-15 13:07:14,246 automower_ble.protocol INFO: Final response: b'02fd1500b63b6047016801af321201000004006c3bd1680c03'
Next start time: 2025-09-22 12:05:00
2025-09-15 13:07:14,247 automower_ble.protocol INFO: Writing: b'02fd1000b63b604701a100af761200000000ef03'
2025-09-15 13:07:14,341 automower_ble.protocol INFO: Received: b'02fd2d00b63b6047018d01af76120000001c0011'
2025-09-15 13:07:14,343 automower_ble.protocol INFO: Received: b'c336001ed13300abc40e0085ae0200ed54000092'
2025-09-15 13:07:14,345 automower_ble.protocol INFO: Received: b'0100001ed133004703'
2025-09-15 13:07:14,347 automower_ble.protocol INFO: Final response: b'02fd2d00b63b6047018d01af76120000001c0011c336001ed13300abc40e0085ae0200ed540000920100001ed133004703'
totalRunningTime 3588881
totalCuttingTime 3395870
totalChargingTime 967851
totalSearchingTime 175749
numberOfCollisions 21741
numberOfChargingCycles 402
cuttingBladeUsageTime 3395870
2025-09-15 13:07:14,350 automower_ble.protocol INFO: Writing: b'02fd1000b63b604701a100af5a120a0000003f03'
2025-09-15 13:07:14,438 automower_ble.protocol INFO: Received: b'02fd1500b63b6047016801af5a120a00000400d8'
2025-09-15 13:07:14,440 automower_ble.protocol INFO: Received: b'ef9c0c3803'
2025-09-15 13:07:14,441 automower_ble.protocol INFO: Final response: b'02fd1500b63b6047016801af5a120a00000400d8ef9c0c3803'
Serial number: 211611608
2025-09-15 13:07:14,442 automower_ble.protocol INFO: Writing: b'02fd1000b63b604701a100af5a1205000000a503'
2025-09-15 13:07:14,536 automower_ble.protocol INFO: Received: b'02fd2600b63b6047013b01af5a12050000150045'
2025-09-15 13:07:14,538 automower_ble.protocol INFO: Received: b'6173694c69666520474f20353030000000000000'
2025-09-15 13:07:14,539 automower_ble.protocol INFO: Received: b'dc03'
2025-09-15 13:07:14,541 automower_ble.protocol INFO: Final response: b'02fd2600b63b6047013b01af5a120500001500456173694c69666520474f20353030000000000000dc03'
Mower name: EasiLife GO 500
2025-09-15 13:07:14,542 automower_ble.protocol INFO: Writing: b'02fd1400b63b6047015500af7a1201000400000000007903'
2025-09-15 13:07:14,633 automower_ble.protocol INFO: Received: b'02fd1a00b63b6047012a01af7a120100000900f2'
2025-09-15 13:07:14,635 automower_ble.protocol INFO: Received: b'76c56809000000029d03'
2025-09-15 13:07:14,637 automower_ble.protocol INFO: Final response: b'02fd1a00b63b6047012a01af7a120100000900f276c56809000000029d03'
Last message: 
        2025-09-13 13:51:46
        TRAPPED
2025-09-15 13:07:14,643 automower_ble.protocol INFO: disconnecting...
2025-09-15 13:07:16,976 automower_ble.protocol INFO: disconnected

@andyb2000
Copy link
Contributor

It's been running flawlessly for the past couple of days, no drops/disconnects so looks stable to me.

@alistair23 alistair23 merged commit ed49260 into main Sep 18, 2025
5 checks passed
@alistair23
Copy link
Owner Author

Awesome! Thanks for testing. I have merged this, hopefully I can test it myself soon to double check then create a new release

@alistair23 alistair23 deleted the alistair/bleak_retry_connector branch September 18, 2025 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants