View previous topic :: View next topic |
Author |
Message |
leejok2003
Joined: 25 Dec 2008 Posts: 32
|
Connecting the ENC28J60+PIC18F4620 boad to a router |
Posted: Mon Mar 09, 2009 3:43 am |
|
|
Hi,
I am currently testing my board to connect to the router in my house to test whether it can be accessed by other computers. But i am facing problems on how to get the board connected? It is just connect it through cable or i need to configure the router? I have include HTTP,ARP, ICMP, and TCP in the board. The IP assigned was 192.168.0.x which is for the local network. Am i missing something?? |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Mon Mar 09, 2009 4:17 am |
|
|
A router isn't involved in local network communication, except for a possible DHCP function, which is apparently not used due to fixed IP configuration. The PIC host should answer ARP and PING requests without additional software running. To establish ingoing TCP connections, a server application must be present at the PIC. |
|
|
leejok2003
Joined: 25 Dec 2008 Posts: 32
|
|
Posted: Mon Mar 09, 2009 5:33 am |
|
|
Hi FvM,
I not really understand about it. Is it means that inside the PIC there should be a HTTP server to respond request from others? |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Mon Mar 09, 2009 5:47 am |
|
|
You didn't tell about your intended kind of operation. For a HTTP connection, yes you need a HTTP server. CCS has provided examples for it. |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
Re: Connecting the ENC28J60+PIC18F4620 boad to a router |
Posted: Mon Mar 09, 2009 6:10 am |
|
|
leejok2003 wrote: | Hi,
I am currently testing my board to connect to the router in my house to test whether it can be accessed by other computers. But i am facing problems on how to get the board connected? It is just connect it through cable or i need to configure the router? I have include HTTP,ARP, ICMP, and TCP in the board. The IP assigned was 192.168.0.x which is for the local network. Am i missing something?? |
If you want the PIC to be reached by other computers on the internet then the router needs to be configured with network address translation (NAT). For example, assume that the PIC is the only web server on your house network and you want to access the PIC via the web from the internet. You need to set up port mapping on the router that that any TCP port 80 traffic maps to the 192.168.8.x address of the PIC. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
leejok2003
Joined: 25 Dec 2008 Posts: 32
|
|
Posted: Tue Mar 10, 2009 3:36 am |
|
|
Hi,
i have tested the board with different cable, cross and straight cable connecting to the router... but i cant detect the board from the router. Which i attend to have a local network communication with the board |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Tue Mar 10, 2009 7:53 am |
|
|
Yes, I also understood local network. So the router is only working as a switch or hub, depending on the hardware. As a first step, you shouldn't replace cables but check the link status of both peers. An established ethernet link is the elementary prerequisite for any communication. Then I would start monitoring the communication with a network monitor as Wireshark. If you are connecting through a switch, most of the communications won't be propagated to other ports, so it's most simple to connect from a PC that is running also the monitor. If you perform a ping, you should see ARP and ICMP packets.
If you get no answer at all, check hard- and software at the PIC side and trace respective network actions with a debugger. |
|
|
leejok2003
Joined: 25 Dec 2008 Posts: 32
|
|
Posted: Wed Mar 11, 2009 1:46 am |
|
|
Hi,
I finally get my board connected to my house's router! I was provided with another cross cable by my lecturer, and i just tried it out! The board now response to ping and arp as well. Thank god. By the way, yesterday i was testing with a hub and not a router (now only i differentiate it). Anyway, thank you guys for giving me the info. |
|
|
|