Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


[How To] Using the Satechi Bluetooth remote with moOde 5.4+
#11
I just want to add my "this is seriously cool!" Thank you both!

Have to admit; in my enthusiasm I spent several hours yesterday updating my RPi0W to test the procedure. No luck yet; it seems my Zero has some Bluetooth issues. This is just a theory – of course – I could be doing something wrong. Hope to test the procedure on a RPi3B+ during the week. 

I'm hoping to pair a 5 buttons Chubby Buttons remote, which I suspect can work with Kent's script.
Reply
#12
(07-14-2019, 09:21 PM)Tenbagger Wrote: I just want to add my "this is seriously cool!" Thank you both!

Have to admit; in my enthusiasm I spent several hours yesterday updating my RPi0W to test the procedure. No luck yet; it seems my Zero has some Bluetooth issues. This is just a theory – of course – I could be doing something wrong. Hope to test the procedure on a RPi3B+ during the week. 

I'm hoping to pair a 5 buttons Chubby Buttons remote, which I suspect can work with Kent's script.

Haven't tried on a Pi Zero. I'll see if I get a chance in the next day or so. Right now I'm trying to understand what's going on with the BT Pairing Agent (on an RPi3A). Doesn't seem to be doing all the things I think it should, but maybe I'm the problemSmile

Why do you think your Zero has BT issues? Can it see other devices such as a smart phone? Pair with and connect with them?

Regards,
Kent

Regards,
Kent
Reply
#13
@Tim Curtis

Not having any luck getting the Satechi remote to pair/connect/trust using the Pairing Agent. moOde 5.4b2 running on RPi3A. Tested the Pairing Agent function first by connecting (then disconnecting) my Nexus 6P phone.

Turn on the Satechi (which from its led I infer starts scanning; have also tried explicitly clicking the scan button on the Satechi). The Satechi just sits flashing its led showing it's scanning. A Bluetooth scanner app on my phone shows both it and the moOde player.

The thing is, when using my phone, I still have to choose explicitly to select moOde from the list of available devices and connect to it. There's no comparable action available on this little remote.

If I click "Scan for devices" in Bluez Config, the Satechi shows up in the list of devices. If I then try to pair with it in Bluez Config it disappears from the list.

Regards,
Kent
Reply
#14
How do you pair it using bluetoothctl?

Maybe BlueZ Config can be enhanced.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#15
@Tim Curtis 

[Haven't looked at your Pairing Agent code, but at first blush it doesn't seem to matter in the following if the Agent is on or off.]

In a nutshell: scan, pair, enter PIN, connect, trust.

Code:
pi@moode54b23a:~ $ sudo bluetoothctl
Agent registered
[bluetooth]# scan on
Discovery started
[CHG] Controller B8:27:EB:FB:1A:BE Discovering: yes
[NEW] Device B8:27:EB:41:35:CF MoodeLR Bluetooth
[CHG] Device B8:27:EB:41:35:CF RSSI: -72
[NEW] Device DC:2C:26:01:82:8A Bluetooth Media Control & Camera Shutter Click    ## NOTE 1
[bluetooth]# pair DC:2C:26:01:82:8A
Attempting to pair with DC:2C:26:01:82:8A
[CHG] Device DC:2C:26:01:82:8A Connected: yes
[agent] PIN code: 932042                                                         ## NOTE 2
[CHG] Device DC:2C:26:01:82:8A Modalias: usb:v05ACp023Cd011B
[CHG] Device DC:2C:26:01:82:8A UUIDs: 00001000-0000-1000-8000-00805f9b34fb
[CHG] Device DC:2C:26:01:82:8A UUIDs: 00001124-0000-1000-8000-00805f9b34fb
[CHG] Device DC:2C:26:01:82:8A UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device DC:2C:26:01:82:8A ServicesResolved: yes
[CHG] Device DC:2C:26:01:82:8A Paired: yes
Pairing successful
[CHG] Device DC:2C:26:01:82:8A ServicesResolved: no
[CHG] Device DC:2C:26:01:82:8A Connected: no
[bluetooth]# connect DC:2C:26:01:82:8A
Attempting to connect to DC:2C:26:01:82:8A
[CHG] Device DC:2C:26:01:82:8A Connected: yes
Connection successful
[CHG] Device DC:2C:26:01:82:8A ServicesResolved: yes
[Bluetooth Media Control & Camera Shutter Click]# trust DC:2C:26:01:82:8A
[CHG] Device DC:2C:26:01:82:8A Trusted: yes
Changing DC:2C:26:01:82:8A trust succeeded
[Bluetooth Media Control & Camera Shutter Click]# info DC:2C:26:01:82:8A
Device DC:2C:26:01:82:8A (public)
    Name: Bluetooth Media Control & Camera Shutter Click
    Alias: Bluetooth Media Control & Camera Shutter Click
    Class: 0x00002540
    Icon: input-keyboard
    Paired: yes
    Trusted: yes
    Blocked: no
    Connected: yes
    LegacyPairing: yes
    UUID: Service Discovery Serve.. (00001000-0000-1000-8000-00805f9b34fb)
    UUID: Human Interface Device... (00001124-0000-1000-8000-00805f9b34fb)
    UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
    Modalias: usb:v05ACp023Cd011B
    RSSI: -66
