View previous topic :: View next topic |
Author |
Message |
ChrisK
Joined: 02 Apr 2008 Posts: 12
|
IP question |
Posted: Wed Sep 03, 2008 1:12 am |
|
|
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
|
|
Posted: Wed Sep 03, 2008 1:36 am |
|
|
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
|
|
Posted: Wed Sep 03, 2008 3:24 am |
|
|
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
|
|
Posted: Wed Sep 03, 2008 4:04 am |
|
|
Possibly wrong usage of the winsock interface? |
|
|
ChrisK
Joined: 02 Apr 2008 Posts: 12
|
|
Posted: Wed Sep 03, 2008 7:12 am |
|
|
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
|
|
Posted: Wed Sep 03, 2008 8:14 am |
|
|
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. |
|
|
|