Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

CR1000 automatic reset


Birk Aug 7, 2012 01:43 PM

Dear all,

is there a possibility to reset a CR1000 datalogger automatically, say once every 24h?(we use a Wavecom Fasttrack GPRS modem for remote connection to LoggerNet)

I imagine it to happen from the CRBasic code running in the logger.
If this is not possible, does anyone of you have an idea how to do this otherwise? E.g. with a relais that I can control from the logger, switch it off so it breaks the power supply, but restores it automatically after a second or so?

Thanks for your ideas in advance


GaryTRoberts Aug 7, 2012 04:42 PM

Could I ask why you would want to do a reset instead of a IF IFTIME? If I could get more details, I think we can get you what you need.

Thanks.


Birk Aug 8, 2012 09:22 AM

We often experience communication breakdowns. The modem is regularly reset (we have a routine in the program where we can set a constant and depending on its value this is happening once/twice per day or even hourly, depending on how stable the connection is), but modem resets often do not bring the station back online - but a logger reset by unplugging power does bring it back online. Only for some of these stations we have to make our customers drive several hours, so they are of course annoyed when this is happening.
Therefore, we'd just like to include this automatically (or have the option to do so).

We are quite certain it is not bad Loggernet settings or a general program error, because some stations are permanently online with the identical program and Loggernet settings, or even they were permanently online until changing the GPRS provider.


thinkitcodeit Aug 8, 2012 02:50 PM

When you say you reset the modem, do you mean you do a software reset or do you have the modem connected to SW12 whereby you power cycle the modem daily?


Birk Aug 8, 2012 02:57 PM

Both options of modem reset do not bring the modem back online, unpowering the logger and making it reboot is necessary to re-establish communication.


GaryTRoberts Aug 8, 2012 03:32 PM

Also, are you seeing any Watchdogs on the datalogger? If so, what OS version are you running?


aps Aug 9, 2012 11:17 AM

Just to follow on from Gary's question, there have been a few issues along the way with GPRS support in the loggers, mainly caused by unexpected events on the TCP/IP link or the modem sending out unexpected data to the logger.

Some of these events will cause a watchdog reset, some will not. Depending how far back in history you go, some problems would block further TCP/IP comms and one issue could prevent the logger redialling the modem (fixed only recently).

We hope we now have nailed most of these problems so would encourage you to upgrade to the very latest operating system for your logger (the latest published on this site a few weeks ago).

There is a way of resetting the logger from its own program, but the consequences of doing so are many, including resetting working variables if you are not careful, invalidating any statistics being calculated during the reset period and wasting data storage space. Therefore we would not recommend this as general practise.

If you still want to learn how to reset the logger please post again.


Birk Aug 9, 2012 11:23 AM

Dear Andrew,

thank you for the post.

We will also try your suggestion of installing the new OS (we currently have v24).

Still, knowing how to reset the logger from the program would be worth knowing. That variables will be reset and data during the reset is lost, is quite obvious, but I think we could live with that if it is a 1-3 min period.


aps Aug 9, 2012 11:52 AM

