CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Help with CCS stack

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
yy



Joined: 22 Aug 2010
Posts: 4

View user's profile Send private message

Help with CCS stack
PostPosted: Sun Aug 22, 2010 6:24 am     Reply with quote

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

View user's profile Send private message Visit poster's website

Re: Help with CCS stack
PostPosted: Sun Aug 22, 2010 7:03 am     Reply with quote

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: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Sun Aug 22, 2010 9:06 am     Reply with quote

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

View user's profile Send private message

network configuration
PostPosted: Sun Aug 22, 2010 1:09 pm     Reply with quote

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: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Sun Aug 22, 2010 1:54 pm     Reply with quote

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

View user's profile Send private message

ARP won't work
PostPosted: Mon Aug 23, 2010 12:14 am     Reply with quote

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: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Mon Aug 23, 2010 8:34 am     Reply with quote

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

View user's profile Send private message

Static IP
PostPosted: Mon Aug 23, 2010 11:33 pm     Reply with quote

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: 1611
Location: Central Illinois, USA

View user's profile Send private message

Re: Static IP
PostPosted: Mon Aug 23, 2010 11:43 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group