Main Page | Report this Page
Linux Forum Index  »  Linux Embedded  »  Can I run web server on DHCP client to control onboard...
Page 1 of 1    

Can I run web server on DHCP client to control onboard...

Author Message
VT...
Posted: Thu Sep 24, 2009 1:46 am
Guest
I have board with one Ethernet port, that port gets IP addr from local
router, I need to control some relays on that board using web
interface, can I run web server on DHCP client?. so that I can access
that web page of that board and control relays from anywhere within
that subnet?.

Thanks.
 
VT...
Posted: Thu Sep 24, 2009 6:45 am
Guest
On Sep 24, 10:44 am, Tauno Voipio <tauno.voi... at (no spam) INVALIDiki.fi> wrote:
Quote:
VT wrote:
I have board with one Ethernet port, that port gets IP addr from local
router, I need to control some relays on that board using web
interface, can I run web server on DHCP client?. so that I can access
that web page of that board and control relays from anywhere within
that subnet?.

Thanks.

Yes, you can, but ...

The problem is to know which address is allocated
by the DHCP server. The problem vanishes if you
can force the router to give always the same IP
address to your box (and its MAC address).

--

Tauno Voipio




Thanks Tauno, appreciated.

I have small board with ethernet port, by default it comesup with
192.168.168.168 IP addr, if I sell this port some customer, they have
192.168.0.1 subnet, they want to control some LED on this board using
web interface (web server running on thos board) by putting this board
on their network by assigning static IP addr using board web
interface.

If I sell to some customer they have 192.168.0.1 subnet, they will
connect their PC directly to baord and goto webpage of baord by
http://192.168.168.168, then they will enter static IP addr like
192.168.0.99 to the board and then they will pulg this baord on their
subnet, now they should access this board from anywhere from their
network by typing 192.168.0.99 and they will goto different page to
control LEDs ON and OFF, will it work?.

thanks.
 
Tauno Voipio...
Posted: Thu Sep 24, 2009 8:44 am
Guest
VT wrote:
Quote:
I have board with one Ethernet port, that port gets IP addr from local
router, I need to control some relays on that board using web
interface, can I run web server on DHCP client?. so that I can access
that web page of that board and control relays from anywhere within
that subnet?.

Thanks.


Yes, you can, but ...

The problem is to know which address is allocated
by the DHCP server. The problem vanishes if you
can force the router to give always the same IP
address to your box (and its MAC address).

--

Tauno Voipio
 
Tauno Voipio...
Posted: Thu Sep 24, 2009 12:22 pm
Guest
VT wrote:
Quote:
On Sep 24, 10:44 am, Tauno Voipio <tauno.voi... at (no spam) INVALIDiki.fi> wrote:
VT wrote:
I have board with one Ethernet port, that port gets IP addr from local
router, I need to control some relays on that board using web
interface, can I run web server on DHCP client?. so that I can access
that web page of that board and control relays from anywhere within
that subnet?.
Thanks.
Yes, you can, but ...

The problem is to know which address is allocated
by the DHCP server. The problem vanishes if you
can force the router to give always the same IP
address to your box (and its MAC address).

--

Tauno Voipio




Thanks Tauno, appreciated.

I have small board with ethernet port, by default it comesup with
192.168.168.168 IP addr, if I sell this port some customer, they have
192.168.0.1 subnet, they want to control some LED on this board using
web interface (web server running on thos board) by putting this board
on their network by assigning static IP addr using board web
interface.

If I sell to some customer they have 192.168.0.1 subnet, they will
connect their PC directly to baord and goto webpage of baord by
http://192.168.168.168, then they will enter static IP addr like
192.168.0.99 to the board and then they will pulg this baord on their
subnet, now they should access this board from anywhere from their
network by typing 192.168.0.99 and they will goto different page to
control LEDs ON and OFF, will it work?.



Using different IP addresses is not the way to go.

A web server usually accepts calls to separate programs
activated by a page request, like

http://www.mymachine.mydomain/cgi-bin/theapp?some-parameters

or

http://192.168.0.99/cgi-bin/theapp?some-parameters

If the board runs Linux, have a look at the boa webserver and
its instructions for GCI (Common Gateway Interface) binaries.
There is a similar mechanism in Apache, but as there is also
everyting else in Apache, it is much more difficult to separate
the CGI information from the other things.

If the board runs something else, code a corresponding
piece of code.

If you select a suitable way of handling the parameters,
you can fill the request from a suitable HTTP form.

--

Tauno Voipio
tauno voipio (at) iki fi
 
 
Page 1 of 1    
All times are GMT - 5 Hours
The time now is Thu Dec 10, 2009 3:11 pm