Paolo
It's fresh install of OpenPLC Runtime on Raspberry Pi 3 Model B Plus Rev 1.3 (bullseye) armv7l with wiringpi_3.2-bullseye_armhf.deb.
Raspberry Pi Hardware Layer compile succefully but UnipiV1.1 Hardware Layer fail :
Optimizing ST program...
Generating C files...
POUS.c
POUS.h
LOCATED_VARIABLES.h
VARIABLES.csv
Config0.c
Config0.h
Res0.c
Moving Files...
Compiling for Raspberry Pi
Generating object files...
Generating glueVars...
Compiling main program...
/usr/bin/ld: /tmp/ccQgmNtQ.o: in function `readAdcThread(void*)':
hardware_layer.cpp:(.text+0x120): undefined reference to `wiringPiI2CWrite'
/usr/bin/ld: hardware_layer.cpp:(.text+0x218): undefined reference to `wiringPiI2CWrite'
/usr/bin/ld: /tmp/ccQgmNtQ.o: in function `mcp_adcSetup(int)':
hardware_layer.cpp:(.text+0x32c): undefined reference to `wiringPiI2CSetup'
/usr/bin/ld: /tmp/ccQgmNtQ.o: in function `initializeHardware()':
hardware_layer.cpp:(.text+0x3e8): undefined reference to `wiringPiSetup'
/usr/bin/ld: hardware_layer.cpp:(.text+0x3fc): undefined reference to `mcp23008Setup'
/usr/bin/ld: hardware_layer.cpp:(.text+0x404): undefined reference to `pwmSetMode'
/usr/bin/ld: hardware_layer.cpp:(.text+0x40c): undefined reference to `pwmSetClock'
/usr/bin/ld: hardware_layer.cpp:(.text+0x414): undefined reference to `pwmSetRange'
/usr/bin/ld: hardware_layer.cpp:(.text+0x458): undefined reference to `pinMode'
/usr/bin/ld: hardware_layer.cpp:(.text+0x4b0): undefined reference to `pinMode'
/usr/bin/ld: hardware_layer.cpp:(.text+0x4c8): undefined reference to `pullUpDnControl'
/usr/bin/ld: hardware_layer.cpp:(.text+0x500): undefined reference to `pinMode'
/usr/bin/ld: /tmp/ccQgmNtQ.o: in function `updateBuffersIn()':
hardware_layer.cpp:(.text+0x5ec): undefined reference to `digitalRead'
/usr/bin/ld: /tmp/ccQgmNtQ.o: in function `updateBuffersOut()':
hardware_layer.cpp:(.text+0x7d8): undefined reference to `digitalWrite'
/usr/bin/ld: hardware_layer.cpp:(.text+0x834): undefined reference to `pwmWrite'
collect2: error: ld returned 1 exit status
Error compiling C files
Compilation finished with errors!
Reply 0 0
thiagoralves
Due to wiringpi being retired, the Raspberry Pi driver switched to pigpio instead of wiringpi. This means that the UniPi driver is now broken and needs to be rewritten to use pigpio instead. A quick fix (since you're running on bullseye and wiringpi still works on bullseye) would be to just link it with wiringpi instead of pigpio as it was before: https://github.com/thiagoralves/OpenPLC_v3/commit/1666535e8554f54b04a5727eb78a7beeaddd6c29 (take a look at the compile_program.sh script)
Reply 1 0
Paolo
OK, so if understand, if I undo what you have change on compile_program.sh it can work without reinstall OpenPLC_v3 ?
Reply 0 0
thiagoralves
Possibly yes.
Reply 0 0
Paolo
Compilation finished successfully!
Thank you
Reply 0 0
Reply