简体   繁体   English

没有公共 URL 的 RaspberryPi 访问可能吗?

[英]RaspberryPi access without public URL possible?

[Never worked with a RPi before, absolute noob on that field] [以前从未使用过 RPi,在那个领域绝对是菜鸟]

I want to make a desktop/mobile app to access a program on a RaspberryPi.我想制作一个桌面/移动应用程序来访问 RaspberryPi 上的程序。 The only task of the app is to send a command and display the received response on an UI.该应用程序的唯一任务是发送命令并在 UI 上显示收到的响应。 It's meant only for private use, but it should also work outside my local.network.它仅供私人使用,但它也应该在我的 local.network 之外工作。 So as long as I have mobile inte.net on the phone it should be possible to access the program with the app .因此,只要我的手机上有 mobile inte.net,就应该可以通过该应用程序访问该程序。 Can I achieve this without using any kind of public website?我可以在不使用任何类型的公共网站的情况下实现这一目标吗? I saw some tutorials that used Flask and other frameworks to do sth similar, but I want the access to be restricted to the app .我看到一些教程使用 Flask 和其他框架来做类似的事情,但我希望访问权限仅限于应用程序 There shouldn't be any URL I could type in my browser, that gives me access to a login page or sth like that.不应该有任何 URL 我可以在我的浏览器中输入,这让我可以访问登录页面或类似的东西。 If you know the specific term for what I am describing here or even better an article/tutorial that features it, that would be very helpful.如果您知道我在这里描述的内容的特定术语,或者更好的文章/教程以它为特色,那将非常有帮助。

You need two things for that:为此你需要两件事:

  • Make your Raspi visible to the outside world.让你的 Raspi 对外界可见。 That can typically be done by configuring port forwarding in your router.这通常可以通过在路由器中配置端口转发来完成。 Note that this might impose a certain security risk.请注意,这可能会带来一定的安全风险。

  • Make sure you have a global DNS name for your inte.net access.确保您的 inte.net 访问具有全局名称 DNS。 Since the IP of your router may change frequently (depending on your ISP), you need a URL or rather, a DNS entry.由于您路由器的 IP 可能经常更改(取决于您的 ISP),因此您需要一个 URL 或者更确切地说,一个 DNS 条目。 There exist public DNS services that can assign a DNS entry to a dynamic IP (typically for a fee).存在公共 DNS 服务,可以将 DNS 条目分配给动态 IP(通常是收费的)。 Many routers support a protocol to configure such services.许多路由器支持配置此类服务的协议。

After that, you can program an app that uses the given DNS entry to talk to your Pi.之后,您可以编写一个应用程序,使用给定的 DNS 条目与您的 Pi 对话。

So no, without a public URL, this is not possible, at least not over the long term.所以不,如果没有公共 URL,这是不可能的,至少从长远来看是不可能的。 You might be able to go with the public IP of your router, but then your app may fail from one day to the next.您可能可以使用路由器的公共 IP 访问 go,但是您的应用程序可能有一天会失败。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 是否可以在不使用预签名URL的情况下访问私有s3存储桶对象? (boto3,python) - Is it possible to access a private s3 bucket objects without using a pre-signed URL? (boto3, python) 无需身份验证即可访问公共Twitter数据的构建脚本 - Building script to access public Twitter data, without authentication 瓶子-是否可以检索不带参数的URL? - Bottle - Is it possible to retrieve URL without parameters? 是否可以编写 Python (iOS) 程序来允许/执行对 RaspberryPi 的命令? - Is it possible to write a Python (iOS) program to allow/execute commands to a RaspberryPi? 是否可以在没有 sudo 的情况下使用 python 访问调试? - Is it possible to access debugs using python without sudo? Django公共URL重写 - Django Public URL Rewrite 是否可以在没有请求上下文的情况下获得 flask 应用程序 url? - Is it possible to get flask app url without request context? 无服务器公共访问 - Serverless public access 在没有 AWS 访问密钥的情况下从 S3 亚马逊公共存储桶下载数据 - Downloading data from S3 amazon public bucket without having AWS access key 是否可以在不访问内置函数的情况下将 ASCII integer 转换为字符? - Is it possible to convert an ASCII integer to a character without access to builtins?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM