Page 1 of 1

Strange timing coincidence of CMX Failed to connect to station

Posted: Tue 17 Oct 2023 10:32 pm
by PaulMy
On my CMX with WiFiLogger I occasionally get an error recorded on the Run screen

Code: Select all

Delaying start for 10 seconds
Start-up delay complete, continuing...

Cumulus running at: http://localhost:8998/
                    http://10.0.0.76:8998/

  Open the admin interface by entering one of the above URLs into a web browser.

Today.ini = data\today.ini
Last update=2023-10-07T17:10:00
Connected to station
07/10/23 9:28:51 PM
Type Ctrl-C to terminate
Downloading Archive Data
 - processed 100%
Downloading Archive Data
 - No Archive data available
Connecting real time FTP
Normal running
2023-10-08 07:02:44 Failed to connect to the station, waiting 30 seconds before trying again
2023-10-08 08:38:36 Failed to connect to the station, waiting 30 seconds before trying again
2023-10-10 07:02:38 Failed to connect to the station, waiting 30 seconds before trying again
2023-10-13 07:02:40 Failed to connect to the station, waiting 30 seconds before trying again
2023-10-14 07:02:40 Failed to connect to the station, waiting 30 seconds before trying again
2023-10-14 09:32:31 Failed to connect to the station, waiting 30 seconds before trying again
2023-10-17 07:02:43 Failed to connect to the station, waiting 30 seconds before trying again
The timing of this "Failed to connect to the station..." at 7:02 five times on different days seems strange. The above is what is now showing since I started this instance on Oct. 7 at 17:10

The MXdiags I have over this period have

Code: Select all

2023-10-13 07:02:40.300 InitTCP: Failed to connect to the station, waiting 30 seconds before trying again
2023-10-14 07:02:40.734 InitTCP: Failed to connect to the station, waiting 30 seconds before trying again
2023-10-14 07:02:40.979 Realtime[198]: Real time files complete
2023-10-14 09:32:31.220 InitTCP: Failed to connect to the station, waiting 30 seconds before trying again
2023-10-17 07:02:43.010 InitTCP: Failed to connect to the station, waiting 30 seconds before trying again
The WiFiLogger does have some issues as it also is uploading to WL.com and 8 other services and CMX is set at 20 for Disconnect period.

This does not affect anything else in CMX running and data logged. I have seen this quite often but hadn't paid attention to the time of these occurrences. Any thoughts?

Enjoy,
Paul

Re: Strange timing coincidence of CMX Failed to connect to station

Posted: Wed 18 Oct 2023 10:13 am
by mcrossley
Does the WilFiLogger have any sort of diagnostics log file? If it does, does it show anything happening at those times?

Re: Strange timing coincidence of CMX Failed to connect to station

Posted: Wed 18 Oct 2023 4:30 pm
by PaulMy
Hi Mark,
And another added at 07:02 this morning

Code: Select all

2023-10-08 07:02:44 Failed to connect to the station, waiting 30 seconds before trying again
2023-10-08 08:38:36 Failed to connect to the station, waiting 30 seconds before trying again
2023-10-10 07:02:38 Failed to connect to the station, waiting 30 seconds before trying again
2023-10-13 07:02:40 Failed to connect to the station, waiting 30 seconds before trying again
2023-10-14 07:02:40 Failed to connect to the station, waiting 30 seconds before trying again
2023-10-14 09:32:31 Failed to connect to the station, waiting 30 seconds before trying again
2023-10-17 07:02:43 Failed to connect to the station, waiting 30 seconds before trying again
2023-10-18 07:02:38 Failed to connect to the station, waiting 30 seconds before trying again
There is no setting in WiFiLogger for diagnostics but adding the /debug command starts a running logging of all activity but no time frame can be specified. But I think I've found the cause...
The WiFiLogger has a Network Information tab and in there I noticed :

Code: Select all

Station Time:	2023-10-18 12:26:04 p.m.
NTP Time:	2023-10-18 12:26:12 p.m.
Last sync:	2023-10-18 7:02:38 a.m.
Uptime:	0 days 5:23:37
Last boot:	2023-10-18 7:02:38 a.m.
so the WiFiLogger does an automatic resync at its built-in time and that likely causes a brief connection lapse. I think Wojek added this to overcome some logger lockups over time.

My own question answered :clap:

Enjoy,
Paul

Re: Strange timing coincidence of CMX Failed to connect to station

Posted: Wed 18 Oct 2023 5:47 pm
by SamiS
Just a thought… Does the logger have a static ip or is it using dhcp with reserved address? Losing a dhcp lease could also cause similar symptom, and getting connection re-established could also trigger a ntp update.

Re: Strange timing coincidence of CMX Failed to connect to station

Posted: Wed 18 Oct 2023 6:17 pm
by mcrossley
That setting also shows a reboot at the same time - that would cause connection issues for a short while.

Re: Strange timing coincidence of CMX Failed to connect to station

Posted: Wed 18 Oct 2023 6:40 pm
by PaulMy
@SamiS,
I have given it a reserved IP after several times finding the IP address was changed and CMX didn't have access to the logger's new IP address (good thing there are several backup methods in my many messes of equipment and programs ;) )

Enjoy,

Re: Strange timing coincidence of CMX Failed to connect to station

Posted: Wed 18 Oct 2023 7:39 pm
by SamiS
PaulMy wrote: Wed 18 Oct 2023 6:40 pm @SamiS,
I have given it a reserved IP after several times finding the IP address was changed and CMX didn't have access to the logger's new IP address (good thing there are several backup methods in my many messes of equipment and programs ;) )
But you actually still use dhcp with reservation? If so, the device still has to ask router ”I have ip address w.x.y.z, can I still keep it?” every time the lease time ends. And the lease time length is decided by the router. So basically that process still theoretically can fail and cause the device to lose connection momentarily. If you actually force a static ip address to logger’s configuration, then dhcp negotiation does not take place at all.

But Mark’s note about reboot taking place at the same time is a better explanation.

Re: Strange timing coincidence of CMX Failed to connect to station

Posted: Wed 18 Oct 2023 8:16 pm
by mcrossley
iirc a DCHP lease renewal should happen at half the lifetime, (and iirc if that fails, then again at 3/4 lease time etc). So, the lease should never expire before it is renewed, keeping continuity.

Re: Strange timing coincidence of CMX Failed to connect to station

Posted: Wed 18 Oct 2023 8:24 pm
by SamiS
mcrossley wrote: Wed 18 Oct 2023 8:16 pm iirc a DCHP lease renewal should happen at half the lifetime, (and iirc if that fails, then again at 3/4 lease time etc). So, the lease should never expire before it is renewed, keeping continuity.
Yes, that is the way it is supposed to work. But in my dayjob I have seen scenarios where lease renewal fails (it based on unicast traffic) but after the lease has expired, dhcprequest (based on broadcast) succeeds. Usually this can be caused by combinations of misconfigured firewalls, router accesslists and dhcp relay agents. However these anomalies are unlikely in normal home networks unless advanced user has tweaked a lot.