Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » [HELP] Raspberry Pi GPIO Usage- Beginner(Help on Raspberry Pi Pin Mapping and GPIO usage.)
icon5.gif  [HELP] Raspberry Pi GPIO Usage- Beginner [message #1753962] Mon, 13 February 2017 12:51 Go to next message
Akshai M is currently offline Akshai MFriend
Messages: 10
Registered: February 2017
Junior Member
Hi Team,

Sorry If I am creating a duplicate thread.I couldn't find any thread for beginners using 4DIAC with RPi hence I made a new one.

What I have done so far :
I have compiled Forte on Pi using help from official page.<https://eclipse.org/4diac/documentation/html/installation/raspi.html>
I have enabled SysFs and compilation was completed in 15 mins using RPi 3.
The forte executable was located in org.eclipse.4diac.forte/bin/posix/src. I tried it using ./forte as a normal user. (No status was conveyed in shell after execution).
Made an application to blink led on GPIO 3 (Pin 5). Referred an example in https://www.eclipse.org/forums/index.php/t/1075043/. I have attached the image for reference.
Defined system.I have used ethernet segment in 4DIAC although I am connected via WiFi.Again,I have attached the image for reference.
Profile of Raspberry Pi in Properties Tab was made HOLOBLOC.
Deployed the application with no errors. (had to restart forte and then uploaded.During upload no status update was shown in shell(forte) but upload was shown complete in 4DIAC IDE)

What is not working:
The LED connected to GPIO 3( PIN 5) does not blink.

I have been working on the same for 1 week.Started off in PiZero and now moved to RPi 3 but the case remains same.Any help is deeply appreciated.

Regards.

Akshai M

[Updated on: Mon, 13 February 2017 16:22]

Report message to a moderator

Re: [HELP] Raspberry Pi GPIO Usage- Beginner [message #1754054 is a reply to message #1753962] Tue, 14 February 2017 08:12 Go to previous messageGo to next message
Waldemar Eisenmenger is currently offline Waldemar EisenmengerFriend
Messages: 4
Registered: February 2016
Junior Member
Hi Akshai,

in the application which you have attached one data connection between the dataoutput "Q" of "E_SR" FB and datainput "OUT" of the "QX" FB is missing.

Regards.

Waldemar
Re: [HELP] Raspberry Pi GPIO Usage- Beginner [message #1754055 is a reply to message #1753962] Tue, 14 February 2017 08:13 Go to previous messageGo to next message
Jose Maria Jesus Cabral Lassalle is currently offline Jose Maria Jesus Cabral LassalleFriend
Messages: 199
Registered: February 2016
Senior Member
You must connect the Q output of SR to the OUT input of QX.

The OUT data input of QX is the value written to the hardware. If something is not working, you can right click on your project and click Monitor. Then a right click on a FB or variable and Watch All/Watch will allow you to see the current value of it.
Re: [HELP] Raspberry Pi GPIO Usage- Beginner [message #1754073 is a reply to message #1754055] Tue, 14 February 2017 11:51 Go to previous messageGo to next message
Akshai M is currently offline Akshai MFriend
Messages: 10
Registered: February 2017
Junior Member
Hi,

Thank you all for the quick reply. I have connected the Q output of SR to the OUT input of QX but still the GPIO value in Pi is not changing after download. Please find the attached images with state changes of function blocks.http://i.imgur.com/6d6lCXg.png
http://i.imgur.com/46TwSMF.png

Regards.
Akshai M
Re: [HELP] Raspberry Pi GPIO Usage- Beginner [message #1754077 is a reply to message #1754073] Tue, 14 February 2017 12:11 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1584
Registered: January 2014
Senior Member

Hi,

the QO and status output gives you feedback that the QX had issues on writing the output. It would be great if you could have a look on the output right after init before the first request. But my assumption is that the user you are running forte on your rapsi does not have the right to access the sysfs filesystem. Either you add your user to the correct group or you try to run FORTE as super user.

I hope this helps.

BR,
Alois
Re: [HELP] Raspberry Pi GPIO Usage- Beginner [message #1754082 is a reply to message #1754073] Tue, 14 February 2017 12:27 Go to previous messageGo to next message
Akshai M is currently offline Akshai MFriend
Messages: 10
Registered: February 2017
Junior Member
Hi,

Ran forte as SU and it worked!!!. But why does it need su permissions ? Is this normal ?

Regards.

Akshai M
Re: [HELP] Raspberry Pi GPIO Usage- Beginner [message #1754085 is a reply to message #1754082] Tue, 14 February 2017 12:53 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1584
Registered: January 2014
Senior Member

Hi,

the point is that FORTE uses the sysfs which is located under "/sys/class/gpio/". In order to use the IOs any application using sysfs needs to be allowed to read and write there. Per default not all users are allowed to do this. Super user is one option but not the option that I would recommend. Normally there is a special group defined and by adding your user to this group you should be able to access as this user sysfs. I don't have currently a raspi with me so I don't know the name of the group. Maybe Waldemar or Jose can tell more on this.

Cheers,
Alois
Previous Topic:Send data between FB
Next Topic:4DIAC: Copy-Paste FBs
Goto Forum:
  


Current Time: Tue Apr 23 15:54:41 GMT 2024

Powered by FUDForum. Page generated in 0.04469 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top