# Using zymkey 4i on orange pi

**URL:** <https://community.zymbit.com/t/using-zymkey-4i-on-orange-pi/767>\
**Category:** ZYMKEY4\
**Created:** [May 13, 2020, 10:13pm UTC](https://community.zymbit.com/t/using-zymkey-4i-on-orange-pi/767 "2020-05-13T22:13:05Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![dzkabyle](https://avatars.discourse-cdn.com/v4/letter/d/c0e974/32.png) [@dzkabyle](https://community.zymbit.com/u/dzkabyle)\
**Post date:** [May 13, 2020, 10:13pm UTC](https://community.zymbit.com/t/using-zymkey-4i-on-orange-pi/767/1 "2020-05-13T22:13:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dzkabyle](https://avatars.discourse-cdn.com/v4/letter/d/c0e974/32.png) [@dzkabyle](https://community.zymbit.com/u/dzkabyle)\
**Post date:** [May 18, 2020, 4:09pm UTC](https://community.zymbit.com/t/using-zymkey-4i-on-orange-pi/767/2 "2020-05-18T16:09:28Z")

</div>

any suggestions ???

---

<div class="post-metadata">

**Author:** ![Bob\_of\_Zymbit](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@Bob\_of\_Zymbit](https://community.zymbit.com/u/Bob_of_Zymbit)\
**Post date:** [May 18, 2020, 11:36pm UTC](https://community.zymbit.com/t/using-zymkey-4i-on-orange-pi/767/3 "2020-05-18T23:36:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Albert](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@Albert](https://community.zymbit.com/u/Albert)\
**Post date:** [May 11, 2023, 8:38am UTC](https://community.zymbit.com/t/using-zymkey-4i-on-orange-pi/767/4 "2023-05-11T08:38:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Bob\_of\_Zymbit](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@Bob\_of\_Zymbit](https://community.zymbit.com/u/Bob_of_Zymbit)\
**Post date:** [May 11, 2023, 6:27pm UTC](https://community.zymbit.com/t/using-zymkey-4i-on-orange-pi/767/5 "2023-05-11T18:27:58Z")

</div>

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 | | | | |

---

<div class="post-metadata">

**Author:** ![Albert](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@Albert](https://community.zymbit.com/u/Albert)\
**Post date:** [May 12, 2023, 12:29am UTC](https://community.zymbit.com/t/using-zymkey-4i-on-orange-pi/767/6 "2023-05-12T00:29:29Z")

</div>

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.

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/zymbit/original/2X/8/8f1b438ca41fc2264d27f3d94b58620404e54185.jpeg)

---

<div class="post-metadata">

**Author:** ![Albert](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@Albert](https://community.zymbit.com/u/Albert)\
**Post date:** [May 12, 2023, 3:34am UTC](https://community.zymbit.com/t/using-zymkey-4i-on-orange-pi/767/7 "2023-05-12T03:34:59Z")

</div>

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?

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/zymbit/original/2X/1/14381d80931ba223a9afa6de7e0621c52fcce9b3.png)

---

<div class="post-metadata">

**Author:** ![Bob\_of\_Zymbit](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@Bob\_of\_Zymbit](https://community.zymbit.com/u/Bob_of_Zymbit)\
**Post date:** [May 12, 2023, 4:40pm UTC](https://community.zymbit.com/t/using-zymkey-4i-on-orange-pi/767/8 "2023-05-12T16:40:24Z")

</div>

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](https://github.com/orangepi-xunlong/wiringOP#orange-pi-33-lts))

`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`.

---

<div class="post-metadata">

**Author:** ![Albert](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@Albert](https://community.zymbit.com/u/Albert)\
**Post date:** [May 13, 2023, 4:15am UTC](https://community.zymbit.com/t/using-zymkey-4i-on-orange-pi/767/9 "2023-05-13T04:15:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Albert](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@Albert](https://community.zymbit.com/u/Albert)\
**Post date:** [May 19, 2023, 12:26am UTC](https://community.zymbit.com/t/using-zymkey-4i-on-orange-pi/767/10 "2023-05-19T00:26:05Z")

</div>

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
