JMiller
I am trying to run the code that is attached on a Raspberry Pi 4. The simulation seems to go fine, but when the program is uploaded nothing happens. The Monitoring page doesn't change states. Also on the Monitoring page, PB2 should be true as it is negated, yet it shows as false on the page.
Quote 0 0
thiagoralves
Did you load the Raspberry Pi driver on the Hardware tab as per instructions on the OpenPLC website?
Quote 0 0
JMiller
Yes, I did. Is there something I am missing on this page?
Quote 0 0
thiagoralves
Just checked your code and it seems fine, couldn't find anything wrong with it. Are you sure you're testing the right input pins? %IX0.3 and %IX0.4 are pins 11 and 13 on the Raspberry Pi GPIO header. Also, negating a contact won't make it show negated on the monitoring page. The monitoring page shows you the state of your variables. A negated contact doesn't change the state of the variable associated with it, just inverts the condition for it to be closed or open.
Open the monitoring page, make sure it is refreshing (works better on Chrome) and touch pins 11 and 13 with 3.3V. You will see that the two inputs will blink.
Quote 0 0
JMiller
I am 100% sure that the pins I am connected to are 11 and 13. When you say blink do mean the highlighted box or the Value. When hovering over one of the pins with my mouse, the pin becomes highlighted with a dark gray box and the box is what is blinking.
Quote 0 0
thiagoralves
You should see this when the variable is true:
true.png and this when the variable is false:false.pngJust upload this little oscillator project to your Pi and first check the monitoring page to see if out0 is changing like the picture above. If it is not, then probably there is something on your browser that is preventing the page refresh. If you can see out0 changing state every second on the monitoring page, then check your %QX0.0 output on the Pi. You should read 0V / 3.3V intermittently every second.
Quote 0 0
JMiller
The monitoring page Value is changing between True and False; however, the LED is not lighting up.
Quote 0 0
thiagoralves
So this means that there is something wrong with your Pi. My best bet is that there is some background library / task / Python script that is interfering with OpenPLC driver. Try installing OpenPLC on a fresh Raspbian install. This usually works best
Quote 0 0
JMiller
Okay, I will try that.
Quote 0 0
JMiller
I installed a fresh Raspbian OS, installed OpenPLC, and uploaded the oscillator .st file. On start up the LED will light up, but will do nothing when OpenPLC start running the program. Attached are photos of the GPIO pins and the circuit. The black wire is ground and the white wire is connected to %QX0.0
Quote 0 0
thiagoralves
Just now I noticed that you're using a Pi4. I've seen users reporting issues on the Pi4 due to WiringPi (a library that OpenPLC relies on to control the GPIO pins). Try to update your WiringPi according to instructions here: http://wiringpi.com/wiringpi-updated-to-2-52-for-the-raspberry-pi-4b/
You need to be at least on version 2.52 for it to work
Quote 0 0
JMiller
After updating wiringpi it is now working. Thank you!
Quote 0 0