Currently working on several apps and a logfile is created on a SD device for history purposes.
In the case where SNTP, WhatIsMyIPpublic, NO-IP updates, etc with no connection was established to the server, it logs these events. In the case of SNTP, there is a serverlist of four servers and each server is attempted 10 times before it goes to the next, circular in nature. No problem there. My current retry rate is 10 seconds. My current Resync rate is 12hrs.
If the Ethernet cable is disconnected or a network problem, the software works correctly and logs and reschedules the event. No problem.
The problem is that without detecting link status, I am filling my logfile with no connectivity information. I know I could limit this but thought this might be a better approach.
If link status is not active, then don't even attempt to connect. Log the event once and when link status comes back, log that event and then allow connectivity functions to occur and log the no connects if server is busy, etc as then the information is valid.
Thought this would be simple but looking at the datasheet, LINKLED flashes at TX RX Attempts....grrrrrrr!!! There are already TX RX LEDs...As this routine would be in the main loop it is not that hard to sample the signal for a second or so and report that status if in case it was blinking. If the state is low, then of course you don't have to keep looking for the status as it is indicating a LINK has occurred.
Yes there is a question.....A lot of experts up here on this platform. I have looked at the datasheet/registers and don't see a link status bit per say.
Is this the only way to monitor the LINKLED output for this? A better way?
My development platform is a Aurduino M2560 with a EthernetShield. Added a wire from LINKLED to a port is no problem. Already modified to have the AVR control the reset pulse.
Thoughts?
TIA,
Mark
[b:db3e8b3bff][color=red:db3e8b3bff](BASCOM-AVR version : 2.0.7.7 )[/b:db3e8b3bff][/color:db3e8b3bff]
↧