UDP receive timeout

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

Moderator: Benj

Post Reply
kabouras_33
Posts: 128
Joined: Thu Jul 27, 2017 5:23 am
Has thanked: 8 times
Been thanked: 8 times
Contact:

UDP receive timeout

Post by kabouras_33 »

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: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: UDP receive timeout

Post by LeighM »

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: 128
Joined: Thu Jul 27, 2017 5:23 am
Has thanked: 8 times
Been thanked: 8 times
Contact:

Re: UDP receive timeout

Post by kabouras_33 »

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 143 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: UDP receive timeout

Post by LeighM »

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

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

Re: UDP receive timeout

Post by kabouras_33 »

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: 128
Joined: Thu Jul 27, 2017 5:23 am
Has thanked: 8 times
Been thanked: 8 times
Contact:

Re: UDP receive timeout

Post by kabouras_33 »

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:

Post Reply