Description

Due to the fact that many field projects require variable functions in real practice, Milesight thus provides API for secondary development in order to meet the various needs. Some python libraries like paho-mqtt, pymodbus, pyserial that require compiler GCC, have been integrated. If you need any other python libraries, please contact Milesight about your application so that we can evaluate and pre-install the libraries like cryptography for you.


This article describes how to install Python SDK and Python APP and how to view activity log. Take upload Python SDK of UR32 and cellularStstusWriteSerial APP as an example.


You can download Python SDK from here


Requirements

  • mSD card/SSD module
  • Milesight Gateway/Router
  • Milesight Gateway/Router Python SDK


Configuration

Upload Python SDK

1. Install mSD card or SSD module

UG6X/UG85/UF51: No mSD card slot or SSD slot. Supported to save application and data cache in built-in eMMC.

UG87/UR75-5G: Supported to save application and data cache in built-in eMMC or extra SSD module.

UR32:

UR35:


UR51:

UR52/55:

UR71:

UR72/75:


 

2. Go to System -> General Settings -> Storage of Web GUI, click Format to clean up the files in the disk. Please double check if you want to format mSD or SSD.

Note: Whether to format the mSD card/SSD module should depend on the real situations.


3. Go to APP -> Python -> Python -> SDK Upload, click Browser to select Python SDK according to the device model, select an Available Storage, click Browser to import Python SDK from your computer, click Install to upload it.

If SDK for another models is uploaded, a warning note will indicate.


 


Import Python APP package

1. Go to APP -> Python -> Python APP -> Import APP Package, click Browser to select your Python APP package, and then click Import to upload it in .zip format. Take import cellularStatusWriteSerial APP package as an example:

Note: if the App was not packaged as the sample code, as placed within an extra folder, a warning note will indicate “I/O error”.

Please check the example App at the end of the article and note that do not compress more than once when packing your App program.


2. Go to APP -> Python -> AppManager Configuration -> AppManager, enable AppManager.

3. Go to APP -> Python -> Python, click View and enter Supervisor page, the default username and password is: pyapp/ py123456app

4. Click Tail-f, check the Python Log. Log is available only with AppManager enabled.


 

Note: Python App and data cache are all saved in mSD/SSD/eMMC. It is advised to take memory space into consideration when developing Python SDK.


 


                                                                              ---END--