I try to run MQTT agent demo with plain_text transport on my cortex m4 board. Board succesfully receive DHCP, DNS requests but i did not see any SYN packets in wireshark. How i can trace more detailed my issue? This part of debug output. I make breakpoint in NetworkInterfaceOutput function but the entry into this function did not occur
FreeRTOS_connect: 43709 to c0a8585bip:1883Socket 43709 -> [192.168.88.91]:1883 State eCLOSED->eCONNECT_SYNConnect[c0a8585bip:1883]: next timeout 0: 500 msConnect[c0a8585bip:1883]: next timeout 0: 500 msConnect[c0a8585bip:1883]: next timeout 0: 500 msConnect[c0a8585bip:1883]: next timeout 0: 500 msConnect[c0a8585bip:1883]: next timeout 0: 500 msConnect[c0a8585bip:1883]: next timeout 0: 500 msConnect[c0a8585bip:1883]: next timeout 0: 500 msConnect[c0a8585bip:1883]: next timeout 0: 500 msConnect[c0a8585bip:1883]: next timeout 0: 500 msConnect[c0a8585bip:1883]: next timeout 0: 500 ms[ERROR] [SocketsWrapper] [Sockets_Connect:123] Failed to connect to server: FreeRTOS_Connect failed: ReturnCode=-116, Hostname=192.168.88.91, Port=1883.
FreeRTOS_closesocket[0ip port 43709 to c0a8585bip port 1883]: buffers 56 socks 0[ERROR] [MQTT] [Plaintext_FreeRTOS_Connect:70] Failed to connect to 192.168.88.91 with error -116.
And another question - what is Zero packets in wireshark? I capture packets in router (on the connection port of the board) and send captured file to wireshark for analyze
Yes, i will try this. I did not try TCP but dhcp, dns work fine
I set the breakpoint on function: socketStatus = FreeRTOS_connect( tcpSocket, &serverAddress, sizeof( serverAddress ) );
and breakpoint in NetworkInterfaceOutput but code execution does not fall within this function.
I just take using_plaintext.c code to implement transport layer. i use zero copy driver implementation. Does i need some modification in using_plaingtest for zero_copy driver type?
I suppouse FreeRTOS_connect function call must refer to the function NetworkInterfaceOutput to transmit the packet,
but this is not happening
I attach log with network event trace code. And i can not see any eNetworkTxEvent, =/ 2:* when FreeRtos try to connect to socket 20240617164257.c (9.6 KB)
Please enable FreeRTOS-Plus-TCP debug logging by setting ipconfigHAS_DEBUG_PRINTF and ipconfigHAS_PRINTF to 1 in your FreeRTOSIPConfig.h. Youโll also need to define FreeRTOS_debug_printf and FreeRTOS_printf
Hi @pistoletov1974,
Based on the log, it appears that the device is unable to receive the SYN-ACK response from the server. The log indicates that the network capabilities on the device itself seem to be functioning correctly, as evidenced by the successful DHCP and ARP processes. However, it would be advisable to investigate potential issues within the network environment along the path to the server. Specifically, it would be prudent to examine the firewall configurations and network settings to ensure that there are no obstructions or restrictions preventing the device from establishing a successful connection with the server. Your assistance in conducting this analysis would be greatly appreciated.
Reference: -116 is pdFREERTOS_ERRNO_ETIMEDOUT
[ERROR] [MQTT] [Plaintext_FreeRTOS_Connect:70] Failed to connect to 192.168.88.91 with error -116.
Thank.you @ActoryOu for reply. I suppose that problem in the stack that not send tcp-syn packet. Broker and my device in local network. In the first post I attach screen from wireshark. In this log I did not see any outgoing tcp packets. May be problem is some timers inside in stack? I see in log connection attempts is too fast.
Place a breakpoint at this line to ensure that a timer event is sent to the IP task. The following callstack in the IP task should lead to xWinPcap_NetworkInterfaceOutput:
Place breakpoints at these lines and try to see why the xWinPcap_NetworkInterfaceOutput function in not getting called to put the SYN packet on the wire.
Thank you, @aggarg . A small note - I run the stack on my m4 board. I ported the driver myself according to the documentation from FreeRTOS. Sending the event to the task is successful
. Below I attach the result of debugging output at the execution step: if( xSendEventToIPTask( eTCPTimerEvent ) != pdPASS ).
4:55:32.656> pxEasyFit: ARP c0a85801ip -> c0a85873ip
14:55:32.656> pxEasyFit: ARP c0a85801ip -> c0a85873ip
14:55:32.656> pxEasyFit: ARP c0a85801ip -> c0a85873ip
14:55:32.656> Network buffers: 50 lowest 50
14:55:32.656> Heap: current 51760 lowest 51760
14:55:32.656> net_ev 1
14:55:32.656>
14:55:32.656> ipARP_REQUEST from c0a85801ip to c0a85873ip end-point c0a85873ip
14:55:32.656> ipARP_REQUEST from c0a85801ip to c0a85873ip end-point c0a85873ip
14:55:32.656> ipARP_REQUEST from c0a85801ip to c0a85873ip end-point c0a85873ip
14:55:32.656> ARP c0a8585bip miss using c0a8585bip
14:55:32.656> ARP for c0a8585bip (using c0a8585bip): rc=0 00-00-00-00-00-00
14:55:32.656> ConnectpxEasyFit: ARP c0a85873ip -> c0a8585bip
14:55:32.656> [c0a8585bip:1883]: next timeout 1: 500 ms
14:55:32.656> net_ev 1
14:55:32.656>
14:55:32.656> ipARP_REPLY from c0a8585bip to c0a85873ip end-point c0a85873ip
14:55:32.656> net_ev 6
14:55:32.656>
I added timestamps to the terminal program. I attach the full log as a file. Extension C since the forum does not allow you to attach files with another extension. log_file.c (13.4 KB)
the code stuck in this code. pxIterator = pxEnd and the code does not go into this while cycle. xBoundTCPSocketsList.uxNumberOffitems=0. No socket bounded. This is problem?
In FreeRTOSIPConfig.h macro is