Home (version 9) discussion
Home Project for Users
wiki
(Thread)
Home (version 9) discussion
Last updated: 2020-02-21
(no subject)
Home Project for Users
wiki
(Thread)
Last updated: 2018-01-02
Home (version 4) discussion
Home Project for Users
wiki
(Thread)
Home (version 4) discussion
Last updated: 2019-09-21
Home (version 5) discussion
Home Project for Users
wiki
(Thread)
Home (version 5) discussion
Last updated: 2020-02-09
Home (version 6) discussion
Home Project for Users
wiki
(Thread)
Home (version 6) discussion
Last updated: 2020-02-20
Home (version 2) discussion
Home Project for Users
wiki
(Thread)
Home (version 2) discussion
Last updated: 2018-08-30
Home (version 1) discussion
Home Project for Users
wiki
(Thread)
Home (version 1) discussion
Last updated: 2018-08-30
Home
admin
wiki
(WikiPage)
This is the personal project of Admin. This project is created automatically during user registration as an easy place to store personal data that doesn't need its own project such as cloned repositories.
Last updated: 2018-01-02
Home (version 1) discussion
admin
wiki
(Thread)
Home (version 1) discussion
Last updated: 2018-09-14
(no subject)
admin
wiki
(Thread)
Last updated: 2018-01-02
wiki Discussion
Home Project for Users
wiki
(Discussion)
Forum for wiki comments
Last updated: 2018-01-02
wiki Discussion
admin
wiki
(Discussion)
Forum for wiki comments
Last updated: 2018-01-02
CODESYS Christmas lights - Raspberry Pi
Home Project for Hacks
blog
(Blog Post)
Video not available Use the Webvisualisation on your mobile phone to switch on the lights. Hardware: Raspberry PI Software: CODESYS Development System / Pi Package from CODESYS Store Android App: https://play.google.com/store/apps/details?id=com.codesys.webview CODESYS Project is available here: http://forge.codesys.com/hax/blog/_discuss/thread/4f238366/9b18/attachment/Weihnachtskrippe.project This example shows how to use a port-expander PCF8574 I2C without library/device description from the application code.
Last updated: 2018-01-08
CODESYS Pi PLC - execute python scripts in the PLC application
Home Project for Hacks
blog
(Blog Post)
Video not available This example shows, how to add python scripts in CODESYS as external files and execute them in your CODESYS application. In a similar way, you can execute virtually every other external program from your PLC application, which opens you a wide range of new possibilities. Unicorn HAT example Project is available here: http://forge.codesys.com/hax/blog/_discuss/thread/82598d1c/3050/attachment/DownloadPythonScript_and_Exec_onPI.project
Last updated: 2018-01-08
CODESYS Raspberry PI - OpenCV on current Raspbian
Home Project for Hacks
blog
(Blog Post)
This is an attempt to get the CODESYS OpenCV Raspberry Package running on the current (or newer) Images of Raspbian. As CODESYS opencv package for Raspberry PI was designed for older Raspbian versions, there are dependencies in the opencv Package, that cannot easily resolved on the newest Raspbian versions. I tried something and found out that it might work like this: Download the CODESYS package: At first you need the package from the store: https://store.codesys.com/opencv-for-raspberry-pi.html Download and transfer the included debian package (*.deb) to your raspberry (as described in the package). But dont install it. This will cause some dependency errors, as the "old" opencv packages in version 2.4.9 are not available anymore in current rasbian. now connect to your raspi via SSH (e.g. putty or whatever program you like) now modify the dependencies of this package: you can do that easily by yourself, or with the attached script "fix_cds_opencv_deps.sh": what it basically does: use the .deb file, unpack it, change the dependencies to opencv, and then repack it again to a "no_deps" .deb this is my script "fix_cds_opencv_deps.sh": 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47#!/bin/bash # this script can be used to fix and remove the opencv lib dependencies of # the codesys opencv package for raspberry pi # # first argument can be the full path to the opencv debian package # if no argument is given, we try to find it in the home directory of the user opencv_pkg=$1 if [ -z "$opencv_pkg" ];then echo "try to use local file"; opencv_pkg=$(find ~ -name "codesys_raspi_opencv_V3.5.*" | tail -n 1) fi if [ ! -f "$opencv_pkg" ];then echo "package file not found. please pass the codesys opencv deb file as argument"; exit -1; fi newpkg=${opencv_pkg/codesys/codesys_nodeps} echo "package: $opencv_pkg" # now we unpack this deb package locally echo "unpack into local folder" dpkg-deb -R $opencv_pkg "codesys-raspi-opencv-pkg" # now we can modify the dependency section of the deb package control file echo "modify dependencies" sed -i "s/^Depends:.*/Depends:/" "codesys-raspi-opencv-pkg/DEBIAN/control" # now we pack it again into a deb file echo "pack into new package: $newpkg" dpkg-deb -b "codesys-raspi-opencv-pkg" "$newpkg" # now we remove the temp folder rm -rf "codesys-raspi-opencv-pkg" echo "Showing info from new packaged without dependencies:" dpkg-deb -I "$newpkg" echo "done!" dont forget to make that file executable with the command chmod +x <filename> then you can execute it with: ./fix_cds_opencv_deps.sh" If that worked, we can focus on the hard work: compiling opencv by yourself: we need some prerequisites to be able to compile. The easy ones are: sudo apt-get install build-essential git cmake pkg-config The difficult ones are: sudo apt-get install libjpeg8-dev sudo apt-get install libtiff4-dev sudo apt-get install libjasper-dev sudo apt-get install libpng12-dev sudo apt-get install libavcodec-dev sudo apt-get install libavformat-dev sudo apt-get install libswscale-dev sudo apt-get install libv4l-dev The versions or numbers of the detailled packages might be slightly different to the mentioned ones. just try with autocompletion which ones work. They heavily depend on the real rasbian version that you are using. Now we proceed: This is my script: "raspi_install_opencv.sh": 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65#!/bin/bash # script to download and compile # opencv from source in version 2.4.9 # that fits to the codesys package opencv # # only execute this directly on the raspberry (as we dont cross compile) # and at the end we install the compiled libraries on this target # # # there are some build prerequisites # sudo apt-get install build-essential git cmake pkg-config # these depend on the detailled config of opencv that you want to build: # sudo apt-get install libjpeg8-dev # sudo apt-get install libtiff4-dev # sudo apt-get install libjasper-dev # sudo apt-get install libpng12-dev # sudo apt-get install libavcodec-dev # sudo apt-get install libavformat-dev # sudo apt-get install libswscale-dev # sudo apt-get install libv4l-dev # # the versions or numbers of the detailled packages might be slightly different to the mentioned ones. just try with autocompletion which ones work # # just a test if we are running on a raspi. if that does not work properly and you are sure that you are running # on a raspi then just comment the next line: if [ -z "$(grep 'BCM' /proc/cpuinfo)" ]; then echo "execute this script only on a raspberry"; exit -1 fi echo "creating local working dir: opencv" mkdir opencv cd opencv; if [ ! -f "2.4.9.1.zip" ]; then echo "downloading the sources from github" wget https://github.com/opencv/opencv/archive/2.4.9.1.zip fi echo "unzip the zip" unzip 2.4.9.1.zip echo "go into directory" cd 2.4.9.1 echo "prepare compilation" mkdir build cd build echo "call cmake" cmake -DCMAKE_BUILD_TYPE=Release -DOPENCV_EXTRA_MODULES_PATH=. .. echo "cmake done" echo "now compile" make all -j4 echo "compilation done" echo "install now" sudo make install echo "congrats, you made it until here" dont forget to make that file executable with the command chmod +x <filename> then execute it: ./raspi_install_opencv.sh the compilation will take some time. in the end it will install all libraries compiled on the raspi. Now you can install the codesys opencv package (the fixed one), and it should work: as admin user (root) or with sudo: dpkg -i codesys_nodeps_raspi_opencv_V3.5.11.0.deb This should work and afterwards you should be able to run opencv example projects on your current Raspberry. I admit that this a pretty fast and roughly hacked tutorial, but in general it should work. Just let me know where you had problems, so i can make this hack here better and a more robust hack. Good luck and have fun with it.
Last updated: 2020-09-07
Driving 12V with SoftPWM
Home Project for Hacks
blog
(Blog Post)
For my current project I need a 12V Analog output. Today I did some first tests. Getting 12V I used a voltage regulator which is rising the 5V of the Pi to 12V. The reason is, that I want to be able to power the whole thing with a standard power bank. Getting a PWM signal I used the SoftPWM FB from the GPIOMods project to get a PWM signal out of GPIO4. Driver To drive a voltage that is higher than 3.3V, I used a usual combination of an NPN and a PNP transistor. I just had not the correct resistors at hand, why lower volatages can't be correctly reached (you will notice in the video ;) )
Last updated: 2018-07-10
CODESYS on Linux
Home Project for Hacks
blog
(Blog Post)
Note: The content moved to this project Get CODESYS SP13 or higher Use Development Version of Wine Get winetricks Install Prerequisits Switch to Win7 Install CODESYS Run the setup Ignore errors for Visual C++ Runtimes Don't install Codemeter Wait for Space Computation Use Custom Setup Add Registry Key Start CODESYS Linux RTE online Don't install SVN Plugin With the release of SP13 it is now finally possible to run CODESYS on Wine. The whole procedure is not very straight forward, but still easily possible. Get CODESYS SP13 or higher You can download CODESYS from the CODESYS store (use 32bit version). You need an account for that, before you can download it, but all is for free. Use Development Version of Wine At the time of writing this, I needed to install the development version of wine. sudo apt-get install wine64-development cabextract winbind Get winetricks You will need to download winetricks, which helps you in installing Dot Net, as well as several Visual C++ Runtimes: wget -c https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks chmod 755 winetricks Install Prerequisits Like already mentioned above, you should install some packages using winetricks. I recommend ot use an own wine directory for that: WINEPREFIX=~/.wine.codesys ./winetricks vcrun2005 vcrun2008 vcrun2013 vcrun2015 dotnet46 Switch to Win7 The emulated windows has to be configured to Windows 7. You can do so by using winecfg: WINEPREFIX=~/.wine.codesys winecfg-development Install CODESYS Run the setup WINEPREFIX=~/.wine.codesys wine-development ~/Downloads/CODESYS\ 3.5.13.0.exe Ignore errors for Visual C++ Runtimes Just click through the first part of the setup, and always ignore errors, if s.th. could not be installed. Don't install Codemeter Do not cancel the installer, just deselect every component of the Codemeter Setup, as this will fail. Wait for Space Computation This is a dialog, which takes a long time. Just wait, it will finish. Use Custom Setup In the custom setup you should deselect all, except CODESYS itself (no OPC DA, no CODESYS Control Services, ...) Codesys Gateway works on 32bit and 64bit edition. Add Registry Key After the installation finished successfully, you need to add a registry key. Without this, I got an error of wine, saying "The specified user does not have a valid profile". WINEPREFIX=~/.wine.codesys wine-development reg add "HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\S-1-5-21-0-0-0-1000" Start CODESYS CODESYS should now be ready to start... WINEPREFIX=~/.wine.codesys wine-development ~/.wine.codesys/dosdevices/c\:/Program\ Files\ \(x86\)/CODESYS\ 3.5.13.0/CODESYS/Common/CODESYS.exe Linux RTE online You can install the Linux RTE and login with your Codesys IDE to this PLC. Don't install SVN Plugin At the moment do not install the SVN Plugin into codesys, it will break your installation.
Last updated: 2019-11-30
Driving 12V with SoftPWM (version 1) discussion
Home Project for Hacks
blog
(Thread)
Driving 12V with SoftPWM (version 1) discussion
Last updated: 2018-09-12
CODESYS Raspberry PI - OpenCV on current Raspbian (version 1) discussion
Home Project for Hacks
blog
(Thread)
CODESYS Raspberry PI - OpenCV on current Raspbian (version 1) discussion
Last updated: 2018-08-31
CODESYS on Linux (version 5) discussion
Home Project for Hacks
blog
(Thread)
CODESYS on Linux (version 5) discussion
Last updated: 2018-11-14
Test discussion
Home Project for Hacks
blog
(Thread)
Test discussion
Last updated: 2018-10-01
CODESYS Pi PLC - execute python scripts in the PLC application (version 5) discussion
Home Project for Hacks
blog
(Thread)
CODESYS Pi PLC - execute python scripts in the PLC application (version 5) discussion
Last updated: 2018-09-12
CODESYS on Linux (version 9) discussion
Home Project for Hacks
blog
(Thread)
CODESYS on Linux (version 9) discussion
Last updated: 2018-11-14
CODESYS on Linux (version 12) discussion
Home Project for Hacks
blog
(Thread)
CODESYS on Linux (version 12) discussion
Last updated: 2018-11-14
Driving 12V with SoftPWM discussion
Home Project for Hacks
blog
(Thread)
Driving 12V with SoftPWM discussion
Last updated: 2018-07-10