Zymkey doesnt bind properly

Using Zymkey 4i / Raspberry Pi 4 Model B

After enabling I2C and running the curl -G https://s3.amazonaws.com/zk-sw-repo/install_zk_sw.sh | sudo bash command my Raspberry Pi rebooted but the zymkey is still blinking blue rapidly. I tried running the command multiple times and even tried going through the entire process on a freshly installed OS. None of this has fixed the problem.

Output of cat /etc/os-release:
PRETTY_NAME=“Debian GNU/Linux 12 (bookworm)”
NAME=“Debian GNU/Linux”
VERSION_ID=“12”
VERSION=“12 (bookworm)”
VERSION_CODENAME=bookworm
ID=debian

Output of systemctl status zkifc:

zkifc.service - Zymkey Interface Connector
Loaded: loaded (/etc/systemd/system/zkifc.service; enabled; preset: enabled)
Active: active (running) since Mon 2024-03-11 18:42:05 CET; 32s ago
Process: 2069 ExecStartPre=/bin/bash -c mkdir -p /run/zkstatus && chown -R zymbit.zymbit /run/zkstatus (code=exited, status=0/SUCCESS)
Process: 2071 ExecStartPre=/bin/sleep 0.5 (code=exited, status=0/SUCCESS)
Main PID: 2072 (zkifc)
Tasks: 3 (limit: 3909)
CPU: 392ms
CGroup: /system.slice/zkifc.service
2072 /usr/bin/zkifc -s /var/lib/zymbit/

Output of journalctl -u zkifc:
mars 11 18:18:31 raspberrypi systemd[1]: Starting zkifc.service - Zymkey Interface Connector…
mars 11 18:18:31 raspberrypi systemd[1]: Started zkifc.service - Zymkey Interface Connector.
mars 11 18:20:41 raspberrypi systemd[1]: Stopping zkifc.service - Zymkey Interface Connector…
mars 11 18:20:42 raspberrypi systemd[1]: zkifc.service: Main process exited, code=killed, status=11/SEGV
mars 11 18:20:43 raspberrypi systemd[1]: zkifc.service: Failed with result ‘signal’.
mars 11 18:20:43 raspberrypi systemd[1]: Stopped zkifc.service - Zymkey Interface Connector.
mars 11 18:20:43 raspberrypi systemd[1]: zkifc.service: Consumed 1.026s CPU time.status=11/SEGV

It looks like theres a segmentation error here but I have no idea how to fix it. Any help?

Is this 64bit bookworm or 32bit? We don’t support 32bit bookworm.

Its 64bit.

uname -m
aarch64

There is also a new error when running journalctl -u zkifc that did not show up previously.

Mar 11 18:32:35 raspberrypi zkifc[2109]: could not open “/dev” dir, errno=24
Mar 11 18:32:36 raspberrypi zkifc[2109]: could not open “/dev” dir, errno=24
Mar 11 18:32:37 raspberrypi zkifc[2109]: could not open “/dev” dir, errno=24
Mar 11 18:32:38 raspberrypi zkifc[2109]: could not open “/dev” dir, errno=24
Mar 11 18:32:39 raspberrypi zkifc[2109]: could not open “/dev” dir, errno=24
Mar 11 18:32:40 raspberrypi zkifc[2109]: could not open “/dev” dir, errno=24
Mar 11 18:32:41 raspberrypi zkifc[2109]: could not open “/dev” dir, errno=24
Mar 11 18:32:42 raspberrypi zkifc[2109]: could not open “/dev” dir, errno=24

Still havent found a way to fix this. Any help would be greatly appreciated :slight_smile:

Please confirm if:

  1. Your ZYMKEY4 is new (you removed it from the secure packaging), or if it comes from some other project?
  2. Has the production mode Tab been cut?

The ZymKey is new, it was opened for the very first time by me. The tab has NOT been cut. I can provide pictures of how the ZymKey looks if needed.

I just ran through a fresh install of bookworm 64bit.

enabled i2c via raspi-config and ran through

curl -G https://s3.amazonaws.com/zk-sw-repo/install_zk_sw.sh | sudo bash

And it binded properly for me. Are you sure, you haven’t done anything else in this process?

Havent done anything else. Tried doing it on a fresh OS as well, which didnt help either.

Please send a picture of your hardware installation.
Do you have any other hardware devices connected to GPIO or I2C?

Sorry for the delay, due to timezone differences I wasnt able to get back to you sooner. Heres a picture of the hardware:

@Mr123 It looks like bookworm was updated yesterday and the rpi-6.6.x kernel no longer overrides an upstream kernel decision to force the base number of the main GPIO controller to be global GPIO 0. The new numbering goes like this:

pi@bookworm64:~ $ head /sys/kernel/debug/gpio
gpiochip0: GPIOs 512-569, parent: platform/fe200000.gpio, pinctrl-bcm2711:
gpio-512 (ID_SDA )
gpio-513 (ID_SCL )
gpio-514 (GPIO2 )
gpio-515 (GPIO3 )
gpio-516 (GPIO4 |sysfs ) in hi IRQ
gpio-517 (GPIO5 )
gpio-518 (GPIO6 )
gpio-519 (GPIO7 )
gpio-520 (GPIO8 )
pi@bookworm64:~ $

For the PI4, GPIO4(PIN7) now maps to 516.

Try and specify using 516 as our WAKE_PIN and restart zkifc.

sudo su
echo "ZK_GPIO_WAKE_PIN=516" > /var/lib/zymbit/zkenv.conf
systemctl restart zkifc

Let me know if that works and I’ll fix our install script.

It did fix the problem! Thank you so much :slight_smile:

I have a similar issue @Finbarr_of_Zymbit. I had a working and bound Zymkey 4i on my RPI 5. I wanted to test rebuilding the set up from scratch so I removed the Zymkey and its battery and rebuilt the operating system from scratch and reinstalled the software. But the fast LED blinks are not going away and my zkifc service is not starting. journalctl says “chown: warning: ‘.’ should be ‘:’: ‘zimbit.zimbit’

My GPIO seems to be correctly mapped 575.

Does it have anything to do with the fact that it was previously bound?

As long as you have not snipped the lock tab to put the Zymkey in Production Mode, it should not matter. It will re-bind. Can you double-check that you enabled the i2c interface vi raspi-config?
(The chown warning doesn’t really matter. It’s just a warning)

Thank you for your prompt reply @Bob_of_Zymbit. I had only removed the comment in front of dtparam=i2c_arm=on in /boot/firmware/config.txt but had not run raspi-config. I had thought raspi-config did just that. But apparently it does more. So, long story short, I ran raspi-config, rebooted and it is bound now and working.

I guess I should have instead done “sudo raspi-config nonint do_i2c 1”?