david_1234
Posts: 645
Joined: Mon Jan 01, 2018 2:14 pm

Control BLE device from pi using python?

Thu Jun 23, 2022 7:37 am

Hello,
I have a programable BLE device that I want to control using PI
I want to connect to him and send him a simple command that will turn on\off led

how can I do this ?
where do I need to start from ? (on which side? )
the device is Espruino (using node JS) , all I did in the BLE side is name it and make him connectable

did someone did something like this and can help?

Thanks,

tepalia02
Posts: 102
Joined: Wed Apr 13, 2022 2:09 pm

Re: Control BLE device from pi using python?

Thu Jun 23, 2022 1:00 pm

I don't know which particular BLE device you're using. In general, you can connect and control a bluetooth device with Raspberry pi by following some steps. The following write-up outlines the basic procedure.

https://www.instructables.com/Control-B ... pberry-Pi/

david_1234
Posts: 645
Joined: Mon Jan 01, 2018 2:14 pm

Re: Control BLE device from pi using python?

Thu Jun 23, 2022 1:28 pm

I have try this before and got nothing
but I think my problem is more in the BLE device (setup and config of it )
there is nothing on it - he is just advertising his name
can't connect to it , no data from it (UUID)
and the documents for this device is very POOR
no logic and any good explaining

I will try to search another BLE devie and see if I can make this work

Thanks ,

User avatar
Douglas6
Posts: 5116
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, USA

Re: Control BLE device from pi using python?

Fri Jun 24, 2022 3:04 am

I'm not sure another device would help. Read up on BLE communication. The peripheral needs to have at least one service set up, and be advertising that service. The Pi can then listen for advertisements and ask for a connection. If you're not clear on all that, it's research time.

MiscBits
Posts: 882
Joined: Wed Jan 27, 2021 12:48 pm

Re: Control BLE device from pi using python?

Tue Jun 28, 2022 9:31 am

You may find the 'Bleak' Python library of some use.

It is a GATT handler so you may be able to communicate to it that way...

The page linked above has a simple scan routine that I would start with to see if that works but after that its anyones guess where you go next unless you can give more details of the device.
Old sig removed given the current world situation. Please wish / pray / work for a peaceful world.

Return to “Other projects”