Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

USB and TCP/IP support

Discussion specific to Davis weather stations
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: USB and TCP/IP support

Post by steve »

I'm using the default timeouts in the DLL, whatever those are. The documentation isn't good. Quite apart from being clearly wrong in places. There's no recovery, the DLL is supposed to handle everything.

Steve
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: USB and TCP/IP support

Post by steve »

If/when it happens again, could you check using netstat or whatever whether the tcp/ip connection is still there?

Meanwhile I'll see if I can do some experimenting.

Steve
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: USB and TCP/IP support

Post by steve »

I've done some experimenting with a test rig. What happens when communication is lost is that the DLL returns an error from the 'read' operation, but doesn't do anything else. So, I'm now checking for this error, disconnecting the TCP/IP connection (just in case, but it's probably already gone), then re-connecting. It seems to work OK (it reconnects and carries on), but I'm a bit limited on what conditions I can simulate. I'll do a new build and upload it later (maybe tomorrow).

Steve
broadstairs
Posts: 1184
Joined: Thu 14 Aug 2008 7:17 am
Weather Station: Ecowitt GW2000/GW3000
Operating System: Linux openSUSE LEAP
Location: Broadstairs, Kent, UK
Contact:

Re: USB and TCP/IP support

Post by broadstairs »

steve wrote:I've done some experimenting with a test rig. What happens when communication is lost is that the DLL returns an error from the 'read' operation, but doesn't do anything else. So, I'm now checking for this error, disconnecting the TCP/IP connection (just in case, but it's probably already gone), then re-connecting. It seems to work OK (it reconnects and carries on), but I'm a bit limited on what conditions I can simulate. I'll do a new build and upload it later (maybe tomorrow).

Steve
When I spot it I'll install it. Have had no further problems today, once I have this update I'll try breaking the IP connection and see if it recovers.

Stuart
Currently running CMX V4.4.2 4085 on Linux openSUSE Leap
broadstairs
Posts: 1184
Joined: Thu 14 Aug 2008 7:17 am
Weather Station: Ecowitt GW2000/GW3000
Operating System: Linux openSUSE LEAP
Location: Broadstairs, Kent, UK
Contact:

Re: USB and TCP/IP support

Post by broadstairs »

Steve running build 721 and when I broke the lan connection so IP would stop Cumulus did not recover the connection without a restart and on restart it read no archived records. How long is the time out and how long should I leave it to recover? I left it about 2 minutes or so with the local lan disconnected and on reconnection netstat did not show any Cumulus connection. I suppose I left it just over a minute to recover after the lan was re-connected.

Stuart
Currently running CMX V4.4.2 4085 on Linux openSUSE Leap
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: USB and TCP/IP support

Post by steve »

I've no idea what the timeout is, the DLL documentation is useless. What happens is that when Cumulus tells the DLL to get the data from the station, the DLL returns an error, so Cumulus tells the DLL to disconnect and then re-connect. If the LAN is still disconnected, this will of course fail, and so the process should keep repeating until it successfully reconnects. But I don't really know how the DLL behaves in this situation.

If you look at the corresponding diags file, it should have some logging of the various actions which should help me to work out why it's not recovering.

Regarding it not reading the archive data on restart, this is because the logging thread is still operating - this is just how Cumulus works, the logging thread carries on happily logging the last good data it had; the same for the graphs. I suppose I could look into stopping these while this recovery is taking place, but then there's the issue of catching up after it recovers. The code just isn't structured in such a way that I can easily download the missing data and then carry on as if nothing had happened. But I'll have a think about it.

Thanks,
Steve
broadstairs
Posts: 1184
Joined: Thu 14 Aug 2008 7:17 am
Weather Station: Ecowitt GW2000/GW3000
Operating System: Linux openSUSE LEAP
Location: Broadstairs, Kent, UK
Contact:

Re: USB and TCP/IP support

Post by broadstairs »

Steve I'll do some more testing and see if I can see anything. It would be good if we can get the recover to work OK now.

As to the catch up would it be possible to detect the IP connectivity failure and then put Cumulus to sleep (sort of) and wait for it to recover and then force a restart internally. The problem with IP connections is that they are more usually long distance and can go down for some time which means your data will flat line, since Cumulus cannot do anything about that I think it should stop all its update activity until it detects the recovery of the connection and then start (or restart) all its processes. If I were using this I know I would prefer that to having a flat line of data and miss all the stuff which the logger still has.

If this is too much for V1 then I believe this is how V2 should behave in order to maintain good data.

Stuart
Currently running CMX V4.4.2 4085 on Linux openSUSE Leap
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: USB and TCP/IP support

Post by steve »

broadstairs wrote:As to the catch up would it be possible to detect the IP connectivity failure and then put Cumulus to sleep (sort of) and wait for it to recover and then force a restart internally.
Yes, this is the sort of thing I had in mind. It's a bit 'high risk' though, it may cause all sorts of problems to lie hidden. I'll see what I can do.

