cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to understand and get Nx_TCP_Echo_Client to work on B-L462E-CELL1

JFlowers
Associate III

OK, I have a STM32L462RE Discovery Kit (apparently a.k.a. B-L462E-CELL1).

I am trying to get its sole Demonstration application to work (STM32CubeExpansion_CELLULAR_V7.1.0\Projects\B-L462E-CELL1\Demonstrations\Nx_TCP_Echo_Client), but I can’t even tell how it is supposed to work.

 

I see “TCP_Echo_Client” in its name, so I assume if I have a simple TCP echo server running on my workstation that if I do the appropriate port forwarding through my router along with the appropriate Windows Firewall settings, then I should see the B-L462E-CELL1 connect to my local TCP Echo Server.

 

Is that correct?


Further, I assume that in this file:

STM32CubeExpansion_CELLULAR_V7.1.0\Projects\B-L462E-CELL1\Demonstrations\Nx_TCP_Echo_Client\NetXDuo\App\tcp_echo_client.c

I should change TCP_SERVER_PORT from 7 to whatever TCP port my local TCP Echo server is running on, AND I should change the TCP_SERVER_ADDRESS IP_ADDRESS(52,215,34,155) in that same file from 52,215,34,155 (which implies 52.215.34.155) to whatever my public facing router’s WAN address is.

 

Is that correct?


If all of that is right and my SIM card is working right, which I think it is - I’m see messages like this on bootup: “Network is up with IP 10.228.182.49” on TeraTerm - then I should see “10.228.182.49” (or whatever IP address is given my B-L462E-CELL1 on bootup) connect to my local TCP echo server.


Is that correct?


Further, I assume that on my TeraTerm console connected to the B-L462E-CELL1, that I will see some sort of confirmation that my local TCP Echo server replied back to the B-L462E-CELL1 with the exact same message that the B-L462E-CELL1 originally sent to it (to my local TCP echo server).


Is that correct?


Where do I change the message that the B-L462E-CELL1 sends to my local TCP echo server?


Help, please.

 

14 REPLIES 14
JFlowers
Associate III


(Well, I sent this more than 13.5 hours ago. Let’s see if it goes through this time.)


Hi @STackPointer64,


1.
When I connect to my local TCP Echo Server using my cellphone (with WiFi turned off), this is what I get:

C:\joe\TCPechoServerWs\Release>TCPEchoServerWS.exe 50001

Handling client (174.203.246.247):
hello STackPointer64!
C:\joe\TCPechoServerWs\Release>

---

2.
When I turn on the B-L462E-CELL1 by plugging it into a USB port, I get nothing. It just sits there:

C:\joe\TCPechoServerWs\Release>TCPEchoServerWS.exe 50001

---

3.
In my tcp_echo_client.c file,

\en.stm32cubeexpansion-cellular-v7-1-0\STM32CubeExpansion_CELLULAR_V7.1.0\Projects\B-L462E-CELL1\Demonstrations\Nx_TCP_Echo_Client\NetXDuo\App\tcp_echo_client.c

\en.stm32cubeexpansion-cellular-v7-1-0\STM32CubeExpansion_CELLULAR_V7.1.0\Projects\B-L462E-CELL1\Demonstrations\Nx_TCP_Echo_Client\STM32CubeIDE\Debug\Nx_TCP_Echo_Client.bin

This is what I have changed and recompiled and dropped Nx_TCP_Echo_Client.bin on the “DISL462RE (E:)” drive for flashing:


#ifndef TCP_SERVER_PORT
#define TCP_SERVER_PORT 50001
#endif /* TCP_SERVER_PORT */

#ifndef TCP_SERVER_ADDRESS
#define TCP_SERVER_ADDRESS IP_ADDRESS(<MY_ROUTER’s>,<WAN>,<IP>,<ADDRESS>)
#endif /* TCP_SERVER_ADDRESS */


---

4.
This is what I get when I power on the B-L462E-CELL1:


ATCore:TIMEOUT EVENT(1000 ms)
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCModem:Tempo started (3000 ms)...
ATCore:TIMEOUT EVENT(3000 ms)
Modem Boot OK, sim slot nb 0
LOG ERROR #1: channel=1 / errorId=7 / gravity=2
LOG ERROR #2: channel=2 / errorId=1 / gravity=2
STM32 IP Address: 0.0.0.0
DNS Server address: 8.8.8.8
SNTP Time Sync... 0.pool.ntp.org
SysCtrl_TYPE1SC:modem channel closed
SysCtrl_TYPE1SC:MODEM POWER OFF
SysCtrl_TYPE1SC:MODEM POWER ON
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCore:TIMEOUT EVENT(1000 ms)
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCModem:Tempo started (3000 ms)...
ATCore:TIMEOUT EVENT(3000 ms)
Modem Boot OK, sim slot nb 0
LOG ERROR #3: channel=1 / errorId=7 / gravity=2
LOG ERROR #4: channel=2 / errorId=1 / gravity=2
SysCtrl_TYPE1SC:modem channel closed
SysCtrl_TYPE1SC:MODEM POWER OFF
SysCtrl_TYPE1SC:MODEM POWER ON
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCore:TIMEOUT EVENT(1000 ms)
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCModem:Tempo started (3000 ms)...
ATCore:TIMEOUT EVENT(3000 ms)
Modem Boot OK, sim slot nb 1
LOG ERROR #5: channel=1 / errorId=7 / gravity=2
LOG ERROR #6: channel=2 / errorId=1 / gravity=2
SysCtrl_TYPE1SC:modem channel closed
SysCtrl_TYPE1SC:MODEM POWER OFF
SysCtrl_TYPE1SC:MODEM POWER ON
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCore:TIMEOUT EVENT(1000 ms)
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCModem:Tempo started (3000 ms)...
ATCore:TIMEOUT EVENT(3000 ms)
Modem Boot OK, sim slot nb 1
ATCModem:no pending URC
ATCModem:Tempo started (2000 ms)...
ATCore:TIMEOUT EVENT(2000 ms)
ATCModem:NetworkState (EPS) = NOT_REGISTERED_SEARCHING
ATCModem:NetworkState (EPS) = NOT_REGISTERED_SEARCHING
ATCModem:NetworkState (CS) = NOT_REGISTERED_SEARCHING
ATCModem:NetworkState (EPS) = NOT_REGISTERED_NOT_SEARCHING
ATCModem:NetworkState (CS) = NOT_REGISTERED_NOT_SEARCHING
ATCModem:NetworkState (EPS) = NOT_REGISTERED_SEARCHING
ATCModck:<MAX SIZE INFO> msgtype=4 size=0 (biggest =78)ATCModem:NetworkState (EPS) = UNKNOWN
ATCModem:+CEREG: tac=3007 =0xbbf
ATCModem:+CEREG: ci=7 =0x7
ATCModem:NetworkState (CS) = REGISTERED_HOME_NETWORK
ATCModem:+CREG URC: lac=9997 =0x270d
ATCModem:+CREG URC: ci=197108497 =0xbbfa311
ATCModem:NetworkState (EPS) = REGISTERED_HOME_NETWORK
ATCModem:+CEREG: tac=9997 =0x270d
ATCModem:+CEREG: ci=197108497 =0xbbfa311
ATCModem:+CEREG: act=7
ATCModem:NetworkState (CS) = REGISTERED_HOME_NETWORK
ATCModem:+CREG: lac=9997 =0x270d
ATCModem:+CREG: ci=197108497 =0xbbfa311
ATCModem:NetworkState (EPS) = REGISTERED_HOME_NETWORK
ATCModem:+CEREG: tac=9997 =0x270d
ATCModem:+CEREG: ci=197108497 =0xbbfa311
ATCModem:+CEREG: act=7
ATCModem:NetworkState (CS) = REGISTERED_HOME_NETWORK
ATCModem:+CREG: lac=9997 =0x270d
ATCModem:+CREG: ci=197108497 =0xbbfa311
Cellular interface:
> IP Address: 10.229.79.126
Network is up with IP 10.229.79.126
SNTP Time Sync... 1.pool.ntp.org
SNTP Time Sync... 2.pool.ntp.org
SNTP Time Sync... 3.pool.ntp.org
SNTP Time Sync... 0.pool.ntp.org
...
...

