queifaro
Hello,
are there any OpenWRT runtime library for OPENPLC ? i would like to use on a ARM target.
Thanks in advance
B/R
Reply 0 0
thiagoralves
OpenPLC runs on both ARM microcontrollers and ARM CPUs. For CPUs you need a Debian-based Linux distro
Reply 0 0
queifaro
Thanks.
Is there any chance to cross-compile the runtime software using a toolchain no debian related (for example OpenWRT) ?
Tnks
Reply 0 0
thiagoralves
Nope...you need gcc on target to be able to compile new PLC programs. If you can manage to get gcc and all other OpenPLC dependencies, then you can compile the whole thing on target and it will work. But I assume it will be a lot of work to do so, probably not worth it.
Reply 0 0
queifaro
so please let me check if my understanding are correct:
-the .st program is realized with OpenPLC editor
-OpenPLC runtime must be built using native CPU gcc
- .st program is upload on OpenPLC runtime
-OpenPLC runtime build .st program using the native CPU gcc and then execute it 
 
is above right ?
 
Some question:
howto on microcontrollers ?
who transform .st program in c language program before gcc build ? 
i think that in order to build OpenPLC runtime on the target many auxiliary libraries are necessary ?
 
Thanks again
Reply 0 0
thiagoralves
Yes, your understanding is correct. MatIEC transpiles the ST program into ANSI C code, and then the whole thing is compiled using the target's GCC.
 
On microcontrollers the editor compiles everything through arduino-cli. The process is similar, but since the target is a programmable board with no OS, OpenPLC uses arduino-cli to compile and upload the binary code to the target.
Reply 0 0
stargieg
Thanks.
Is there any chance to cross-compile the runtime software using a toolchain no debian related (for example OpenWRT) ?
Tnks
Yes.
 
 
You can compile this feed with the openwrt-sdk (cross compiler and toolchain) for the latest stable release
or from scratch with openwrt build.
Reply 0 0
ouinouin
@stargieg , very nice to try to port this to openwrt which would be a nice platform fot this kind of project, associated with mqtt this could be a killer feature.
do you plan to maintain your repo ? i might jump in as a tester (unforntunately not being a dev , i could fill issues but likely not correct anything).
Reply 0 0
stargieg
I will continue to develop and maintain the feed.
I don't have access to a compiler farm yet. Therefore there is only a limited choice of binary packages.
On which hardware can you test it. The Openwrt universe is huge. :-) https://openwrt.org/toh/start
BTW: I have added a README.md.
Reply 0 0
ouinouin
Hi,
@stargieg thanks for answer my plan is to test it on an archer C7V2 : target AR71XX , netgear R7800 : ipq806x and GLinet MIFI : AR71XX. in the hope i can find a trick to link this somehow to mqtt.
indeed, thanks for the readme that gives a hint on how to hook this to the buildroot env.
Reply 0 0
stargieg
I have add more arch. See README. The target ar71xx was renamed to ath79. I'm thinking about bacnet, knx and mqtt integration.
Reply 0 0
ouinouin
@stargiest yeah, you rock , i just had time to reload your page, i was installing an openwrt buildroot to give a try , but you got quicker, il give a try on precompiled binaries.
i just saw that with buildroot it seems you cannot compile a package for multiple targets (make menuconfig only let you select for one target). does the SDK allow this, is there somewhere a version of the SDK not outdated (links seems old or broken in the openwrt documentation?
Reply 0 0
stargieg
I have add usage of OpenWRT SDK and IB to README
Reply 0 0
ouinouin
Thanks, @stargieg , i gave a try on ath79 , i managed to get the blink example working, but not the multilanguage, failing at compilation, unfortunately the compilation takes forever (several minutes for the blink example). i faced also an issue on the debug part on the st file while compiliing the multilanguage + once removes the debugging par, he complained about not being able to movo config0.h (that indeed wasnt created), so i gave up for now for this target, i ll give a try with my qualcomm targets while around.
there is room for improvement like compiling in the /tmp instead of wearing the flash by compiling on /usr/libexex/openplc . i also had some issues instaling this since opkg downloads in /tmp and on my 64MB ram board, the tmp is 32MB only , and the gcc package is bigger than that, moreover opkg doesnt deal well with a massive dependencies since it downloads and install packages without erasing the download directly after, which put pressure on the size of tmp.
So the future looks promising but there is room for improvement.
@thiagoralves the main downside i see on those restricted and not powerful platform is having to compile everytime the st file to launch it. is there anyway to keep the compiled version of each program (and trackits matching with its source through md5 or so ) to survive a reboot ?
Reply 0 0
thiagoralves
OpenPLC keeps the latest compiled program binary and launches it every time. You only need to compile again if you change the running program. By the way, the multi language example indeed is not working on the Linux runtime. The config is named incorrectly (it should be config0 as you saw in the sources)
Reply 0 0
Reply