![]() |
Activate Bluetooth via button - Printable Version +- Moode Forum (https://moodeaudio.org/forum) +-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3) +--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7) +--- Thread: Activate Bluetooth via button (/showthread.php?tid=5010) |
Activate Bluetooth via button - psychofaktory - 08-09-2022 I wonder if it would be possible to activate the Bluetooth via a button via GPIO and how to do it. RE: Activate Bluetooth via button - Tim Curtis - 08-09-2022 What do you mean by "activate" Bluetooth? Once you turn it on in Audio Config it remains running int the background waiting for incoming connections. RE: Activate Bluetooth via button - psychofaktory - 08-09-2022 (08-09-2022, 05:49 PM)Tim Curtis Wrote: What do you mean by "activate" Bluetooth? That is correct, but then I would have to go to the web configuration and do a manual scan in the BlueZ configuration for pairing. Since I run Moode exclusively headless via UPnP would be something incompfortable. I am aware that I can enable the pairing agent to work around this. But then anyone in the vicinity can connect to Moode via Bluetooth (unauthorized) and take control. In both cases, devices once paired with Bluetooth would also remain connected to Moode in the future and could always reconnect. Currently, only people who are on the (wifi) network can control Moode. This prevents unauthorized control. However, sometimes someone else (who does not have access to the network) wants to connect to Moode via Bluetooth. In this case, I would like to allow the connection via Bluetooth temporarily. Since, as I said, it is a headless operation, a button that temporarily activates Bluetooth, or the Bluetooth renderer, could be an elegant solution. RE: Activate Bluetooth via button - Tim Curtis - 08-09-2022 The challenge with this is that Bluetooth range is so limited that the "vicinity" you are referring to is basically "in the same room". You would be standing next to person that wanted to connect. You could prolly create a script that starts/stops the pairing agent, clears all the pairings, etc and specify that for some GPIO buttons. Something like that. Code: # Start/stop pairing agent RE: Activate Bluetooth via button - psychofaktory - 08-09-2022 (08-09-2022, 07:23 PM)Tim Curtis Wrote: The challenge with this is that Bluetooth range is so limited that the "vicinity" you are referring to is basically "in the same room". You would be standing next to person that wanted to connect. Indeed, I use Moode a lot over a home-built music system at parties. Here, potentially a whole bunch of people would be close enough to the system to connect and "take over" the music via bluetooth. (08-09-2022, 07:23 PM)Tim Curtis Wrote: You could prolly create a script that starts/stops the pairing agent, clears all the pairings, etc and specify that for some GPIO buttons. Something like that. Would it also be possible to enable/disable Bluetooth, or at least the Bluetooth renderer via a script? RE: Activate Bluetooth via button - Tim Curtis - 08-09-2022 You would prolly need to create a new PHP script modeled after /var/www/util/restart-renderers.php. The new script would only have functions for starting and stopping Bluetooth. When stopping Bluetooth the last command needs to be like below so MPD/ALSA volume level is restored otherwise ALSA volume will be left at 0dB :-0 sysCmd('/var/www/vol.sh -restore'); Wouldn't it be easier to just bring up the Web UI on your Phone and turn Bluetooth On/Off? You can save the Audio Config page as a bookmark to reduce navigation. RE: Activate Bluetooth via button - psychofaktory - 08-10-2022 (08-09-2022, 09:01 PM)Tim Curtis Wrote: Wouldn't it be easier to just bring up the Web UI on your Phone and turn Bluetooth On/Off? You can save the Audio Config page as a bookmark to reduce navigation. You're probably right. Only often I myself am not on site when music is heard over the system to activate Bluetooth via the Webgui. The people who control the music are all not very tech-savvy and only know how to control via BubbleUPnP. Therefore, I thought a physical button on the system would be more ergonomic. |