11
nitwhiz
6y

The Raspberry Pi is fun. As long as you not try to connect it via bluetooth to something and read/write serial-ish.

Comments
  • 1
    What happens then?
  • 4
    @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.
  • 2
    @daintycode πŸ˜‚ well, good to know then
  • 1
    @daintycode I thought that was just Linux in general? Haha ☺️
  • 1
    @iKameo pi3 on-board bt module?
    And do you send custom data between them?
  • 1
    @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.(:
  • 1
    @iKameo would you mind sharing the script you use to let the raspi listen/write to a device?
  • 2
    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
  • 3
    @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.
  • 2
    @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
  • 1
    @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.(:
  • 1
    @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 πŸ˜‚
  • 1
    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
  • 2
    @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?
  • 1
    @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
Add Comment