RCM 4010

Hello ,

Forgive me if this is too much of a noob question.

I recently got t he RCM 4010. Now i have a dlink router that I use to normally use to connect to the internet .

I would want my RCM 4010 to be a Http reader .
By providing a URL , I would want to read the contents from the webserver and display it to stdio for the time being

  1. Can i connect the RCM to a router port ?
  2. Do i have to implement a DHCP client ?

Are there any examples that I can look into . Help is appreciated

Hi maverick447,

  1. Can i connect the RCM to a router port ?

Yes…

  1. Do i have to implement a DHCP client ?

No…

You can manually assign you IP address, subnet, gateway etc as follows…



#define TCPCONFIG 1
#define _PRIMARY_STATIC_IP  "192.168.0.50"
#define _PRIMARY_NETMASK    "255.255.255.0"
#define MY_GATEWAY          "192.168.0.1"
#define MY_NAMESERVER       "192.168.0.1"

In Dynamic C, try pressing CRTL-H when on the TCPCONFIG for more information… TCPCONFIG allows you to specify compile time settings, you can also specify these settings at runtime by setting TCPCONFIG to 0 (zero) and using ifconfig in your main(), for example…



ifconfig(IF_ETH0,
  IFS_DOWN,
  IFS_IPADDR, aton("10.10.6.100"),
  IFS_NETMASK, 0xFFFFFF00uL,
  IFS_ROUTER_SET, aton("10.10.6.1"),
  IFS_NAMESERVER_SET, aton("192.68.1.123"),
  IFS_NAMESERVER_ADD, aton("192.68.1.124"),
  IFS_UP,
  IFS_END);

When you asked about your router port, assuming you meant the outgoing or listening port for the socket, try looking up ‘tcp_open’, ‘tcp_listen’, ‘tcp_clearreserve’ and ‘tcp_reserveport’ (CTRL-H)… (Obvisously for external access you will need to setup port forwarding on your router)

Also, check out the sample TCP/IP code found under…

C:\DCRABBIT_10.21\Samples cpip

and

C:\DCRABBIT_10.21\Samples\RCM4000\TCPIP

Hope this helps to get you started…

Dave :wink:

Thanks for your detailed explanation !

Hi ,
Is the rabbit web code freely available ( coz when i tried to compile some of the examples it informed me that these libraries were not free)

Thanks

Thanks for your detailed explanation !

Not a problem…

Is the rabbit web code freely available ( coz when i tried to compile some of the examples it informed me that these libraries were not free)

Yeah should be, what version of Dynamic C are your running? (I am using 10.21)

There are some modules you have to buy seperately (e.g. AES / SSL support etc.), but not for what you are trying to do.

I have not tried the ‘Lite’ version and so cannot comment on that…

Dave