In OS25 there were a couple of fixes relevant to PPP connections (see http://www.campbellsci.com/70_103). Item 28 being one I mentioned before where the logger may stop redialling a failed connection, plus some changes to PPP dialling.

As long as you are aware of the risks, the technique to reset the logger uses the Filemanage command and is more normally used to change the current program running in the logger. Below is some code which shows the principle, slightly complicated by giving the option of resetting on a given day (so once per week).


Dim Thisfilename as string*40
Dim rTime(9) 'declare as public and dimension rTime to 9

Alias rTime(1) = Year 'assign the alias Year to rTime(1)

Alias rTime(2) = Month 'assign the alias Month to rTime(2)

Alias rTime(3) = DOM 'assign the alias Day to rTime(3)

Alias rTime(4) = Hour 'assign the alias Hour to rTime(4)

Alias rTime(5) = Minute 'assign the alias Minute to rTime(5)

Alias rTime(6) = Second 'assign the alias Second to rTime(6)

Alias rTime(7) = uSecond 'assign the alias uSecond to rTime(7)

Alias rTime(8) = WeekDay 'assign the alias WeekDay to rTime(8)

Alias rTime(9) = Day_of_Year 'assign the alias Day_of_Year to rTime(9)

SlowSequence
Scan(10,Min,10,0)
RealTime( rTime ) 'Get time
If WeekDay = 1 AND hour = 2 AND Minute >=50 Then
'Filename of current program
ThisFileName = Status.ProgName
'Restart Program
FileManage (ThisFileName,6)
EndIf
NextScan


Ansgar Aug 13, 2012 09:34 AM

I am a colleague of Birk.

If we use a power switch to restart the datalogger, how long should the logger be switched off minimum to ensure a logger restart?


Birk Oct 8, 2012 09:27 AM

Hi,

I have tested that filemanage command now and it works fine - the program is restarting without any problems so far and no data table has been deleted yet.

One question I still have - does this command cause the datalogger to do a complete restart (that means, like a hardware reset by unplugging power)?

The background is: We'd like to use the command to avoid doing hardware resets when the GPRS connection is frozen - it happened quite frequently, OS25 made it better but did not entirely remove the problem. In these cases of frozen connection, only a logger reset resolved the problems, not a modem reset (neither hardware nor software reset).


Sam Oct 9, 2012 05:32 PM

It is similar but not exactly like a hardware reset. For your application though I do not think you will notice a difference between a software and hardware reset.

It would be really really really great if you could give us a call or send a detailed message about what you are experiencing so that we can get this resolved. You shouldn't have to do this, and we don't want you to have to do this.


FRphil Apr 9, 2013 01:05 PM

Hi all,
I have the same problem with one of my stations in Morocco. The measurement recording keeps working but the remote connection is impossible after a period about 12 days. I have two ways of recieving my data : waiting a callback or connecting manually.
Like Birk, the only way I have found to "repair" the connection link is a hardware reboot.
Have you find a solution to your problem Birk ?

Thanks


trashbk Apr 9, 2013 01:38 PM

Hi,

yes we have now found a solution for it. We use a Time Relais to cut power supply for a certain time.

There are relais that, when they get voltage on a signal port (which comes from a CR1000 C-Port) interrupt the power on the line they are built in for a time you can select with a switch on the relais.

We now kick off the CR1000 once every few days from the program, but it is still in testing phase in the office. Of course this must be 100% reliable, otherwise you have to go there again and lose measurement during off-time.


FRphil Apr 10, 2013 07:39 AM

Ok, thank you.
Using time relays is a good hardware solution. Do you think that there is a risk of loosing data ? I mean : I use a CR1000 + CFM100 + CS-GPRS. My data are stored on the CompactFlash module CFM100. Cutting off the power each 10 days is dangerous for the elements of my system ?


trashbk Apr 11, 2013 06:50 AM

We have not tried with CFM modules yet. Of course, if the shutdown comes during flash writing operation, that might be bad.
I'd try that for several weeks at last on a station "at home" before using in the field.

Maybe there is a general comment from Campbell Sci to this procedure - or they might want to bring out a module to do a hardware reset themselves?

Still, these communication losses are frustrating, and we could not find a systematic behind it. We think it is not about the modem, because a modem reset does not solve the problem, when it occurs.


aps Apr 11, 2013 09:02 AM

The official standpoint on this is that turning the power off to the logger, especially with flash memory cards installed is high risky. Even without the risk of corrupting the memory cards there is also the issue of invalidating long term statistics being calculated by the logger.

I would like to say that this process is not necessary but in some of our earlier operating systems the logger has been prone to running out of TCP/IP memory when subject to the real world of unreliable comms over GPRS.

We will be releasing a new release of firmware within 1-2 weeks that includes some extra traps TCP/IP memory issues and one fix to ensure PPP dialling resumes correctly in all cases.

I would advise switching to that when release if possible and checking if it solves your problem.

If time does not allow this then I would advise using the Filemanage option mentioned above to force a recompilation of the logger program under the logger's own control.


trashbk Apr 11, 2013 03:32 PM

Dear Andrew,

thanks for the response. We're eagerly waiting for OS26 then and will test it.


FRphil Apr 16, 2013 12:55 PM

Is it possible to change the OS remotely ? With Loggernet for example.


heiko Jun 10, 2013 12:54 PM

Does the problem with no GPRS connection solved in the OS26?
I implemented a Modem reset with the PSW12. But currently I lost the connection of ~10 Stations.
All my stations are running with OS25.


FRphil Jul 22, 2013 01:24 PM

Hi all,
I have set the OS26, and the problem is still there ! I have to manually reboot my station every 10-12 days for the GPRS connection to work again...
Do you have another solution ?

Thank you


aps Jul 22, 2013 03:36 PM

Do you know if the modems are still registered on the network when you get locked out. It is not uncommon for some networks to deregister GPRS modems if they remain online for longer than a time (the time is set by the network).

Power cycling the whole system will fix this but a soft reset of the modem will usually fix this too(details are given the CS-GSM/GPRS manual).


heiko Jul 23, 2013 08:21 PM

I still have the same problem.
But not all of the stations. It´s quite complicate to figure out a rule, when does the connection breakdown happe.
Currently I upgraded all CR1000 with OS26. I use sim card of different provider in different countries.

last year I used the same station with the same provider in GSM-mode and I never had problems in that mode. By switching to the GPRS mode the connection problem appear.

Just to head to a quick solution of the problem I will give some comments to the connection as I understood and my setting.

When I use the GSM-mode the modem is registered in a network and waiting for a call. That was working.
Using the GPRS mode, the modem is permanent sending some data to a fixed IP-Address. That is the function as I understood. The connection will cut once a day by the provider for a short time to assign a new IP-Address to the modem. Therfore I connect the modem to the SW12 or a relay switch to power down the modem for around 20 sec. Mostly I got a new IP-Adress for the modem.
For a few of the station that was not working. Now I inserted a PPPOpen and PPPClose. I´am not sure if this working.

old code

If TimeIntoInterval(0,3,Hr) Then SW12(0)
Delay (1,2,Sec)
SW12(1)


new code

If hour > 0 AND hour < 6 Then
SW12(0)
PPPClose
Else
SW12(1)
PPPOpen
EndIf


?!?!?!?!

regards
Heiko


aps Jul 24, 2013 09:07 AM

The first code will clearly just glitch the power and should force the modem to restart (although some models may not if in a low power state as they have a lot of on board capacitors).

It is advisable to use PPPClose before turning a modem off otherwise the logger can take a while to detect the connection has been lost and will still try to send PPP traffic out through the modem. This may upset the modem when it tries to reconnect (which could be more of a problem with the 2 sec power cycle).

The new code clearly will turn the modem off for longer (6 hours - assuming variable hour maps to an updating realtime value), but there is one mistake in that you turn off the power before calling PPPClose.

In example code in our manuals we also advise, after using PPPClose, to shutdown the GSM connection (by sending it AT+CFUN=0...for most modems) before pulling the power, as some network providers object to incorrect sign-offs from the network. By "object" I mean there may be a delay before you can connect again (usually because your SIM is still registered as being connected) or you could even get barred.

Log in or register to post/reply in the forum.