---

5.
This is what I get when I press the RESET button on the B-L462E-CELL1 board:

Nx_TCP_Echo_Client application started.
Create IP instance...

===== X-Cube-Cellular version : X-CUBE-CELLULAR-7.1.0 =====

TYPE1SC UART config: BaudRate=115200 / HW flow ctrl=1
Get IP Address...
SysCtrl_TYPE1SC:MODEM POWER ON
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCore:TIMEOUT EVENT(1000 ms)
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCModem:Tempo started (3000 ms)...
ATCore:TIMEOUT EVENT(3000 ms)
Modem Boot OK, sim slot nb 0
LOG ERROR #1: channel=1 / errorId=7 / gravity=2
LOG ERROR #2: channel=2 / errorId=1 / gravity=2
STM32 IP Address: 0.0.0.0
DNS Server address: 8.8.8.8
SNTP Time Sync... 0.pool.ntp.org
SysCtrl_TYPE1SC:modem channel closed
SysCtrl_TYPE1SC:MODEM POWER OFF
SysCtrl_TYPE1SC:MODEM POWER ON
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCore:TIMEOUT EVENT(1000 ms)
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCModem:Tempo started (3000 ms)...
ATCore:TIMEOUT EVENT(3000 ms)
Modem Boot OK, sim slot nb 0
LOG ERROR #3: channel=1 / errorId=7 / gravity=2
LOG ERROR #4: channel=2 / errorId=1 / gravity=2
SysCtrl_TYPE1SC:modem channel closed
SysCtrl_TYPE1SC:MODEM POWER OFF
SysCtrl_TYPE1SC:MODEM POWER ON
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCore:TIMEOUT EVENT(1000 ms)
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCModem:Tempo started (3000 ms)...
ATCore:TIMEOUT EVENT(3000 ms)
Modem Boot OK, sim slot nb 1
LOG ERROR #5: channel=1 / errorId=7 / gravity=2
LOG ERROR #6: channel=2 / errorId=1 / gravity=2
SysCtrl_TYPE1SC:modem channel closed
SysCtrl_TYPE1SC:MODEM POWER OFF
SysCtrl_TYPE1SC:MODEM POWER ON
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCore:TIMEOUT EVENT(1000 ms)
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCModem:Tempo started (3000 ms)...
ATCore:TIMEOUT EVENT(3000 ms)
Modem Boot OK, sim slot nb 1
ATCModem:no pending URC
ATCModem:Tempo started (2000 ms)...
ATCore:TIMEOUT EVENT(2000 ms)
ATCModem:NetworkState (EPS) = NOT_REGISTERED_SEARCHING
ATCModem:NetworkState (EPS) = NOT_REGISTERED_SEARCHING
ATCModem:NetworkState (CS) = NOT_REGISTERED_SEARCHING
ATCModem:NetworkState (EPS) = NOT_REGISTERED_NOT_SEARCHING
ATCModem:NetworkState (CS) = NOT_REGISTERED_NOT_SEARCHING
ATCModem:NetworkState (EPS) = NOT_REGISTERED_SEARCHING
ATCModck:<MAX SIZE INFO> msgtype=4 size=0 (biggest =78)ATCModem:NetworkState (EPS) = UNKNOWN
ATCModem:+CEREG: tac=3007 =0xbbf
ATCModem:+CEREG: ci=7 =0x7
ATCModem:NetworkState (CS) = REGISTERED_HOME_NETWORK
ATCModem:+CREG URC: lac=9997 =0x270d
ATCModem:+CREG URC: ci=197108497 =0xbbfa311
ATCModem:NetworkState (EPS) = REGISTERED_HOME_NETWORK
ATCModem:+CEREG: tac=9997 =0x270d
ATCModem:+CEREG: ci=197108497 =0xbbfa311
ATCModem:+CEREG: act=7
ATCModem:NetworkState (CS) = REGISTERED_HOME_NETWORK
ATCModem:+CREG: lac=9997 =0x270d
ATCModem:+CREG: ci=197108497 =0xbbfa311
ATCModem:NetworkState (EPS) = REGISTERED_HOME_NETWORK
ATCModem:+CEREG: tac=9997 =0x270d
ATCModem:+CEREG: ci=197108497 =0xbbfa311
ATCModem:+CEREG: act=7
ATCModem:NetworkState (CS) = REGISTERED_HOME_NETWORK
ATCModem:+CREG: lac=9997 =0x270d
ATCModem:+CREG: ci=197108497 =0xbbfa311
Cellular interface:
> IP Address: 10.230.16.255
Network is up with IP 10.230.16.255
SNTP Time Sync... 1.pool.ntp.org
SNTP Time Sync... 2.pool.ntp.org
...
...


---

6.
Still, my local TCP Echo Server gets no connections.

---

7.
Help, please.

 

JFlowers
Associate III

(Well, I sent this more than 13.5 hours ago. Let’s see if it goes through this time.)


Hi @STackPointer64,


1.
When I connect to my local TCP Echo Server using my cellphone (with WiFi turned off), this is what I get:

C:\joe\TCPechoServerWs\Release>TCPEchoServerWS.exe 50001

Handling client (174.203.246.247):
hello STackPointer64!
C:\joe\TCPechoServerWs\Release>

---

2.
When I turn on the B-L462E-CELL1 by plugging it into a USB port, I get nothing. It just sits there:

C:\joe\TCPechoServerWs\Release>TCPEchoServerWS.exe 50001

---

3.
In my tcp_echo_client.c file,

\en.stm32cubeexpansion-cellular-v7-1-0\STM32CubeExpansion_CELLULAR_V7.1.0\Projects\B-L462E-CELL1\Demonstrations\Nx_TCP_Echo_Client\NetXDuo\App\tcp_echo_client.c

\en.stm32cubeexpansion-cellular-v7-1-0\STM32CubeExpansion_CELLULAR_V7.1.0\Projects\B-L462E-CELL1\Demonstrations\Nx_TCP_Echo_Client\STM32CubeIDE\Debug\Nx_TCP_Echo_Client.bin

This is what I have changed and recompiled and dropped Nx_TCP_Echo_Client.bin on the “DISL462RE (E:)” drive for flashing:


#ifndef TCP_SERVER_PORT
#define TCP_SERVER_PORT 50001
#endif /* TCP_SERVER_PORT */

#ifndef TCP_SERVER_ADDRESS
#define TCP_SERVER_ADDRESS IP_ADDRESS(<MY_ROUTER’s>,<WAN>,<IP>,<ADDRESS>)
#endif /* TCP_SERVER_ADDRESS */


---

4.
This is what I get when I power on the B-L462E-CELL1:


