【问题标题】:Send command to raspberry pi from hosted website从托管网站向树莓派发送命令
【发布时间】:2017-12-01 02:41:17
【问题描述】:

我在本教程中使用 nginx 在我的树莓派上托管了一个网站: https://andrewmichaelsmith.com/2013/08/raspberry-pi-wi-fi-honeypot/

这是一个强制门户,该网站是一个测验。完成测验后,我希望提交按钮从连接到使用本教程设置的树莓派的热敏收据打印机打印“处方”: https://learn.adafruit.com/networked-thermal-printer-using-cups-and-raspberry-pi?view=all

我可以运行教程中的命令:“lpr location/image_file.png”从树莓派的 CLI 打印。那么问题来了,如何链接提交按钮以将此命令发送到 RPi?

感谢您的任何建议!

【问题讨论】:

    标签: nginx raspberry-pi remote-access thermal-printer


    【解决方案1】:

    对于任何想要回答类似问题的人,我自己想通了:

    答案是在你的 nginx 服务器块中启用 php 转发(只需快速搜索一下它是如何与 FastCGI 一起工作的)并拥有一个发送的 php 文件:

    shell_exec("你的命令")

    :)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多