View previous topic :: View next topic |
Author |
Message |
kahjoo
Joined: 28 Apr 2006 Posts: 2 Location: Malaysia
|
The ARP problem in which sending or receiving data using UDP |
Posted: Tue Jul 04, 2006 3:09 am |
|
|
Hi,
I've using the ENC28J60 and CCS compiler to compile the example file with the TCP/IP source code given by the CCS. We are planed to build a two devices that can be talk to each other either by using TCP or UDP. The two devices can be said are point to point and not going through any server, meant we want it to be when the two devices are connected to the LAN and they can talk to each other. However, the two devices can be only talk to the assigned remote IP and PORT number and will not be changes.
For currently, I'm testing the code using the UDP. I taking the code from the Example 12, and I found that the program need to received packet from server and then can send the data out. However, due to our application, I need the MCU can sending or receiving data anytime. So I found out example from the forum and test it out through my PC, and it works, but the problem was sometime the MCU are not sending out the ARP to request the MAC address, and cause the MCU cannot get the MAC address and sending out the data or receiving the data. Is there better way to solve this problem?
Another question is when I make this program and program it into two different devices, with different IP and MAC address, but assigned the each other remote IP, can it be work by using the attached program? Or any good idea of doing it? Thanks.
Quote: |
c:\program files\picc\tcp-ip\pic examples source\ex12.c
|
Regards
Kah Joo
+++++++++++++++++
Posted code changed to file directory.
Reason: Forum Rule #10
10. Don't post the CCS example code or drivers
-- Forum Moderator
+++++++++++++++++ _________________ Everything can be done, do you willing to do it!!! |
|
|
artur_saraiva
Joined: 10 Aug 2009 Posts: 2
|
|
Posted: Tue Sep 22, 2009 9:03 am |
|
|
Example 12 work fine? I'm testing the file but isn't working. I don't understand what the problem is.
Does it need to define a function MACInit ? ENCSPIInit ? More defines ? I'm testing send UDP packets using udp.exe from microchip to pic18F + enc28j60 ethernet controller. I get listening the port, but I don't receive anything. Can you help me?
Edit..
The function StackInit() makes the program don't run in next line of program text...im testing line to line sending msg rs232 from pc.
How ARP works in code "text"? I don't understand.
ARP is for know the ip and mac address from pc ?
In opensokect(), the atribute null from variable type remoteNode
is right ?
Last edited by artur_saraiva on Tue Sep 22, 2009 10:26 am; edited 1 time in total |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Tue Sep 22, 2009 12:21 pm |
|
|
Kahjoo:Don't bother with TCP/IP then. It's just more overhead. Just use the ethernet addresses and be done with it. Look at MAC.c for a start.
Artur: Your email didn't really come across too clear. Can you explain a little more carefully? _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
artur_saraiva
Joined: 10 Aug 2009 Posts: 2
|
|
Posted: Wed Sep 23, 2009 4:21 am |
|
|
Hi bkamen,
I'm using the ex12.c (comunication via UDP) from the tcp/ip stack and I want to know if this example works fine? I'm using pic 18f4520 + enc28j60 (ethernet controller) but i don't receive anything.
I'm doing some prinft's via rs232 to see where the program stops running and i've notice that it stops in StackInit() function.
I don't understand how ARP works in the code, is it to get the IP and the MAC address from the pc?
In UDPRxTask() it uses de UDPOpen function but it has NULL in the atributes, should it be remotenode (IP address and MAC address) or am I wrong? |
|
|
|