I had a company develop for me a device that works by connecting to the internet using DHCP and then downloading data from the internet, using a enc28j60 ethernet module and a PIC device, current issue is explained below. Code is written in C.
The situation is like this, the device used to have a DHCP connection issue, that happened everytime it was connected to a router that didn´t have the [login to view URL] IP as default gateway = DHCP server.
For instance, if router had the default gateway on [login to view URL], the device could not connect to the internet.
DHCP code was fixed, but now there are random errors with the download part,
things like download error, device downloading from 0 to 100% then going to 101%, then showing "data not found", or downloading up to a certain % then displaying "invalid data".
I think this issue is happening because the download code (con_userfunction.h) is still based on the old DHCP code (ethernet_old_bug.h), so these random download issues happen on specific routers, the ones that have default gateway different from 192.168.1.1.
I included the following codes:
- Con_userfunction.h - download code
- Ethernet_fixed.h - DHCP fixed code
- Ethernet_old_bug.h - DHCP old code (bug)
The download code file is "con_userfunction.h" , the function name is:
void call_server_mode_fn()
{
unsigned int jk=0;"
Hello.
More 20 years programming experience.
Regards.
------------------------------------------------------------------------------------------------------------------------------------------------