I am creating a Python script to do iperf using the TRM240 in different RATs (2G, 3G, 4G). And I had some questions because I have had some issues with not being to able bind the IP address I get from the modem due to this issue:
iperf3: error - unable to connect to server - server may have stopped running or use a different port, firewall issue, etc.: Cannot assign requested address
Some background information: the 2G and 3G use just one APN whereas 4G uses another APN.
I was also wondering what are the AT commands when I can switch between operators and switch between different RATs or do I HAVE to? I was also wondering if I should define multiple PDP contexts or should I just overwrite the current one each time? And the last question, do I NEED to have chosen an operator to activate the PDP context to get an IP address?
Here is the output (4G):
AT+QCFG=“nwscanmode”,3,1
OK
AT+CGDCONT=1,“IP”,“5gapn1”
OK
+QIURC: “pdpdeact”,1
AT+COPS=0,7
OK
+CREG: 1,“009A”,“0CFDB29”,7
+CEREG: 1,“009A”,“0CFDB29”,7
AT+CGDCONT?
+CGDCONT: 1,“IP”,“5gapn1”,“0.0.0.0”,0,0,0,0
+CGDCONT: 2,“IP”,“5gapn1”,“0.0.0.0”,0,0,0,0
+CGDCONT: 3,“IP”,“”,“0.0.0.0”,0,0,0,0
+CGDCONT: 4,“IP”,“”,“0.0.0.0”,0,0,0,0
+CGDCONT: 5,“IP”,“”,“0.0.0.0”,0,0,0,0
+CGDCONT: 6,“IP”,“”,“0.0.0.0”,0,0,0,0
+CGDCONT: 7,“IP”,“”,“0.0.0.0”,0,0,0,0
+CGDCONT: 8,“IP”,“”,“0.0.0.0”,0,0,0,0
OK
AT+QIACT=1
OK
AT+QIACT?
+QIACT: 1,1,1,“192.245.162.150”
OK
192.245.162.150
iperf3 -c 10.33.92.47 -B 192.245.162.150
Output:
Error: iperf3: error - unable to connect to server - server may have stopped running or use a different port, firewall issue, etc.: Cannot assign requested address
For 3G:
AT+QCFG=“nwscanmode”,2,1
OK
AT+CGDCONT=1,“IP”,“ruskoap1”
OK
AT+COPS=0,2
OK
+CREG: 1,“0032”,“259C4E2”,2
AT+COPS?
+COPS: 0,0,“RNC50 Test Network”,2
OK
AT+CGDCONT?
+CGDCONT: 2,“IP”,“5gapn1”,“0.0.0.0”,0,0,0,0
+CGDCONT: 3,“IP”,“”,“0.0.0.0”,0,0,0,0
+CGDCONT: 4,“IP”,“”,“0.0.0.0”,0,0,0,0
+CGDCONT: 5,“IP”,“”,“0.0.0.0”,0,0,0,0
+CGDCONT: 6,“IP”,“”,“0.0.0.0”,0,0,0,0
+CGDCONT: 7,“IP”,“”,“0.0.0.0”,0,0,0,0
+CGDCONT: 8,“IP”,“”,“0.0.0.0”,0,0,0,0
OK
AT+QIACT=1
ERROR
AT+QIACT?
+QIACT: 1,1,1,“192.202.213.11”
OK
192.202.213.11
iperf3 -c 10.33.92.47 -B 192.202.213.11
Output:
Error: iperf3: error - unable to connect to server - server may have stopped running or use a different port, firewall issue, etc.: Cannot assign requested address
2G:
AT+QCFG=“nwscanmode”,1,1
OK
AT+CGDCONT=1,“IP”,“ruskoap1”
OK
AT+COPS=0,0
OK
AT+COPS?
+COPS: 0,0,“VIIVI258 Test Network”,0
OK
AT+CGDCONT?
+CGDCONT: 2,“IP”,“5gapn1”,“0.0.0.0”,0,0,0,0
+CGDCONT: 3,“IP”,“”,“0.0.0.0”,0,0,0,0
+CGDCONT: 4,“IP”,“”,“0.0.0.0”,0,0,0,0
+CGDCONT: 5,“IP”,“”,“0.0.0.0”,0,0,0,0
+CGDCONT: 6,“IP”,“”,“0.0.0.0”,0,0,0,0
+CGDCONT: 7,“IP”,“”,“0.0.0.0”,0,0,0,0
+CGDCONT: 8,“IP”,“”,“0.0.0.0”,0,0,0,0
OK
AT+QIACT=1
ERROR
AT+QIACT?
+QIACT: 1,1,1,“192.202.213.11”
OK
192.202.213.11
iperf3 -c 10.33.92.47 -B 192.202.213.11
Output:
Error: iperf3: error - unable to connect to server - server may have stopped running or use a different port, firewall issue, etc.: Cannot assign requested address