We had a company develop for us a hardware, equipped with a PIC18F46K22, connected via UART communication to another hardware using another PIC.
The hardware works by connecting to the internet using a ENC28j60 module, with a ethernet connection using DHCP, and then, downloads data from a mysql server to microcontroller RAM.
The code is working fine in some some routers/ISPs, but the connection to the server is highly unstable if connected to other routers/ISPs. This is the bug that I need to fix, unstable connection to the remote server.
Device has a character LCD, that displays the percentage indicator for the download that is being done, in some internet provider, I get many download error messages.
Code is attached.