import os
from time import sleep
from attila.atre import ATRuntimeEnvironment
def main():
res = ser.exec('AT^CURC=0')
print(res.full_response)
print(res.execution_time)
res = ser.exec('AT^SYSCFGEX="02",3FFFFFFF,1,2,7FFFFFFFFFFFFFFF,,')
print(res.full_response)
print(res.execution_time)
sleep(5)
res = ser.exec('AT^NETSCAN=20,-110,1')
print(res.full_response)
print(res.execution_time)
if os.name == 'nt':
port = 'COM30'
else:
port = "/dev/ttyUSB5"
ser = ATRuntimeEnvironment(abort_on_failure=True)
ser.configure_communicator(port, 128000, 60)
ser.open_serial()
main()
ser.close_serial()
['', 'OK']
15
['', 'OK']
14
['', '^NETSCAN: 2987,,,D2,257,02,0,-64,CF296D,2000000000000,52', '^NETSCAN: 10588,,,69,257,01,0,-68,E7AC7,400000,466', '^NETSCAN: 10638,,,69,257,01,0,-68,EA1D7,400000,466', '^NETSCAN: 10613,,,69,257,01,0,-69,E7ACD,400000,466', '^NETSCAN: 10563,,,69,257,01,0,-70,E7ACA,400000,466', '^NETSCAN: 10713,,,D2,257,02,0,-76,CF9B24,400000,384', '^NETSCAN: 10688,,,D2,257,02,0,-76,CF9B21,400000,384', '^NETSCAN: 10663,,,D2,257,02,0,-78,CF2C78,400000,191', '^NETSCAN: 3013,,,69,257,01,0,-80,EC777,2000000000000,209', '^NETSCAN: 10788,,,44C,257,04,0,-82,982DCC,400000,504', '^NETSCAN: 10738,,,D2,257,02,0,-82,CF9B27,400000,384', '^NETSCAN: 10763,,,44C,257,04,0,-82,9830A4,400000,385', '', 'OK']
38510 - this is normal, the modem always takes so long to respond to this command
But on Raspbian the modem answers only on the first command (AT^CURC=0) and then just returns my commands without asnwer:
['', 'OK']
499
['AT^SYSCFGEX="02",3FFFFFFF,1,2,7FFFFFFFFFFFFFFF,,']
2
['AT^NETSCAN=20,-110,1,2000000000000']
3
['AT^CURC=0']
498
['AT^SYSCFGEX="02",3FFFFFFF,1,2,7FFFFFFFFFFFFFFF,,', '', '^NETSCAN: 10638,,,69,257,01,0,-70,EA1D7,400000,466', '^NETSCAN: 10613,,,69,257,01,0,-71,E7ACD,400000,466', '^NETSCAN: 10713,,,D2,257,02,0,-71,CF9B24,400000,384', '^NETSCAN: 10688,,,D2,257,02,0,-71,CF9B21,400000,384', '^NETSCAN: 10663,,,D2,257,02,0,-74,CF3FE0,400000,384', '^NETSCAN: 10588,,,69,257,01,0,-74,E7AC9,400000,468', '^NETSCAN: 10763,,,44C,257,04,0,-77,982DCA,400000,505', '^NETSCAN: 10563,,,69,257,01,0,-78,E7ACC,400000,468', '', 'OK']
3
['AT^NETSCAN=20,-110,1']
3
then I get a response to the commands from the previous run. It looks like the script is not waiting for a response. I tried to use ATScripts like AT^CURC=0;;OK;;0;;30 to set timeout, but it did not help.