Hello Guys,
I am building a remotely controlled car using the rabbit microcontroller RCM 3710. Basically I want to communicate with the rabbit through a router.
Now I configured the rabbit as an http server to listen for http traffic from a web browser "client" through a socket. I want to know how this can be done.
I think that i should connect the rabbit using ethernet to the router and to communicate using (through wifi) http but I don't know how to program this what I did is the following:
#class auto
#define _PRIMARY_STATIC_IP "10.10.6.100"
#define _PRIMARY_NETMASK "255.255.255.0"
#define TCPCONFIG 1 // Default configuration of tcpip
#define SWFPORT 3333
#define SOCK_BUF_SIZE 16384
#define MAX_SOCKETS 8
#define TIMEZONE +3
#use "dcrtcp.lib" // bring in tcp/ip libraries
#use "http.lib" // Bring http library
#use "hobbyist.lib" // Check!!
#ximport "Other TCP_IP Samples/pages/static.html" index_html
#ximport "Other TCP_IP Samples/pages/rabbit1.gif" rabbit1_gif
SSPEC_MIMETABLE_START
SSPEC_MIME(".html", "text/html"),
SSPEC_MIME(".gif", "image/gif")
SSPEC_MIMETABLE_END
SSPEC_RESOURCETABLE_START
SSPEC_RESOURCE_XMEMFILE("/index.html", index_html),
SSPEC_RESOURCE_XMEMFILE("/rabbit1.gif", rabbit1_gif)
SSPEC_RESOURCETABLE_END
#define SW_ON 0
#define SW_OFF 1
void main()
{
int i;
float spd;
int dir1, dir2, MotorUpdate;
HBmotorInit(); //move it
spd = 0.0;
dir1 = dir2 = 1;
MotorUpdate = 1;
sock_init(); // initialize the stack
http_init();
tcp_reserveport(3333);
for (;;) // create an endless loop while(1)
{
http_handler();
}
}