Home of the Squeezebox™ & Transporter® network music players.
Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 29
  1. #11
    Senior Member
    Join Date
    Apr 2005
    Location
    Watford, UK
    Posts
    1,927
    Quote Originally Posted by Jeff07971 View Post
    Apart from setting the GPIO and the Active State (High or Low) in the Web settings page nothing else needs to be done.

    I use GPIO13 as its right next to 0v and I know its not used by my Hifiberry Hat

    Jeff
    OK, thanks.
    I've done exactly what you suggest and GPIO 13 (pin #33) stays obstinately on 3.25V whether the player is on or off.
    Have I done something stupid?

    Name:  gpio.png
Views: 102
Size:  13.2 KB
    Transporter -> ATC SCM100A

  2. #12
    Senior Member Jeff07971's Avatar
    Join Date
    Aug 2011
    Location
    London, England
    Posts
    1,590
    Quote Originally Posted by cliveb View Post
    OK, thanks.
    I've done exactly what you suggest and GPIO 13 (pin #33) stays obstinately on 3.25V whether the player is on or off.
    Have I done something stupid?
    I Doubt it its fairly foolproof !

    I don't have any Pi4's as players, I'll burn a card and test on a Pi4

    Jeff

    Want a webapp ? Get SqueezeLite-X ! https://forums.slimdevices.com/showt...l=1#post903953

  3. #13
    Senior Member
    Join Date
    Apr 2005
    Location
    Watford, UK
    Posts
    1,927
    Quote Originally Posted by Jeff07971 View Post
    I Doubt it its fairly foolproof !

    I don't have any Pi4's as players, I'll burn a card and test on a Pi4

    Jeff
    I've just tried on a Pi2 with the same results: GPIO 13 remains high at all times.
    I must be missing something that's glaringly obvious.
    Transporter -> ATC SCM100A

  4. #14
    Senior Member Jeff07971's Avatar
    Join Date
    Aug 2011
    Location
    London, England
    Posts
    1,590
    Quote Originally Posted by cliveb View Post
    I've just tried on a Pi2 with the same results: GPIO 13 remains high at all times.
    I must be missing something that's glaringly obvious.
    Just tried it on my Pi4 works and toggles fine, what meter are you using ?

    Name:  20-12-23 13-32-05 2276.jpg
Views: 91
Size:  121.2 KB

    Want a webapp ? Get SqueezeLite-X ! https://forums.slimdevices.com/showt...l=1#post903953

  5. #15
    Senior Member
    Join Date
    Apr 2005
    Location
    Watford, UK
    Posts
    1,927
    Quote Originally Posted by Jeff07971 View Post
    Just tried it on my Pi4 works and toggles fine, what meter are you using ?

    Name:  20-12-23 13-32-05 2276.jpg
Views: 91
Size:  121.2 KB
    This one:

    Name:  meter.jpg
