Code Monkey home page Code Monkey logo

Comments (6)

BaReinhard avatar BaReinhard commented on May 28, 2024

If you use the same phone each time you should be able to follow the instructions here:

https://raspberrypi.stackexchange.com/questions/44520/bluetooth-autoconnect-on-reboot-car-setup-with-scripts

I haven't actually used this in practice, but came up with the idea a while ago. It may need some playing around with the existing files, but should be relatively straight forward.

from super-simple-raspberry-pi-audio-receiver-install.

Jitblass avatar Jitblass commented on May 28, 2024

Thanks, Brett!

My end goal to support multiple phones/devices, but I'll start here. I suppose to achieve such a longterm goal I would need to write the mac address for the most recent device in attempt to autoconnect (of course.... I wonder if that means read only is not an option anymore....)

JT

from super-simple-raspberry-pi-audio-receiver-install.

BaReinhard avatar BaReinhard commented on May 28, 2024

from super-simple-raspberry-pi-audio-receiver-install.

Jitblass avatar Jitblass commented on May 28, 2024

Okay.... one more...

I added to the file at "/etc/rc.local" the following line (I added it both before and after "exit 0" with the same results:

echo "connect AA:BB:CC:DD:EE:FF \nquit" | bluetoothctl

where AA:BB:CC:DD:EE:FF is the address for my iphone. I rebooted... and nothing changes. I have to still manually connect each time as I did before inputting the code. Anything I'm missing here?

Thanks!

JT

from super-simple-raspberry-pi-audio-receiver-install.

Hacksore avatar Hacksore commented on May 28, 2024

@Jitblass try putting the -e flag when you invoke echo.

echo -e "connect <mac> \nquit | bluetoothctl

This is because we need to pass an escape sequence "\n" so you need to pass the -e flag. Otherwise, bluetoothctl is interpreting connect <mac> quit as one command, which we know is not valid.

from super-simple-raspberry-pi-audio-receiver-install.

BaReinhard avatar BaReinhard commented on May 28, 2024

I’ve been thinking about this more, you could place a line in /usr/local/bin/bluez-udev to check if the bluetooth mac is in a file already, if not add it. Then have a script to poll for nearby devices and check said file for MAC address, if it’s available then connect. However, I think this would be a better topic on the rpi forum or other related forums. I doubt many interested parties will find this here. I’ll keep updating back if I find anything suitable on the subject, but for now I will be closing this issue.

from super-simple-raspberry-pi-audio-receiver-install.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.