Hello friends,
i am doing a project with atmega32 and Ethernet module ENC28J60
On starting it works fine .when i checked it show
but after some time connection will lost and it shows
when i reset the micro controller it start to work again.so i thought the program may freeze in the micro controller, but on freeze time i checked the micro controller with UART communication , it work fine. only problem with etherner communication...i don't know why fix the problem when i reset my micro controller .. please give me some suggestions and help... if my explanation is not clear then ask your doubts please... i hope your valuable suggestions as early as possible.. thank you....
Hey,i had that problem too.Some of problems depends on your library,i have found another one more stable but I don't remember her name.What library do you use?
I too have had stability issues with a cheap ENC module.
They work, but are not that solid.
Try different libraries like Beny suggested. There is one for this module but is not directly compatible with the Ethernet Arduino library, I think it's called Ethercard and another that is compatible but with less features, UipEthernet.
You could also try a reset every so often or a watchdog.
Also, I think this is a software TCP/IP so you need RAM, make sure you optimize you code to hava as much available memory as possible.
beny10:
Hey,i had that problem too.Some of problems depends on your library,i have found another one more stable but I don't remember her name.What library do you use?
hello sir.. thanks for your reply...here i am attaching the library for my Ethernet module
somedude:
I too have had stability issues with a cheap ENC module.
They work, but are not that solid.
Try different libraries like Beny suggested. There is one for this module but is not directly compatible with the Ethernet Arduino library, I think it's called Ethercard and another that is compatible but with less features, UipEthernet.
You could also try a reset every so often or a watchdog.
Also, I think this is a software TCP/IP so you need RAM, make sure you optimize you code to hava as much available memory as possible.
hello sir thanks for your valuable reply...
you said it.. i did watchdog timer reset option..but when will do WDT reset? doing WDT reset in particular time period will affect the performance of the micro controller anyway? or how can we detect the freezing of Ethernet module? please help me sir....
somedude:
but you can try a connection every so often and reset when the connection fails.
sir i do not understand this.how can we try a connection every so often.. it will be so helpful if you explain it... thank you very much for your sincere help
It depends on what the issues are, but if you ping your own IP say, every 5 minutes, from your sketch and when it's frozen it doesn't give you a reply, you could try a reset.
This may not work if the Ethernet module still replies to its own pings, but from what I experienced when I was using en ENC module, it was just dropping the connection, not really freezing.
Based on your post, it seems that the microcontroller still runs so it should be a problem with the ENC module.
You could even try to re-initialize it in your sketch, but much of that depends on which library you are using.
The file you posted is not a library as such, but you could try the enc28j60_init() function to re-initialize the module every few minutes or so.
somedude:
It depends on what the issues are, but if you ping your own IP say, every 5 minutes, from your sketch and when it's frozen it doesn't give you a reply, you could try a reset.
This may not work if the Ethernet module still replies to its own pings, but from what I experienced when I was using en ENC module, it was just dropping the connection, not really freezing.
Based on your post, it seems that the microcontroller still runs so it should be a problem with the ENC module.
You could even try to re-initialize it in your sketch, but much of that depends on which library you are using.
The file you posted is not a library as such, but you could try the enc28j60_init() function to re-initialize the module every few minutes or so.
thanks for your reply sir..
you are right... i think enc28j60_init() function solve the problem but reinitializing also create a connection problem so if we reinitialize every second there will be a timeout in connection in always... look on the picture below sir
so it will be better to reinitialize when lost connection....sir can we ping IP by using program and check connection? i am wishing your valuable suggestions .. thank you