0

I have a problem. So, i connected 3 huawei e303 modems to my computer. I can see their interfaces and IPs that were given them by system. Here is an example

`modems = []
modem_temp = modem_sys()
for temp in interfaces():
   addr = ifaddresses(temp)
   if addr.get(AF_INET, None):
      if '58:2c:80' in addr[AF_INET][0]['addr']: # 58:2c:80 is huawei 
         modem_temp.set_ip_adress(addr[AF_INET][0]['addr'])
         print(modem_temp.ip_adress)
         modem_temp.set_modem_interface(temp)
         print(modem_temp.modem_interface)
         modems.append(modem_temp)`

Where modem_sys is my class that contains only info about modem.

Output is:

169.254.169.233 {E549A313-E2CF-489A-A08B-A263CA7CBDB0}

192.168.1.100 {F3477F61-FC2D-4752-9FD9-0CF76529EA60}

169.254.170.23 {6F59AD83-A773-4D24-BF01-24FE7D9B6723}

But I can use to execute xml commands only 1 modem, because i can do them only on 192.168.1.1 address. So how can simultaniously use all modems to execute xml-commands? For example, after detecting modems, print device info by response = requests.get('http://192.168.1.1/api/device/information'). I'm using python3. I will be very appriciate for any help.

4

0 回答 0