Интерфейс REST API ------------------ Connection SETUP ================ **VISION-AI module USB-RNDIS configuration** The new generation of intelligent VISION-AI module is different from the previous USB-HID mode, and uses the USB-RNDIS mode to communicate with the host computer. In addition, the HTTP method is used to make the communication content richer and more diverse, decoupled from the specific implementation language, and more convenient to integrate. **Implementation principle** USB-RNDIS mode means that when the VISION-AI module is inserted into the weighing terminal, it will be recognized as a USB network card (in most cases, no drive is required). After the configuration is correct, the weighing terminal and the VISION-AI module form a local area network, so that the two can use the network protocol to access each other. This device uses the HTTP protocol for interaction. **Configure on Linux** **IP configuration** VISION-AI module: IP: 172.22.0.6 Mask: 255.255.255.0 (already configured, no need to configure) Linux-pos end: IP: 172.22.0.7 Mask: 255.255.255.0 After the VISION-AI module is inserted into the linux terminal, after the module is turned on normally (usually within 30 seconds), it will generally be correctly recognized as a USB network card by Linux. Since the VISION-AI module is configured with DHCP service, some systems will automatically configure the IP and subnet mask for the network card, as shown above. Generally, the network card is usb0, and if the ip has been configured through \`ifconfig usb0\` command, skip this section. On some Linux, the configuration of the network card cannot be loaded automatically. At this time, manual configuration is required. First, confirm whether the network card is correctly recognized by the system. Use the \`ifconfig -a\` command to check whether there is a device with a name similar to usb0. If so, configure the ip and enable the network card through \`ifconfig usb0 172.22.0.7 netmask 255.255.255.0 up`, if the configuration is successful, you can use \`ping 172.22.0.6\` to confirm whether the connection with the module is normal. If the usb network card is not found through the \`ifconfig -a\` command, first use the \`lsusb \| grep 2207:372d\` command to confirm whether the usb is enumerated successfully. 2207:372d is the VID and PID of this module in USB-RNDIS mode. If the enumeration is unsuccessful, please confirm the connection cable and firmware version of the module. If the enumeration is successful and there is no such network card node, please contact us. **Communication** The software and VISION-AI modules on the scale-end Linux use \`http://172.22.0.6:80/{api}\` to access. For details, see the relevant interface documentation. **Notice** \* Please ensure that the above IP is configured and the VISION-AI module can be pinged normally on the Linux side. If the IP is incorrectly configured, the communication will fail. \* The IP of the weighing terminal must be \`172.22.0.7`, because this IP is the gateway to identify the module. Please do not set other IP. \* Please make sure that there are no other devices on the 172.22.0.0/24 network segment. \* After the IP configuration is restarted on the scale end Linux, or after the VISION-AI module is restarted, the corresponding configuration may be lost and may need to be reconfigured. When the firmware of the VISION-AI module is upgraded, it needs to be restarted. In other cases, the VISION-AI module generally does not restart. \* Network sharing and proxy configurations may be lost after the end of Linux restarts, and may need to be reconfigured. \* The VID and PID of the old version of the USB-HID device are 2207:3729, and the VID and PID of the new version of the USB-RNDIS device are 2207:372d. If you need to be compatible with both new and old devices. Please make the distinction. Device management ----------------- Query recognition module info ============================= This interface is used to query the current recognition modules SDK version, firmware version, algorithm model and synchronization package version, SN serial number, customer number, customer name information,etc. **Interface URL** http://172.22.0.6/api/get_device_info **Query way** POST **Content-Type** none **The exsample of a successful response** .. code:: { "code": 0, "data": { "clientID": "11095", "clientName": "Fruit Store Name", "engine": "9.5.0", "firmware": "9.9.4.2", "learnMode": 1, "masterIP": "", "masterSN": "", "sdk": "9.1.1", "sn": "12345678", "soldOutLimit": 3, "sync": "9.5.17.0", "syncMode": "normal" } } +---------------+-----------+---------+-----------------------------------+ |Parameter |Example |Parameter|Parameter | | | | | | |name |value |type |description | +===============+===========+=========+===================================+ |code |0 |Integer |Request return value: | | | | | | | | | |0 means success; | | | | | | | | | |Not 0 means err. | | | | | | | | | |See error code table | +---------------+-----------+---------+-----------------------------------+ |data | --- |Object | Returns the data segment, | | | | | | | | | | or null if none. | +---------------+-----------+---------+-----------------------------------+ |data.clientID |11095 |String |Customer store number, | | | | | | | | | |factory default 0000 | +---------------+-----------+---------+-----------------------------------+ |data.clientName|Lan |String |Customer store name, | | | | | | | | | |factory is not activated | +---------------+-----------+---------+-----------------------------------+ |data.engine |9.5.0 |String |Recognize engine version number | +---------------+-----------+---------+-----------------------------------+ |data.firmware |9.9.4.2 |String |Firmware version no. | +---------------+-----------+---------+-----------------------------------+ |data.learnMode |1 |Integer |Learning mode. There are two: | | | | | | | | | |1 recognition while learning; | | | | | | | | | |0 only recognition. Default 1 | +---------------+-----------+---------+-----------------------------------+ |data.masterIP | --- |String |Main scales ip, only when | | | | | | | | | |sync_mode = "slave", the field | | | | | | | | | |will have the valid data, | | | | | | | | | |otherwise it is null character. | +---------------+-----------+---------+-----------------------------------+ |data.masterSN | --- | |Main scales sn, this field | | | | | | | | | |is valid only when sync_mode = | | | | | | | | | |"slave", there is valid data, | | | | | | | | | |otherwise it is a null character. | +---------------+-----------+---------+-----------------------------------+ |data.sdk |9.1.1 |String |Sdk version | +---------------+-----------+---------+-----------------------------------+ |data.sn |12345678 |String |Recognition serial number | +---------------+-----------+---------+-----------------------------------+ |data |3 |Integer |Automatic removal threshold. | |.soldOutLimit | | | | +---------------+-----------+---------+-----------------------------------+ |data.sync |9.5.17.0 |String |Synchronization package | | | | | | | | | |version number. | +---------------+-----------+---------+-----------------------------------+ |data.syncMode |Normal |String |There are three mode of | | | | | | | | | |synchronization: | | | | | | | | | |"normal", "master", "slave". | | | | | | | | | |Default is "normal" | +---------------+-----------+---------+-----------------------------------+ Factory reset ============= This interface restores the VISION-AI module to factory settings, cancels the association between the store and the device, and clears all caches, identified products, and registered products. **Interface URL** http://172.22.0.6/api/reset_device **Query way** POST **Content-Type** none Restart recognition module ========================== Call this interface to restart the recognition module **Interface URL** http://172.22.0.6/api/reboot **Query way** POST **Content-Type** none **Example of a successful response** .. code:: { "code": 0, "data": null } +---------+-------+---------+--------------------------------------------+ |Parameter|Example|Parameter|Parameter | | | | | | |name |value |type |description | +=========+=======+=========+============================================+ | | --- | | | Request return value: 0 means | | code | | Number | | success, no 0 means error | | | | | | see detail in error code list | +---------+-------+---------+--------------------------------------------+ | | --- | | Returns the data segment, or null if | | data | | Object | none. | +---------+-------+---------+--------------------------------------------+ Set the recognition area ======================== The recognition module needs to calibrate the recognition area to improve the recognition accuracy Before calibration, you need to call the get_image interface to display a picture, and returned picture with resolution 1280x720, and then manually frame the coordinates of the recognition area on the current picture, and pass the coordinates into the set_calib interface When the location of the device changes, the recognition area needs to be reset. **Interface URL** http://172.22.0.6/api/set_calib **Query way** POST **Content-Type** json **Request Body parameter** .. code:: { "height": 482, "left": 444, "top": 39, "width": 348 } **Example of a successful response** .. code:: { "code": 0, "data": null } +---------+-------+---------+--------------------------------------------+ |Parameter|Example|Parameter|Parameter | | | | | | |name |value |type |description | +=========+=======+=========+============================================+ | | --- | | | Request return value: 0 means | | code | | Number | | success, no 0 means error | | | | | | see detail in error code list | +---------+-------+---------+--------------------------------------------+ | | --- | | Returns the data segment, or null if | | data | | Object | none. | +---------+-------+---------+--------------------------------------------+ Query recognition area ====================== Get the coordinate parameters of the current recognition area, the coordinates are based on the 1280x720 resolution picture. **Interface URL** http://172.22.0.6/api/get_calib **Query way** POST **Content-Type** none **Example of a successful response** +-----------+-------+---------+--------------------------------------------+ |Parameter |Example|Parameter|Parameter | | | | | | |name |value |type |description | +===========+=======+=========+============================================+ | | --- | | | Request return value: 0 means | | code | | Number | | success, no 0 means error | | | | | | see detail in error code list | +-----------+-------+---------+--------------------------------------------+ | | --- | | Returns the data segment, or null if | | data | | Object | none. | +-----------+-------+---------+--------------------------------------------+ |data.height| | | Height of the recognition area | | | 482 | Number | | +-----------+-------+---------+--------------------------------------------+ |data.left | | | The abscissa of up left recognition | | | 444 | Number | area | +-----------+-------+---------+--------------------------------------------+ | | | | The ordinate of the left recognition | |data.top | 39 | Number | area | +-----------+-------+---------+--------------------------------------------+ |data.width | | | Width of the recognition area | | | 348 | Number | | +-----------+-------+---------+--------------------------------------------+ Query learning mode =================== Query the status of the current learning mode. **Interface URL** http://172.22.0.6/api/get_learnmode **Query way** POST **Content-Type** none **Example of a successful response** .. code:: { "code": 0, "data": { "mode": 0 } } +---------+-------+---------+--------------------------------------------+ |Parameter|Example|Parameter|Parameter | | | | | | |name |value |type |description | +=========+=======+=========+============================================+ | code | --- | | | Request return value: 0 means | | | | Number | | success, no 0 means error | | | | | | see detail in error code list | +---------+-------+---------+--------------------------------------------+ | data | --- | | Returns the data segment, or null if | | | | Object | none. | +---------+-------+---------+--------------------------------------------+ | | --- | | Learning mode: | | | | | | |data.mode| | Number | 0: learning mode off | | | | | | | | | | 1: learning mode on | +---------+-------+---------+--------------------------------------------+ Set learning mode ================= The setting switch of the learning mode enables the recognition module to freely turn off and turn on the learning function. When it is turned on, returns the clicked result, interface has a learning function. **Interface URL** http://172.22.0.6/api/set_learnmode **Query way** POST **Content-Type** json **Request Body parameter** .. code:: { "mode": 0 } +----------+-------+---------+----------+--------------------------------------+ |Parameter |Example|Parameter|Is it |Parameter | | | | | | | |name |value |type |necessary?|description | +==========+=======+=========+==========+======================================+ | | --- | | | Learning mode: | | | | | | | | mode | | Number | Yes | 0: learning mode off | | | | | | | | | | | | 1: learning mode on | +----------+-------+---------+----------+--------------------------------------+ **Example of a successful response** .. code:: { "code": 0, "data": null } +---------+-------+---------+--------------------------------------------+ |Parameter|Example|Parameter|Parameter | | | | | | |name |value |type |description | +=========+=======+=========+============================================+ | | --- | | | Request return value: 0 means | | code | | Number | | success, no 0 means error | | | | | | see detail in error code list | +---------+-------+---------+--------------------------------------------+ | | --- | | Returns the data segment, or null if | | data | | Object | none. | +---------+-------+---------+--------------------------------------------+ Category management ------------------- Query the recognizable list =========================== Get the list of recognizable product IDs. **Interface URL** http://172.22.0.6/api/get_item_list **Query way** POST **Content-Type** none **Example of a successful response** +---------+-------+---------+--------------------------------------------+ |Parameter|Example|Parameter|Parameter | | | | | | |name |value |type |description | +=========+=======+=========+============================================+ | code | --- | | | Request return value: 0 means | | | | Number | | success, no 0 means error | | | | | | see detail in error code list | +---------+-------+---------+--------------------------------------------+ | data | --- | | Returns the data segment, or null if | | | | String | none. | +---------+-------+---------+--------------------------------------------+ | | | | Recognizable category id | | data.id | 001 | String | | +---------+-------+---------+--------------------------------------------+ | | | | The name corresponding to the | |data.name|Test1 | Object | identifiable category id. | +---------+-------+---------+--------------------------------------------+ Register pictures to cache ========================== Register the template image to the cache area, and the template in the registered cache area needs to be submitted to take effect. **Interface URL** http://172.22.0.6/api/register_item **Query way** POST **Content-Type** json **Request Body parameter** .. code:: { "id": "001", "name": "Test" } +-------------+----------+------------+-------------+--------------------------------------+ |Parameter |Example |Parameter |Is it |Parameter | | | | | | | |name |value |type |necessary? |description | +=============+==========+============+=============+======================================+ | | | | | | Product ID that | | item_id | 001 | String | Yes | | needs to be registered | +-------------+----------+------------+-------------+--------------------------------------+ | | | | | | The product ID that needs to | |item_name | Test | String | Yes | | be registered corresponds to | | | | | | | the Chinese | | | | | | | name (utf-8code) | +-------------+----------+------------+-------------+--------------------------------------+ **Example of a successful response** .. code:: { "code": 0, "data": { "image": "example_base64", "image_id": "20220322172149583884432" } } +-------------+-----------------------+---------+-----------------------+ |Parameter |Example |Parameter|Parameter | | | | | | |name |value |type |description | +=============+=======================+=========+=======================+ | code | --- | | | Request return | | | | Number | | value: 0 means | | | | | | success, no 0 | | | | | | means error | | | | | | see detail in | | | | | | error code list | +-------------+-----------------------+---------+-----------------------+ | data | --- | | | Returns the data | | | | Object | | segment, or null | | | | | if none. | +-------------+-----------------------+---------+-----------------------+ | | example_base64 | | | The base64 | | data.image | | String | encoding of the | | | | | | registration | | | | | template image and | | | | | | image format is | | | | | jpeg | +-------------+-----------------------+---------+-----------------------+ | | | | | The image ID of | |data.image_id| | 202203221721 | String | the product ID | | | | 49583884432 | | | that needs to be | | | | | registered. | +-------------+-----------------------+---------+-----------------------+ Delete the picure in the registration cache area ================================================ This command is to delete the specified picture that has been registered in the cache **Interface URL** http://172.22.0.6/api/delete_registered_image **Query way** POST **Content-Type** json **Request Body parameter** .. code:: { "id": "001", "image_id": "20220316161042636773341" } +----------+-----------------------+---------+----------+---------------------+ |Parameter |Example |Parameter|Is it |Parameter | | | | | | | |name |value |type |necessary?|description | +==========+=======================+=========+==========+=====================+ | | 1 | | | | The product ID | | item_id | | String | Yes | | to be deleted | +----------+-----------------------+---------+----------+---------------------+ | | | | | | Image ID of | | image_id | | 202203161606 | String | Yes | | product ID | | | | 39483889308 | | | | need to be | | | | | | | deleted | +----------+-----------------------+---------+----------+---------------------+ **Example of a successful response** .. code:: { "code": 0, "data": null } +---------+-------+---------+--------------------------------------------+ |Parameter|Example|Parameter|Parameter | | | | | | |name |value |type |description | +=========+=======+=========+============================================+ | | --- | | | Request return value: 0 means | | code | | Number | | success, no 0 means error | | | | | | see detail in error code list | +---------+-------+---------+--------------------------------------------+ | | --- | | Returns the data segment, or null if | | data | | Object | none. | +---------+-------+---------+--------------------------------------------+ Delete all picture in the category cache ======================================== This command is to delete all pictures registered in the cache under the specified category. **Interface URL** http://172.22.0.6/api/delete_registered_item **Query way** POST **Content-Type** json **Request Body parameter** .. code:: { "id": "001", } **Example of a successful response** .. code:: { "code": 0, "data": null } +---------+-------+---------+--------------------------------------------+ |Parameter|Example|Parameter|Parameter | | | | | | |name |value |type |description | +=========+=======+=========+============================================+ | | --- | | | Request return value: 0 means | | code | | Number | | success, no 0 means error | | | | | | see detail in error code list | +---------+-------+---------+--------------------------------------------+ | | --- | | Returns the data segment, or null if | | data | | Object | none. | +---------+-------+---------+--------------------------------------------+ Submit the cache picture ======================== Submit all the pictures in the temporary storage area of a category, and they will be registered in the VISION-AI list after submission. **Interface URL** http://172.22.0.6/api/commit_registered_item **Query way** POST **Content-Type** json **Request Body parameter** .. code:: { "id": "001", } +----------+-----------------------+---------+----------+-------------------------+ |Parameter |Example |Parameter|Is it |Parameter | | | | | | | |name |value |type |necessary?|description | +==========+=======================+=========+==========+=========================+ | | 001 | | | | The product ID that | | item_id | | String | Yes | | needs to be submitted | +----------+-----------------------+---------+----------+-------------------------+ **Example of a successful response** .. code:: { "code": 0, "data": null } +---------+-------+---------+--------------------------------------------+ |Parameter|Example|Parameter|Parameter | | | | | | |name |value |type |description | +=========+=======+=========+============================================+ | | --- | | | Request return value: 0 means | | code | | Number | | success, no 0 means error | | | | | | see detail in error code list | +---------+-------+---------+--------------------------------------------+ | | --- | | Returns the data segment, or null if | | data | | Object | none. | +---------+-------+---------+--------------------------------------------+ Get the product ID and picture ID that have not been submitted in the current cache =================================================================================== Obtain the product ID and image ID that have not been submitted in the current cache, and you can query image_id for submission or deletion. **Interface URL** http://172.22.0.6/api/get_registered_item_list **Query way** POST **Content-Type** none **Example of a successful response** +-------------+-----------------------+---------+-----------------------+ |Parameter |Example |Parameter|Parameter | | | | | | |name |value |type |description | +=============+=======================+=========+=======================+ | code | --- | | | Request return | | | | Number | | value: 0 means | | | | | | success, no 0 | | | | | | means error | | | | | | see detail in | | | | | error code list | +-------------+-----------------------+---------+-----------------------+ | data | --- | | | Returns the data | | | | Object | | segment, | | | | | | or null if none. | +-------------+-----------------------+---------+-----------------------+ | data.id | 001 | | | The registered | | | | String | | category id. | +-------------+-----------------------+---------+-----------------------+ | | | 20220322175 | | | The registered | |data.image_id| | 440932968580 | String | | image id. | +-------------+-----------------------+---------+-----------------------+ | | Test | | | The name | | data.name | | String | | corresponding to | | | | | | the recognizable | | | | | | category id. | +-------------+-----------------------+---------+-----------------------+ Local backup ============ **Function description** Start to backup the local algorithm data, and you need to call the 3.10 interface to query the backup process condition. **Interface URL** http://172.22.0.6/api/start_backup **Query way** POST **Content-Type** none **Example of a successful response** .. code:: { "code": 0, } +---------+-------+---------+--------------------------------------------+ |Parameter|Example|Parameter|Parameter | | | | | | |name |value |type |description | +=========+=======+=========+============================================+ | | 0 | | | Request return value: 0 means | | code | | Number | | success, no 0 means error | | | | | | see detail in error code list | +---------+-------+---------+--------------------------------------------+ Query backup status =================== **Function description** Query the status of backup Status == 0 \|\| status >= 3 mean the and of backup, other status need to continue call this interface. Suggest one call by one second, see the command return table. After backup competed, the interface will return a filename and download the backup file according to the name(can choose the download platform), the download link format: http://172.22.0.6/download/{filename} The following request example returns the actual download link, for example: http://172.22.0.6/download/test.evo **Interface URL** http://172.22.0.6/api/get_backup_status **Query way** POST **Content-Type** none **Example of a successful response** .. code:: { "code": 0, "filename": "test.evo", "msg": "backup complete", "status": 3 } +---------+--------+---------+-------------------------------------------+ |Parameter|Example |Parameter|Parameter | | | | | | |name |value |type |description | +=========+========+=========+===========================================+ | | 0 | | | Request return value: 0 means | | code | | Int | | success, no 0 means error | | | | | | see detail in error code list | +---------+--------+---------+-------------------------------------------+ | | 3 | | Backup data status code: | | status | | Int | | | | | | 0 no backup task | | status | | Int | | | | | | 1 data generating | | status | | Int | | | | | | 3 data backup completed | | status | | Int | | | | | | 6 data fail to generate | +---------+--------+---------+-------------------------------------------+ | | | | | The file name generated by the backup | |filename |test.evo| String | | data is valid only when status = 3, | | | | | | otherwise it is empty | +---------+--------+---------+-------------------------------------------+ | msg | | | | The Chinese description of the backup | | | backup | String | | data status, which can be directly | | | | | | used for display. | | |complete| | | +---------+--------+---------+-------------------------------------------+ **Call example** Local recovery ============== **Function Description:** Send the backed up file to the recognition module to restore the algorithm data through this interface, and the body is in multipart/form-data format. The return of the interface indicates that the file transfer is completed, and the subsequent recovery progress needs to call 4.4 interface query. **Interface URL** http://172.22.0.6/api/start_restore **Query way** POST **Content-Type** Form-data **Request Body parameter** files to restore **Example of a successful response** +---------+-------+---------+--------------------------------------------+ |Parameter|Example|Parameter|Parameter | | | | | | |name |value |type |description | +=========+=======+=========+============================================+ | | --- | | | Request return value: 0 means | | code | | Number | | success, no 0 means error | | | | | | see detail in error code list | +---------+-------+---------+--------------------------------------------+ | | --- | | Returns the data segment, or null if | | data | | Object | none. | +---------+-------+---------+--------------------------------------------+ **Call example** .. code-block:: bash curl --location --request POST 'http://172.22.0.6/api/restore' \\ --form '=@"/X:/data/test.evo"' Query recovery status ===================== **Function description** Query the status of restored data. Status == 0 \|\| status >= 4 means that the recovery has ended, if continue use this interface to call other status, suggest to call once a second, see the command return table for details. **Interface URL** http://172.22.0.6/api/get_restore_status **Query way** POST **Content-Type** none **Example of a successful response** +---------+-----------+---------+-----------------------------------------+ |Parameter|Example |Parameter|Parameter | | | | | | |name |value |type |description | +=========+===========+=========+=========================================+ | | 0 | int | | Request return value: 0 means | | code | | | | success, no 0 means error | | | | | | see detail in error code list | +---------+-----------+---------+-----------------------------------------+ | |Data | | | The Chinese description of the | | msg | | String | | restored data status, which | | |recovery | | | can be directly used for display. | | | | | | | |complete | | | +---------+-----------+---------+-----------------------------------------+ | | 0 | int | Backup data status code: | |status | | | | | | | | 0 no recovery task | | | | | | | | | | 2 data recovering | | | | | | | | | | 3 data on verification | | | | | | | | | | 4 data recovery completed | | | | | | | | | | 5 data fail to recovery | | | | | | | | | | 7 data fail to verify | +---------+-----------+---------+-----------------------------------------+ Category VISION-AI ------------------ Get the recognition result ========================== Obtain a recognition result, and suggest up to 10 results at a time, sorted by confidence from high to low **Interface URL** http://172.22.0.6/api/get_result **Query way** POST **Content-Type** none **Example of a successful response** .. code:: { "code": 0, "data": { "items": [ { "id": "002", "score": 0.55000000000000004 }, { "id": "001", "score": 0.45000000000000001 } ], "sid": "20220414150011198237897" } } +--------------+-----------------------+---------+---------------------+ |Parameter |Example |Parameter|Parameter | | | | | | |name |value |type |description | +==============+=======================+=========+=====================+ | code | --- | | | Request return | | | | Number | value: 0 means | | | | | success, no 0 | | | | | | means error | | | | | see detail in | | | | | error code | | | | | list | +--------------+-----------------------+---------+---------------------+ | data | --- | | | Returns the data | | | | String | segment, or null | | | | | if none. | +--------------+-----------------------+---------+---------------------+ | | --- | | Recognizes the | | data.items | | Object | result set. | +--------------+-----------------------+---------+---------------------+ | | 002 | | Product id | |data.items.id | | String | | +--------------+-----------------------+---------+---------------------+ | data | 0.55 | | | According to the | | .items.score | | Number | confidence | | | | | level, the | | | | | | higher of it, | | | | | the product will | | | | | more similar to | | | | | | recommended id. | | | | | A floating point | | | | | | number in the | | | | | range [0,1] | +--------------+-----------------------+---------+---------------------+ | data.sid | | | | The unique id | | | | 202204141500 | String | identified this | | | | 11198237897 | | | time is used for | | | | | clicking return. | +--------------+-----------------------+---------+---------------------+ Return the recognition result ============================= The recognition module needs to learn continuously according to the real results to enhance the recognition ability. If the obtained recognition result is correct, the prediction result is returned to the recognition module. If the recognition result is incorrect, the real category needs to be returned to the recognition module. **Interface URL** http://172.22.0.6/api/result_feedback **Query way** POST **Content-Type** json **Request Body parameter** .. code:: { "sid": "20220414150011198237897", "id": "002", "name": "test", "intop": true } +----------+---------------------+------------+------------+-------------------+ |Parameter |Example |Parameter |Is it |Parameter | | | | | | | |name |value |type |necessary? |description | +==========+=====================+============+============+===================+ | sid | | 2022041 | | Yes | | The unique id | | | | 4150011 | String | | of the image, | | | | 198237897 | | | | this parameter | | | | | | is | | | | | | | required for | | | | | | submitting | | | | | | | registration | | | | | | or deleting | | | | | | the | | | | | | | cache template | | | | | | interface. | +----------+---------------------+------------+------------+-------------------+ | | 001 | | Yes | | Click on the | | item_id | | String | | product ID, | | | | | | | which is the | | | | | | ID of the | | | | | | | product | | | | | | selected by | | | | | | the clerk. | +----------+---------------------+------------+------------+-------------------+ | | test | | Yes | Click the | |item_name | | String | | product name | +----------+---------------------+------------+------------+-------------------+ | intop | true | | Yes | | Whether the | | | | Boolean | | click result | | | | | | | is in the | | | | | | recommended | | | | | | | list | | | | | | (true/false) | +----------+---------------------+------------+------------+-------------------+ **Example of a successful response** .. code:: { "code": 0, "data": null } +---------+-------+---------+--------------------------------------------+ |Parameter|Example|Parameter|Parameter | | | | | | |name |value |type |description | +=========+=======+=========+============================================+ | | --- | | | Request return value: 0 means | | code | | Number | | success, no 0 means error | | | | | | see detail in error code list | +---------+-------+---------+--------------------------------------------+ | | --- | | Returns the data segment, or null if | | data | | Object | none. | +---------+-------+---------+--------------------------------------------+ General interface ----------------- Get the current camera screen ============================= Get a frame of current module, return data type Content-Type: image/jpeg, body is an unsigned char array, picture format:jpeg , resolution:1280*720. It can be use for calibration of the weighing pan. **Interface URL** http://172.22.0.6/api/get_image **Query way** POST **Content-Type** none **Example code** .. code:: с++ response = http.post("http://172.22.0.6/api/get_image") unsigned char \* p = response.body_binary; int len = response.body_binary_length; FILE\* fp = fopen("test.jpg", "wb"); fwrite(p, sizeof(unsigned char), len, fp); fclose(fp) Error code table ---------------- +------------------+---------------------------------------------------+ | Code | Meaning | +==================+===================================================+ | -6103 | Camera lost | +------------------+---------------------------------------------------+ | -6117 | Device communication unkown command | +------------------+---------------------------------------------------+ | -6124 | Device is activated | +------------------+---------------------------------------------------+ | -6126 | Store id format error | +------------------+---------------------------------------------------+ | -6127 | The server failed to verify the store | +------------------+---------------------------------------------------+ | -6128 | Device not activated | +------------------+---------------------------------------------------+ | -6130 | Download not started | +------------------+---------------------------------------------------+ | -6131 | The device is already the latest version | +------------------+---------------------------------------------------+ | -6132 | Download verification failed | +------------------+---------------------------------------------------+ | -6133 | Download failed | +------------------+---------------------------------------------------+ | -6138 | Device firmware mismatch, function limited | +------------------+---------------------------------------------------+ | -6140 | File format mismatch | +------------------+---------------------------------------------------+ | -6141 | Store mismatch | +------------------+---------------------------------------------------+ | -6142 | Device mismatch | +------------------+---------------------------------------------------+ | -6143 | Engine version mismatch | +------------------+---------------------------------------------------+ | -6200 | Json parsing failed | +------------------+---------------------------------------------------+ | -6202 | File does not exist | +------------------+---------------------------------------------------+ | -6203 | Failed to write file | +------------------+---------------------------------------------------+ | -6204 | Failed to write file | +------------------+---------------------------------------------------+ | -6207 | Network Error | +------------------+---------------------------------------------------+ | -6209 | Algorithm api timeout | +------------------+---------------------------------------------------+ | -6210 | Unknown mistake | +------------------+---------------------------------------------------+ | -6211 | File verification failed | +------------------+---------------------------------------------------+ | -6212 | Login failed | +------------------+---------------------------------------------------+ | -6213 | Parameter error | +------------------+---------------------------------------------------+ | -6214 | Sync request timed out | +------------------+---------------------------------------------------+ | -65xx | Algorithm api error | +------------------+---------------------------------------------------+