ATCore:TIMEOUT EVENT(1000 ms)
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCModem:Tempo started (3000 ms)...
ATCore:TIMEOUT EVENT(3000 ms)
Modem Boot OK, sim slot nb 0
LOG ERROR #1: channel=1 / errorId=7 / gravity=2
LOG ERROR #2: channel=2 / errorId=1 / gravity=2
STM32 IP Address: 0.0.0.0
DNS Server address: 8.8.8.8
SNTP Time Sync... 0.pool.ntp.org
SysCtrl_TYPE1SC:modem channel closed
SysCtrl_TYPE1SC:MODEM POWER OFF
SysCtrl_TYPE1SC:MODEM POWER ON
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCore:TIMEOUT EVENT(1000 ms)
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCModem:Tempo started (3000 ms)...
ATCore:TIMEOUT EVENT(3000 ms)
Modem Boot OK, sim slot nb 0
LOG ERROR #3: channel=1 / errorId=7 / gravity=2
LOG ERROR #4: channel=2 / errorId=1 / gravity=2
SysCtrl_TYPE1SC:modem channel closed
SysCtrl_TYPE1SC:MODEM POWER OFF
SysCtrl_TYPE1SC:MODEM POWER ON
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCore:TIMEOUT EVENT(1000 ms)
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCModem:Tempo started (3000 ms)...
ATCore:TIMEOUT EVENT(3000 ms)
Modem Boot OK, sim slot nb 1
LOG ERROR #5: channel=1 / errorId=7 / gravity=2
LOG ERROR #6: channel=2 / errorId=1 / gravity=2
SysCtrl_TYPE1SC:modem channel closed
SysCtrl_TYPE1SC:MODEM POWER OFF
SysCtrl_TYPE1SC:MODEM POWER ON
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCore:TIMEOUT EVENT(1000 ms)
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCModem:Tempo started (3000 ms)...
ATCore:TIMEOUT EVENT(3000 ms)
Modem Boot OK, sim slot nb 1
ATCModem:no pending URC
ATCModem:Tempo started (2000 ms)...
ATCore:TIMEOUT EVENT(2000 ms)
ATCModem:NetworkState (EPS) = NOT_REGISTERED_SEARCHING
ATCModem:NetworkState (EPS) = NOT_REGISTERED_SEARCHING
ATCModem:NetworkState (CS) = NOT_REGISTERED_SEARCHING
ATCModem:NetworkState (EPS) = NOT_REGISTERED_NOT_SEARCHING
ATCModem:NetworkState (CS) = NOT_REGISTERED_NOT_SEARCHING
ATCModem:NetworkState (EPS) = NOT_REGISTERED_SEARCHING
ATCModck:<MAX SIZE INFO> msgtype=4 size=0 (biggest =78)ATCModem:NetworkState (EPS) = UNKNOWN
ATCModem:+CEREG: tac=3007 =0xbbf
ATCModem:+CEREG: ci=7 =0x7
ATCModem:NetworkState (CS) = REGISTERED_HOME_NETWORK
ATCModem:+CREG URC: lac=9997 =0x270d
ATCModem:+CREG URC: ci=197108497 =0xbbfa311
ATCModem:NetworkState (EPS) = REGISTERED_HOME_NETWORK
ATCModem:+CEREG: tac=9997 =0x270d
ATCModem:+CEREG: ci=197108497 =0xbbfa311
ATCModem:+CEREG: act=7
ATCModem:NetworkState (CS) = REGISTERED_HOME_NETWORK
ATCModem:+CREG: lac=9997 =0x270d
ATCModem:+CREG: ci=197108497 =0xbbfa311
ATCModem:NetworkState (EPS) = REGISTERED_HOME_NETWORK
ATCModem:+CEREG: tac=9997 =0x270d
ATCModem:+CEREG: ci=197108497 =0xbbfa311
ATCModem:+CEREG: act=7
ATCModem:NetworkState (CS) = REGISTERED_HOME_NETWORK
ATCModem:+CREG: lac=9997 =0x270d
ATCModem:+CREG: ci=197108497 =0xbbfa311
Cellular interface:
> IP Address: 10.229.79.126
Network is up with IP 10.229.79.126
SNTP Time Sync... 1.pool.ntp.org
SNTP Time Sync... 2.pool.ntp.org
SNTP Time Sync... 3.pool.ntp.org
SNTP Time Sync... 0.pool.ntp.org
...
...

---

5.
This is what I get when I press the RESET button on the B-L462E-CELL1 board:

Nx_TCP_Echo_Client application started.
Create IP instance...

===== X-Cube-Cellular version : X-CUBE-CELLULAR-7.1.0 =====

