GPIO access

Support Forum VoltaStream ZERO GPIO access

This topic contains 10 replies, has 2 voices, and was last updated by  marcelveldt 7 months, 1 week ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1424

    marcelveldt
    Participant

    Hi Philip,

    I’d like to access the GPIO pins from within python.
    Can I use the standard gpio package for the pi on the Voltastream or does it need to be adapted.

    On a side note I already tried accessing the GPIO pins by command line commands but I couldn’t get any results.
    Basically what I want is to control one or more relays connected to the gpio pins and a rotary encoder (to control volume).

    I already created the python code for my raspberry pi’s and now I’d like to port it for the Voltastream but I get a bit lost in the documentation about the gpio pins/naming.

    Regards,

    Marcel

    #1426

    VoltaStream
    Keymaster

    Hi Marcel,

    first thing you’d need to do is to modify the kernel device-tree to add new GPIO’s.
    Except for I2C everything on the GPIO connector isn’t enabled by default.

    If there would be a proper way of integrating local volume control with a rotary encoder, I would already ship everything configured for that.
    The problem is that all integrated streaming clients have only one-way volume control. That means if you change it locally the remote source won’t be notified of this. Next time you change the volume from remote it will jump back to the previous level. Unfortunately I can’t do anything about this as it’s a limitation of several streaming-client open-source projects.

    Nevertheless if you’d like to continue, install a VM and set it up for cross-compiling. Clone the voltastream kernel and add the GPIO’s you’d like to use to the imx6ull-voltastream0.dts file. Compile just the device-tree files and copy the new imx6ull-voltastream0.dtb over to your SD card.

    Alternatively I can prepare that for you and ship a new DT for the scenario with the next kernel update. How many GPIO’s do you need?

    All the best,
    Philip.

    #1431

    marcelveldt
    Participant

    Hi Philip,

    The rotary encoder stuff is something I already have working on other boards.
    In case of hardware volume control I change volume with alsamixer, otherwise I just talk to the api of my music software (Roon).
    I can confirm that this method also works with the Voltastream (tested on the command line).

    It would be great if the gpio pins are accessible just like with the Pi, i2c would also be really great if you want to hook up an LCD.

    #1432

    marcelveldt
    Participant

    Hi Philip,

    Is it also possible to just create a devicetree overlay to enable the gpio pins ?
    In that case, it might even be possible to compile the dts file to dtbo from the commandline opn the Voltastream itself.

    I just need access to the common GPIO pins, comparable to how this is setup with raspberry Pi’s and Orangepi’s and such.
    If you can get me the devicetree overlay to enable the hardware, I can create ports of the python libraries for gpio access.

    If you don’t have time to create the overlay / device-tree, can you please write down a few steps how I can do it myself on a VM or from the commandline ?

    #1445

    marcelveldt
    Participant

    @Philip.

    Any quick hints for me how to proceed with adjusting the devicetree file ?
    I’m looking at that dts file right now looks a lot like abacadabra to me 🙂

    I just like to add a few gpio pins so I can toggle a relay or read a button (or rotary encoder). Being able to enable internal pullup would be great but not really needed.
    I can adjust the python gpio library myself but first I need to be able to address the pins.

    Looking at the devicetree file, it appears that pins 0 – 4 are already defined, is that correct ? If so, which pins on the gpio connector are those ?

    #1446

    VoltaStream
    Keymaster

    Hi Marcel,

    sorry for the delay.
    No, with the current dt there are no general GPIO’s defined.
    Just tell me which pins on the GPIO header you’d like to use. Then I’ll add it to the device-tree and push out an update.

    All the best,
    Philip.

    #1571

    marcelveldt
    Participant

    Hi Philip,

    I just need 4 pins, do not care much which ones.
    For example, physical pins 11, 13, 15 and 19 ?

    Would be really great if you can provide the device-tree update. The board is now sitting useless on my desk because I can’t use it with spdif (as you know) and the other project I want to use it in has some buttons I need to wire.

    Regards,

    Marcel

    #1575

    VoltaStream
    Keymaster

    Hi Marcel,

    yes, will include some GPIO’s next time when I’m working on the kernel.
    Will keep you posted.

    Thanks,
    Philip.

    #1576

    marcelveldt
    Participant

    Great, really waiting for it.

    #1579

    marcelveldt
    Participant

    any news yet ?

    #1665

    marcelveldt
    Participant

    Hi Philip,

    I saw you updated PolyOS. Any chance this includes the gpio access ?

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.