Gardena bluetooth lawn mower

I’m on Linux (Ubuntu 20.04).

I have tried factory resetting as well but could not connect. I’m willing to experiment this summer if you want a guinea pig :smiley:

Thanks for the link, it seems the Minimo versions are not supported?

@lfg_home You are connecting to the wrong address in you example above. The device address is “12:34:45:EX:AM:PL”

Ps. I assume you redacted that, since that looks strange :slight_smile:

Yeah, changed it :slight_smile:
Thanks for the hint, tried it first but got a BleakDBusError: [org.bluez.Error.Failed] Software caused connection abort so I figured I would try the uuids instead.

Now I can connect and receive this output:

Service: 98bd0001-0b0e-421a-84e5-ddbf75dc6de4 (Handle: 9): Husqvarna
 -  98bd0002-0b0e-421a-84e5-ddbf75dc6de4 (Handle: 10): Unknown
 -  ['write-without-response']
 -  98bd0004-0b0e-421a-84e5-ddbf75dc6de4 (Handle: 17): Unknown
 -  ['read']
 -  98bd0003-0b0e-421a-84e5-ddbf75dc6de4 (Handle: 13): Unknown
 -  ['read', 'notify']
Service: 00001801-0000-1000-8000-00805f9b34fb (Handle: 8): Generic Attribute Profile

You also wrote this:

If it connects, you need to try to figure out the data it contains. You can grab the gardena app from: https://apkpure.com/gardena-bluetooth®-app/com.gardena.apps.gardenabluetoothapp then run it through APK decompiler - decompile Android .apk ✓ ONLINE ✓ dissassebler. It will get you java:ish code, where you can find how the characteristics are to be parsed.

Any other guidance here? What should I be looking for?

In a file called MowerCapablities.java there is a section with the following code (don’t want to post the whole thing, not sure if OK?).

    private MowerCapabilities(MowerModel mowerModel2, MowerVariant mowerVariant2, int i, int i2, boolean z, boolean z2, boolean z3, boolean z4, boolean z5, boolean z6, int i3, int i4, int i5, int i6, boolean z7, boolean z8, boolean z9, boolean z10, boolean z11, boolean z12, boolean z13, boolean z14, boolean z15, boolean z16, boolean z17, boolean z18, boolean z19, boolean z20, MowerPlatform mowerPlatform, boolean z21, boolean z22, boolean z23, boolean z24, boolean z25, boolean z26, boolean z27, int i7, int i8, boolean z28) {
        this.mowerModel = mowerModel2;
        this.mowerVariant = mowerVariant2;
        this.numberOfGuides = i;
        this.numberOfAreas = i2;
        this.gpsAssistance = z;
        this.isUltrasonic = z2;
        this.headlights = z3;
        this.cuttingHeightInSettings = z4;
        this.isCuttingHeightAvailable = z5;
        this.isWeatherTimer = z6;
        this.minDrivePastWire = i3;
        this.maxDrivePastWire = i4;
        this.minReversingDistance = i5;
        this.maxReversingDistance = i6;
        this.extendedBluetoothSettings = z7;
        this.isReversingOut = z8;
        this.exitAngles = z9;
        this.searchBoundary = z10;
        this.searchDirect = z11;
        this.searchGuide = z12;
        this.corridorWidth = z13;
        this.spiralCutting = z14;
        this.settableGeoFenceRange = z15;
        this.sensorData = z16;
        this.liftAlarm = z17;
        this.tiltAlarm = z18;
        this.motionAlarm = z19;
        this.testFollowInOut = z20;
        this.platform = mowerPlatform;
        this.mowerHouse = z21;
        this.hmi = z22;
        this.isPinCodeRequired = z23;
        this.isPinRequiredForAlarm = z24;
        this.passageCutting = z25;
        this.profilesAvailable = z26;
        this.wifiSupport = z27;
        this.maxNumberOfTasksRaw = i7;
        this.maxNumberOfTasksPerDayRaw = i8;
        this.eposAvailable = z28;
    }

Does the Minimo have a screen/lcd?

Unfortunately no. There are physical buttons on the mower itself but everything is configured via the app. I’m going to try snooping Bluetooth data instead via the app.

Hmm. That was less characteristics than i expected. My guess is one need to authenticate/pair to it in some way to get all fields.

Its hard to tell what to look for. For the water computer, the UUID numbers are listed in the client/connection classes. Ive not found the same for the mower. It seems it is using some lib from husqvarnagroup for the communication, so we:d need to understand that yo figure out how to speak to the device.

Yeah good thinking, the app does have a pin which you need to provide, either via the app or physically, for it to connect (the first time).

I actually have Bluetooth packets sniffed from my phone that I’ve looked at in Wireshark. It looks like the authentication dialog between my phone and the mower is all there (SMP protocol). I did a factory reset, authenticated with my phone/Gardena app again and then sent a “cut the grass for 30 minutes” command. Then I stopped the sniffing. There also seems to be services and characteristics declared.

There’s a lot of information there, I’m just not sure what to do with it :smiley: This is my first time working with Bluetooth and Wireshark so a lot of new information and concepts to grasp.

Ultimately I would have wanted to just replay the conversation between the phone and the mower but have not found a good tool to help with that yet.

