ENC28J60 Ethernet Library V3.3
I found that it works correct with my ie7 from vmware that sends this header
GET /s HTTP/1.1
Accept: */*
Referer: http://192.168.10.20/
Accept-Language: pt-br
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; FDM)
Connection: Keep-Alive
Host: 192.168.10.20
Pragma: no-cache
But if I try to open with my other ie7 that is not in the vmware it doesnt displays the page, the header sended by this other ie is a litle diferent take a look.
GET / HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*
Accept-Language: pt-br
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Host: 192.168.10.20
Connection: Keep-Alive
Maybe is a bug with .NET CLR 3.0 ho know ...
Kindly Regards,
Diego.
GET /s HTTP/1.1
Accept: */*
Referer: http://192.168.10.20/
Accept-Language: pt-br
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; FDM)
Connection: Keep-Alive
Host: 192.168.10.20
Pragma: no-cache
But if I try to open with my other ie7 that is not in the vmware it doesnt displays the page, the header sended by this other ie is a litle diferent take a look.
GET / HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*
Accept-Language: pt-br
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Host: 192.168.10.20
Connection: Keep-Alive
Maybe is a bug with .NET CLR 3.0 ho know ...
Kindly Regards,
Diego.
Hi, when I try to connect all works, but after a while (10 sec timer?) an update is attempted and then it fails:Loki1_11 wrote:Hi Dany try again now please
(1)Fout bij verbinden
(2)Firefox kan geen verbinding maken met de server op 192.168.10.20.
(3)Hoewel de website lijkt te bestaan is het de browser niet gelukt ermee te verbinden.
(4) Misschien is de website tijdelijk niet beschikbaar? Probeer het later opnieuw.
Translation:
(1): Connection error
(2): Firefox cannot connect to server 192.168.10.20
(3): While the website seems to exist, the browser cannot make a connection
(4): Perhaps the site is not online for the moment? Try later again.
p.s.:similar result with IE7: there it goes wrong after toggling one of the inverters.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Hi, a little bit off topic: I think that a lot of recent posts in this thread belong actually/better to another thread: http://www.mikroe.com/forum/viewtopic.php?t=17602. They do not fall under the title "ENC28J60 Ethernet Library V3.3".
I do not know if a move from this to that other thread is still possible. (Anyway: I think this is something for a moderator.)
But: Yo2Lio is the starter of this thread, of course it is his decision to do the move or not... Florin?
I do not know if a move from this to that other thread is still possible. (Anyway: I think this is something for a moderator.)
But: Yo2Lio is the starter of this thread, of course it is his decision to do the move or not... Florin?
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Hi Florin,
Is there a difference in sending data to UDP with "Send_UDP" and rerurn data at the end of " Eth_UserUDP"? I ask this beacuse the latter works (to be seen in the compiler's UDP terminal), while the "Send_UDP" does not seem to work (nothing received in the compiler's UDP terminal), but on every call to "Send_UDP" the hub's light flashes!
The code that I try to copy is the one from "UDP_Send.pbas", translated to mP.
p.s. I am using the ENC version 3.4 and mikroPascal v8.3 (I get a linker error with 7.0: "Length" redefined).
Probably I do something wrong due to lack of ethernet/tcp/ip knowledge...
Below is some code.
As you can see I added some testcode: writing an "X" to the uart if Send_ARP succeeds and an "S" if Send_UDP succeeds. They both seem to succeed, and, what is more, they continue to do so when the ethernet cable is disconnected from the ENC board.
Any suggestions? Thanks in advance.
Is there a difference in sending data to UDP with "Send_UDP" and rerurn data at the end of " Eth_UserUDP"? I ask this beacuse the latter works (to be seen in the compiler's UDP terminal), while the "Send_UDP" does not seem to work (nothing received in the compiler's UDP terminal), but on every call to "Send_UDP" the hub's light flashes!
The code that I try to copy is the one from "UDP_Send.pbas", translated to mP.
p.s. I am using the ENC version 3.4 and mikroPascal v8.3 (I get a linker error with 7.0: "Length" redefined).
Probably I do something wrong due to lack of ethernet/tcp/ip knowledge...
Below is some code.
As you can see I added some testcode: writing an "X" to the uart if Send_ARP succeeds and an "S" if Send_UDP succeeds. They both seem to succeed, and, what is more, they continue to do so when the ethernet cable is disconnected from the ENC board.
Any suggestions? Thanks in advance.
Code: Select all
Procedure Eth_SetParameters; // set your parameters here
Begin
Str2Ip('192.168.123.79' ,eth_ip_addr); // the PIC devices IP address
Str2Ip('85.120.220.254' ,eth_ntp_addr); // not used here
Str2Ip('192.168.123.254',eth_gateway); // the gateway of the network
Str2Ip('255.255.255.0' ,eth_mask); // the network IP mask
Str2Mac('0004A3008093' ,eth_mac); // the PIC devices MAC address
eth_port := 10001;
dest_port := 10001;
Str2Ip('192.168.123.77',user_ip_addr); // PC IP address
end;
begin
Init;
Spi_Init;
Eth_SetParameters;
Eth_Init_(PORTC, 1, PORTC, 0);//(ENC_Port_CS,CS,ENC_Port_Reset,Reset);
Wait_for_LAN;
data_user := 'Some data ..... here ....';
while true do
begin
Eth_DoPacket;
if (TickCounter2 > 1000) then
begin
TickCounter2 := 0;
if Send_ARP(user_ip_addr, MacAddress) then Soft_Uart_Write('X');
if Send_UDP(user_ip_addr, dest_port, eth_port, length(data_user), data_user)
then Soft_Uart_Write('S');
end;
end;
end.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Yes, you are right.Dany wrote:Below is some code.
As you can see I added some testcode: writing an "X" to the uart if Send_ARP succeeds and an "S" if Send_UDP succeeds. They both seem to succeed, and, what is more, they continue to do so when the ethernet cable is disconnected from the ENC board.
I don't take into account the Ethernet link up or down. But this is a very good suggestion ...
Ethernet have ARP cache. The cache is refreshed at every 20 minutes.
If Ethernet have the MAC address in cache and expired time is smaller than 20 minutes, then library take MAC from cache instead to send new ARP request ...
So, the result will be true !!!
I will read documentations about link up and I will change the library regarding this problem ... maybe I can do this today
Best regards, Florin Andrei Medrea.
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
You can download the latest mcl file, including this feature from here : http://www.microelemente.ro/MikroPascal ... l_file.zip
Please try now your example with this mcl.
PS. you must include aditional_string_util in program.
Please give me a feedback about the result . Thanks.
Please try now your example with this mcl.
PS. you must include aditional_string_util in program.
Code: Select all
uses aditional_string_util,lib1_enc28j60_V3_4,enc_lib_user,lib2_enc28j60_V3_4;
Best regards, Florin Andrei Medrea.
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
Hi Florin, thanks for your fast response.yo2lio wrote:Please try now your example with this mcl. Please give me a feedback about the result . Thanks.
The good news:
This is solved: both fail (return false) once the network cable is removed.As you can see I added some testcode: writing an "X" to the uart if Send_ARP succeeds and an "S" if Send_UDP succeeds. They both seem to succeed, and, what is more, they continue to do so when the ethernet cable is disconnected from the ENC board.
The bad news:
My original problem still persists. I must be doing something wrongIs there a difference in sending data to UDP with "Send_UDP" and return data at the end of " Eth_UserUDP"? I ask this beacuse the latter works (to be seen in the compiler's UDP terminal), while the "Send_UDP" does not seem to work (nothing received in the compiler's UDP terminal), but on every call to "Send_UDP" the hub's light flashes!
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Hi Florin, the unit "definitions_ENC" should not be "used" any more? (It works apparently without it...). It was part of the ENC library I think?yo2lio wrote:Code: Select all
uses aditional_string_util,lib1_enc28j60_V3_4,enc_lib_user,lib2_enc28j60_V3_4;
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
When you send data with Send_UDP , you are the master and you initiate the transmission :
First send ARP request and the send data over UDP.
In the second case when you send reply in Eth_UserUDP function you just send data back to remote server.
Your problem will be resolved with this software : http://www.hw-group.com/download/sw/HerculesSetup.zip
I use this software like terminal for UDP, TCP, RS232 ... etc
First send ARP request and the send data over UDP.
In the second case when you send reply in Eth_UserUDP function you just send data back to remote server.
Your problem will be resolved with this software : http://www.hw-group.com/download/sw/HerculesSetup.zip
I use this software like terminal for UDP, TCP, RS232 ... etc
Best regards, Florin Andrei Medrea.
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
Nice! Thanks Florin for the fast reply and the adaptation of the library. I will try "Hercules" asap and give you feedback.
In the mean time: my mP V8.3 has crashed (during its startup) and I have to re-install it before I can go on (all settings are lost, o.a. docking is gone).
One can experience always something new with mP...
In the mean time: my mP V8.3 has crashed (during its startup) and I have to re-install it before I can go on (all settings are lost, o.a. docking is gone).
One can experience always something new with mP...
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Hi Florin, as you said:
So, the "guilty" (if I may say so) was the compiler's UDP terminal.
Everything works! Thanks!!!Your problem will be resolved with this software : http://www.hw-group.com/download/sw/HerculesSetup.zip
So, the "guilty" (if I may say so) was the compiler's UDP terminal.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)