通过蜂窝网络Webify基于Linux的嵌入式控制器
需要以下项目的基本方向。
有一个基于Linux的控制器做一些工业控制的事情。 该盒子配备了蜂窝调制解调器,能够通过蜂窝运营商上网。使用蜂窝通信是因为控制器大多安装在没有电缆或短距离无线电的地方。阳光通常照射不到的地方:)
任务是允许互联网客户端直接连接到盒子以进行一些基本的控制/监视。问题是连接性——客户端如何发现盒子? - 我想让盒子充当服务器(如果可能的话)。假设移动运营商允许盒子上网并不一定意味着盒子将获得公共 IP,以便任何人都能够连接。据我了解,蜂窝网络充当在其内部工作的人员的网关,从外部联系该网络中的某人是不可能的。我错了吗?我们正在寻找通用解决方案,而不是围绕特定蜂窝提供商的解决方案。控制器安装在不同的国家,我们需要找到标准方式将其“网络化”。
盒子里的软件(和硬件)是我们的,我们基本上可以做任何事情,但我正在寻找正确的方法来做到这一点,以避免以后与不同的提供商发生意外。顺便说一句,解决方案不一定是技术性的,也许可以为每个盒子购买永久 IP,或者设置 VPN。我应该采用哪种方式?要问什么问题?
欢迎您的想法!
Need a basic direction in the following project.
There is a linux based controller doing some industrial control stuff.
The box is equipped with cellular modem and is capable to get online through cellular carrier. Cellular communication is used because controller is mostly installed where no cables or short range radio is available. Places where sun don't normally shine :)
The task is to allow internet clients to connect directly to the box for some basic control/monitoring stuff. The problem is connectivity - how clients will discover the box? - I'd like to have the box act as a server (if possible). Assuming that cellular carrier allows the box to get online doesn't necessarily mean that the box will get public IP so that anyone would be able to get connected. To my understanding the cellular network acts as a gateway from those who are working inside of it, and reaching someone in that network from outside isn't possible. Am I wrong? We are looking for a generic solution, not a solution around particular cellular provider. The controller is installed in different countries, we need to find the standard way to "webify" it.
The software (and hardware) in the box is ours, we can basically do anything, but I am looking for the right way to do it in order to avoid surprises with different providers later. BTW, the solution doesn't necessarily have to be technical, may be it's possible to buy a permanent IP's per box, or setup VPNs.. Which way should I dig to? What questions to ask?
Your ideas are welcome!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你对问题的总结基本上是正确的。我已经实现了几个可以做到这一点的系统,并且成功的可能性很大。
您解决此问题的方式取决于您期望单个用户与之交互的远程单元的数量。如果每个用户只处理一两个设备,那么在远程设备上实现 Web 服务器是可行的。如果每个用户处理许多设备,请考虑尽可能集中管理。我使用 Zenoss 进行数据记录和自定义控制服务器来实现这一点。
如果 Web 服务器位于远程设备上,您可以购买具有静态 IP 的 SIM 卡,或使用代理服务器。我建议设置代理服务器,除非设备数量非常少。
SIM 卡有三种选择:
如果您使用 openvpn,这里还有一些提示:
其他提示:
Your summary of the problem is basically correct. I've implemented several systems that do this, and the odds of success are good.
The way you tackle this will depend on the number of remote units you expect a single user to interact with. If each user will handle only one or two devices, it's plausible to implement the web server on the remote device. If each user handles many devices, consider centralising as much administration as possible. I've implemented this using Zenoss for data logging, and a custom control server.
If the web server sits on the remote device, you can either buy a SIM with a static IP, or use a proxy server. I recommend setting up a proxy server unless the number of devices is very small.
There are three options for SIMs:
If you use openvpn, here are some more tips:
Other tips:
这是“移动代理”出现在不同地方或使用不同提供商(在这种情况下只有一个提供商,但几乎相同)的典型问题。通常,它是使用某种归属代理来解决的 - 移动设备连接到的服务器,并提供有关如何到达它的详细信息,或者如果无法直接到达,则归属代理充当代理。
客户端总是首先联系本地代理,然后如果可能,他们会联系移动设备,如果不可能,他们会使用服务器作为代理。
在某些情况下,动态 dns 可能就足够了,而在其他情况下,您需要真正的代理/外观。
有一本好书:Andrew S. Tanenbaum & Maarten van Steen:“分布式系统:原则和范式”
This is a typical problem with "mobile agent" appearing in different places or using different providers (in this case just one provider, but it's almost the same). Usually it's solved using some kind of home agent - a server that the mobile connects to and gives details about how to reach it or if it can't be reached directly then the home agent acts as a proxy.
Client always contact the home agent first and then if it is possible they contact the mobile or if it's not they use the server as a proxy.
In some cases dynamic dns might be sufficient in other you need real proxy/ façade.
There's a good book: Andrew S. Tanenbaum & Maarten van Steen :"Distributed Systems: Principles and Paradigms"
您可以要求移动运营商为您提供一张可以访问互联网和固定 IP 地址的 SIM 卡。然后您可以托管任何您喜欢的服务器。不要忘记您正在处理有限的带宽。
You can ask cellular provider to give you a SIM card with internet access and fixed IP address. Then you can host any server you like. Do not forget that you are dealing with limited bandwidth.