UDP receive timeout

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

kabouras_33
Posts: 74
Joined: Thu Jul 27, 2017 5:23 am
Has thanked: 7 times
Been thanked: 7 times
Contact:

UDP receive timeout

Postby kabouras_33 » Tue Oct 29, 2019 10:17 pm

Hello all!!!,
I am having a rather peculiar problem i use a pic24fj254ga106 with wiz5500.
Well i initialize the wiz i create the udp socket and i set destination....then loop and txstart...sent string...txend...
Then rxcheck for available data if >0 receive string and flush rx...
(It would be much easier to upload the code but i am not currently in the office.)
So i receive a hello message on my pc ok and i have a button on my pc app when i press it sents ok to the pic and it enables an Led by compare string.
So far so good...so after 1-2 minutes of operation the pic transmits normally but stops receiveing until i reset the mclr?????
Any ideas???i think the rx port closes but how to restart it???

User avatar
LeighM
Matrix Staff
Posts: 1919
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 461 times
Been thanked: 649 times
Contact:

Re: UDP receive timeout

Postby LeighM » Wed Oct 30, 2019 12:49 pm

Hi,
You could try a call to GetSocketStatus()
This will return the Sn_SR register (see W5500 datasheet page 50)
For example, 0x22 indicates that the socket is opened in UDP mode,
0x00 indicates that the socket has closed,
in which case you would need to re-open it.

kabouras_33
Posts: 74
Joined: Thu Jul 27, 2017 5:23 am
Has thanked: 7 times
Been thanked: 7 times
Contact:

Re: UDP receive timeout

Postby kabouras_33 » Wed Oct 30, 2019 2:27 pm

Hello Leigh,
and thank you for your support!
I read the datasheet and i get your point!!! :wink:
Only one stupid question....How do I open again the UDP socket??? only create I can see...
And last question? what is the purpose of the communication channels 0-3....??
I tried to find some info but I couldn't :D
Thanks again for your assistance!!
Attachments
MASTER MODULE.fcfx
(22.55 KiB) Downloaded 10 times

User avatar
LeighM
Matrix Staff
Posts: 1919
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 461 times
Been thanked: 649 times
Contact:

Re: UDP receive timeout

Postby LeighM » Wed Oct 30, 2019 2:55 pm

Hi,
Yes, create does the open.
The W5500 supports more than one "channel",
so for example you can open another UDP port to another host simultaneously,
just keep track of which channel (e.g. 0 and 1) you are using for which host,
pass the appropriate channel number to the read and write functions
These users thanked the author LeighM for the post:
kabouras_33 (Mon Nov 04, 2019 6:22 pm)
Rating: 5.26%
 

kabouras_33
Posts: 74
Joined: Thu Jul 27, 2017 5:23 am
Has thanked: 7 times
Been thanked: 7 times
Contact:

Re: UDP receive timeout

Postby kabouras_33 » Wed Oct 30, 2019 5:20 pm

Well i tried your suggestion and the socket is still open when the receiving stops....I connected a uart and a terminal and i keep getting "" which is 0x22 which indicates port is still open
It transmits but stops receiving :twisted: :twisted: :twisted:
Why all the weird staff happens to me!!!!

kabouras_33
Posts: 74
Joined: Thu Jul 27, 2017 5:23 am
Has thanked: 7 times
Been thanked: 7 times
Contact:

Re: UDP receive timeout

Postby kabouras_33 » Sun Nov 03, 2019 6:46 pm

Ok fixed!!!!!!it took me a while but i found it with your help!!!thanks a lot!!!!
I just switched to another port and disabled the firewall from the ap :wink:
These users thanked the author kabouras_33 for the post:
LeighM (Mon Nov 04, 2019 8:56 am)
Rating: 5.26%