Hi all,
My B4A app control a 3D Printer by connecting to an ESP32 over TCP socket.
My app is a client and ESP32 is a server.
The ESP32 is connected to a 3D printer over USB cable with USB Host Shield, so ESP32 acts as true host (the same than pc) and can control a 3D Printer, even receive feedback that is sent to my app. ESP32 even have uSD card slot where read gcode files transferred from my app.
All this works. Now the problem is:
If I connect my app (client) to ESP32 (server), when I disconnect or just close the app, ESP32 know a disconnection without problems.
This do not happen on client side, if I switch off ESP32 while client is connected, my app do not know that server goes offline.
I use AsyncStreams and SocketAStreams_Terminated or SocketAStreams_Error do not fires at all.
Do this happen because it is a client and not a server ?
How I can know that server stay online or offline or just disconnect the client ?
I need to use a timer to continue ping the server to know it ? I want avoid to do this, there are other solutions ?
Many thanks
My B4A app control a 3D Printer by connecting to an ESP32 over TCP socket.
My app is a client and ESP32 is a server.
The ESP32 is connected to a 3D printer over USB cable with USB Host Shield, so ESP32 acts as true host (the same than pc) and can control a 3D Printer, even receive feedback that is sent to my app. ESP32 even have uSD card slot where read gcode files transferred from my app.
All this works. Now the problem is:
If I connect my app (client) to ESP32 (server), when I disconnect or just close the app, ESP32 know a disconnection without problems.
This do not happen on client side, if I switch off ESP32 while client is connected, my app do not know that server goes offline.
I use AsyncStreams and SocketAStreams_Terminated or SocketAStreams_Error do not fires at all.
Do this happen because it is a client and not a server ?
How I can know that server stay online or offline or just disconnect the client ?
I need to use a timer to continue ping the server to know it ? I want avoid to do this, there are other solutions ?
Many thanks
Last edited: