Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@jakobev you enter a hell of no helping google search results, systemd's you don't understand, reboots and random disconnects.
Right after you tried 5 different bluetooth terminal apps for android because they are all weird.:D
BUT, somehow, you get it to work. And then everything's fine again. -
@iKameo kudos to you.:D
I don't like that the devices need to be paired via bluetoothctl or stuff like that. I wanted it to be a server, being able to be found and connected to from every device.
But I've worked it out for me.(: -
@iKameo would you mind sharing the script you use to let the raspi listen/write to a device?
-
Bluetooth is pretty defunct when it comes to IOT implementations. I recommend using a wifi based protocol like MQTT.
Adafruit.io is a good place to start, there's even a handy dandy library for it -
@tehdoctor wireless is no option, the device is a blackbox, no display, nothing. And it's not in the same network all the time, either.
The idea is to send ssid and psk over via Bluetooth and receive it's ip like this after connecting to provided wifi. -
@daintycode you could always make the pi into a hotspot that ask for wifi credentials. I havent done something like this on a pi, only an Arduino. But https://github.com/jasbur/RaspiWiFi looks like a good place to start
-
@tehdoctor thats actually an option. But i thought it's more comfortable to turn on bt for a while and turn it off again instead of switching networks around.
If anyone wants to know - i got shit settled now.:D
Nodejs, a few packages for serial communication and weird ps-tree hacks to see if rfcomm has any connection later i can talk to my raspi using my smartphone and vice versa.π
@iKameo still interested in how you did it tho.(: -
@iKameo i didn't do better at first.
I fucking read the stdout (ran by stdbuf -o0 so this is even possible) of rfcomm and as soon as "Connected to xx:xx:xx..." was there i went on with cat /dev/rfcomm0 to read and echo "shit" > /dev/... to write π -
Little update on that stuff:
You won't be able to use another raspi with the same card after pairing. It seems like hell breaks loose because the pairing was done with a different bt-mac as host. What do I know.
tl;dr: this is still shit :D -
@tehdoctor I just read into MQTT a bit. Both devices need to be connected to some kind of network over which they establish the connection, did I get this right?
Because the pi won't be connected to anything when the protocol is needed, so mqtt won't be an option, did I get this right? -
@daintycode yeah MQTT is a connection based protocol. Albeit very easy and with many free services available (cloudmqtt and adafruit.io are good places to start)
However if you don't have an open network connection when you need it, then MQTT goes on the back burner for another project.
There are even some ifttt tie ins with adafruit.io. For example when I tell Google assistant "replica on" it enables this facial tracking sentry gun I made through mqtt
Related Rants
-
nitwhiz29I've made a thing and I'm proud of it.:D
-
CogInTheWheel12Waiting for a bus. And there is a 14 year old smoking and looking after 3 10 year olds. She then gets them to ...
-
kb888Google Assistant Python SDK has been published ten days ago. Just in time, I've integrated it in AlexaPi, so n...
The Raspberry Pi is fun. As long as you not try to connect it via bluetooth to something and read/write serial-ish.
rant
bluetooth
raspberry
/dev/rfcomm0