Zymbit Setup Issue?

Hello,
I have just recently purchased and tried to setup a zymbit 4i security module on a raspberry pi 3 B+. Overall the setup went great and I believed it was successful, but I am seeing some odd error and issues that kind of lead me to believe otherwise. First and foremost, I can successfully execute all of the examples provided which is great. But if I put in this command:
pi@raspberrypi:~/Desktop/zymTest $ sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- – -- – -- – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --
I have seen 0x30 show up once in about 100 runs of the command. I have also put the performance flag on the cpu governor just to be safe…Any ideas? Also I running the latest OS and have updated all of my packages.
Thanks,
Dave

@davemm,

The Zymkey doesn’t show up in i2cdetect displays by design. You can tell if you successfully installed it by observing the blue LED. If it is flashing once every 3 seconds, then binding completed. You can also use the systemctl command. It should say “active (running)”:

systemctl status zkifc

If you need more help or the LED is doing something different, post back and we can help you figure out what is going on.

Bob

Thank you Bob, I am encouraged by that then…and the zkifc says it is running and the light is blinking appropriately so that is great. But I am still having an issue when I am trying just basic programs:
from zymkey import client

print(“Hello World”)

print(client.get_time())

mne = client.gen_key_pair(“secp256k1”)

print(mne)
Results:
Hello World
1609267023
Traceback (most recent call last):
File “pyTest.py”, line 6, in
mne = client.gen_key_pair(“secp256k1”)
File “/usr/local/lib/python2.7/dist-packages/zymkey/module.py”, line 582, in gen_key_pair
raise AssertionError(‘bad return code %d’ % ret)
AssertionError: bad return code -1
So I was hoping it was the i2c but maybe it is something else.
Thanks for the help!
Dave

gen_key_pair() is not supported in the current Zymkey4. It will be supported in a future product HSM6 which is scheduled for release in the first quarter of 2021. We updated the Python API doc to reflect what is currently supported. Apologies for any confusion.

If you see the notation (model >= HSM6), it will be supported in future products only. Link to the updated API document:

https://s3.amazonaws.com/zk-sw-repo/zk_app_utils.py.pdf

Hi Bob, thanks for the info…is there any more info about the private keys loaded on the device anywhere?
Thanks,
Dave

The private keys are loaded here at the factory and never exposed. And there are three slots.

Dear Zymbit Team,
I’m using a Zymkey 4i with a Raspberry Pi 4B running duster and writing a C++ application (KontrollerCPP) using Geany.

The software installation went fine, the Zymkey completed binding OK (blue led flashes at 0.33 Hz) and my /usr/include/zymbit/ directory now contains zkAppUtilsClass.h, zk_app_utils.h and zk_b64.h.

My problems start when I try to get my C++ application to call Zymkey methods. My C++ application includes the statement #include </usr/include/zymkey/zkAppUtilsClass.h>,
but when I try to compile it, I get the following error message (this is the German version of Raspi):

g++ -Wall -o “KontrollerCPP” “KontrollerCPP.cxx” -lwiringPi -l/usr/include/zymkey/zkAppUtilsClass (im Verzeichnis: /home/pi/Documents)
In file included from KontrollerCPP.cxx:33:
/usr/include/zymkey/zkAppUtilsClass.h:24:10: fatal error: zk_app_utils.h: Datei oder Verzeichnis nicht gefunden
#include <zk_app_utils.h>
^~~~~~~~~~~~~~~~
compilation terminated.
Kompilierung fehlgeschlagen.

It seems that I am not telling the compiler where to find the file zk_app_utils.h, but I’m not sure where. Please can you help me? An example of a working C++ application would really assist me in understanding the problem.

Many thanks in advance,
Alan Teale.

Hi Alan,

I compiled a C++ application with the include statement:

#include <zymkey/zkAppUtilsClass.h>

Can you try compiling it with this line:

g++ -I /usr/include/zymkey -lzkAppUtilsClassCPP -g KontrollerCPP.cpp -o KontrollerCPP

The font is kind of misleading but that first argument is a capital “i” and the second is a lowercase “L”

Eric

Hi Eric,

Many thanks for your swift and very helpful reply. Once I added -I/usr/include/zymkey -lzkAppUtilsClassCPP to the “Compile” and “Build” C++ commands in Geany I was able to compile my code with #include <zymkey/zkAppUtilsClass.h> without errors.

I had some difficulty instantiating a zkClass-Object until I realized that I needed to also specify the zkAppUtils Class, e.g.

zkAppUtils::zkClass myZymkey;
myZymkey.ledOn();

Once again, many thanks for getting me started with using the functions of my Zymkey 4i.
Alan Teale

1 Like