[Bluetooth Media Control & Camera Shutter Click]#                               ## NOTE 3

Notes
  1. Satechi doesn't show up until I click its own scan button
  2. If I entered the wrong PIN (fat fingers!) then CHG reports "connected: off" and bluetoothctl offers a new PIN
  3. from here on, Connected sometimes transitions to "no". I think it relates to the Satechi going to sleep (or being off but doesn't seem to happen synchronously with turning off the Satechi). In any case, the connection is reestablished when the Satechi is waked up with a button press or is turned back on.
After the above actions, moOde's Bluez Config shows "Bluetooth Media Control & Camera Shutter Click" in the list of paired devices and asks if I want to connect or remove, even when bluetoothctl says its connected.

Regards,
Kent
Reply
#16
(07-14-2019, 09:33 PM)TheOldPresbyope Wrote: Why do you think your Zero has BT issues? Can it see other devices such as a smart phone? Pair with and connect with them?
Yes; I can connect and pair with other devices. Chubby Buttons is not visible to Zero, but to my phone and my computer (with a keyboard icon).
Using moOde 5.3.1, a quick test with RPi3B+ suggests it behaves in the same way.
Regards,
Dag
Reply
#17
(07-15-2019, 06:40 PM)Tenbagger Wrote:
(07-14-2019, 09:33 PM)TheOldPresbyope Wrote: Why do you think your Zero has BT issues? Can it see other devices such as a smart phone? Pair with and connect with them?
Yes; I can connect and pair with other devices. Chubby Buttons is not visible to Zero, but to my phone and my computer (with a keyboard icon).
Using moOde 5.3.1, a quick test with RPi3B+ suggests it behaves in the same way.
Regards,
Dag

[Rats, I composed a reply the other day but must have forgotten to post it. Got too distracted by the arrival of an RPi4B, I guess!]

I was asking about your Zero, actually. Does it see other devices and can they see it? 

I just spun up an RPi0W with moOde 54beta2 and enabled Bluetooth. If I put my Satechi Remote into discovery mode then 'Scan for devices' on the RPi0W detects the Satechi Remote and also my other moOde players which have BT enabled. From the Stubby Buttons guide I just read, it looks like you have to press and hold the play/pause button for 5+ seconds to put it in discovery mode. I assume you are doing this.

As I said in my original post, I do not use the moOde UI to set up the connection. I use bluetoothctl.

I'm modifying my code to improve robustness and to try out Linux systemd, but this front-end connection business will stay the same for the time being.

Regards,
Kent
Reply
#18
(07-13-2019, 11:40 PM)Tim Curtis Wrote: Isn't the slow startup due to the remote having to re-connect after coming out of sleep mode? The initial button press is probably lost because it serves only to wake up the remote and reinitiate the BT connection.

For example if my Mac Air is sleeping and I key in my login password the first keypress is lost and just serves to display the login screen. I end up having to reenter my password after the login screen appears.

Hi, Tim.

It looks like you were right.

I contrived an experiment which shows that when I click the Satechi Remote to "wake up the connection" it takes 3+/- seconds (more likely - than +) for the message to appear in syslog showing that udev has done its job. Other experiments suggest that the Python script starts running much less than a second later whether from udev I call my helper script or use the systemd machinery I've contrived since.

it's annoying because with a 3 second delay a user is likely to keep clicking impatiently. Even I do Tongue

It works fine once awake.

I'm going to move this to a github repro so modifications will be easier to track.

Regards,
Kent

Post edit: appears to be closer to 2 seconds, but still...
Reply
#19
Thats no prob. I'd guess that many remotes that automatically sleep to conserve battery will eat the initial keypress that causes them to wake up.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#20
(07-17-2019, 03:05 PM)TheOldPresbyope Wrote: I was asking about your Zero, actually. Does it see other devices and can they see it? 

Yes, but it cannot see all devices: My Zero can see iPhone and MacBook Air, but not Polar watch and Chubby buttons.

When I install Buster Lite on the Zero; it can see all, and it can pair with Chubby Buttons. 


Regards,
Dag
Reply


Forum Jump: