Do you have tcp_config.lib for this processor? In my copy of tcp_config.lib (for the Rabbit 4000) the IP address and other paramters have names slightly different from those in your code snippet:
Thanks for the quick reply.
I guess I could do that - but I hate having to edit the default libraries, that’s something I didn’t think would be good. What happens if I have want to program several devices with the same code but different IP addresses - I’d need to edit the LIB everytime…
Found that the correct way to use a specific IP address is to use the following: #define MY_IP_ADDRESS “169.254.39.200” #define MY_NETMASK “255.255.255.0” #define MY_GATEWAY “169.254.39.2” #define PORT 4001 #define TCPCONFIG 0 #define USE_ETHERNET 1 #use dcrtcp.lib
The imporant line is the #define TCPCONFIG 0
You can also use #define TCPCONFIG 100 and put the macros in a user-suppled custom_config.lib
[QUOTE=KennyM;1001]Thanks for the quick reply.
I guess I could do that - but I hate having to edit the default libraries, that’s something I didn’t think would be good. What happens if I have want to program several devices with the same code but different IP addresses - I’d need to edit the LIB everytime…[/quote]
I just edited tcp_config.lib to get a quick start and verify connectivity. Ultimately I also used TCPCONFIG 0 and used the default tcp_config.lib.
Hi, there is an even better way in which you can set and change the IP subnet and gateway during runtime. This way, you can have functions that can change these settings in a “live” environment, very useful to me because alot of my installations are about 2 - 3 km underground in the gold mines (south africa). If you would like a code sample then shout.
Now I also have a question that I guess may be useful to many people. I am not a networking person, so I don’t know all the terms, but I want to use my Rabbit on DHCP, and give it a name (as your PC would have a name on the network). Then I would want to access my Rabbit over the network using its name rather than IP address. Does anyone know if that’s possible?
John,
I would like to look at the technique you used for setting the netmask and gateway at run-time.
I am working on code to set several network config settings at run-time using ifconfig(). I’m using another board to send a serial message to the Rabbit containing all the network settings. The Rabbit parses that and then calls ifconfig().
[QUOTE=Johnno;1039]Hi, there is an even better way in which you can set and change the IP subnet and gateway during runtime. This way, you can have functions that can change these settings in a “live” environment, … If you would like a code sample then shout.
[/quote]
That’s a problem I’m currently trying to figure out. If you have a code sample you can post to the forums, that would be great.