I have an embedded system running a web server that will usually be connected to an Ethernet network so users can simply enter the IP address of the device to access it.
However, I also need to make some of the same website functionality avaiable to users of the serial port on the device. It would be nice if I could reuse some of the logic I've developed for the web forms for this.
I am currently using .开发者_StackOverflowNET for development on my desktop and my embedded device is Linux based. Is it possible to host website content via a serial port or is there some other means by which I can pull this off?
Just a wild guess: back in the days when you connected by modem to the internet, there was a SLIP protocol: IP over Serial Line. Could you use that to establish an "internet connection" to your device?
There are a few options:
If the server is to be in windows, and you have windows 7 then windows xp mode (1) (2) will allow you to use SLIP so that you can provision over serial as you would to any IP address by mapping the serial port to an IP address.
Alternatively there is a sourceforge project called Contiki which has source code to allow the same if you fancy coding your own (the class is called uIp TCP/IP Stack).
Let me know if this is roughly what you're looking for and I can focus in on your specific requirements if you like:)
Cheers.
The first thing that comes to mind is some sort of LYNX like browser (I don't even know if it exists anymore). Maybe easier would be to just do a simple command line interface? It's linux, so you should just be able to spin up a telnet session pretty easily, right?
I believe you should be able to configure your Linux distribution to point your serial port at a terminal, and have that terminal log in with lynx
as the shell.
You might want to follow directions for a Linux serial console (tutorial here) and potentially create a user account with the shell set directly to run lynx. Instruct the login prompt (/etc/issue
in the tutorial) with the username and password.
Edit: If you're just looking for some sort of data entry from the console, you could just write a shell script or other program and point that user's shell to that application instead.
You could build a TCP client application on your linux device that will talk to your linux web server and redirect data to serial port, and build a TCP server application for your users that will talk to their serial port and redirect data to some TCP port (like 12345). Then all your users need to do is to set their browser to http://localhost:12345 and connect their PC to linux device via serial port cross over cable.
精彩评论