Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20577

BASCOM-AVR : GetSocket/SocketConnect : NEWTOPIC

$
0
0
I am having an issue connecting to a server after ~6hrs of the application executing. This app connects every 10 minutes to get the public IP. Could post code but that isn't the issue. It basically comes down to GETSOCKET and SOCKETCONNECT. SocketConnect is ALWAYS returning a 1 in this condition. This means an error occurred. The routine then reschedules the event. It will then look for a free socket, get it and pass it to socketconnect, where it then errors. Since this works for several hours, I am at a loss of what my code could possibly be doing to these functions. It appears that something in the socket is not really free or the socketconnect is going a stray. The reason I say this is in the debug log output, ~6hrs of success, then errors start to occur on socketconnect. I let that run for several hours with out a single successful socketconnect. I then press the reset button on the Arduino and this of course resets the uC and the Wiznet 5100. I have modified the Wiznet's reset to be controlled by an Arduino output. The first attempt during reset, the socketconnect function was successful. So I wasn't being blocked by a server. Not asking for help debugging my code but to possibly some expert debugging pointers to track down this problem. I am currently thinking of if a certain number of no connects occur in a row (10?) then reset the Wiznet and re-initialize it. Currently I am 99.9% sure that will solve the problem but is masking the real issue. Any good socketconnects would reset the no connect counter. Thoughts? TIA. Mark [b:5ebbd77c65][color=red:5ebbd77c65](BASCOM-AVR version : 2.0.7.7 )[/b:5ebbd77c65][/color:5ebbd77c65]

Viewing all articles
Browse latest Browse all 20577

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>