Using zymkey 4i on orange pi

hello

I bought a zymkey i4 card to use it on a orangepi
i am using armbian Armbian Buster with Linux 5.4.2-sunxi

Linux orangepione 5.4.2-sunxi #19.11.3.342 SMP Sun Dec 8 02:26:21 CET 2019 armv7l GNU/Linux

after the installation is finished and machine is rebooted

the led stop blinking fast blink 10 time slow and stop for 1~2 S than blink very fast fast and repeat it

for service

root@orangepione:~# service zkifc status
● zkifc.service - Zymkey Interface Connector
Loaded: loaded (/etc/systemd/system/zkifc.service; enabled; vendor preset: enabled)
Active: inactive (dead)
root@orangepione:~#
and when start it manually it give me this

root@orangepione:~# service zkifc start
^C
root@orangepione:~# service zkifc status
● zkifc.service - Zymkey Interface Connector
Loaded: loaded (/etc/systemd/system/zkifc.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2020-05-13 22:04:51 UTC; 3min 47s ago
Process: 2135 ExecStartPre=/bin/bash -c mkdir -p /run/zkstatus && chown -R zymbit.zymbit /run/zkstatus (code=exited, status=0/SUCCESS)
Process: 2137 ExecStartPre=/bin/sleep 0.5 (code=exited, status=0/SUCCESS)
Main PID: 2138 (zkifc)
Tasks: 3 (limit: 778)
Memory: 1.4M
CGroup: /system.slice/zkifc.service
└─2138 /usr/bin/zkifc -s /var/lib/zymbit/

May 13 22:04:50 orangepione systemd[1]: Starting Zymkey Interface Connector…
May 13 22:04:51 orangepione systemd[1]: Started Zymkey Interface Connector.
root@orangepione:~#

the python examples give this :

root@orangepione:~# python /usr/local/share/zymkey/examples/zk_app_utils_test.py
Exception AssertionError: AssertionError(‘bad return code -1’,) in <bound method Zymkey.del of <zymkey.module.Zymkey object at 0xb681ae70>> ignored
Testing data lock…
Traceback (most recent call last):
File “/usr/local/share/zymkey/examples/zk_app_utils_test.py”, line 6, in
dst = zymkey.client.lock(src)
AttributeError: ‘NoneType’ object has no attribute ‘lock’
root@orangepione:~#

I really want to know if someone has already successfully installed the zymkey on an OPI

thank you

any suggestions ???

The only platform we officially support is the Raspberry Pi. There is a customer that got this going on an OrangePi 3 using a Debian Stretch with Armbian Linux 5.3.0-rc3-sunxi64 build. They used our standard install_zk_sw.sh script.

You will need to deal with GPIO4. Make a file in /var/lib/zymbit/ named zkenv.conf with the following line:

ZK_GPIO_WAKE_PIN=<platform pin number>

where the <platform pin number> is the one on that platform that corresponds to GPIO4 on the RPi.

I am trying to get the ZymKey 4 to run in Orange Pi 3 LTS but not successful. I am going this route due to the supply problem with Raspberry Pi 3B+.

May I know if it is possible to change the I2C bus number for Zkifc?. In Armbian BullsEye for OrangePi 3 LTS there are three internal i2c when the first i2c0 is initialized, I have a total of 4 where the I2c0 is at bus zero where as for raspberry pi it is bus 1. Any help is appreciated. Thank you.

Here’s an example that a customer used to change the i2c bus on a PI due to a conflict.

OVERVIEW
Instructions for reconfiguring Zymbit ZYMKEY4 security module to communicate over a separate, software emulated, I2C bus (named bus 3)
ASSUMPTIONS
a) GPIO12, GPIO 13, GPIO20 are available and unused by any other devices
b) GPIO12, GPIO 13 will be used to emulate signals SDA and SCL, to communcate with Zymbit Zymkey
c) GPIO20 will be used to communicate status with the Zymbit Zymkey
INSTRUCTIONS
1. Move Zymkey SDA to GPIO12 and SCL to GPIO13.
2. Add 4K7 resistor from GPIO12 to 3V3
3. Add 4K7 resistor from GPIO13 to 3V3
4. Add the following line to /boot/config.txt: dtoverlay=i2c-gpio,i2c_gpio_sda=12,i2c_gpio_scl=13,bus=3
5. Optionally add the following line to /var/lib/zymbit/zkenv.conf: ZK_RESTRICTED_I2C_LIST=3
6. Reboot the system

Hi,
Thank for the addition information. But I still cannot get it to work. The the zkifc service does not start on reboot but when I manually restart it through systemctl start zkifc it just hang there without giving the cursor back.

Is there any way to debug?. The pins in Orange Pi 3 LTS for Zymbit exactly align to those in Raspberry PI 3B+, at least for the first 10 pins.

Another thing that I notice that the zkifc is initializing the gpio on gpiochip1 where as the native gpiochip is zero. I create the gppio354 (PL2) via cli as a comparision. Is there anyway to change that?

I might’ve made that more complicated than it has to be. I think all you really need to do is create a file in /var/lib/zymbit/ named zkenv.conf and add the following entries:

ZK_GPIO_WAKE_PIN=<platform pin number>

where <platform pin number> is the one on that platform that corresponds to the default GPIO4 for pin7 on the RPi. I think it might be GPIO 118 for that OPi (from here: GitHub - orangepi-xunlong/wiringOP: wiringPi for Orange Pi)

ZK_GPIO_WAKE_PIN=118

The device scan will go through all the i2c busses which can take a long time. You can specify the specific bus you are on. For instance, for i2c=0 add,

ZK_RESTRICTED_I2C_BUS_LIST=0

restricts the zymkey scan only to bus 0 (/dev/i2c-0).

Try that. For debugging, check /var/log/messages for i2c info and journalctl -u zkifc.

I have the configuration as you have suggested but still a no go.

Eventually I hock up a an oscilloscope, the signal through the pin PD26 and PD25 are correct (via i2cdetect -y 0). But somehow the zkfic is not sending any signal to both pins when the service is started. There is also no error messages from journalctl or messages.

The same config on Raspberry Pi show signal regardless whether the ZymKey4 is installed or not. Once I start the zkifc service (without zymkey4 installed) the signal is seen on both pins (gpio 2 and 3)

What else can I do to troubleshoot this? Thanks.

Hi @Bob_of_Zymbit ,

Is there any tools that I can use (or provided by zymbit) to debug the communication between ZymKey4 and the host? I am willing to try to debug this.

Thank you.

Regards,
Albert