[TITLE]
Windows 虚拟 IoT 安装与配置完整指南

[DESCRIPTION]
本文提供 Windows 虚拟 IoT 的完整安装、设备连接、防火墙配置、主页访问、重启及卸载步骤,并强调安全注意事项,帮助用户快速在 Windows 10/11 环境中部署 Odoo IoT。

[KEYWORDS]
Windows 虚拟 IoT, Odoo, 安装指南, 防火墙配置, 设备连接, 安全风险, 重启服务, 卸载步骤, 本地网络, HTTPS 证书

Windows 虚拟 IoT

要开始使用 Windows 虚拟 IoT:

  1. 确认电脑运行的是已更新的 Windows 系统(Windows 10 或 Windows 11),无论是笔记本、台式机还是服务器。
  2. 在 Windows 电脑上 安装 Windows 虚拟 IoT <iot/windows-iot/installation>
  3. 将你的 设备 连接到 Windows 虚拟 IoT。
  4. 配置 Windows 防火墙 <iot/windows-iot/firewall>
  5. 将 Windows 虚拟 IoT 连接到你的 Odoo 数据库

:::: note
::: title
注意
:::

  • MRP(物料需求计划) 设备(包括摄像头和测量工具)不兼容 Windows 虚拟 IoT。
  • 也可以在 macOS/Linux 电脑上创建 Windows 虚拟机,但该选项不受 Odoo 官方支持,且不提供故障排除帮助。
    ::::

::: seealso
iot_advanced/troubleshooting
:::

:::: important
::: title
重要
:::

切勿让 Windows 虚拟 IoT 暴露在公共互联网。IoT 系统旨在让你的数据库访问本地网络中的设备,公开访问会造成 安全风险
::::

在 Windows 电脑上安装 Windows 虚拟 IoT 的步骤:

  1. 访问 Odoo 的下载页面,向下滚动至 Virtual IOT 部分,点击 Download

  2. 打开下载的 .exe 文件,允许应用更改设备,选择语言后点击 OK

  3. 点击 Next,然后 I Agree 接受条款并继续。

  4. 确认电脑上有足够空间后点击 Next

  5. Destination folder 中输入 C:\odoo,点击 Install

    :::: warning
    ::: title
    警告
    :::

    请勿将 Odoo 的 Windows 虚拟 IoT 安装在任何 Windows 用户目录下,否则可能导致 HTTPS 证书生成 <iot/connect/https_certificate> 出错。
    ::::

  6. 设置 GPL Ghostscript:点击 Next,同意条款,点击 Install,随后 Finish

  7. 点击 NextFinish 完成设置。系统会自动在浏览器打开 IoT 系统主页,地址为 http://localhost:8069

  8. 重启 <iot/windows_iot/restart> Windows 虚拟 IoT 服务。

  9. 检查是否可以在浏览器访问 IoT 系统主页 <iot/windows-iot/homepage>:

    • 在运行 Windows 虚拟 IoT 的电脑上;

    • 在同一局域网的其他设备上,访问 http://xxx:8069xxx 为 IoT 系统的 IP 地址);

    • 在同一局域网的其他设备上,访问 https://xxx 以测试 HTTPS <iot/connect/https_certificate> 连接。

      :::: tip
      ::: title
      小贴士
      :::

      若无法从其他设备访问 IoT 系统主页,请创建 Windows 防火墙 <iot/windows-iot/firewall> 规则,允许端口 8069 的通信。
      ::::

大多数 设备 会通过 Windows Plug and Play (PnP) 自动连接到运行 Windows 虚拟 IoT 的电脑。但若 Windows 未自动识别设备,管理员可能需要手动安装相应驱动。

:::: tip
::: title
小贴士
:::

连接设备后,刷新 IoT 系统主页 <iot/windows-iot/homepage> 以确认设备已列出。如未出现,请从 IoT 系统主页 重新加载处理程序 reload the handlers <iot_updating_iot/handlers>
::::

防火墙有助于设备安全,但有时会阻断合法连接。如果 Windows 虚拟 IoT 在局域网(LAN)中不可访问,可能是防火墙拦截导致。为避免此问题,需要在操作系统或防火墙设置中为网络发现配置例外。

:::: note
::: title
注意
:::

若 Windows 电脑上已安装第三方防火墙软件,请参考该软件文档配置防火墙例外。
::::

在 Windows Defender 中创建规则并允许所需端口的通信,步骤如下:

  1. 在开始菜单搜索 firewall,选择 Windows Defender Firewall with Advanced Security 应用。

  2. 在窗口左侧选择 Inbound Rules

  3. 在右侧 Actions 下点击 New Rule

  4. 在弹出的 New Inbound Rule Wizard 中,选择 Port 类型,点击 Next

  5. Protocols and Ports 页面,确保选中 TCPSpecified local ports,在字段中输入 [8069, 80, 443],点击 Next

    :::: note
    ::: title
    注意
    :::

    根据 IoT 设备的不同,可能需要额外端口。例如,支付终端 worldline 需要端口 9050,ingenico 需要端口 9000。
    ::::

  6. Action 页面选择 Allow the connection,点击 Next

  7. Profile 页面取消勾选不适用于当前电脑的连接类型,点击 Next

  8. Name 页面填写规则名称(如 Odoo),可选填写描述,点击 Finish

::: seealso
Windows 防火墙规则文档
:::

要访问 Windows 虚拟 IoT 的主页:

  • 在运行该系统的电脑上打开浏览器,访问 http://localhost:8069
  • 或在同一局域网的其他电脑上访问 http://xxx:8069xxx 为 IoT 系统的 IP 地址)。

当 Windows 虚拟 IoT 已连接到 Odoo 数据库 后,可在 Odoo 中打开 IoT 应用,点击对应 IoT 卡片的 Homepage 进入主页。

:::: note
::: title
注意
:::

确保 Windows 防火墙已配置 <iot/windows-iot/firewall>,允许访问。
::::

手动重启 Windows IoT 服务器:在开始菜单搜索 services,打开 Services 应用,向下找到 odoo-server-xxx 服务,右键选择 StartRestart

要卸载 Windows 虚拟 IoT,访问此链接并在 Windows 电脑上 卸载 Odoo 程序,确认卸载并完成 Odoo Uninstall 对话框中的步骤。


[SUMMARY]

  • Windows 虚拟 IoT
    • 开始使用
      • 前置条件
      • 安装步骤
      • 重启服务
      • 访问主页
    • 设备连接
      • 自动识别
      • 手动驱动安装
    • 防火墙配置
      • 创建入站规则
      • 必要端口列表
      • 第三方防火墙注意事项
    • 安全注意事项
      • 不兼容的 MRP 设备
      • 禁止公开互联网访问
    • 卸载指南