TYPE1SC UART config: BaudRate=115200 / HW flow ctrl=1
Get IP Address...
SysCtrl_TYPE1SC:MODEM POWER ON
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCore:TIMEOUT EVENT(1000 ms)
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCModem:Tempo started (3000 ms)...
ATCore:TIMEOUT EVENT(3000 ms)
Modem Boot OK, sim slot nb 0
LOG ERROR #1: channel=1 / errorId=7 / gravity=2
LOG ERROR #2: channel=2 / errorId=1 / gravity=2
STM32 IP Address: 0.0.0.0
DNS Server address: 8.8.8.8
SNTP Time Sync... 0.pool.ntp.org
SysCtrl_TYPE1SC:modem channel closed
SysCtrl_TYPE1SC:MODEM POWER OFF
SysCtrl_TYPE1SC:MODEM POWER ON
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCore:TIMEOUT EVENT(1000 ms)
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCModem:Tempo started (3000 ms)...
ATCore:TIMEOUT EVENT(3000 ms)
Modem Boot OK, sim slot nb 0
LOG ERROR #3: channel=1 / errorId=7 / gravity=2
LOG ERROR #4: channel=2 / errorId=1 / gravity=2
SysCtrl_TYPE1SC:modem channel closed
SysCtrl_TYPE1SC:MODEM POWER OFF
SysCtrl_TYPE1SC:MODEM POWER ON
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCore:TIMEOUT EVENT(1000 ms)
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCModem:Tempo started (3000 ms)...
ATCore:TIMEOUT EVENT(3000 ms)
Modem Boot OK, sim slot nb 1
LOG ERROR #5: channel=1 / errorId=7 / gravity=2
LOG ERROR #6: channel=2 / errorId=1 / gravity=2
SysCtrl_TYPE1SC:modem channel closed
SysCtrl_TYPE1SC:MODEM POWER OFF
SysCtrl_TYPE1SC:MODEM POWER ON
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCore:TIMEOUT EVENT(1000 ms)
SysCtrl_TYPE1SC:UART config: setting HW Flow Control to 1
ATCModem:Tempo started (3000 ms)...
ATCore:TIMEOUT EVENT(3000 ms)
Modem Boot OK, sim slot nb 1
ATCModem:no pending URC
ATCModem:Tempo started (2000 ms)...
ATCore:TIMEOUT EVENT(2000 ms)
ATCModem:NetworkState (EPS) = NOT_REGISTERED_SEARCHING
ATCModem:NetworkState (EPS) = NOT_REGISTERED_SEARCHING
ATCModem:NetworkState (CS) = NOT_REGISTERED_SEARCHING
ATCModem:NetworkState (EPS) = NOT_REGISTERED_NOT_SEARCHING
ATCModem:NetworkState (CS) = NOT_REGISTERED_NOT_SEARCHING
ATCModem:NetworkState (EPS) = NOT_REGISTERED_SEARCHING
ATCModck:<MAX SIZE INFO> msgtype=4 size=0 (biggest =78)ATCModem:NetworkState (EPS) = UNKNOWN
ATCModem:+CEREG: tac=3007 =0xbbf
ATCModem:+CEREG: ci=7 =0x7
ATCModem:NetworkState (CS) = REGISTERED_HOME_NETWORK
ATCModem:+CREG URC: lac=9997 =0x270d
ATCModem:+CREG URC: ci=197108497 =0xbbfa311
ATCModem:NetworkState (EPS) = REGISTERED_HOME_NETWORK
ATCModem:+CEREG: tac=9997 =0x270d
ATCModem:+CEREG: ci=197108497 =0xbbfa311
ATCModem:+CEREG: act=7
ATCModem:NetworkState (CS) = REGISTERED_HOME_NETWORK
ATCModem:+CREG: lac=9997 =0x270d
ATCModem:+CREG: ci=197108497 =0xbbfa311
ATCModem:NetworkState (EPS) = REGISTERED_HOME_NETWORK
ATCModem:+CEREG: tac=9997 =0x270d
ATCModem:+CEREG: ci=197108497 =0xbbfa311
ATCModem:+CEREG: act=7
ATCModem:NetworkState (CS) = REGISTERED_HOME_NETWORK
ATCModem:+CREG: lac=9997 =0x270d
ATCModem:+CREG: ci=197108497 =0xbbfa311
Cellular interface:
> IP Address: 10.230.16.255
Network is up with IP 10.230.16.255
SNTP Time Sync... 1.pool.ntp.org
SNTP Time Sync... 2.pool.ntp.org
...
...


---

6.
Still, my local TCP Echo Server gets no connections.

---

7.
Help, please.

STackPointer64
ST Employee

Hello,

After analyzing the output log you provided for the different test cases and comparing it with the application source code and program flow, it appears that the issue revolves around SNTP time synchronization. This step is critical, as it is the last initialization step required before starting the TCP Echo Client thread, as shown in the program flow below.

  /* Sync up time by SNTP at start up. */
  ret = sntp_time_sync();

  /* Check status.  */
  if (ret != NX_SUCCESS)
  {
    printf("SNTP Time Sync failed.\r\n");
    Error_Handler();
  }

  /* Start sample. */
  sample_start(&IpInstance, &AppPool, &DnsClient, unix_time_get);

  /* this thread is not needed any more, we relinquish it */
  tx_thread_relinquish();
}

