View previous topic :: View next topic |
Author |
Message |
yy
Joined: 22 Aug 2010 Posts: 4
|
Help with CCS stack |
Posted: Sun Aug 22, 2010 6:24 am |
|
|
Hello,
I use the 3.3v Ethernet Controller kit. I've used the CCS stack in order to send udp messages over a network. At this point Ive decided to make the device ask an IP address based on a udp message it got from a pc App I wrote this feature workd fine with our linksys router but when i've truied another router (edimax) the data arrived perfectly to the device but it never gets the requested IP.
can anybody suggest the basic steps needed in order to implement such feature using the CCS stack?
I use pic18F67j60 CCS ver. 4.108 |
|
|
collink
Joined: 08 Jan 2010 Posts: 137 Location: Michigan
|
Re: Help with CCS stack |
Posted: Sun Aug 22, 2010 7:03 am |
|
|
yy wrote: | Hello,
I use the 3.3v Ethernet Controller kit. I've used the CCS stack in order to send udp messages over a network. At this point Ive decided to make the device ask an IP address based on a udp message it got from a pc App I wrote this feature workd fine with our linksys router but when i've truied another router (edimax) the data arrived perfectly to the device but it never gets the requested IP.
can anybody suggest the basic steps needed in order to implement such feature using the CCS stack?
I use pic18F67j60 CCS ver. 4.108 |
Since your code worked with one router but not another I'd start by making sure that the second router really responds to DHCP. Have you tried it from a PC? If that works then get wireshark and trace the UDP exchange and see how the PC is talking to the second router. See if there is something going on that you don't do on the pic. |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Sun Aug 22, 2010 9:06 am |
|
|
You need to give us better network configuration for this.
Are you saying you want to talk to a device that's connected like this?
PIC -> Local Router-> Internet -> Remote Router -> PC?
If both of the networks behind the routers are private IP's (RFC1918), it will never work unless you have some form of DMZ or mapped IP address set up on the remote router. And then you'll never see the PC's address as it's private and has no route.
You would talk to the Remote Router at the desired port number and just get answers back back from the PC on behalf of the Remote Router
I'm just guessing. We need to know more about your network configuration.
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
yy
Joined: 22 Aug 2010 Posts: 4
|
network configuration |
Posted: Sun Aug 22, 2010 1:09 pm |
|
|
My network configuration is very simple:
PIC -> Local Router-> PC
This is what's strange, it is a simple configuration so changing a router shouldn't have such an effect, and as I said all I want is the pic to ask and get a specific ip. |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Sun Aug 22, 2010 1:54 pm |
|
|
So the PC is on the other side of the router or the PC is on the same side of the router as the PIC?
If the case is the former, then I would still ask, what are the IP addresses of all the items in question (no RFC1918 ip's)? Is the router a firewall running NAT?
If it's the latter, then the PIC should be contacting the PC directly via an ARP request... the router shouldn't be getting involved at all.
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
yy
Joined: 22 Aug 2010 Posts: 4
|
ARP won't work |
Posted: Mon Aug 23, 2010 12:14 am |
|
|
As I see it ARP helps to find the address, but nothing more.
I've tried using the ARP Command from command line but it didn't work.
Code: | arp -s 192.168.2.202 00-02-03-04-05-3E |
Because I use udp messages to work remotely with the PIC I've sent the requested IP to the it and It was Supposed to put it into the DHCP request which works with our linksys router but not with others. |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Mon Aug 23, 2010 8:34 am |
|
|
DHCP can be a problem because a lot of cheaper routers take shortcuts implementing it.
If the PIC isn't getting an address (and is set to do so) --- it won't talk on the network until it gets one.
Try turning off DHCP on the PIC and assigning a static address and then see if your application works.
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
yy
Joined: 22 Aug 2010 Posts: 4
|
Static IP |
Posted: Mon Aug 23, 2010 11:33 pm |
|
|
giving it static IP works fine but putting that same IP in DHCPRequest message doesn't work.
I've tryid conncecting only my PC and the pic to the router and yet couldn't get a specific ip
Last edited by yy on Mon Aug 23, 2010 11:44 pm; edited 1 time in total |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
Re: Static IP |
Posted: Mon Aug 23, 2010 11:43 pm |
|
|
yy wrote: | but putting that same IP in DHCPRequest message doesn't work |
That doesn't make any sense.
How do you put in an IP in a DHCP request.
The IP Address is in the DHCPOFFER that comes from the server.
Anyway - it sounds like you have DHCP problems with that brand of firewall/router more than issues with your application.
You need to wireshark the entire DHCP conversation between the PIC and the firewall/router to see why it's not working.
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
|