Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: RASPBERRY et GPIO

RASPBERRY et GPIO 5 years 3 months ago #10165

  • Denis
  • Denis's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
Hello everyone,

I try, to run PROVIEW on a RPI. In the first stage, I created a very simplified project, just to "try".

Everything seems to behave well until the launch of the runtime on the RPI. The problem is that nothing happens. In appearance: everything appears normal (the runtime is in green) but the automatism seems inactive (while it works very well in simulation).

Does anyone have a positive experience of the same nature? did he manage to run the GPIO with PROVIEW ? where should I search to find my mistake?

Thank you in advance for your answers.

Denis

PJ : Log at runtime launched after a reset of it and PLC
Attachments:
Last Edit: 5 years 3 months ago by Denis.
The administrator has disabled public write access.

RASPBERRY et GPIO 5 years 2 months ago #10167

  • cresus
  • cresus's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 7
  • Karma: 0
Hi Denis,
1)Add pwrp to the sudoers

2)Try to light a LED with the Shell command:
go here: luketopia.net/2013/07/28/raspberry-pi-gpio-via-the-shell/
or here(in french): www.windtopik.fr/debuter-gpio/

3)the plc executable need to have write access to the GPIO files!!
Go here: www.proview.se/v3/index.php/forum/4-prov...i2-gpio?limitstart=0
for me, it is like:
sudo chown root $pwrp_exe/plc_rpi3c_0001_plc
sudo chmod u+s $pwrp_exe/plc_rpi3c_0001_plc

Don't forget sdf 'projectname'...

4)Change "group" file(add pwrp to gpio group)
pwd
cd /etc
nano group

good luck

Vous semblez français.
j'ai réussis il y a environ un an à commander les sorties et à lire les entrées GPIO...avec pas mal de difficultés.
Je penses que votre problème est que le plc n'a pas les privilèges pour commander le GPIO

1)je vous conseil d'abord d'ajouter pwrp au sudoers.

2)essayer ensuite d'allumer une LED avec les commandes Shell.
C'est très bien expliqué ici: www.windtopik.fr/debuter-gpio/

3)Aller voir ci-dessous pour permettre au plc d'accéder au GPIO:
www.proview.se/v3/index.php/forum/4-prov...i2-gpio?limitstart=0

Pour moi cela donnait:
sudo chown root $pwrp_exe/plc_rpi3c_0001_plc
sudo chmod u+s $pwrp_exe/plc_rpi3c_0001_plc

N'oublier pas sdf 'projectname'... pour bien pointer sur le bon Projet

4)Il faut ensuite modifier le fichier "group", sinon pour moi cela ne fonctionnait pas
pwd
cd /etc
nano group
Dans le fichier, il faut ajouter "pwrp" au groupe "gpio"
J'ai constaté qu'après un reboot, mes GPIO sont commandés qu'au deuxième démarrage de la PLC. Pas d'explication à cela.

Bon courage!
Attachments:
Last Edit: 5 years 2 months ago by cresus.
The administrator has disabled public write access.

RASPBERRY et GPIO 5 years 2 months ago #10168

  • Denis
  • Denis's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
Hello Cresus and thank's a lot for this post.
Bsr Cresus et merci beaucoup de vous intéresser à mon pb.

I tried to do every things you wrote ... without any success.
J'ai tenté toutes les corrections proposées, sans succès.

In fact my pb seems to come from a form of "inactivity" of the PLC. Indeed, I have placed a function "pulse train" that does not change state.
En fait mon pb semble provenir d'une forme d'"inactivité" du PLC. En effet, j'y ai placé une fonction "pulse train" qui ne change pas d'état.

I have a question, please: during your tests on raspberry, did you built the executable on the raspberry or on another computer (then distributing it on the raspberry)?
J'aurais une question, SVP : lors de vos essais sur raspberry, construisiez-vous l’exécutable sur le raspberry ou sur un autre micro (en le distribuant ensuite sur le raspberry) ?

Merci de votre réponse.
The administrator has disabled public write access.

RASPBERRY et GPIO 5 years 2 months ago #10190

  • Denis
  • Denis's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
Good evening everyone

After much research and attempts, I think I have identified a cause of my problem. As I indicated previously, I felt that the LPC was not starting. So I replaced my previous schema with a Grafcet. It works well, too, on the development station, in simulation mode. After "distribute" on the raspberry, I run the runtime, and still nothing. I thought that the operating tempos were too short for the RPI, and I increased them (unsuccessfully). And there, I just realized that the process "rt_io" was inactive, while launching "pwr_io" seems well launched.

Has anyone ever encountered this phenomenon? Could he tell me where is my mistake?

I put in PJ, the system state table, and the launch log runtime (after a reset of it).

Note : I access the RPI through an SSH connection.

