Encoders jumping around on testing

Hi Guys,
After some patience I finally was able to get back onto the testing branch with my custom kit(direct wired encoders to gpio). The issue I have now is that the encoders are misbehaving, they are jumping around when I use them. I saw something similiar during one of my builds when I incorrectly wired an encoder but this happens to all 4 encoders and I verified my wiring on the encoders with gpio readall.

I don’t know how to see the output of the encoders but gpio readall at least told me that I was on available pins and gave me the physical to check. The encoders work fine on the stable branch but I thought I would verify with wiringpi in case an update possibly changed a pin assignment.

Anyways, not sure if it is a bug in testing or an issue on my end. Any help would be greatly appreciated.

Thx

1 Like

Could you check if the zyncoder library is building without errors?

cd /zynthian/zyncoder
./build.sh

Also, have you tried to run the zyncoder test program?

systemctl stop zynthian
cd /zynthian/zyncoder/build
./zyncoder_test

Regards,

Also, will you confirm consistently good behaviour with stable and consistently bad behaviour with testing?

Hi jofemodo/Riban,
I checked my zyncoder build on testing and it builds error free with custom wiring config using wiringpi.
I ran the zyncoder test on my testing image and it shows me exactly what I am observing in the UI; the rotary encoders respond but will increase/decrease to a value and then jump back to 0. Switches appear to work ok, at least I see the messages. Interestingly enough the “select” encoder doesn’t give me any message > than 2(i.e. encoder will increase to 1 or 2 and then back to 0).

I then put my stable image in and checked my encoders were working fine with no issues. I ran the zyncoder test in stable and it showed the encoders increasing/decreasing by 4, which I believe is correct. I then checked my switches on stable and the zyncoder test script in stable does not see SW1 or 2 when pressed BUT the Zynthian OS is working as expected(i.e. “back and select” switches work).

Now that I think of it, when I run zyncoder test on the testing image the encoders responded 1 PT per detent until they jumped back to 0 whereas I see the encoders moving by 4’s in the stable release. I don’t know if that means anything.

Thx

Could you send the log from the zyncoder_test?

Thanks

Absolutely… if I knew how.
Sorry I’m not a linux guy. I’m more a google and try what others have done kind of guy.

If you don’t mind please, could you tell me how I can log while running tests and find the log after?

Thanks

Hi,
I’m hoping this helps, here is the terminal output of zyncoder_test as I go through ENC 1-4:
root@zynthian:/zynthian/zyncoder/build# ./zyncoder_test
Starting ZynCore…
ZynCore: Zynswitches poll thread created successfully
ZynCore: Setting-up 8 x Zynswitches…
ZynCore: Setting-up 4 x Zynpots (zyncoders)…
Testing switches & rotaries…
SW-0 = 380628
PT-0 = 51
PT-0 = 52
PT-0 = 53
PT-0 = 54
PT-0 = 55
PT-0 = 56
PT-0 = 57
PT-0 = 58
PT-0 = 59
PT-0 = 60
PT-0 = 61
PT-0 = 62
PT-0 = 0
PT-0 = 1
SW-1 = 181990
PT-1 = 51
PT-1 = 52
PT-1 = 53
PT-1 = 0
PT-1 = 1
PT-1 = 2
PT-1 = 3
PT-1 = 4
PT-1 = 5
PT-1 = 6
PT-1 = 7
SW-2 = 184917
PT-2 = 51
PT-2 = 52
PT-2 = 53
PT-2 = 54
PT-2 = 55
PT-2 = 56
PT-2 = 57
PT-2 = 58
PT-2 = 59
PT-2 = 60
PT-2 = 61
PT-2 = 62
PT-2 = 63
PT-2 = 64
PT-2 = 65
PT-2 = 0
PT-2 = 1
SW-3 = 157013
PT-3 = 51
PT-3 = 0
PT-3 = 1
PT-3 = 2
PT-3 = 0
PT-3 = 1
PT-3 = 0
PT-3 = 1
PT-3 = 2
PT-3 = 3
PT-3 = 0
PT-3 = 1

Thx

1 Like

Great!! I’ve rescued an old v1 from my lab storage and now i can reproduce your problem. Give me some hours/days to fix it.

Thanks!

OK, thanks so much!

Just so you know, my encoders are KY040 Arduino PCB mount with the resistors removed and no connection to +v, pin A/B from schematic is actually pin B/A to get correct increase/decrease:

Pin A – 27,21,3,7

Pin B – 25,26,4,0

SW – 23,6,2,22

Regards

1 Like

I think it’s solved now:

Please update and test.

Thanks!

Hi @jofemodo,

It’s fixed!

Thanks so much, I was getting worried that as the project progresses, those of us with these v1 type boxes would get left behind.

For me, it was the need for a bigger display and no need for zynswitches that led me down the custom zynthian path, I wish I had purchased kit v4 at the start because I had a tough time getting both my custom boxes up and running but I’m here now and they are working good thanks to you!

Thx