CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Mon Sep 16, 2019 5:42 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Raspberry Watchdog
PostPosted: Mon Sep 22, 2014 7:32 am 
Offline

Joined: Thu Sep 18, 2014 12:10 am
Posts: 88
Is there any example how can i use the hardware watchdog of Raspberry pi B+ from Codesys like "watchdog daemon"?
http://www.bayerschmidt.com/raspberry-pi/89-auto-reboot-a-hung-raspberry-pi-using-the-on-board-watchdog-timer.html

Regards


Top
   
 Post subject: Re: Raspberry Watchdog
PostPosted: Mon Sep 22, 2014 3:38 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3448
Hi,

as I see this should already work on a licensed Raspberry Pi, on a unlicensed Pi
you'll have the problem after the 2h demo the load does increase, therefore the whatchdog might
lead to an unwanted reboot.
Can someone confirm this?
BR
Edwin


Top
   
 Post subject: Re: Raspberry Watchdog
PostPosted: Mon Sep 22, 2014 4:20 pm 
Offline

Joined: Thu Sep 18, 2014 12:10 am
Posts: 88
Hi Edwin

Do you mean that the licenced and unlicenced Raspberries they differ in functionality?
Can i check the function of Raspberry watchdog before take a licence?
I don't care for an unwanted reboot because we need this only for tests before licence.

Regards


Top
   
 Post subject: Re: Raspberry Watchdog
PostPosted: Mon Sep 22, 2014 4:25 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3448
Hi,
functionality difference not, this is for sure!
But there is an issue if the runtime of 2h is over, the runtime increase the processorload
which maybe lead to an trigger of the watchdog.


>Can i check the function of Raspberry watchdog before take a licence?
yes so this also a test for the whatdog function - after two hour you should see a reboot ;-)
>I don't care for an unwanted reboot because we need this only for tests before licence.
Let me know if this happens.
I will test this too.

BR Edwin


Top
   
 Post subject: Re: Raspberry Watchdog
PostPosted: Mon Sep 22, 2014 4:52 pm 
Offline

Joined: Thu Sep 18, 2014 12:10 am
Posts: 88
Hi Edwin.

That's what I need, a sample project to see how I can use the Raspberry watchdog from codesys IEC control.

Regards


Top
   
 Post subject: Re: Raspberry Watchdog
PostPosted: Mon Sep 22, 2014 4:57 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3448
Hi,
one moment then this is a misunderstanding,
from CODESYS project there is nothing which you need to add.
You just install the watchdog this is what you have as description in your link.
That is it-> In the config of the watchdog you setup the load... !
Todo more makes no sense, on an non hard realtime capable environment like the Raspberry Pi it is.
(I mean triggering the watchdog from runtime side make no sense... except you have realtime in your runtime task which is not the case on raspberry pi)
Do you agree ?
BR
Edwin


Top
   
 Post subject: Re: Raspberry Watchdog
PostPosted: Mon Sep 22, 2014 5:19 pm 
Offline

Joined: Thu Sep 18, 2014 12:10 am
Posts: 88
Hi Edwin.

We need the watchdog because if we have any bug in our IEC code or we lost serial communication we need to reboot the system to make sure that we continue working.


Top
   
 Post subject: Re: Raspberry Watchdog
PostPosted: Mon Sep 22, 2014 5:25 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3448
hm... but the only thing what you can react on is if you do accidentally an endless loop in your application,
this will lead to an reboot. (triggered by the external watchdog from your link)

In this case I would recommend to use the Watchdog function on the tasks or use the plcload watchdog
which you could configure in the CODESYSCOntrol.cfg

If you detect that serial communication from you application does not work anymore and this should cause a reboot triggered
by your application I would recommend to use Sysprocess to call the reboot manually by your application.
here is a link for executing a reboot:

viewtopic.php?f=21&t=5714#p10298


BR
Edwin


Top
   
 Post subject: Re: Raspberry Watchdog
PostPosted: Mon Sep 22, 2014 5:32 pm 
Offline

Joined: Thu Sep 18, 2014 12:10 am
Posts: 88
Codesys control for Raspberry is a soft plc and everything can go wrong in operating system.
The only sure is a hardware watchdog.
Any example how can use the hardware watchdog from IEC?


Top
   
 Post subject: Re: Raspberry Watchdog
PostPosted: Mon Sep 22, 2014 6:29 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3448
Hi,
what should this function called from CODESYS do?
retrigger the watchdog (if not retriggered -> reboot)?
That is what I have tried to examplain already this make no sense in a non realtime environment,
because another Linux process (outside the plc runtime) could use 100% processorload - what should happen then?

For this you could install the watchdog - use it outside of the runtime - nothing special what you need to call from the CODESYS runtime,
BR
Edwin


Last edited by Edwin Schwellinger on Mon Sep 22, 2014 7:41 pm, edited 1 time in total.

Top
   
 Post subject: Re: Raspberry Watchdog
PostPosted: Mon Sep 22, 2014 6:50 pm 
Offline

Joined: Thu Sep 18, 2014 12:10 am
Posts: 88
Thatt's exactly we want to do:
1) enable watchdog with time set.
2) retrigger the watchdog

It make sense because we talk for non real time environment, not for non work environment.

Because I am not expert in Linux ask you for your help.


Top
   
 Post subject: Re: Raspberry Watchdog
PostPosted: Mon Sep 22, 2014 7:51 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3448
Hi,
no, for now,the only way to use the watchdog is the way you use it under Linux
outside the runtime.
Let me check other options.
BR
Edwin


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 12 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited