Bluetooth support for Raspberry Pi Zero W


#1

Hi,

Please forgive me if this question is a bit incoherent, I’m a bit of an IoT/Particle/Raspberry Pi noob.

I’ve got my Raspberry Pi Zero W working well with Particle, including some i2c stuff. So far, so good.

Next, I want to port over some bluetooth code I had running in Python, but I was working at such a high abstraction in Python that I’m not sure if/how bluetooth might be supported via Particle.

In a nutshell, what I’d like to do is port this library, that supports controlling BLE outlet, over to particle: https://github.com/bernieplug/plugable-btaps/blob/master/btaps/libbtaps.py

Suggestions on where I should start? Is there a low level bluetooth library already ported to particle that will work with my Raspberry Pi Zero W?

Thanks in advance for any pointers


#2

So, it appears the simple way to handle this is to create an rfcomm channel and then open it like a serial port. However, from what I’ve read and seen Serial1/2/3/4 doesn’t actually work on the Raspberry Pi. I also read that a work around would be to drop down to wiringSerial, but I can’t seem to include that from the web IDE.

Any suggestions?


#3

For now, as a workaround, I’ve just hacked it further to directly open /dev/rfcomm :frowning:


#4

I’d be interested in seeing your hack. Can you share how you did this?


#5

I just googled on how to use rfcomm and then with some trial and error I made it work by just reading/writing to an rfcomm device. I no longer have the code, because in the end I decided to just ditch the bluetooth stuff - it was slow and not super reliable. Instead, I just use a relay wired directly to my pi.