宜兴通达竭诚为您服务。

通达科技 - 宜兴电脑维护及IT服务外包服务商

List Connected Devices
  • 上传者: Administrator
  • 上传时间:2025年05月09日 08时45分11秒
摘要:
List Connected Devices** After successfully connecting the devices and the IoT box with Odoo, we can see the connected devices from the IoT App > Devi ......
正文 相关文章 请喝咖啡

    List Connected Devices

    After successfully connecting the devices and the IoT box with Odoo, we can see the connected devices from the IoT App > Devices. By default, it will display the list of devices grouped by the IoT Box. We can also see the connection status, whether it is connected or not, and the connection type, like over WiFi, USB, or Bluetooth.

    odoo Development

    We can see more details about the device by clicking any of the tiles.

    odoo Development

    Input from device

    The IoT Devices that are popularly used is QR code scanners, cameras, etc. Odoo IoT Box may not support all the devices out there, so we may have to provide support for the device to communicate with the IoT box. You can find the list of supported devices on this page https://www.odoo.com/page/iot-hardware. If your desired device is not on the list, we have to develop the driver for it.

    Let’s say we are trying to connect a camera to the IoT box to capture the image of incoming products in our shop. After connecting the device to the IoT Box and loading the drivers, the camera will be ready. Now we have to fetch the image from the camera. For that, we can add a new field on the stock.picking model.

    class StockPicking(models.Model):
    		_inherit = 'stock.picking'
    		device_id = fields.Many2one('iot.device', string='IoT
    Device',domain="[('type', '=', 'camera')]")
    ip_device = fields.Char(related="device_id.iot_id.ip")
    device_identifier = fields.Char(related='device_id.identifier')
    		input_picture = fields.Binary()

    There is a quality_iot module which is part of the Enterprise edition, and it contains a widget that allows us to request an image from the camera through an IoT box. We can use this widget to capture the image. So we can add this module to our depends list. We can also create our own widget if we want.

    ...
    	depends : [ 'quality_iot'],
    ...'

    Now we can use the widget in the form view of the receipt transfer,

    <group>
        <field name="device_id" required="1"/>
        <field name="ip_device" invisible="1"/>
        <field name="device_identifier" invisible="1"/>
        <field name="input_picture" widget="iot_picture" options="{'ip_field': 'ip', 'identifier': 'device_identifier'}"/>
    </group>

    The user should select the Camera from the list of devices, and the IP and identifier of the device are necessary for the widget to communicate with the camera.

    Install and update the module, and you will get a button to capture the image in the Receipt transfer form view. Clicking the button will request the IoT box to capture an image and will return the image data as a response. It will be saved in the binary field.

    本文章从网上收集,如有侵权请联系tderp@tderp.com删除
  • 微信扫一扫,一分也是爱:
  • 微信

服务原则及地区范围

宜兴通达网络科技有限公司,地处中国宜兴环科园内,是一家高新技术企业。公司在企业网络维护和企业信息化建设与咨询方面,有10多年经验。

我公司愿与客户一道,力求彻底解决客户问题!
我们不是在给企业提供“头痛医头、脚痛医脚”的暂时解决方案,而是在部署根本性安全与稳定服务!!
我们愿携手客户,建立企业IT规划;杜绝随意安装系统、软件等操作;力求共同维护有序、安全、稳定的网络办公环境!!!
IT服务,服务是根本,客户是上帝;我们提供快速响应、快速上门、快速排查,提供优质高效的服务!!!!

通达科技提供全国范围内的服务,服务形式包括远程协助、电话咨询、电子邮件咨询、传真咨询、问答平台的问题解决等。

宜兴地区提供上门服务:

  • 市区服务:宜城街道、城北街道(屺亭街道)、新街街道、新庄街道、环科园、渚桥开发区
  • 市郊服务:张渚镇、西渚镇、太华镇、徐舍镇、官林镇、杨巷镇、新建镇、和桥镇、高塍镇、万石镇、周铁镇、芳桥镇、丁蜀镇、湖父镇。
  • 联系电话:189-21-343434
  • 在线沟通: