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 » How to add wiringPi library to access the softPWM functions.
How to add wiringPi library to access the softPWM functions. [message #1740478] Sun, 14 August 2016 14:37 Go to next message
Santosh Kumar Panda is currently offline Santosh Kumar PandaFriend
Messages: 9
Registered: June 2016
Junior Member
Hi All,

I want to generate a software based PWM in Raspberry Pi. For this I have installed wiringPi library.

Now I want to add the wiringPi library to Forte while compiling it. How this can be done? Also do I need to compile the same in the local forte?

Thanks,
Santosh
Re: How to add wiringPi library to access the softPWM functions. [message #1740482 is a reply to message #1740478] Sun, 14 August 2016 18:20 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 644
Registered: January 2014
Senior Member
Hi,

you need to specify the library you want to add in the CMakeList.txt file with the forte_add_link_library command. You can have a look at the mqtt_paho module for examples on how you can do this.

No you don't need to add this to your local forte. You only need add the libraries for the specific platforms.

Alois
Re: How to add wiringPi library to access the softPWM functions. [message #1777912 is a reply to message #1740478] Wed, 06 December 2017 06:46 Go to previous messageGo to next message
Barry wan is currently offline Barry wanFriend
Messages: 36
Registered: July 2017
Member
hi,i also want to control a motor with pwm use 4diac on raspberry board,
have you finished it ?
Re: How to add wiringPi library to access the softPWM functions. [message #1778362 is a reply to message #1777912] Wed, 13 December 2017 13:15 Go to previous messageGo to next message
Jose Maria Jesus Cabral Lassalle is currently offline Jose Maria Jesus Cabral LassalleFriend
Messages: 103
Registered: February 2016
Senior Member
I have created a PWM as a Servcie Function Block that only works on posix, so it would work for the rpi. It is a software PWM that turns on and off an output in its own thread. I could attach the .fbt, the .cpp and the .h file here, but I'm not sure if that's what you are looking for
Re: How to add wiringPi library to access the softPWM functions. [message #1778497 is a reply to message #1778362] Fri, 15 December 2017 01:44 Go to previous messageGo to next message
Barry wan is currently offline Barry wanFriend
Messages: 36
Registered: July 2017
Member
would you mind sharing it with me ? thank you
Re: How to add wiringPi library to access the softPWM functions. [message #1778578 is a reply to message #1778497] Mon, 18 December 2017 08:25 Go to previous messageGo to next message
Jose Maria Jesus Cabral Lassalle is currently offline Jose Maria Jesus Cabral LassalleFriend
Messages: 103
Registered: February 2016
Senior Member
Hi, here are the FBT file to be used in 4DIAC and the cpp and h file to compile in forte. Follow https://www.eclipse.org/4diac/documentation/html/installation/install.html#ownFORTE to build forte with the new FB.
  • Attachment: PWM.fbt
    (Size: 5.47KB, Downloaded 81 times)
  • Attachment: PWM.h
    (Size: 3.32KB, Downloaded 40 times)
  • Attachment: PWM.cpp
    (Size: 5.78KB, Downloaded 34 times)
Re: How to add wiringPi library to access the softPWM functions. [message #1778630 is a reply to message #1778578] Tue, 19 December 2017 06:37 Go to previous messageGo to next message
Barry wan is currently offline Barry wanFriend
Messages: 36
Registered: July 2017
Member
Thank you very much for your sharing

[Updated on: Tue, 19 December 2017 06:55]

Report message to a moderator

Re: How to add wiringPi library to access the softPWM functions. [message #1795057 is a reply to message #1778578] Thu, 13 September 2018 18:25 Go to previous messageGo to next message
Rodrigo Esposito is currently offline Rodrigo EspositoFriend
Messages: 24
Registered: August 2016
Junior Member
How do i import this block on 4diac IDE?
Re: How to add wiringPi library to access the softPWM functions. [message #1795063 is a reply to message #1795057] Thu, 13 September 2018 19:58 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 644
Registered: January 2014
Senior Member
jsut copy paste the fbt file into your projects type library directory.
Re: How to add wiringPi library to access the softPWM functions. [message #1795176 is a reply to message #1795063] Mon, 17 September 2018 20:20 Go to previous messageGo to next message
Rodrigo Esposito is currently offline Rodrigo EspositoFriend
Messages: 24
Registered: August 2016
Junior Member
Thank you very much for your response.
I'm trying to use the pwm block and I'm having this Response ID: "Unsupported_Type" The runtime Device Manager has returned an Error of type Unsupported_Type . In the images are the console outputs. I'm running the fort on raspberry and the version was built according to image 3. Could someone help me? I have the wiringPi library installed on raspberry and I ran a test with an application in c and it worked.
Re: How to add wiringPi library to access the softPWM functions. [message #1795205 is a reply to message #1795176] Tue, 18 September 2018 11:25 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 644
Registered: January 2014
Senior Member
If you are getting unsuported type it typcially means that the forte you are running does not contain the FB. Have you ensured that during recompilation of FORTE the cpp file of your pwm was compiled. I noticed that in some odd cases the build process didn't generate a forte executable. Therefore it make sense to check if the data of your forte executable file has changed (this costed me last week at least half an hour error searching).

Then if you have several fortes are you starting the right one.

Finally is there already a forte running on your system, e.g., started from systemd or init.d. Better check with ps -aux | grep forte and if yes kill it first.
Re: How to add wiringPi library to access the softPWM functions. [message #1795232 is a reply to message #1795205] Tue, 18 September 2018 20:46 Go to previous messageGo to next message
Rodrigo Esposito is currently offline Rodrigo EspositoFriend
Messages: 24
Registered: August 2016
Junior Member
I was compiling it an external module and it was not working, so i just created a directory under src/modules and cmake could read and compile in the right way. Thank you once again!
Re: How to add wiringPi library to access the softPWM functions. [message #1795233 is a reply to message #1795232] Tue, 18 September 2018 20:51 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 644
Registered: January 2014
Senior Member
Oh. Thanks to let us know. It looks like that the external modules directory feature is still a bit fragile to use. The important point here is that the structure of the external modules directory is simular to the internal modules directory. That means the directory you specify as external modules directory has to have the different modules as sub directories and not directly the module itself.
Previous Topic:Help Modbus communication
Next Topic:INVALID_DST error
Goto Forum:
  


Current Time: Tue Oct 16 23:16:45 GMT 2018

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

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

Back to the top