Thank you for the help you would like to bring me.

________________________________________________________________________________
ProviewR Runtime Environment

I Reading Boot file /pwrp/common/load/ld_boot_raspberrychauffage_0001.dat
I Created at 15-FEB-2019 16:49:04.32 for project: chauffage
I This node vill run PLC file: plc_raspberrychauffage_0001_plc
I This node has node identity 0.1.1.1 (65793)
I Reading Node file /pwrp/common/load/ld_node_raspberrychauffage_0001.dat
I Reading volume file /pwrp/common/load/volchauffage.dbs
I Created 15-FEB-2019 16:48:46.00
I Reading volume file /usr/pwrrt/load/rt.dbs
I Created 21-OCT-2018 12:00:00.00
I Reading volume file /usr/pwrrt/load/pwrs.dbs
I Created 21-OCT-2018 12:00:00.00
I Reading volume file /usr/pwrrt/load/pwrb.dbs
I Created 21-OCT-2018 12:00:00.00
I Reading volume file /usr/pwrrt/load/basecomponent.dbs
I Created 21-OCT-2018 12:00:00.00
I Reading volume file /usr/pwrrt/load/profibus.dbs
I Created 21-OCT-2018 12:00:00.00
I Reading volume file /usr/pwrrt/load/otherio.dbs
I Created 21-OCT-2018 12:00:00.00
I Mapped /tmp/pwr_db_lock_001, base: b6ef8000, size: 12
I Objects : 44707 : 13233272 bytes
I Volumes : 30 : 13680 bytes
I Classes : 300 : 33600 bytes
I Nodes : 10 : 6720 bytes
I Mount servers: 100 : 7600 bytes
I Alias servers: 50 : 2400 bytes
I Sub servers : 500 : 54000 bytes
I Sub clients : 2000 : 352000 bytes
I San servers : 200 : 16800 bytes
I Cache : 10000
I Cached classes: 300 : 208800 bytes
I Cached class volumes: 150 : 8400 bytes
I Sub class objects: 300 : 37200 bytes
I Pool isize : 13974472, esize: 1746809
I Rtdb isize : 5375736, esize: 671967
I Mapped /tmp/pwr_pool_001, base: b6ef3000, size: 18516
I Mapped /tmp/pwr_po0001_001, base: b22d5000, size: 13974472
I Mapped /tmp/pwr_rtdb_001, base: b6eee000, size: 18516
I Mapped /tmp/pwr_rt0001_001, base: b1db4000, size: 5375736
I Mapped /tmp/pwr_po0002_001, base: b6eed000, size: 2016
I Reading volume file /pwrp/common/load/volchauffage.dbs
I Loading volume VolChauffage ()...
I Reading volume file /usr/pwrrt/load/rt.dbs
I Loading volume rt ()...
I Reading volume file /usr/pwrrt/load/pwrs.dbs
I Loading volume pwrs ()...
I Reading volume file /usr/pwrrt/load/pwrb.dbs
I Loading volume pwrb ()...
I Reading volume file /usr/pwrrt/load/basecomponent.dbs
I Loading volume BaseComponent ()...
I Reading volume file /usr/pwrrt/load/profibus.dbs
I Loading volume Profibus ()...
I Reading volume file /usr/pwrrt/load/otherio.dbs
I Loading volume OtherIO ()...
I Created pwrNode, oid: 1.1.1.1:2147483649
I Setting log file to: /pwrp/common/log/pwr_raspberrychauffage.log
I Mapped /tmp/pwr_qdb_lock_001, base: b6eec000, size: 12
I Qcom pool isize : 600000, esize: 300000
I Mapped /tmp/pwr_qpool_001, base: b6ee7000, size: 18516
I Mapped /tmp/pwr_qp0001_001, base: b1d21000, size: 600000
I Mapped /tmp/pwr_qp0002_001, base: b6ee6000, size: 560
I Mapped /tmp/pwr_time_lock_001, base: b6ee5000, size: 12
I Mapped /tmp/pwr_str_lock_001, base: b6ee4000, size: 12
I Mapped /tmp/pwr_nmps_lock_001, base: b6ee3000, size: 12
I BACKUP loading information from $pwrp_load/pwr_backup.bck
I Starting pwr_neth, file: rt_neth, prio: 18
I Started pwr_neth_1, prio: 18, pid: 2646
file: rt_neth
I Starting pwr_qmon, file: rt_qmon, prio: 19
I Started pwr_qmon_1, prio: 19, pid: 2647
file: rt_qmon
I Starting pwr_nacp, file: rt_neth_acp, prio: 17
I Started pwr_nacp_1, prio: 17, pid: 2648
file: rt_neth_acp
I Starting pwr_io, file: rt_io_comm, prio: 17
I Started pwr_io_1, prio: 17, pid: 2649
file: rt_io_comm
I Starting pwr_tmon, file: rt_tmon, prio: 17
I Started pwr_tmon_1, prio: 17, pid: 2650
file: rt_tmon
I Starting pwr_emon, file: rt_emon, prio: 17
I Started pwr_emon_1, prio: 17, pid: 2651
file: rt_emon
I Starting pwr_alim, file: rt_alimserver, prio: 17
I Started pwr_alim_1, prio: 17, pid: 2652
file: rt_alimserver
I Starting pwr_bck, file: rt_bck, prio: 16
I Started pwr_bck_1, prio: 16, pid: 2653
file: rt_bck
I Not starting pwr_linksup, file: rt_linksup
I Not starting pwr_trend, file: rt_trend
I Not starting pwr_fast, file: rt_fast
I Not starting pwr_remh, file: rs_remotehandler
I Not starting pwr_remlog, file: rs_remote_logg
I Starting pwr_elog, file: rt_elog, prio: 15
I Started pwr_elog_1, prio: 15, pid: 2654
file: rt_elog
I Not starting pwr_sysmon, file: rt_sysmon
I Starting pwr_webmon, file: rt_webmon.sh, prio: 15
I Started pwr_webmon_1, prio: 15, pid: 2655
file: rt_webmon.sh
I Starting pwr_webmonmh, file: rt_webmonmh.sh, prio: 15
I Started pwr_webmonmh_1, prio: 15, pid: 2656
file: rt_webmonmh.sh
I Starting pwr_webmonelog, file: rt_webmonelog.sh, prio: 15
I Started pwr_webmonelog_1, prio: 15, pid: 2657
file: rt_webmonelog.sh
I Not starting pwr_websocketserver, file: rt_websocketserver.sh
I Not starting pwr_opc_server, file: opc_server
I Starting pwr_statussrv, file: rt_statussrv, prio: 15
I Started pwr_statussrv_1, prio: 15, pid: 2658
file: rt_statussrv
I Not starting pwr_post, file: rt_post
I Not starting pwr_report, file: rt_report
I Not starting pwr_sevhistmon, file: rt_sevhistmon
I Not starting pwr_sev_server, file: sev_server
I Not starting pwr_powerlink, file: rt_powerlink
I Not starting pwr_videomgm, file: rt_videomgm
I Not starting pwr_redcom, file: rt_redcom
I Not starting pwr_sim, file: rt_sim
sched_setscheduler: Operation not permitted
failed to set pid 2646's policy
sched_setscheduler: Operation not permitted
failed to set pid 2647's policy
sched_setscheduler: Operation not permitted
failed to set pid 2648's policy
sched_setscheduler: Operation not permitted
failed to set pid 2649's policy
sched_setscheduler: Operation not permitted
failed to set pid 2650's policy
sched_setscheduler: Operation not permitted
failed to set pid 2651's policy
sched_setscheduler: Operation not permitted
failed to set pid 2652's policy
sched_setscheduler: Operation not permitted
failed to set pid 2653's policy
sched_setscheduler: Operation not permitted
failed to set pid 2654's policy
sched_setscheduler: Operation not permitted
failed to set pid 2655's policy
sched_setscheduler: Operation not permitted
failed to set pid 2656's policy
sched_setscheduler: Operation not permitted
failed to set pid 2657's policy
sched_setscheduler: Operation not permitted
failed to set pid 2658's policy
I Adding application. aix: 1
I Starting pwr_plc_plc, file: plc_raspberrychauffage_0001_plc, prio: 5
I Started pwr_plc_plc_1_0, prio: 5, pid: 2659
file: plc_raspberrychauffage_0001_plc
HistServer starting
java.library.path = /usr/pwrrt/exe:/usr/java/packages/lib/arm:/usr/lib/arm-linux-gnueabihf/jni:/lib/arm-linux-gnueabihf:/usr/lib/arm-linux-gnueabihf:/usr/lib/jni:/lib:/usr/lib
JHist: Before waiting for client
Attachments:
The administrator has disabled public write access.

RASPBERRY et GPIO 5 years 2 months ago #10198

Hi Denis,

Could you try manually launching an application with realtime priority? For example:
sudo chrt -f 10 nano

chrt (CHange RealTime) sets the scheduler (-f for the FIFO scheduler) and priority (10) of an application (nano).

Does this work or do you get the same error message "sched_setscheduler: Operation not permitted"?
The administrator has disabled public write access.

RASPBERRY et GPIO 5 years 2 months ago #10200

  • Denis
  • Denis's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
Hi Christoffer and thanks for your reply.

I tried to do what you wrote, but unfortunately, the command launched "NANO"without error.

Nonetheless, thanks again for your help.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Time to create page: 8.422 seconds