Steve
broadstairs
Posts: 1184
Joined: Thu 14 Aug 2008 7:17 am
Weather Station: Ecowitt GW2000/GW3000
Operating System: Linux openSUSE LEAP
Location: Broadstairs, Kent, UK
Contact:

Re: USB and TCP/IP support

Post by broadstairs »

Steve I've done some more testing stopping the local lan and I can see the Cumulus connection is stopped as it does not show in netstat, but that's it I cannot find anything in either the debug log or any diags file which says anything meaningful about what has happened. What should I be looking for?

Stuart
Currently running CMX V4.4.2 4085 on Linux openSUSE Leap
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: USB and TCP/IP support

Post by steve »

I'm going to have to get back to you on that. I've just looked for the code that logs that messages so I could tell you what to look for, and it's not there. Neither is any of the recovery code I put in. I've no idea how that's happened. So it's no surprise that the latest version doesn't do any recovery :-(

Steve
broadstairs
Posts: 1184
Joined: Thu 14 Aug 2008 7:17 am
Weather Station: Ecowitt GW2000/GW3000
Operating System: Linux openSUSE LEAP
Location: Broadstairs, Kent, UK
Contact:

Re: USB and TCP/IP support

Post by broadstairs »

OK I understand why now.... :o :o

Steve for now if you can get Cumulus to detect the lack of IP connectivity and shutdown cleanly I can use Startwatch (from the VVP author) to monitor this and restart Cumulus when the VVP port comes back online. This would at least allow for continuity of data, especially if the IP goes down for any extended period. Maybe the shutdown could be an option rather that default to give folks a choice.

Stuart
Currently running CMX V4.4.2 4085 on Linux openSUSE Leap
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: USB and TCP/IP support

Post by steve »

I've put the code back and uploaded a new build. This should recover, but I haven't made any attempt to do any more than that. See how this goes, then we can think about the best thing to do with it.

Steve
broadstairs
Posts: 1184
Joined: Thu 14 Aug 2008 7:17 am
Weather Station: Ecowitt GW2000/GW3000
Operating System: Linux openSUSE LEAP
Location: Broadstairs, Kent, UK
Contact:

Re: USB and TCP/IP support

Post by broadstairs »

steve wrote:I've put the code back and uploaded a new build. This should recover, but I haven't made any attempt to do any more than that. See how this goes, then we can think about the best thing to do with it.

Steve
Well that worked OK Steve it recovered. So now you need to decide how you want to handle it. As I said I'd like an option to exit cleanly from Cumulus so I can restart it with Startwatch when the IP connectivity is restored, but its up to you how to manage this.

Stuart
Currently running CMX V4.4.2 4085 on Linux openSUSE Leap
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: USB and TCP/IP support

Post by steve »

I've looked at the code and I think I can handle making it catch up. It's mainly cut & paste - I'll have to duplicate the code as it won't be quite the same as the start up case, and it's in the wrong thread to update the display, so I'll have to change that. Then of course there's the end of day rollover situation, but that's similar to the start up case. So I think it's possible. I'm just wondering if it isn't a lot of trouble and a lot of extra code for a case which won't happen very often. Realistically, how often is the connection going to be lost for any length of time?

Steve
broadstairs
Posts: 1184
Joined: Thu 14 Aug 2008 7:17 am
Weather Station: Ecowitt GW2000/GW3000
Operating System: Linux openSUSE LEAP
Location: Broadstairs, Kent, UK
Contact:

Re: USB and TCP/IP support

Post by broadstairs »

steve wrote:I've looked at the code and I think I can handle making it catch up. It's mainly cut & paste - I'll have to duplicate the code as it won't be quite the same as the start up case, and it's in the wrong thread to update the display, so I'll have to change that. Then of course there's the end of day rollover situation, but that's similar to the start up case. So I think it's possible. I'm just wondering if it isn't a lot of trouble and a lot of extra code for a case which won't happen very often. Realistically, how often is the connection going to be lost for any length of time?

Steve
Steve the real reason for this is an IP datalogger where you have a remote VP2 connected across the internet, not the VVP environment we are testing in. So it is likely to happen under these circumstances, you can have a router fail or your ISP loses your connection or someone cuts the phone cable, and then double that because it can happen both ends... so it's very likely to happen. Of course it can also happen in a VVP environment also if you have someone pulling data from your VP across the internet on the other side of the world. Now the other side of the coin is 'how many IP dataloggers are likely to use Cumulus?', so you need to consider this and way up the pros and cons. As I said you can recover OK using Startwatch if Cumulus just exits and restarts when the IP link comes back up.

Stuart
Currently running CMX V4.4.2 4085 on Linux openSUSE Leap
Post Reply