Not sure it’s possible to get. But the trace you showed above showed just requests, ie stuff sent to the device. Not the responses. Could the responses have been filtered away?

Also… Think you can see if you can pair with the device over commandline? Pairing from Ubuntu Core | Ubuntu

The trace had the responses filtered out, I do have those as well (if necessary).

BUT…I managed to connect! I had tried to use bluetoothctl before but did it properly this time and factory reset the mower again and then tried to connect again.

I’ve not tried your gardena_bluetooth script but perhaps it’s not necessary any more?

[CHG] Device 70:B9:50:68:C8:F2 Connected: yes
Connection successful
[NEW] Primary Service (Handle 0xc461)
        /org/bluez/hci0/dev_70_B9_50_68_C8_F2/service0008
        00001801-0000-1000-8000-00805f9b34fb
        Generic Attribute Profile
[NEW] Primary Service (Handle 0xc461)
        /org/bluez/hci0/dev_70_B9_50_68_C8_F2/service0009
        98bd0001-0b0e-421a-84e5-ddbf75dc6de4
        Vendor specific
[NEW] Characteristic (Handle 0xc461)
        /org/bluez/hci0/dev_70_B9_50_68_C8_F2/service0009/char000a
        98bd0002-0b0e-421a-84e5-ddbf75dc6de4
        Vendor specific
[NEW] Descriptor (Handle 0x1e74)
        /org/bluez/hci0/dev_70_B9_50_68_C8_F2/service0009/char000a/desc000c
        00002901-0000-1000-8000-00805f9b34fb
        Characteristic User Description
[NEW] Characteristic (Handle 0xc461)
        /org/bluez/hci0/dev_70_B9_50_68_C8_F2/service0009/char000d
        98bd0003-0b0e-421a-84e5-ddbf75dc6de4
        Vendor specific
[NEW] Descriptor (Handle 0x2d04)
        /org/bluez/hci0/dev_70_B9_50_68_C8_F2/service0009/char000d/desc000f
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Descriptor (Handle 0x2ff4)
        /org/bluez/hci0/dev_70_B9_50_68_C8_F2/service0009/char000d/desc0010
        00002901-0000-1000-8000-00805f9b34fb
        Characteristic User Description
[NEW] Characteristic (Handle 0xc461)
        /org/bluez/hci0/dev_70_B9_50_68_C8_F2/service0009/char0011
        98bd0004-0b0e-421a-84e5-ddbf75dc6de4
        Vendor specific
[NEW] Descriptor (Handle 0x35d4)
        /org/bluez/hci0/dev_70_B9_50_68_C8_F2/service0009/char0011/desc0013
        00002901-0000-1000-8000-00805f9b34fb
        Characteristic User Description
[CHG] Device 70:B9:50:68:C8:F2 UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Device 70:B9:50:68:C8:F2 UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Device 70:B9:50:68:C8:F2 UUIDs: 98bd0001-0b0e-421a-84e5-ddbf75dc6de4
[CHG] Device 70:B9:50:68:C8:F2 ServicesResolved: yes
[CHG] Device 70:B9:50:68:C8:F2 ServicesResolved: no
[CHG] Device 70:B9:50:68:C8:F2 Connected: no

Now that I’m connected through the computer, should I try to write values back to the mower, e.g. through bluetoothctl and the gatt menu (write)? Perhaps using a write command from the sniffed packets?

You could, but i still would be interested in the output from my script, to see if it understand any of the characteristics after being paired.

Tried it a few times (restart mower, run script), finally got this. Ran it three times.

p.s. the **TEST** comes from me modifying your script and increasing the timeout in the connect method.

I accidentally had bluetoothctl running in another terminal and got the question to Accept pairing (yes/no). Don’t think I would have gotten the output if I hadn’t been running this. It looks identical to the output received earlier.

Using bluetoothctl I did manage to stay connected to the mower (had to be right next to it physically, otherwise I would get disconnected).

And I tried to read a few values from attributes but I’m in deep waters right now :smiley:

1 Like

Soo… the mowers seem to work on a very different protocol than the watering units. You can find the protocol at this location in tha apk: sources/com/husqvarnagroup/dss/amc/blelib in the app.

In essence, they just use BLE services to transport raw packet data for their proprietary protocol which seemingly support events and other commands.

I will not have time to re-implement that in python. If anybody get’s to doing it i’ll review and accept pull requests for it on the library.

4 Likes

Following this topic as I’d love to see this working. All I would like is start, stop, and return to base control, recognising that the Bluetooth range isn’t very good so it would probably need some kind of outside aerial.

2 Likes

Any progress in this? :slightly_smiling_face: i am also very interested in this. I have two mowers. One sileno city and one sileno minimo i would like to try this on​:slightly_smiling_face:. Very god work btw

1 Like

Good job!
What is this: Sileno City 250 goes "smart" - App-Steuerung via Bluetooth | Roboter-Forum.com

I decompiled the Android app. But my rudimentary Java knowledge is not enough to understand it or to find the right code passages.

Is there anyone here who can explain how the protocol works?

Perhaps others can then do the implementation in Python!

I think there has been some progress here. Gardena/Macculloc mowers probably use the same protocol.

5 Likes