Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

GPIO donot function on Raspberry Pi 4

lubos
2020-09-17
2021-03-04
  • lubos - 2020-09-17

    Hello,

    I have problem to control GPIO pins on Raspberry Pi 4.
    I use latest CODESYS runtime Version 3.5.16.10.

    I can control GPIO from RPi 4 system (e.g. Python code), but not from CODESYS.
    I tried older runtime Versions too, another RPi 4 device, but nothing helps.

    On Raspberry 3B+ function everething without problem.

    Did You tried this or do You how to solve this issue?

    Thanks.

     
  • mosfet - 2020-12-05

    Hello,
    I also have the same problem. On the raspberry pi4 model B, the GPIOs controlled with Codesys do not work while if controlled with Python scripts they work correctly. Can someone help me?
    Thanks.

     
  • lubos - 2020-12-07

    Hello,
    I solved this issue with use of new CODESYS runtime V3.5.16.20.
    There I used new GPIO driver: "GPIOs B+/Pi2". (The older was named "GPIOs A/B" and worked me only on RPi3B+).
    Lubos

     

    Last edit: lubos 2020-12-07
  • mosfet - 2020-12-07

    But to enable the GPIO working with codesys, on raspberry I have to configure something? Upgrading to that version still doesn't work for me.

     
  • lubos - 2020-12-07

    Here is detailed picture how to change GPIO control... Update Device for GPIO:

     

    Last edit: lubos 2020-12-07
  • mosfet - 2020-12-07

    thank you for the help but even doing the update (as you showed in the figure) the result does not change. I am really so sorry because i thought it worked without problems.

     
  • lubos - 2020-12-07

    OK, can be, that You have another Problem.. but this need more description of Your issue..

    In Raspbian is neccessary to allow control of GPIO in "Interfaces - Raspberry Pi Configuration". I hope, this You have set if You uses Python.

    Which CODESYS and runtime version do You use?
    Do You set outputs or read inputs?
    Can You send some printscreens or whole project is best...

     
  • tomj - 2020-12-15

    Sorry to butt in here.
    I had same problem to control GPIO on Raspberry Pi 4,
    but I have solved it fortunately.

    The following is just for your information.
    In my case, it is solved by downgrading Raspberry Pi OS.
    What I did was reinstall Raspberry Pi OS by using old Image
    (2020-02-05-raspbian-buster.zip) downloading from Raspberry
    Pi Site and didn't update module while I was installing the OS.

    My Raspberry Pi 4 is ...
    pi@raspberrypi:~ $ cat /proc/device-tree/model
    Raspberry Pi 4 Model B Rev 1.4

    • My environment which GPIO is working
      Codesys Control for Rasberry Pi 3.5.16.20
      Raspberry Pi OS : debian_version 10.2
      (displayed by following command)
      pi@raspberrypi:~ $ cat /etc/debian_version
      10.2

    • My environment which GPIO did not work
      Codesys Control for Rasberry Pi 3.5.16.20
      Raspberry Pi OS :debian_version 10.4
      (displayed by following command)
      pi@raspberrypi:~ $ cat /etc/debian_version
      10.4

     
  • bwmlee - 2021-03-03

    I’m using codesys control v4.0.0.0 with Debian version 10.4 and also do not have functioning GPIOs.
    To codesys, when will this be fixed to avoid having to downgrade Debian?

     
  • eschwellinger

    eschwellinger - 2021-03-03

    as far as I know, this works with current version and current RaspberryPI OS... you just need to select the PB+/PI2 GPOI's

     
  • bwmlee - 2021-03-03

    I’ve tried using the example GPIO project with a flashing output on GPIO23 with no success. I’m conscious that Tomj’s response was only a few months ago. Was v4.0.0.0 intended to fix the issue to support Debian v10.4?

     
  • eschwellinger

    eschwellinger - 2021-03-03

    There was no change on CODESYS side...Just plug the right connector PIB+/P2

     

    Last edit: eschwellinger 2021-03-04
  • bwmlee - 2021-03-03

    I have been using the PiB+/P2 without success.

     

Log in to post a comment.