ESP32-Pi and OpenPLC Build Failure

Yorkie

New member
I am trying out the ESP32-Pi board for the first time, but am unable to get it working successfully using the OpenPLC Editor v3.0 (latest release) for Windows.

My setup is as follows:
  • ESP32-Pi
  • 16 Relay HAT, stack level 4
  • 16 LV Digital Input HAT, stack level 6
I am using OpenPLC as my development environment, and without using any of the Sequent Microsystems Module function blocks I appear to be able to compile and transfer a simple program to the ESP32-Pi.

1749249178463.png

However as soon as I add the SM_16DIN or SM_16RELAY function blocks into the program, it fails to compile with the errors listed below, noting multiple references to 'undefined reference to `digIn16Init'' and 'undefined reference to `relay16Init'' type errors.

Code:
[2025-06-06T17:08:33.635] C:/Users/xxxxx/AppData/Local/Arduino15/packages/esp32/tools/esp-x32/2411/bin/../lib/gcc/xtensa-esp-elf/14.2.0/../../../../xtensa-esp-elf/bin/ld.exe: C:\Users\xxxxx\AppData\Local\Temp\arduino\sketches\F0E51118FE6867EC570CA64BB84D6C65\libraries\src\POUS.c.o:(.literal.ACU1_body__+0x14): undefined reference to `digIn16Init'
[2025-06-06T17:08:33.660] C:/Users/xxxxx/AppData/Local/Arduino15/packages/esp32/tools/esp-x32/2411/bin/../lib/gcc/xtensa-esp-elf/14.2.0/../../../../xtensa-esp-elf/bin/ld.exe: C:\Users\xxxxx\AppData\Local\Temp\arduino\sketches\F0E51118FE6867EC570CA64BB84D6C65\libraries\src\POUS.c.o:(.literal.ACU1_body__+0x18): undefined reference to `digIn16Get'
[2025-06-06T17:08:33.693] C:/Users/xxxxx/AppData/Local/Arduino15/packages/esp32/tools/esp-x32/2411/bin/../lib/gcc/xtensa-esp-elf/14.2.0/../../../../xtensa-esp-elf/bin/ld.exe: C:\Users\xxxxx\AppData\Local\Temp\arduino\sketches\F0E51118FE6867EC570CA64BB84D6C65\libraries\src\POUS.c.o:(.literal.ACU1_body__+0x1c): undefined reference to `relay16Init'
[2025-06-06T17:08:33.724] C:/Users/xxxxx/AppData/Local/Arduino15/packages/esp32/tools/esp-x32/2411/bin/../lib/gcc/xtensa-esp-elf/14.2.0/../../../../xtensa-esp-elf/bin/ld.exe: C:\Users\xxxxx\AppData\Local\Temp\arduino\sketches\F0E51118FE6867EC570CA64BB84D6C65\libraries\src\POUS.c.o:(.literal.ACU1_body__+0x20): undefined reference to `relay16Set'
[2025-06-06T17:08:33.756] C:/Users/xxxxx/AppData/Local/Arduino15/packages/esp32/tools/esp-x32/2411/bin/../lib/gcc/xtensa-esp-elf/14.2.0/../../../../xtensa-esp-elf/bin/ld.exe: C:\Users\xxxxx\AppData\Local\Temp\arduino\sketches\F0E51118FE6867EC570CA64BB84D6C65\libraries\src\POUS.c.o: in function `SM_16DIN_body__':
[2025-06-06T17:08:33.788] C:\Users\xxxxx\OpenPLC_Editor\editor\arduino\src\lib/sm_cards.h:553:(.text.ACU1_body__+0x42a): undefined reference to `digIn16Init'
[2025-06-06T17:08:33.820] C:/Users/xxxxx/AppData/Local/Arduino15/packages/esp32/tools/esp-x32/2411/bin/../lib/gcc/xtensa-esp-elf/14.2.0/../../../../xtensa-esp-elf/bin/ld.exe: C:\Users\xxxxx\OpenPLC_Editor\editor\arduino\src\lib/sm_cards.h:562:(.text.ACU1_body__+0x446): undefined reference to `digIn16Get'
[2025-06-06T17:08:33.852] C:/Users/xxxxx/AppData/Local/Arduino15/packages/esp32/tools/esp-x32/2411/bin/../lib/gcc/xtensa-esp-elf/14.2.0/../../../../xtensa-esp-elf/bin/ld.exe: C:\Users\xxxxx\AppData\Local\Temp\arduino\sketches\F0E51118FE6867EC570CA64BB84D6C65\libraries\src\POUS.c.o: in function `SM_16RELAY_body__':
[2025-06-06T17:08:33.883] C:\Users\xxxxx\OpenPLC_Editor\editor\arduino\src\lib/sm_cards.h:423:(.text.ACU1_body__+0x573): undefined reference to `relay16Init'
[2025-06-06T17:08:33.913] C:/Users/xxxxx/AppData/Local/Arduino15/packages/esp32/tools/esp-x32/2411/bin/../lib/gcc/xtensa-esp-elf/14.2.0/../../../../xtensa-esp-elf/bin/ld.exe: C:\Users\xxxxx\OpenPLC_Editor\editor\arduino\src\lib/sm_cards.h:443:(.text.ACU1_body__+0x610): undefined reference to `relay16Set'
[2025-06-06T17:08:34.007] collect2.exe: error: ld returned 1 exit status
[2025-06-06T17:08:34.068] Multiple libraries were found for "WiFi.h"
[2025-06-06T17:08:34.100]   Used: C:\Users\xxxxx\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.0\libraries\WiFi
[2025-06-06T17:08:34.132]   Not used: C:\Users\xxxxx\OneDrive\My OneDrive Documents\Arduino\libraries\WiFiNINA
[2025-06-06T17:08:34.163] Using library src in folder: C:\Users\xxxxx\OpenPLC_Editor\editor\arduino\src (legacy)
[2025-06-06T17:08:34.211] Using library WiFi at version 3.2.0 in folder: C:\Users\xxxxx\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.0\libraries\WiFi
[2025-06-06T17:08:34.242] Using library Networking at version 3.2.0 in folder: C:\Users\xxxxx\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.0\libraries\Network
[2025-06-06T17:08:34.274] Using library lib in folder: C:\Users\xxxxx\OpenPLC_Editor\editor\arduino\src\lib (legacy)
[2025-06-06T17:08:34.487]
[2025-06-06T17:08:34.524] Used library Version Path
[2025-06-06T17:08:34.556] src                  C:\Users\xxxxx\OpenPLC_Editor\editor\arduino\src
[2025-06-06T17:08:34.557] WiFi         3.2.0   C:\Users\xxxxx\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.0\libraries\WiFi
[2025-06-06T17:08:34.557] Networking   3.2.0   C:\Users\xxxxx\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.0\libraries\Network
[2025-06-06T17:08:34.557] lib                  C:\Users\xxxxx\OpenPLC_Editor\editor\arduino\src\lib
[2025-06-06T17:08:34.558]
[2025-06-06T17:08:34.558] Used platform Version Path
[2025-06-06T17:08:34.558] esp32:esp32   3.2.0   C:\Users\xxxxx\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.0
[2025-06-06T17:08:34.558] Error during build: exit status 1
[2025-06-06T17:08:34.559] $? = 1
[2025-06-06T17:08:34.559] Build phase <function build.<locals>.build_project at 0x0000020656589F70> failed

If I remove the Sequent Microsystems function block, it compiles again fine.
While I'm hoping there's a simple explanation for this, I'm running out of things to try, and at present I'm unable to successfully compile any program that includes the Sequent function blocks.

Another odd one is in order to verify it's doing something, I have a simple timer to flash the ESP32-PI onboard LED. If I execute the transfer with Board Type set to SEQUENT-ESP32-PI [3.2.0], it doesn't flash. If I change the Board Type to 'ESP32-WROOM', it does flash. Both options appear to compile and upload okay.

Any ideas what to try next?

Thanks!
 

alexburcea

Administrator
Staff member
Hi,

Our last library was designed with OpenPLC editor V2.01. Give us some time to test with the newest version, but in the meantime, if it's not too hard, you can post on the OpenPLC forum to see if someone has the same problem.
 

Yorkie

New member
Many thanks for your swift response - I have added a post on the OpenPLC forum and will see where that takes us.

However I did find another PC with OpenPLC Editor v2.01 installed, so I decided to give that a go. This version does not appear to include the Sequent Microsystems function blocks at all, and the blocks within my program are highlighted red? Am I missing something here?
 

alexburcea

Administrator
Staff member
Hi,

Sorry, I am not able to look into this deeply. I wrote the libraries a long time ago, I don't remember much, so I need some time to reconnect to the subject. Unfortunately, I need to finish my current job before that. Here is the editor I worked with:
Screenshot 2025-06-07 203814.jpg
 

Yorkie

New member
For info there is now an update for the OpenPLC Editor 3 (release date 2025-06-09) that fixes this issue. All working now!

Thank you!
 
Top