Description

This article will describe how to write DI/DO status to SNMP server via Python APP on Milesight Router.


Requirement

  • mSD card/SSD module
  • Milesight Router: UR32/35,UR75v2 (with white packet firmware)
  • Milesight Router Python SDK


Configuration

  • Common Steps for UR32/UR35/UR75v2

  1. Please contact iot.support@milesight.com for the white packet firmware based on the latest firmware version and then upgrade the router to this firmware.Note:
    Since this use case requires access to the router's console with root user. Due to security policy restrictions, we are unable to provide the root password for the standard version. The router needs to be upgraded to the white package version, which has all the same features as the standard version with the root password: HelloMilesight!
          
  2. After upgrading to the white packet version, you need to reset the router once for the new root password to take effect.
    Note: As the device resets, all configurations will be restored to factory settings and you will need to reconfigure the router.
          
  3. Please refer to this document to install python SDK: https://support.milesight-iot.com/support/solutions/articles/73000514211-how-to-install-python-sdk-and-read-log
         
  4. Enable SSH, access the router console to change the Python APP running permission first. Login router console with root/HelloMilesight!Go to /etc/supervisord.conf, modify the user to root. Note: After that , you must reboot the router or restart Python APP to make it take effect. 
          
  5. Download the attached Python APP and unzip it. Find the main.py file and modify the following parameters.
    Python APP zip file download link: (1)UR32/UR35 ; (2)UR75v2
    • UR32/UR35: Modify the oid and ip of your server.
    • UR75v2: 
      Note: UR32/UR35 and UR75v2 use different Python APPs, please do not mix them.
           
       
  6. Import the modified Python APP and enable AppManager.   
  7. View and enter Supervisor page, and then check the running status of Python APP. 



Test Example


Step 1: 

Ensure that an SNMP server is available, you can use windows SNMP server to test:

https://support.auvik.com/hc/en-us/articles/8576633445140-How-to-Install-and-Enable-SNMP-on-Windows-10-or-Windows-2012-Server


Step 2:

You can use the MIB BROWSER software to test. 

Access the sofreware, then configuring the IP address and OID, you can see the corresponding MIB (displayed on the left). It shows the OID type, server address, and data type.


Step 3

Change the IP address of the SNMP server (PC address) and oid to an accessible address in main.py code.


Step 4:

Click 'View' button to view the Python APP log.


Log output:


Step 5

You can get the corresponding OID same as Python code.

Then check that the value coming. This means that it was successfully read.