I implement the connection of android devices via Wi-Fi in TCP client mode to the wifi232 (Waveshare) wireless module connected to the stm32f4discovery card. The network finds, but in most cases the application can not connect, although sometimes the connection is established and the data transfer goes quietly in both directions. At the same time, the PC client always connects.

The part of the application responsible for the connection:

void Connect() { class RunSocketTask extends AsyncTask<Integer, Void, Void> { protected Void doInBackground(Integer... params) { SocketAddress serverAddr = new InetSocketAddress(SERVER_IP, SERVER_PORT); try { socket.connect(serverAddr, 5000); socket.setKeepAlive(true); } catch (Exception e) { Log.e("ClientActivity", "S: Error", e); } socketThreadRun = new ClientThread(); socketThreadRun.reasonToRun = true; socketThread = new Thread(socketThreadRun); socketThread.start(); tValidateConnection.run(); return null; } } new RunSocketTask().execute(1, null, null); } 

If the connection fails, SocketTimeoutException: connect timed out crashes. Please help me figure it out.

    0