通过串口查看网站

发布于 2024-10-15 23:13:53 字数 217 浏览 4 评论 0原文

我有一个运行 Web 服务器的嵌入式系统,该服务器通常连接到以太网,因此用户只需输入设备的 IP 地址即可访问它。

但是,我还需要为设备上串行端口的用户提供一些相同的网站功能。如果我可以重用我为此 Web 表单开发的一些逻辑,那就太好了。

我目前在桌面上使用 .NET 进行开发,而我的嵌入式设备是基于 Linux 的。是否可以通过串行端口托管网站内容,或者是否有其他方法可以实现这一点?

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 .NET 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

緦唸λ蓇 2024-10-22 23:13:53

只是一个疯狂的猜测:当您通过调制解调器连接到互联网的时候,有一个 SLIP 协议:IP over Serial Line。您可以使用它来与您的设备建立“互联网连接”吗?

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?

一生独一 2024-10-22 23:13:53

有几个选项:

如果服务器要在 Windows 中,并且您有 Windows 7,则使用 Windows XP 模式 (1) (2) 将允许您使用 SLIP,以便您可以通过将串行端口映射到 IP 地址来像任何 IP 地址一样通过串行进行配置。

或者,有一个名为 Contiki 的 sourceforge 项目,它的源代码允许相同的 if您喜欢编写自己的代码(该类名为 uIp TCP/IP Stack)。

让我知道这是否是您想要的,如果您愿意,我可以专注于您的具体要求:)

干杯。

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.

人心善变 2024-10-22 23:13:53

我首先想到的是某种类似 LYNX 的浏览器(我什至不知道它是否存在)。也许更简单的是只做一个简单的命令行界面?它是 Linux,所以你应该能够很容易地启动 telnet 会话,对吧?

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?

枯叶蝶 2024-10-22 23:13:53

我相信您应该能够配置您的 Linux 发行版以将串行端口指向终端,并让该终端使用 lynx 作为外壳。

您可能需要遵循 Linux 串行控制台的说明(此处的教程)并可能创建一个用户帐户,并将 shell 设置为直接运行 lynx。使用用户名和密码指示登录提示(教程中的 /etc/issue)。

编辑:如果您只是从控制台查找某种数据条目,您可以编写一个 shell 脚本或其他程序,然后将该用户的 shell 指向该应用程序。

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.

您可以在 Linux 设备上构建一个 TCP 客户端应用程序,它将与您的 Linux Web 服务器通信并将数据重定向到串行端口,并为您的用户构建一个 TCP 服务器应用程序,它将与他们的串行端口通信并将数据重定向到某个 TCP 端口(如 12345)。然后,所有用户需要做的就是将浏览器设置为 http://localhost:12345 并将其 PC 连接到 Linux 设备通过串行端口交叉电缆。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文