Views: 85
Size:  24.1 KB

    Stays at 3.27V at all times. (3.25V on the Pi4 I was trying before).
    Transporter -> ATC SCM100A

  6. #16
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    3,934
    How many players do you have on your LMS, are you sure you are selecting the correct player when toggling power?

    There are 2 command line tools provided with pcp.

    pcp-gpio (which will let you do simple things like toggle and output or read an input.)
    readall.sh (This is a simple shell script that reads the current state of the gpio)

    So start with "sudo readall.sh" and make sure GPIO 13 is an output and the software side is toggling with squeezelite. If this tool shows the output toggling, then you fried your board. If it is not toggleing, then something is setup wrong on the squeezelite/lms side. But use pcp-gpio command to toggle your output.

    Code:
    tc@pCP7-Test:/usr/local/bin$ sudo readall.sh
    +-----+---------+------+---+-----++-----+---+------+---------+-----+
    | BCM |  NAME   | MODE | V |  Physical  | V | MODE |  NAME   | BCM |
    +-----+---------+------+---+-----++-----+---+------+---------+-----+
    |     |    3.3v |      |   |   1 ||  2  |   |      |      5v |     |
    |  2  | GPIO  2 | ALT0 | 1 |   3 ||  4  |   |      |      5v |     |
    |  3  | GPIO  3 | ALT0 | 1 |   5 ||  6  |   |      |      0v |     |
    |  4  | GPIO  4 |   IN | 1 |   7 ||   8 | 0 |   IN | GPIO 14 |  14 |
    |     |      0v |      |   |   9 ||  10 | 1 |   IN | GPIO 15 |  15 |
    | 17  | GPIO 17 |   IN | 0 |  11 ||  12 | 0 | ALT0 | GPIO 18 |  18 |
    | 27  | GPIO 27 |   IN | 0 |  13 ||  14 |   |      |      0v |     |
    | 22  | GPIO 22 |   IN | 0 |  15 ||  16 | 0 |   IN | GPIO 23 |  23 |
    |     |    3.3v |      |   |  17 ||  18 | 0 |   IN | GPIO 24 |  24 |
    | 10  | GPIO 10 | ALT0 | 0 |  19 ||  20 |   |      |      0v |     |
    |  9  | GPIO  9 | ALT0 | 0 |  21 ||  22 | 0 |   IN | GPIO 25 |  25 |
    | 11  | GPIO 11 | ALT0 | 0 |  23 ||  24 | 1 |  OUT | GPIO  8 |   8 |
    |     |      0v |      |   |  25 ||  26 | 1 |  OUT | GPIO  7 |   7 |
    |  0  | GPIO  0 |   IN | 1 |  27 ||  28 | 1 |   IN | GPIO  1 |   1 |
    |  5  | GPIO  5 |   IN | 1 |  29 ||  30 |   |      |      0v |     |
    |  6  | GPIO  6 |   IN | 1 |  31 ||  32 | 0 |   IN | GPIO 12 |  12 |
    | 13  | GPIO 13 |  OUT | 0 |  33 ||  34 |   |      |      0v |     |
    | 19  | GPIO 19 | ALT0 | 0 |  35 ||  36 | 0 |   IN | GPIO 16 |  16 |
    | 26  | GPIO 26 |   IN | 0 |  37 ||  38 | 0 | ALT0 | GPIO 20 |  20 |
    |     |      0v |      |   |  39 ||  40 | 0 | ALT0 | GPIO 21 |  21 |
    +-----+---------+------+---+-----++-----+---+------+---------+-----+
    | BCM |  NAME   | MODE | V |  Physical  | V | MODE |  NAME   | BCM |
    +-----+---------+------+---+-----++-----+---+------+---------+-----+
    tc@pCP7-Test:/usr/local/bin$ sudo pcp-gpio toggle 13
    tc@pCP7-Test:/usr/local/bin$ sudo readall.sh
    +-----+---------+------+---+-----++-----+---+------+---------+-----+
    | BCM |  NAME   | MODE | V |  Physical  | V | MODE |  NAME   | BCM |
    +-----+---------+------+---+-----++-----+---+------+---------+-----+
    |     |    3.3v |      |   |   1 ||  2  |   |      |      5v |     |
    |  2  | GPIO  2 | ALT0 | 1 |   3 ||  4  |   |      |      5v |     |
    |  3  | GPIO  3 | ALT0 | 1 |   5 ||  6  |   |      |      0v |     |
    |  4  | GPIO  4 |   IN | 1 |   7 ||   8 | 0 |   IN | GPIO 14 |  14 |
    |     |      0v |      |   |   9 ||  10 | 1 |   IN | GPIO 15 |  15 |
    | 17  | GPIO 17 |   IN | 0 |  11 ||  12 | 0 | ALT0 | GPIO 18 |  18 |
    | 27  | GPIO 27 |   IN | 0 |  13 ||  14 |   |      |      0v |     |
    | 22  | GPIO 22 |   IN | 0 |  15 ||  16 | 0 |   IN | GPIO 23 |  23 |
    |     |    3.3v |      |   |  17 ||  18 | 0 |   IN | GPIO 24 |  24 |
    | 10  | GPIO 10 | ALT0 | 0 |  19 ||  20 |   |      |      0v |     |
    |  9  | GPIO  9 | ALT0 | 0 |  21 ||  22 | 0 |   IN | GPIO 25 |  25 |
    | 11  | GPIO 11 | ALT0 | 0 |  23 ||  24 | 1 |  OUT | GPIO  8 |   8 |
    |     |      0v |      |   |  25 ||  26 | 1 |  OUT | GPIO  7 |   7 |
    |  0  | GPIO  0 |   IN | 1 |  27 ||  28 | 1 |   IN | GPIO  1 |   1 |
    |  5  | GPIO  5 |   IN | 1 |  29 ||  30 |   |      |      0v |     |
    |  6  | GPIO  6 |   IN | 1 |  31 ||  32 | 0 |   IN | GPIO 12 |  12 |
    | 13  | GPIO 13 |  OUT | 1 |  33 ||  34 |   |      |      0v |     |
    | 19  | GPIO 19 | ALT0 | 0 |  35 ||  36 | 0 |   IN | GPIO 16 |  16 |
    | 26  | GPIO 26 |   IN | 0 |  37 ||  38 | 0 | ALT0 | GPIO 20 |  20 |
    |     |      0v |      |   |  39 ||  40 | 0 | ALT0 | GPIO 21 |  21 |
    +-----+---------+------+---+-----++-----+---+------+---------+-----+
    | BCM |  NAME   | MODE | V |  Physical  | V | MODE |  NAME   | BCM |
    +-----+---------+------+---+-----++-----+---+------+---------+-----+
    tc@pCP7-Test:/usr/local/bin$ sudo pcp-gpio toggle 13
    tc@pCP7-Test:/usr/local/bin$ sudo readall.sh
    +-----+---------+------+---+-----++-----+---+------+---------+-----+
    | BCM |  NAME   | MODE | V |  Physical  | V | MODE |  NAME   | BCM |
    +-----+---------+------+---+-----++-----+---+------+---------+-----+
    |     |    3.3v |      |   |   1 ||  2  |   |      |      5v |     |
    |  2  | GPIO  2 | ALT0 | 1 |   3 ||  4  |   |      |      5v |     |
    |  3  | GPIO  3 | ALT0 | 1 |   5 ||  6  |   |      |      0v |     |
    |  4  | GPIO  4 |   IN | 1 |   7 ||   8 | 0 |   IN | GPIO 14 |  14 |
    |     |      0v |      |   |   9 ||  10 | 1 |   IN | GPIO 15 |  15 |
    | 17  | GPIO 17 |   IN | 0 |  11 ||  12 | 0 | ALT0 | GPIO 18 |  18 |
    | 27  | GPIO 27 |   IN | 0 |  13 ||  14 |   |      |      0v |     |
    | 22  | GPIO 22 |   IN | 0 |  15 ||  16 | 0 |   IN | GPIO 23 |  23 |
    |     |    3.3v |      |   |  17 ||  18 | 0 |   IN | GPIO 24 |  24 |
    | 10  | GPIO 10 | ALT0 | 0 |  19 ||  20 |   |      |      0v |     |
    |  9  | GPIO  9 | ALT0 | 0 |  21 ||  22 | 0 |   IN | GPIO 25 |  25 |
    | 11  | GPIO 11 | ALT0 | 0 |  23 ||  24 | 1 |  OUT | GPIO  8 |   8 |
    |     |      0v |      |   |  25 ||  26 | 1 |  OUT | GPIO  7 |   7 |
    |  0  | GPIO  0 |   IN | 1 |  27 ||  28 | 1 |   IN | GPIO  1 |   1 |
    |  5  | GPIO  5 |   IN | 1 |  29 ||  30 |   |      |      0v |     |
    |  6  | GPIO  6 |   IN | 1 |  31 ||  32 | 0 |   IN | GPIO 12 |  12 |
    | 13  | GPIO 13 |  OUT | 0 |  33 ||  34 |   |      |      0v |     |
    | 19  | GPIO 19 | ALT0 | 0 |  35 ||  36 | 0 |   IN | GPIO 16 |  16 |
    | 26  | GPIO 26 |   IN | 0 |  37 ||  38 | 0 | ALT0 | GPIO 20 |  20 |
    |     |      0v |      |   |  39 ||  40 | 0 | ALT0 | GPIO 21 |  21 |
    +-----+---------+------+---+-----++-----+---+------+---------+-----+
    | BCM |  NAME   | MODE | V |  Physical  | V | MODE |  NAME   | BCM |
    +-----+---------+------+---+-----++-----+---+------+---------+-----+
    tc@pCP7-Test:/usr/local/bin$
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  7. #17
    Senior Member Jeff07971's Avatar
    Join Date
    Aug 2011
    Location
    London, England
    Posts
    1,590
    Quote Originally Posted by cliveb View Post
    This one:

    Stays at 3.27V at all times. (3.25V on the Pi4 I was trying before).
    Its OK I thought that the pin might not be actively driven low, I tried with my DMM and verified that it actaully is.

    @Paul- Another command to be added to the "toolbox" !

    @Cliveb What server are you using ?

    Jeff

    Want a webapp ? Get SqueezeLite-X ! https://forums.slimdevices.com/showt...l=1#post903953

  8. #18
    Senior Member
    Join Date
    Apr 2005
    Location
    Watford, UK
    Posts
    1,927
    OK, there are some developments...

    First of all, when browsing around I discovered this on the Tweaks page:

    Attachment 32642
    I wondered if this had anything to do with things, so I tried activating the gpio-poweroff tweak (setting the pin to 13) and rebooted. But it didn't seem to do anything.
    I deactivated it, rebooted, and then to my surprise the Squeezelite power on/off started working (when switching the player on/off via the LMS web interface).

    Q: Does activating the gpio-poweroff tweak cause something to get switched on in the Pi hardware?

    This was all using the Pi2.

    So I returned to the Pi4 only to discover that the same sequence of events did NOT cause the power on/off to start working.

    OK, so now on to Paul's suggestion:
    Quote Originally Posted by paul- View Post
    How many players do you have on your LMS, are you sure you are selecting the correct player when toggling power?

    There are 2 command line tools provided with pcp.

    pcp-gpio (which will let you do simple things like toggle and output or read an input.)
    readall.sh (This is a simple shell script that reads the current state of the gpio)
    Yes, I am sure it's the correct player. It's the only one called "picoreplayer" in LMS :-)

    I played around with pcp-gpio & readall.sh, and confirmed that the pins are behaving as they should:
    readall confirmed that GPIO was in OUT mode
    "pcp-gpio write 13 1" sets GPIO13 to 3.25V, and "pcp-gpio write 13 0" sets it to 0V.
    This was verified by both the output from readall, and using my multimeter to check the voltage.
    But turning the player on & off in the LMS web interface didn't change GPIO13.
    The voltage shown on the multimeter stayed the same, and the V column in the readall output didn't change.
    This was on the Pi4.

    Thinking I might have imagined it working on the Pi2, I returned to that and sure enough the Squeezelite power on/off IS working when the payer is switched in the LMS web interface. (And just to verify things, it also worked when turning the player on & off using the Squeezer app on my phone).

    So it's all a bit perplexing.

    Responding to Jeff:
    Quote Originally Posted by Jeff07971 View Post
    @Cliveb What server are you using ?
    LMS 7.9.2, running in another piCorePlayer on a RPi3 in the loft.
    Transporter -> ATC SCM100A

  9. #19
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    3,934
    Turning the gpio-poweroff on then off would put things back in the default state. There is nothing special that needs to be done. However if two drivers are trying to claim the same GPIO, then things are unpredictable.

    You've mentioned a pi2 and a pi4, I really think you've been swapping things around, and getting a wrong IP address. Check the information page on the LMS settings interface, it will list all known players connected (or those recently connected) and their ip adresses. Do you see more than one called piCorePlayer?

    Oh, and if you are using internet streaming services, you really need to upgrade your LMS server. If you are just using local music, then 7.9.2 is fine.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  10. #20
    Senior Member
    Join Date
    Apr 2005
    Location
    Watford, UK
    Posts
    1,927
    Quote Originally Posted by paul- View Post
    Turning the gpio-poweroff on then off would put things back in the default state. There is nothing special that needs to be done. However if two drivers are trying to claim the same GPIO, then things are unpredictable.
    OK, thanks.

    Q: is the gpio-poweroff option another way of achieving the same thing as the Squeezelite power on/off setting?
    (The options states "Refer to /mnt/mmcblk0p1/overlays/README", but that file doesn't exist).

    Quote Originally Posted by paul- View Post
    You've mentioned a pi2 and a pi4, I really think you've been swapping things around, and getting a wrong IP address.
    No, I absolutely haven't been getting them mixed up. They were never powered up at the same time. I know the IP addresses I used were correct.


    Quote Originally Posted by paul- View Post
    Check the information page on the LMS settings interface, it will list all known players connected (or those recently connected) and their ip adresses. Do you see more than one called piCorePlayer?
    As far as I can see, my LMS (7.9.2) only lists the players currently connected. Perhaps recently connected ones are shown in later versions of LMS?

    Quote Originally Posted by paul- View Post
    Oh, and if you are using internet streaming services, you really need to upgrade your LMS server. If you are just using local music, then 7.9.2 is fine.
    I only use local music.
    Mind you, I did wonder if the fact that LMS is running on version 4.1.0 of piCorePlayer, but the players I'm testing are running version 6.1.0, might be a factor.
    But that wouldn't explain why the Pi2 started working and the Pi4 still won't.
    And I still don't understand why the Pi2 started working when it had previously not been.

    But if you are confident that updating LMS would solve this problem, I'll give it a go.

    I know it sounds suspicious, but I am 100% certain that I haven't been getting any IP addresses wrong.
    I just restarted the Pi4, it appears in LMS with an IP address of 192.168.0.107, and when I ssh to that address and play with pcp-gpio, the pins work as expected.
    But they don't respond to switching the player on & off from LMS.

    I even went to the extent of re-writing the SD card with a fresh piCorePlayer image and starting again from scratch, just in case something had become corrupted. But it still doesn't work.
    Transporter -> ATC SCM100A

Posting Permissions

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