Pico HC-05 not connecting to Raspberry Pi 4: Failed to connect: org.bluez.Error.NotAvailable

I am trying to establish a Bluetooth connection between a Raspberry Pi Pico H (using an HC-05 Bluetooth module) and a Raspberry Pi 4 (using its built-in Bluetooth). However, when I run the command:

>> connect 00:23:00:00:8C:5F

It gives me the following error:

>> Failed to connect: org.bluez.Error.NotAvailable

This is my terminal:

>> sarim@raspberrypi:~ $ sudo bluetoothctl
Agent registered
>> [bluetooth]# scan on
Discovery started
[CHG] Controller D8:3A:DD:1C:97:16 Discovering: yes
[CHG] Device 4B:2F:EC:24:E7:E3 RSSI: -46
[CHG] Device 4B:2F:EC:24:E7:E3 TxPower: 12
[CHG] Device 74:C8:88:ED:85:AB RSSI: -75
[CHG] Device 74:C8:88:ED:85:AB TxPower: 9
[CHG] Device 5A:D6:EF:9B:10:7C RSSI: -80
[CHG] Device 5A:D6:EF:9B:10:7C TxPower: 12
[CHG] Device 77:45:CB:07:86:B9 RSSI: -81
[CHG] Device 77:45:CB:07:86:B9 TxPower: 11
[NEW] Device 5A:4E:F9:A4:87:D4 5A-4E-F9-A4-87-D4
[DEL] Device D3:F5:4D:51:1A:9A N08PR
[NEW] Device 00:23:00:00:8C:5F HC-05
>> [bluetooth]# pair 00:23:00:00:8C:5F
Attempting to pair with 00:23:00:00:8C:5F
[CHG] Device 00:23:00:00:8C:5F Connected: yes
Request PIN code
>> [agent] Enter PIN code: 1234
[CHG] Device 00:23:00:00:8C:5F UUIDs: 00001101-0000-1000-8000-00805f9b34fb
[CHG] Device 00:23:00:00:8C:5F ServicesResolved: yes
[CHG] Device 00:23:00:00:8C:5F Paired: yes
Pairing successful
[CHG] Device 00:23:00:00:8C:5F ServicesResolved: no
[CHG] Device 00:23:00:00:8C:5F Connected: no
>> [bluetooth]# trust 00:23:00:00:8C:5F
[CHG] Device 00:23:00:00:8C:5F Trusted: yes
Changing 00:23:00:00:8C:5F trust succeeded
[NEW] Device 74:E0:11:79:3E:DF 74-E0-11-79-3E-DF
>> [bluetooth]# connect 00:23:00:00:8C:5
Attempting to connect to 00:23:00:00:8C:5F
[CHG] Device 00:23:00:00:8C:5F Connected: yes
[CHG] Device 00:23:00:00:8C:5F ServicesResolved: yes
Failed to connect: org.bluez.Error.NotAvailable
[DEL] Device 5A:4E:F9:A4:87:D4 5A-4E-F9-A4-87-D4
[CHG] Device 00:23:00:00:8C:5F ServicesResolved: no
[CHG] Device 00:23:00:00:8C:5F Connected: no
[CHG] Device 77:45:CB:07:86:B9 ManufacturerData Key: 0x004c
[CHG] Device 77:45:CB:07:86:B9 ManufacturerData Value:
  01 00 00 00 00 00 00 00 00 00 00 00 00 80 00 00  ................
  00                                          

Read more here: Source link