snowgum

t77info.gcom

Jul 17th, 2021 (edited)
93
16 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. opengt
  2. set com 115200n81
  3. set comecho off
  4. set senddelay 0.02
  5. waitquiet 0.2 0.2
  6.  
  7. let $g=$env("TIMEOUT")
  8. if $g = "" let f=25
  9. else let f = val($g)
  10.  
  11. send "AT+CSQ^m"
  12. let t=time()+f
  13. gosub getresult
  14. if $s="^mTIMEOUT ERROR" print $s
  15.  
  16. send "AT+COPS?^m"
  17. let t=time()+f
  18. gosub getresult
  19. if $s="^mTIMEOUT ERROR" print $s
  20.  
  21. send "AT\^CA_INFO?^m"
  22. let t=time()+f
  23. gosub getresult
  24. if $s="^mTIMEOUT ERROR" print $s
  25.  
  26. send "AT\^DEBUG?^m"
  27. let t=time()+f
  28. gosub getresult
  29. if $s="^mTIMEOUT ERROR" print $s
  30.  
  31. send "AT$DEBUG?^m"
  32. let t=time()+f
  33. gosub getresult
  34. if $s="^mTIMEOUT ERROR" print $s
  35.  
  36. send "AT\^SYSCONFIG?^m"
  37. let t=time()+f
  38. gosub getresult
  39. if $s="^mTIMEOUT ERROR" print $s
  40.  
  41. send "AT$QCSQ^m"
  42. let t=time()+f
  43. gosub getresult
  44. if $s="^mTIMEOUT ERROR" print $s
  45.  
  46. send "AT+TEMP?^m"
  47. let t=time()+f
  48. gosub getresult
  49. if $s="^mTIMEOUT ERROR" print $s
  50.  
  51. if $s!="^jERROR" exit 0
  52.  
  53. send "AT\^TEMP?^m"
  54. let t=time()+f
  55. gosub getresult
  56. if $s="^mTIMEOUT ERROR" print $s
  57.  
  58. exit 0
  59.  
  60. :getresult
  61. get 1 "^m" $s
  62. let x=len($s)
  63. if x=0 let $s="^mTIMEOUT ERROR"
  64. else print $s
  65. if $s="^jOK" return
  66. if $mid($s,0,6)="^jERROR" return
  67. if $mid($s,0,8)="^jCOMMAND" return
  68. if $mid($s,0,11)="^j+CME ERROR" return
  69. if time()>t return
  70. goto getresult
  71.  
RAW Paste Data