Skip to main content

将命令代理到 JVC 投影仪的简单 Python 服务器。

项目描述

充当客户端和 JVC 投影仪(例如投影仪)之间代理的小型服务器。除了正常的 TCP 3 次握手之外,JVC 投影仪坚持额外的 3 次握手(PJ_OK、PJREQ、PJACK)。这意味着某些家庭自动化设备可能难以与投影仪通信,因为它们缺乏实现额外握手的协议知识。

有关有效管理 JVC 投影仪的实际代码,请参阅JVC 投影仪控制代码

使用服务器

在通常的 JVC 控制端口号 (20554) 上启动服务器、localhost 和“my-projector”之间的代理。

$ jvc_proxy -l DEBUG -r 2 -t 1 my-projector

将服务器绑定到机器外部可访问的 IP 地址/主机名(即不是本地主机)。将日志记录级别设置为 DEBUG(将记录代理的实际字节数)。将重试两次失败的投影机连接。网络操作允许 1 秒超时。

$ jvc_proxy --proxy_host my-pc -l DEBUG -r 2 -t 1 my-projector

可用参数:

usage: jvc_proxy.py [-h] [--jvc_port JVC_PORT] [--proxy_host PROXY_HOST]
                    [--proxy_port PROXY_PORT] [-t TIMEOUT] [-v VERBOSE]
                    [-l {ERROR,WARNING,INFO,DEBUG}] [-r RETRIES]
                    [-w RETRY_WAIT]
                    jvc_host

positional arguments:
  jvc_host              JVC host to proxy to. Default: 20554.

optional arguments:
  -h, --help            show this help message and exit
  --jvc_port JVC_PORT   JVC port number to connect to.
  --proxy_host PROXY_HOST
                        Proxy server host/IP to bind to. Default: localhost.
  --proxy_port PROXY_PORT
                        Proxy server port number to listen on. Default: 20554.
  -t TIMEOUT, --timeout TIMEOUT
                        Timeout for network operations (seconds). Default: 2.
  -v VERBOSE, --verbose VERBOSE
                        Whether or not to output proxied data. Default: False.
  -l {ERROR,WARNING,INFO,DEBUG}, --loglevel {ERROR,WARNING,INFO,DEBUG}
                        Logging level. Default: ERROR.
  -r RETRIES, --retries RETRIES
                        Number of retries to allow in connection to the JVC
                        host. Default: 0
  -w RETRY_WAIT, --retry_wait RETRY_WAIT
                        Seconds to wait between connection retries. Default:
                        5.

默认启动服务器

使用包含的 jvc_proxy.service 将服务器作为 systemd 单元启动。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

jvc_proxy-0.0.1.tar.gz (8.6 kB 查看哈希

已上传 source

内置分布

jvc_proxy-0.0.1-py2.py3-none-any.whl (7.0 kB 查看哈希

已上传 py2 py3