物联网系统与 Odoo 的连接¶
先決條件¶
要将物联网系统连接到 Odoo 数据库,必须满足以下前提条件:
物联网(IoT)应用程序必须 已安装。
物联网系统必须与网络连接。
The device connecting to Odoo must be on the same network as the IoT system.
備註
建议将物联网系统连接到 正式运行 实例,因为其他类型的环境可能会导致问题(如 HTTPS 证书生成)。
連接¶
To connect the IoT system to an Odoo database, open the IoT app and click Connect.
The browser then scans the network to which the computer is connected for available IoT systems. If an IoT system is detected, it is connected automatically. If multiple IoT systems are found, select the appropriate one in the popup that opens, then click Connect. If no IoT system is detected automatically, try connecting it to the database using a pairing code or a connection token.
小訣竅
The IoT system’s name is composed of either the IoT box or the Windows computer’s motherboard serial number, followed by its pairing code.
使用配对代码连接¶
備註
The pairing code is valid for up to 2 hours after the IoT system powers on. If the code is no longer valid, restart the IoT box or restart the Windows virtual IoT service to display another pairing code. Alternatively, connect the IoT system to the database using a connection token.
The pairing code is not displayed if the IoT system is already connected to a database (e.g., a test database). If necessary, disconnect the IoT system from the database.
Retrieve the IoT system’s pairing code:
Connect the IoT box to an external monitor or a USB printer. If the IoT box was already plugged prior to this, restart it.
External monitor: The pairing code will be displayed on the screen after (re)starting the IoT box.
USB-connected printer: The pairing code should be printed automatically.
小訣竅
如果物联网盒未连接外部显示器或打印机,请访问 物联网盒主页;代码显示在 配对代码 部分。
在安装了 Windows 虚拟物联网的计算机上,通过导航到 URL
http://localhost:8069,在 Web 浏览器中打开物联网系统的主页。然后,滚动到 配对代码 部分。在 Odoo 中,打开物联网应用程序并点击 连接。
In the Searching for an IoT Box popup that opens, click Use Pairing Code.
Enter the Pairing code and click Connect.
使用连接令牌连接¶
在 Odoo 中,打开物联网应用程序并点击 连接。
In the Searching for an IoT Box popup that opens, click Offline pairing.
In the Pair an IoT Box offline popup that opens, copy the Token.
访问 物联网盒子的 主页或 Windows 虚拟物联网的 主页。
In the Odoo database connected section, click Configure.
将令牌粘贴到 服务器令牌 字段,然后点击 连接。
備註
Once the IoT system is connected to a database:
If the Point of Sale app is installed, a popup appears to select the POS the IoT system should be associated with.
If using an IoT box, wait a few minutes for it to update before using the connected devices.
The IoT system automatically requests an HTTPS certificate and its homepage is updated to a new HTTPS URL ending with
.odoo-iot.comwhen it becomes available.
也參考
物联网系统表格¶
Once the IoT system is connected to the Odoo database, it is displayed as a card in the IoT app. Click the card to access the IoT system’s form, which allows to access the IoT box’s or Windows virtual IoT’s homepage and view the list of devices connected to the IoT system.
小訣竅
Enable the developer mode to access the IoT system’s Technical Information, such as its Domain Address, Image Version, and SSL Certificate End Date. By default, drivers are automatically updated every time the IoT system is restarted. To disable automatic updates, uncheck the Automatic drivers update option.
Disconnecting an IoT system from a database¶
To disconnect the IoT system from a database, follow these steps:
Open the IoT app and click the relevant IoT system’s card.
Click the (Actions) icon, and select Delete.
小訣竅
Alternatively:
访问 物联网盒子的 主页或 Windows 虚拟物联网的 主页。
Click Configure in the Odoo database connected section.
Click Disconnect in the popup that opens.
HTTPS certificate¶
HTTPS is the secure, encrypted version of HTTP. It uses TLS (previously SSL) certificates to authenticate the server and protect the data exchanged between a browser and a website. Some network devices, such as payment terminals, require a valid HTTPS certificate to communicate with the IoT system; without it, they cannot interact properly.
備註
在本文以至整個 Odoo 系統中,「 HTTPS 證書 」一詞是指可進行 HTTPS 連線的有效 SSL 證書。
When the IoT system is (re-)started and connected to a database, it automatically downloads the HTTPS certificate if the database meets the following eligibility criteria:
資料庫必須為 正式運行 的安裝個體。套用的資料庫個體不應是副本、複製本、模擬或開發環境的資料庫。
The Odoo subscription must be ongoing (In Progress status).
系統收到證書之後:
The IoT system’s homepage address is updated to a new HTTPS URL ending with
.odoo-iot.com.The HTTPS certificate banner displays the certificate’s validity period. To view this information, click the (cogs) button at the top-right of the IoT system’s homepage.