# RCM 4010

**URL:** <https://forums.digi.com/t/rcm-4010/9260>\
**Category:** Rabbit\
**Created:** [February 20, 2008, 9:30pm UTC](https://forums.digi.com/t/rcm-4010/9260 "2008-02-20T21:30:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![maverick447](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@maverick447](https://forums.digi.com/u/maverick447)\
**Post date:** [February 20, 2008, 9:30pm UTC](https://forums.digi.com/t/rcm-4010/9260/1 "2008-02-20T21:30:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sure24](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@sure24](https://forums.digi.com/u/sure24)\
**Post date:** [February 20, 2008, 10:58pm UTC](https://forums.digi.com/t/rcm-4010/9260/2 "2008-02-20T22:58:38Z")

</div>

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…

```auto

#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…

```auto

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 😉

---

<div class="post-metadata">

**Author:** ![maverick447](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@maverick447](https://forums.digi.com/u/maverick447)\
**Post date:** [February 21, 2008, 12:12am UTC](https://forums.digi.com/t/rcm-4010/9260/3 "2008-02-21T00:12:36Z")

</div>

Thanks for your detailed explanation !

---

<div class="post-metadata">

**Author:** ![maverick447](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@maverick447](https://forums.digi.com/u/maverick447)\
**Post date:** [February 21, 2008, 12:19am UTC](https://forums.digi.com/t/rcm-4010/9260/4 "2008-02-21T00:19:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sure24](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@sure24](https://forums.digi.com/u/sure24)\
**Post date:** [February 21, 2008, 11:59am UTC](https://forums.digi.com/t/rcm-4010/9260/5 "2008-02-21T11:59:26Z")

</div>

> 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
