ESP32 Ethereum code error

I’m trying Ethereum’s Simple transaction code using ESP32.
However, the following error about zsocket.c occurs when compiling.

[error] C:\Users\edge-\zerynth2\dist\r2.3.2\stdlib\csrc\zsockets\zsockets.c => line 179 : ‘zhwcrypto_info’ undeclared (first use in this function)

[error] C:\Users\edge-\zerynth2\dist\r2.3.2\stdlib\csrc\zsockets\zsockets.c => line 179 : ‘ZHWCRYPTO_KEY_ECKEY’ undeclared (first use in this function)

[error] C:\Users\edge-\zerynth2\dist\r2.3.2\stdlib\csrc\zsockets\zsockets.c => line 263 : unknown type name ‘mbedtls_threading_mutex_t’

[error] C:\Users\edge-\zerynth2\dist\r2.3.2\stdlib\csrc\zsockets\zsockets.c => line 266 : unknown type name ‘mbedtls_threading_mutex_t’

[error] C:\Users\edge-\zerynth2\dist\r2.3.2\stdlib\csrc\zsockets\zsockets.c => line 270 : unknown type name ‘mbedtls_threading_mutex_t’

[error] C:\Users\edge-\zerynth2\dist\r2.3.2\stdlib\csrc\zsockets\zsockets.c => line 274 : unknown type name ‘mbedtls_threading_mutex_t’

[error] C:\Users\edge-\zerynth2\dist\r2.3.2\stdlib\csrc\zsockets\zsockets.c => line 373 : ‘mbedtls_mutex_init_alt’ undeclared (first use in this function)

[error] C:\Users\edge-\zerynth2\dist\r2.3.2\stdlib\csrc\zsockets\zsockets.c => line 374 : ‘mbedtls_mutex_free_alt’ undeclared (first use in this function)

[error] C:\Users\edge-\zerynth2\dist\r2.3.2\stdlib\csrc\zsockets\zsockets.c => line 375 : ‘mbedtls_mutex_lock_alt’ undeclared (first use in this function)

[error] C:\Users\edge-\zerynth2\dist\r2.3.2\stdlib\csrc\zsockets\zsockets.c => line 376 : ‘mbedtls_mutex_unlock_alt’ undeclared (first use in this function)

[error] Error in C natives [—] in [[C:\Users\edge-\zerynth2\dist\r2.3.2\stdlib\csrc\zsockets\zsockets.c] at line 0](javascript:app.open_marker(‘c:\users\edge-\simple_transaction’,‘c:\users\edge-\zerynth2\dist\r2.3.2\stdlib\csrc\zsockets\zsockets.c’,0))

Please tell me the solution.

Hi @Ryo_Nakagawa, it may not be so clear in the documentation, but you need to create a project.yml file inside you Zerynth project folder and put the following two lines in it:

config:
    ZERYNTH_SSL: true

this will enable the compilation of additional modules required for crypto related operations.

Let me know if it works now,
Cheers,

Antonio

Thank you for your reply.
When I cloned the simple transaction project in examples, the file was already created.
Therefore, the same error has occurred.

I use ESP32 devkitC.
And the cause of this error seems to be the imported wifi-driver library.

from espressif.esp32net import esp32wifi as net_driver

Do you have any solutions?

It currently is under investigation, there may be some problem on ESP32 network library as you pointed out. I’ll update you when we find some more informations.

Thanks,
Antonio

Thank you very much!

Hi, I am also having the same issue. I can’t compile the examples Simple Transaction and DiceGame. Error:

[error] C:\Users\DELL\zerynth2\dist\r2.3.2\stdlib\csrc\zsockets\zsockets.c => line 179 : ‘zhwcrypto_info’ undeclared (first use in this function)

[error] C:\Users\DELL\zerynth2\dist\r2.3.2\stdlib\csrc\zsockets\zsockets.c => line 179 : ‘ZHWCRYPTO_KEY_ECKEY’ undeclared (first use in this function)

[error] C:\Users\DELL\zerynth2\dist\r2.3.2\stdlib\csrc\zsockets\zsockets.c => line 263 : unknown type name 'mbedtls_threading_mutex_t’

[error] C:\Users\DELL\zerynth2\dist\r2.3.2\stdlib\csrc\zsockets\zsockets.c => line 266 : unknown type name 'mbedtls_threading_mutex_t’

[error] C:\Users\DELL\zerynth2\dist\r2.3.2\stdlib\csrc\zsockets\zsockets.c => line 270 : unknown type name 'mbedtls_threading_mutex_t’

[error] C:\Users\DELL\zerynth2\dist\r2.3.2\stdlib\csrc\zsockets\zsockets.c => line 274 : unknown type name 'mbedtls_threading_mutex_t’

[error] C:\Users\DELL\zerynth2\dist\r2.3.2\stdlib\csrc\zsockets\zsockets.c => line 373 : ‘mbedtls_mutex_init_alt’ undeclared (first use in this function)

[error] C:\Users\DELL\zerynth2\dist\r2.3.2\stdlib\csrc\zsockets\zsockets.c => line 374 : ‘mbedtls_mutex_free_alt’ undeclared (first use in this function)

[error] C:\Users\DELL\zerynth2\dist\r2.3.2\stdlib\csrc\zsockets\zsockets.c => line 375 : ‘mbedtls_mutex_lock_alt’ undeclared (first use in this function)

[error] C:\Users\DELL\zerynth2\dist\r2.3.2\stdlib\csrc\zsockets\zsockets.c => line 376 : ‘mbedtls_mutex_unlock_alt’ undeclared (first use in this function)

[error] Error in C natives [—] in [[C:\Users\DELL\zerynth2\dist\r2.3.2\stdlib\csrc\zsockets\zsockets.c] at line 0](javascript:app.open_marker(‘c:\users\dell\dicegame’,‘c:\users\dell\zerynth2\dist\r2.3.2\stdlib\csrc\zsockets\zsockets.c’,0))

I faced similar issue. I don’t know what is the cause of the problem but I solved this issue.

Just create a new project and copy paste the code from simple transaction and you will be able to compile that code.

Thank you for your reply.
I also solved this issue to create a new project.
However, The same error occurred when I imported a new library into the program.
It seems that every time this error occurs, a new project needs to be created.

Thanks sushant662000. This now compiles fine for me.