ENC28J60 and router ?
catostay
Posts: 8
I am trying to build an application to switch relays on and off trough TCP/IP using the ENC28J60 chip and the PropTCP drivers. I need to run my application with a static IP address. At this point I am able to switch LED's on and off trough telnet on my local network but I am unable to control the LED's trough WIFI or even the internet. I think the reason is that my router only acts as a hub on the local network and if the request comes from the internet the router doesn't know where to send the request to.
I also don't see the IP address of the my "PropTCP" board in the list of the connected devices list of my router. I tried to forward port 23 to the ip address of the "PropTCP" board but it didn't work because the router doesn't now that the "probtcp" board is on the local network.
My questions:
1) How can I tell my router that my board is connect on the local network and that all request are getting forwarded?
2) Can I send a command from the "ProbTCP" board to the router and register as a local network address?
Well TCP/IP seems to be more complicated that I thought. Any help would be appreciated
Thanks,
Wolfgang
I also don't see the IP address of the my "PropTCP" board in the list of the connected devices list of my router. I tried to forward port 23 to the ip address of the "PropTCP" board but it didn't work because the router doesn't now that the "probtcp" board is on the local network.
My questions:
1) How can I tell my router that my board is connect on the local network and that all request are getting forwarded?
2) Can I send a command from the "ProbTCP" board to the router and register as a local network address?
Well TCP/IP seems to be more complicated that I thought. Any help would be appreciated
Thanks,
Wolfgang
Comments
2) Again, you don't need to send a command to the router for address registration. Just set a static IP on the Propeller that is in your local network's subnet (and outside the DHCP range).
Also: PropTCP is fully aware of subnets and routing, so it should work through routers and the internet (both in client and server modes).
Please post your source code. It's hard to tell what's wrong without looking at what you are doing.
Harrison
I tried for hours to get the signals trough my router without any success so far. I attached the code to this post.
This works fine on the local network but not outside.
Thanks,
Wolfgang
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propalyzer: Propeller PC Logic Analyzer
http://forums.parallax.com/showthread.php?p=788230
Well so far I was not able to control my board other than trough the local network. I am playing all afternoon with my router configuration but no success yet.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propalyzer: Propeller PC Logic Analyzer
http://forums.parallax.com/showthread.php?p=788230
What I am seeing is an ARP request from 192.168.1.250 (PC on WIFI) to 192.168.1.4 (PropTCP) and shortly after that an ARP request from 192.168.1.1 (router) to 192.168.1.4 (PropTCP) but in both cases no ARP response from 192.168.1.4 (PropTCP)
If try to connect from a local network PC (192.168.1.243). I will get an ARP request (192.168.1.243 > 192.168.1.4) and shortly after that a response from 192.168.1.4. Shortly after that 192.168.1.243 and 192.168.1.4 communicate trough port 23 in TCP.
So my router forwards the request from the WIFI PC but the PropTCP doesn't respond.
Any ideas anybody ?
Thanks
Wolfgang
To access a computer on a LAN or WLAN from a WAN port you may have to set up DMZ and change your firewall settings.
I presume your ISP had provided you with a static address. Note Harrisons comments on Port forwarding too.
BTW I use the same set up to monitor my bilge pump and battery voltages on my boat whilst it is in the marina and remotely control some
other functions)
regards
Ron
Post Edited (Ron Sutcliffe) : 5/24/2009 12:45:42 AM GMT
Well I have 2 setups here:
Setup 1: PropTCP > ROUTER > PC (all wired) With this setup my PC talks to the PropTCP
Setup 2: PropTCP > ROUTER > WIFI-PC (wired from PropTCP to Router and wireless from Router to Wifi-PC) With this setup the wifi PC doesn't talk to the PropTCP
I forwarded port 23 to my PropTCP and additional I setup DMZ to the PropTCP. With Microsoft Network Monitor I can see ARP requests from both setups but only an ARP response in setup 2
As you can see I am not even going trough the internet yet.
In option one the router acts as a hub only but in the second option it acts as a gateway.
So far I can't figure out the problem. I am trying to understand the ARP functions in the file "driver_socket" but this will take me a couple more our and lots of coffee..
Sorry if I explain everything so complicated but English is only my second language.
Wolfgang
Also, you'll want to prepend all socket accesses with a \ to catch aborts. Most of the socket operations can abort on socket failures (read or write to a closed socket, etc). It's very likely that the stack is aborting due to socket errors, which causes your application to stop.
Change your code to:
Also try changing the MAC address to:
Thanks again.
Wolfgang
Try doing a tracert command go to the dos prompt in windows or console if unix/linux and type tracert the address 192.168.?.? and you can watch it over its hops it will stop at your router gateway address ??192.168.1.1
if you are trying to see from the Wan side you can go into your router I am guessing something like 128.34.56.? and do the same thing but it will stop at the private address 192.168.?.?
if you are trying to watch the packets with Netmon or something similar the same thing will happen you will see packets stop at the private address space.