Home of the Squeezebox™ & Transporter® network music players.
Page 87 of 89 FirstFirst ... 37778586878889 LastLast
Results 861 to 870 of 881
  1. #861
    Quote Originally Posted by paul- View Post
    That's why I mentioned to go through the speaker setup, as it sets up the automatic starting of bluetooth and also setup persistence of paired devices.
    Ah, I see. Sorry, had misunderstood you there. I'll give that a go.

  2. #862
    Okay, I tried that and could indeed pair the remote and even select it as a speaker. Bluetooth persisted through a reboot but knowledge of the remote apparently didn't. As soon as I set the audio output to something other than Bluetooth, Bluetooth persistence was gone again.

  3. #863
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    1,770
    Yes, once you change the audio, the audio start script does not run. Add this to Custom User commands.

    "/usr/local/etc/init.d/pcp-bt boot"
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  4. #864
    Great, that worked like a charm! Bluetooth is active on boot, the remote is known (I was probably mistaken there in my earlier post – I tried so many things I have them somewhat confused) and connects as soon as a key is pressed.

    Now where do I take it from here? The remote turns up as /dev/input/event0. Should I try to get it running via lirc somehow or would you rather recommend writing a small script that polls the device and controls pCP via the CLI? How would I permanently store such a script on pCP?

    Update: Figured the last one out myself: "pcp backup" apparently saves everything in the home directory. I hacked together a quick shell script that seems to work okay. I'll try adding that to the user startup commands and expect I'll be done then. Might not be the cleanest solution but as long as it works I'm happy. Should give me remote control capability without a need for line of sight.

    One suggestion: Would it maybe make sense to permanently activate Bluetooth whenever built-in Bluetooth is enabled on the Wifi settings tab? I don't see any case where the latter would make much sense without the former...
    Last edited by Manul; 2019-05-14 at 15:17.

  5. #865
    Next update: I managed to get my script to start and stop on connection/disconnection of the remote via udev rules. The only problem I have now is that pcp-bt-connect-daemon somehow interferes: While that is running the udev rule seems to spawn my script multiple times instead of just once which leads to erratic behaviour.

    Any hint on how to get rid of the connect-daemon? I tried deleting /usr/local/etc/pcp/pcp-bt.conf but the daemon starts anyway. I could kill it with another user startup command of course but I'd prefer a somewhat more elegant solution.

  6. #866
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    1,770
    Quote Originally Posted by Manul View Post
    Next update: I managed to get my script to start and stop on connection/disconnection of the remote via udev rules. The only problem I have now is that pcp-bt-connect-daemon somehow interferes: While that is running the udev rule seems to spawn my script multiple times instead of just once which leads to erratic behaviour.

    Any hint on how to get rid of the connect-daemon? I tried deleting /usr/local/etc/pcp/pcp-bt.conf but the daemon starts anyway. I could kill it with another user startup command of course but I'd prefer a somewhat more elegant solution.
    I would make a copy of the script that you are launching and edit that out so it doesn't start.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  7. #867
    Thank you for the suggestion, that's of course an option. I think it would be more elegant if the pcp-bt init script supported an extra argument "init" that would just call it's init function without actually starting the connect daemon. That way, I could stay closer to the original pCP. Would adding such an option be an option for you?

    Forget what I wrote, turns out it's not pcp-bt-connect-daemon but a badly written udev rule that doesn't work correctly when the remote first connects. I'll have to revisit that.

    I still think it would make sense if the connect daemon did not start when there's no speaker to connect to but that's another thing.

    BTW, I noticed the following two lines in pcp-bt-connect-daemon:

    Code:
    [ -f $BTDEVICECONF ] || (echo "Need to pair device. \n Please run pcp-bt-pair"  >> $BT_LOG; exit 1 )
    
    [ "$BTDEVICE" = "" -a "$BTDELAY" = "" ] && (echo "Need to pair device. \n Please run pcp-bt-pair" >> $BT_LOG; exit 1 )
    On first sight I thought these would prevent the daemon from starting if no BT configuration was found but then I noticed the exit statement was inside a subshell so it does not have that effect. Is that on purpose? If so, could you explain what it's meant to achieve?
    Last edited by Manul; 2019-05-16 at 11:10.

  8. #868
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    1,770
    Yes, the exit doesn't do anything, likely a cut and paste from development files. It was not intended to kill the daemon. (I don't think)

    Make a local copy of the init.d script and then just call that.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  9. #869
    Quote Originally Posted by paul- View Post
    Yes, the exit doesn't do anything, likely a cut and paste from development files. It was not intended to kill the daemon. (I don't think)
    So what is the purpose of running the connect daemon if it doesn't have anything to connect to? I fail to see how that would make sense.

    Quote Originally Posted by paul- View Post
    Make a local copy of the init.d script and then just call that.
    That's what I'm doing now though I might be going back to just calling the original script since the daemon, while I don't need it, probably doesn't hurt me either.

    On a completely different note: Have you ever thought about setting up a Wiki for pCP? That could be a good central collection point for user contributed documentation. I'd like to document the BT remote setup once it's confirmed working and I'm happy with it but I think forum threads with hundreds of pages and thousands of messages are not the optimal place for that. What do you think?

  10. #870
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    1,770
    Quote Originally Posted by Manul View Post
    So what is the purpose of running the connect daemon if it doesn't have anything to connect to? I fail to see how that would make sense.
    Because I never tried or worried about doing what you are trying to do, so it never got in the way.

    On a completely different note: Have you ever thought about setting up a Wiki for pCP? That could be a good central collection point for user contributed documentation. I'd like to document the BT remote setup once it's confirmed working and I'm happy with it but I think forum threads with hundreds of pages and thousands of messages are not the optimal place for that. What do you think?
    We have help pages on our site, but we lack content creators. Some have written help pages and we happily add them.
    Last edited by paul-; 2019-05-17 at 09:52.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •