WIZ550io UDP loopback 질문 드립니다.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: WIZ550io UDP loopback 질문 드립니다.
by kknd dhu ·
else if(g_uart2_buffer[0] == ‘3’)
{
int32_t recv_size = 0;
uint16_t udp_port = 4023;
이렇게 수정해도 Socketerror #11001이 발생 되네요.
-. socket을 열면 1이 리턴되며, Hercules에서 Send data를 눌러도 Socket error #11001만 발생 되네요.
-. recv단 주석 처리 후 sendto만 사용해서 문자열 보내는 것까진 되네요… 받는것만 안되는걸로 보입니다.
-. Herclues에 Module IP가 W5500의 IP가 되는것이 맞나요"?? 여기에 0을 넣고 접속해도
sendto로 넘기는 문자열이 Received data창에 표기가 되네요;;;;;
RE: RE: WIZ550io UDP loopback 질문 드립니다.
by becky ·
안녕하세요
UDP는 Server, Client의 개념이 없습니다.
TCP와 달리 별도의 연결과정없이 Destination 을 설정하여 send하면 데이터 전송이 가능합니다.
Hercules에서 Module IP와 Port에는 W5500 IP와 pot를 적어주시면 됩니다.
이때 port는 loopback_udps함수에서 매개변수 port와 같습니다.
Hercules에서 Local port는 W5500에서 맞춰줄 필요가 없습니다.

아래 코드와 같이 W5500에서 data를 수신하면 전송한 target의 IP와 port를 확인하여 loopback 해주게 되어있습니다.
socket error #11001은 host not found error로 파악됩니다.
ip와 port 등을 한번더 확인하시고 가능하면 wireshark도 확인해보시는게좋을 것 같습니다.
RE: WIZ550io UDP loopback 질문 드립니다.
by kknd dhu ·
안녕하세요. IP와 PORT가 제대로 설정이 안되어있었네요…
wiz_NetInfo gWIZNETINFO => 여기 구조체에서 자동으로 참조 하는줄 알았는데
loopback_udps() => 이 function에서 값을 넣어주니 잘 동작합니다.
uint8_t destip[4] = { 192, 168, 1, 130 }; //IP 추가
uint16_t destport = PORT_UDPS; //PORT 추가
답변 감사드립니다.
RE: WIZ550io UDP loopback 질문 드립니다.
by becky ·
구조체에 값을 설정해주신후
wizchip_setnetinfo(&gWIZNETINFO);
함수를 사용해주시면 설정됩니다.
앞서 말씀드렸듯이 W5500은 recvfrom함수에서 destination ip와 port를 확인하여 해당 변수에 return해줍니다. 따라서 loopback 동작에서는 설정해줄 필요가 없습니다.
다만, loopback이 아닌 W5500에서 데이터를 먼저 전송하는경우에는 위와같이 설정해주셔야합니다.
또한,
W5500 port (loopback_udps()매개변수)- Hercules port
W5500 dest port - Hercules Local port
입니다.
W5500 port 와 Hercules port PORT_UDPS으로 설정하신걸로 확인했는데
destination port에도 PORT_UDPS로 설정하셨네요
다만 Hercules Local port도 3000으로 설정하셔서 모두 3000으로 설정해주시면 통신하는데는 문제 없습니다.