To further investigate and resolve the issue, follow these steps:

  1. Use Wireshark for Packet Analysis:
    Install and run Wireshark on your PC to monitor the network interface being used. Filter the traffic to focus on packets coming from the board's IP address. Check if:

    • Packets are being received and dropped or not reaching your PC.
  2. Test with a Clean Project:
    To eliminate any potential issues caused by source code modifications:

    • Obtain a fresh, unmodified project.
    • Change only the server IP and server port to match your setup.
    • Compile the project without making any other changes.
      This will help ensure the issue is not caused by unintended changes in the code.
  3. Change the NTP Server List:
    If the above steps do not resolve the issue, try modifying the NTP server list in the source code. Use reliable and accessible NTP servers to ensure proper synchronization. You could use NTP Pool project .

  4. Adjust NX_SNTP_CLIENT_MAX_ROOT_DISPERSION:
    If none of the above steps work, locate the NX_SNTP_CLIENT_MAX_ROOT_DISPERSION parameter in the nx_user.h file. This parameter measures the precision of the server clock. Set it to 0 to disable this feature and test the setup again.

Best regards,


Hi @STackPointer64,


I had to REM-out the call to sntp_time_sync() in app_netxduo.c and then use the PavelBansky EchoTool. It “worked” after that.

My bet is that the SNTP service is not allowed/not enabled in the cellular connection provider’s network (TRUPHONE).

---

\en.stm32cubeexpansion-cellular-v7-1-0\STM32CubeExpansion_CELLULAR_V7.1.0\Projects\B-L462E-CELL1\Demonstrations\Nx_TCP_Echo_Client\NetXDuo\App\app_netxduo.c

// /* Sync up time by SNTP at start up. */
// ret = sntp_time_sync();
//
// /* Check status. */
// if (ret != NX_SUCCESS)
// {
// printf("SNTP Time Sync failed.\r\n");
// Error_Handler();
// }

---

https://github.com/PavelBansky/EchoTool
C:\joe\TCPechoServerWs\Release>"C:\Users\joefl\Downloads\echotool.exe" /p tcp /s 50001

SHA256 hash of C:\Users\joefl\Downloads\echotool.exe:
e1af7723d0672d7169cd259829b743efb0b9ae297276687a063e6853aee55733

---


1. Use Wireshark for Packet Analysis
Unnecessary


2. Test with a Clean Project
Unnecessary


3. Change the NTP Server List
I tried the following, but it did not help.

static const char *sntp_servers[] =
{
“0.europe.pool.ntp.org”,
“1.europe.pool.ntp.org”,
“2.europe.pool.ntp.org”,
“3.europe.pool.ntp.org”
};

and

static const char *sntp_servers[] =
{
"0.north-america.pool.ntp.org",
"1.north-america.pool.ntp.org",
"2.north-america.pool.ntp.org",
"3.north-america.pool.ntp.org"
};

I tried those two in particular because the IP addresses that were connecting to my local TCP echo server (with sntp_time_sync() REM-ed out) seemed to be located in the UK or in the US.

Still, sntp_time_sync() did not work.


4. Adjust NX_SNTP_CLIENT_MAX_ROOT_DISPERSION

I tried Adjust NX_SNTP_CLIENT_MAX_ROOT_DISPERSION = 0 as you recommended, but it did not help.

---

 

STackPointer64
ST Employee

Hello @JFlowers,

It seems you were able to run the TCP Echo part by commenting out the SNTP time request, which is a great step forward. However, SNTP relies on UDP, and it is highly likely that your SIM provider is blocking UDP traffic or the SNTP service in particular.

Additionally, the IP address on your cellular board (10.x.x.x) is private, which means it requires Network Address Translation (NAT) to access the internet. UDP packets often encounter challenges with NAT. Routers may temporarily cache local-to-outside UDP port mappings, but this cache doesn’t persist for long, so there’s no guarantee that UDP packets will consistently get through.

To address these issues, you may consider contacting your SIM provider to obtain a public IP address, which can help bypass NAT-related issues. 

Best regards,