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

IP question

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



Joined: 02 Apr 2008
Posts: 12

View user's profile Send private message

IP question
PostPosted: Wed Sep 03, 2008 1:12 am     Reply with quote

Hi There,

I like to do the following, but can't figure out how to do it:

I like to connect a board with an 18F66J60 to my LAN network. Then I like to send with my PC application a new IP, Gateway, MASK and port to the board with an UDP message.

So first of all I don't know the IP from the PCB. I was thinking that I could use hardcoded IP 127.0.0.1, port 5530.

Then I send a message from the PC to that IP and port with new IP and port information. That info will be stored in EEprom. From that moment I know the IP and port from the PCB.

But when I transmit a message to IP 127.0.0.1, it's looped back in the PC application, and is not received by the PCB.

I tried the same with 255.255.255.255, messages on that IP should be received by every node on the network, but also that is not working.

I can't use DHCP because not all the LAN's I will use are using DHCP.

Has anybody an idea how to do this ?
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Wed Sep 03, 2008 1:36 am     Reply with quote

Sending to the 127.0.0.1 never can reach a peer at the network, broadcast to 255.255.255.255 is basically correct.

You should verify, if the UDP broadcast is actually send, e. g. by wireshark/ethereal. Most likely it is. If so, the problem would be in the PIC IP stack not configured to receive broadcasts.

In case of your problem, broadcast is the only feasible way to reach an uncofigured device, so you should make the stack receiving them.
ChrisK



Joined: 02 Apr 2008
Posts: 12

View user's profile Send private message

PostPosted: Wed Sep 03, 2008 3:24 am     Reply with quote

I don't see anything with wireshark, when I send a message to 255.255.255.255

Any idea where to check ?
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Wed Sep 03, 2008 4:04 am     Reply with quote

Possibly wrong usage of the winsock interface?
ChrisK



Joined: 02 Apr 2008
Posts: 12

View user's profile Send private message

PostPosted: Wed Sep 03, 2008 7:12 am     Reply with quote

Sorry to say, but I'm not that familiar with winsock and that stuff. So I really don't know how to solve this matter.

Also I have another question, maybe you know the answer.

I use the EX12.C example from CCS, I like to send an UDP message to an IP adress I like to select. Where and how should I setup that IP so that the UDPTxTask will use that IP ?
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Wed Sep 03, 2008 8:14 am     Reply with quote

Quote:
I'm not that familiar with winsock
No problem so far, but how did you try to send the broadcast?

The example ex12 is only answering to a peer, to my opinion and takes the IP address from received data. There are probably other examples with active connection setup.

Up to now, I only took a brief view at the PIC IP stack, didn't use it yet.
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