Pi4 and v1 kits

The following script

#!/usr/bin/env python3

from gpiozero import Button
from signal import pause

b13 = Button(13)
b13.when_pressed = lambda: print('13 on')
b13.when_released = lambda: print('13 off')
pause()

produces output when the back button is pushed:

root@zynthian-2:~# ./button.py 
13 on
13 off
13 on
13 off

So it seems zyncoder needs a fix for GPIO setup or input reading

OK, it looks like the author of wiringPi has hit a wall and declared wiringPi EOL while acknowledging that there are issues working with the Pi v4.

When I run watch gpio readall I donā€™t see changes when buttons are pushed, so this is definitely an issue within wiringPi. (and this was even with his binary-only 2.52 package which has no corresponding source release :grimacing:)

Iā€™ll look for forks on github to see if anyone is maintaining a fork which works with v4. Maybe longer term this is a chance to move away from wiringPiā€™s pin numbering - its pretty confusing :wink:

Itā€™s quite strange your case. Iā€™ve do some research, but i canā€™t find any reference about pin differences at boot up. Of course, the RBPi4 GPIO is much more configurable and almost every pin have several modes (GPIO, I2C, SPI, UART, etc.) Perhaps some problem with the wiringpi library ā€¦ i donā€™t know ā€¦

It really does look like wiringPi is broken on 4B, is unmaintained, and has no regular source code releases.

gpiozero supports wiringPi pin numbers by doing new Button(ā€˜WPI23ā€™), and there is an unmerged pull request to add support for the MCP23008 and MCP23017

I realize it would be a bit of work though.

I see. I just read your link. I will start looking for alternatives ā€¦ but we need a C library for zyncoder. I would check:

Anyway, itā€™s a big change and i would prefer that wiringpi could be saved ā€¦

Regards,

So, maybe it is time to upgrade our v1 zyntians to v2 or v3. Maybe It would be safer for the project overall. @jofemodo, what should i order to update my old construction?

Would it be better to switch over to i2c encoders? I love the simplicity of these, plus the added RGB. I donā€™t need a MIDI DIN, they would eliminate the need for a custom MCP23017 board like I have now in my DIY Zynth.

1 Like

Yeah, Iā€™m just trying to save money and time, and I would prefer to have an all-in-one board.

If it is declared that prototype setups and Pi4B are incompatible then Iā€™d upgrade and move on.

The fact that wiringPi is unmaintained and its GPIO support is broken on the 4B means there is a risk that i2c support might break for some future raspberry pi hardware release

These look nice, and I wouldnā€™t miss legacy MIDI.

Isnā€™t it possible somebody will step up and maintain WiringPi?

Maybe, but his behavior suggests that he wonā€™t make the source available for the fixes to add Pi4B support (which still donā€™t fix my problem anyway)

But existing source is available, there are surely people who can take it from there and handle Pi4b support.

Existing source is available to 2.50, the github forks seem to be earlier releases.

Iā€™ve just put this together[1], and I might try and compile it on my zynthian and attempt to debug the 4b issues.

[1] https://github.com/steveb/WiringPi/tree/master

OK, Iā€™m making some progress

1 Like

OK, Iā€™m comfortable we can fix this. My fork[1] now has a fix for the /dev/mem peripheral base address. My current problem is that setting pull-up is having no effect when done through wiringPi. When I do it through some other tool like raspi-gpio then the buttons start working.

Maybe we can pull this repo[1] into the zynthian github to maintain our fixes until some central replacement emerges?

[1] https://github.com/steveb/WiringPi

1 Like

Iā€™m getting very similar effects on the I/O bus connected (no AllinOne or 1to1 card connected straight to the I/O pins). These are zynths 3Bs .

Back key works nothing else does on zynthian-amp.local for exampleā€¦

Will this be related?

These look fascinating . . . :smiley:

I like those I2C knobs as well.
Do you know if the price is per knob or for 9.
I think for one.
What is the maximum number of cascading knobs?
We should really try to get those integrated, esp if they offer more than 9.

From what I can see, those I2C encoder boards are USD6.90 each, plus the cost of the encoder, and each one can be assigned a different 7-bit address by soldering jumpers.
So, itā€™s theoretically possible to connect 128 of them on a single I2C bus, though I2C capacitance limit might reduce the actual number.

ok, hence 40EUR incl shipping for 4 encoders.
Itā€™s not for everyone :slight_smile: