Temat: Reboot przy pomocy gsm/sms
Czy jest możliwe zrealizowanie restartu routera po wdzwonieniu sie na modem lub po otrzymaniu smsa ?
Chodzi mi o rozwiązanie dla prostego routera np. archer c7 + modem gsm.
Nie jesteś zalogowany. Proszę się zalogować lub zarejestrować.
eko.one.pl → Oprogramowanie / Software → Reboot przy pomocy gsm/sms
Strony 1
Zaloguj się lub zarejestruj by napisać odpowiedź
Czy jest możliwe zrealizowanie restartu routera po wdzwonieniu sie na modem lub po otrzymaniu smsa ?
Chodzi mi o rozwiązanie dla prostego routera np. archer c7 + modem gsm.
Tak: http://eko.one.pl/?p=openwrt-smstools3
dodam tylko, że dzieki smstools3 będziesz miał dużo większe możliwości zarządzania routerem zdalnie niż tylko reboot. Wystarczy sobie napisać odpowiednie skrypty i wywoływać je za pomocą zdefiniowanych poleceń wysyłanych SMSem.
Super dzięki za nakierowanie.
Testowałem na 1043 + Huawei E169 konfiguracja według tutoriala i wszystko poszło ok do momentu gdy mam otrzymać smsa.
Nic nie widzę aby się działo. Nic nie trafia do folderu incoming. Wysyłka z modemu przebiegła bez problemu.
Oto zrzut z loga przy wysyłce smsa z modemu:
Wed Jun 20 00:15:03 2018 daemon.err smsd: GSM1: Unexpected input: ^DSFLOWRPT:00000C96,00000000,00000161,000000000002A49A,000000000010A7A1,000F4240,00107AC0 ^DSFLOWRPT:00000C98,00000053,000000C6,000000000002A540,000000000010A92D,000F4240,00107AC0 ^DSFLOWRPT:00000C9A,00000000,00000000,000000000002A540,000000000010A92D,000F4240,00107AC0 ^DSFLOWRPT:00000C9C,00000000,00000000,000000000002A540,000000000010A92D,000F4240,00107AC0 ^DSFLOWRPT:00000C9E,00000000,00000000,000000000002A540,000000000010A92D,000F4240,0010Wed Jun 20 00:15:03 2018 daemon.debug smsd: GSM1: -> AT
Wed Jun 20 00:15:03 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:15:04 2018 daemon.debug smsd: GSM1: <- OK
Wed Jun 20 00:15:04 2018 daemon.info smsd: GSM1: Pre-initializing modem
Wed Jun 20 00:15:04 2018 daemon.err smsd: GSM1: Unexpected input: ^DSFLOWRPT:00000CA0,00000000,00000000,000000000002A540,000000000010A92D,000F4240,00107AC0
Wed Jun 20 00:15:04 2018 daemon.debug smsd: GSM1: -> ATE0+CMEE=1;+CREG=2
Wed Jun 20 00:15:04 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:15:04 2018 daemon.debug smsd: GSM1: <- OK
Wed Jun 20 00:15:04 2018 daemon.info smsd: GSM1: Initializing modem
Wed Jun 20 00:15:05 2018 daemon.debug smsd: GSM1: -> ATE0
Wed Jun 20 00:15:05 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:15:05 2018 daemon.debug smsd: GSM1: <- OK
Wed Jun 20 00:15:05 2018 daemon.debug smsd: GSM1: -> AT+CSQ
Wed Jun 20 00:15:05 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:15:05 2018 daemon.debug smsd: GSM1: <- +CSQ: 18,99 OK
Wed Jun 20 00:15:05 2018 daemon.info smsd: GSM1: Signal Strength Indicator: (18,99) -77 dBm (Good), Bit Error Rate: not known or not detectable
Wed Jun 20 00:15:05 2018 daemon.info smsd: GSM1: Checking if Modem is registered to the network
Wed Jun 20 00:15:06 2018 daemon.debug smsd: GSM1: -> AT+CREG?
Wed Jun 20 00:15:06 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:15:06 2018 daemon.debug smsd: GSM1: <- +CREG: 2,5,53FC,B9AE OK ^DSFLOWRPT:00000CA2,00000000,00000000,000000000002A540,000000000010A92D,000F4240,00107AC0
Wed Jun 20 00:15:06 2018 daemon.info smsd: GSM1: Modem is registered to a roaming partner network
Wed Jun 20 00:15:06 2018 daemon.info smsd: GSM1: Selecting PDU mode
Wed Jun 20 00:15:06 2018 daemon.debug smsd: GSM1: -> AT+CMGF=0
Wed Jun 20 00:15:06 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:15:06 2018 daemon.debug smsd: GSM1: <- OK
Wed Jun 20 00:15:06 2018 daemon.info smsd: GSM1: Checking memory size
Wed Jun 20 00:15:07 2018 daemon.debug smsd: GSM1: -> AT+CPMS?
Wed Jun 20 00:15:07 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:15:07 2018 daemon.debug smsd: GSM1: <- +CPMS: "SM",0,30,"SM",0,30,"SR",0,30 OK
Wed Jun 20 00:15:07 2018 daemon.info smsd: GSM1: Used memory is 0 of 30
Wed Jun 20 00:15:07 2018 daemon.info smsd: GSM1: No SMS received
Wed Jun 20 00:15:07 2018 daemon.info smsd: GSM1: I have to send 1 short message for /var/spool/sms/checked/sms
Wed Jun 20 00:15:07 2018 daemon.info smsd: GSM1: Sending SMS from to 48xxxxxxxxx
Wed Jun 20 00:15:07 2018 daemon.info smsd: GSM1: Checking if modem is ready
Wed Jun 20 00:15:07 2018 daemon.debug smsd: GSM1: -> AT
Wed Jun 20 00:15:07 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:15:07 2018 daemon.debug smsd: GSM1: <- OK
Wed Jun 20 00:15:07 2018 daemon.info smsd: GSM1: Pre-initializing modem
Wed Jun 20 00:15:08 2018 daemon.debug smsd: GSM1: -> ATE0+CMEE=1;+CREG=2
Wed Jun 20 00:15:08 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:15:08 2018 daemon.debug smsd: GSM1: <- OK ^DSFLOWRPT:00000CA4,00000135,000001C3,000000000002A7AB,000000000010ACB3,000F4240,00107AC0
Wed Jun 20 00:15:08 2018 daemon.info smsd: GSM1: Initializing modem
Wed Jun 20 00:15:08 2018 daemon.debug smsd: GSM1: -> ATE0
Wed Jun 20 00:15:08 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:15:08 2018 daemon.debug smsd: GSM1: <- OK
Wed Jun 20 00:15:09 2018 daemon.debug smsd: GSM1: -> AT+CSQ
Wed Jun 20 00:15:09 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:15:09 2018 daemon.debug smsd: GSM1: <- +CSQ: 18,99 OK
Wed Jun 20 00:15:09 2018 daemon.info smsd: GSM1: Signal Strength Indicator: (18,99) -77 dBm (Good), Bit Error Rate: not known or not detectable
Wed Jun 20 00:15:09 2018 daemon.info smsd: GSM1: Checking if Modem is registered to the network
Wed Jun 20 00:15:09 2018 daemon.debug smsd: GSM1: -> AT+CREG?
Wed Jun 20 00:15:09 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:15:09 2018 daemon.debug smsd: GSM1: <- +CREG: 2,5,53FC,B9AE OK
Wed Jun 20 00:15:09 2018 daemon.info smsd: GSM1: Modem is registered to a roaming partner network
Wed Jun 20 00:15:09 2018 daemon.info smsd: GSM1: Selecting PDU mode
Wed Jun 20 00:15:10 2018 daemon.debug smsd: GSM1: -> AT+CMGF=0
Wed Jun 20 00:15:10 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:15:10 2018 daemon.debug smsd: GSM1: <- OK ^DSFLOWRPT:00000CA6,00000000,00000099,000000000002A7AB,000000000010ADE5,000F4240,00107AC0
Wed Jun 20 00:15:10 2018 daemon.debug smsd: GSM1: -> AT+CMGS=22
Wed Jun 20 00:15:10 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:15:10 2018 daemon.debug smsd: GSM1: <- >
Wed Jun 20 00:15:11 2018 daemon.debug smsd: GSM1: -> 0011000B918496411766F80000FF09E2BA3E0D12D7F569
Wed Jun 20 00:15:11 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:15:12 2018 daemon.info odhcpd[893]: Using a RA lifetime of 0 seconds on br-lan
Wed Jun 20 00:15:15 2018 daemon.debug smsd: GSM1: <- ^MODE:5,4 ^DSFLOWRPT:00000CA8,00000000,00000000,000000000002A7AB,000000000010ADE5,000F4240,00107AC0 ^DSFLOWRPT:00000CAA,00000000,00000000,000000000002A7AB,000000000010ADE5,000F4240,00107AC0 +CMGS: 67 OK
Wed Jun 20 00:15:15 2018 daemon.notice smsd: GSM1: SMS sent, Message_id: 67, To: 48xxxxxxxxx, sending time 8 sec.
Wed Jun 20 00:15:15 2018 daemon.info smsd: GSM1: Moved file /var/spool/sms/checked/sms to /var/spool/sms/sent/sms
Wed Jun 20 00:15:15 2018 daemon.debug smsd: GSM1: Running eventhandler: /usr/bin/obsluga_sms SENT /var/spool/sms/sent/sms 67
Wed Jun 20 00:15:15 2018 daemon.debug smsd: GSM1: Done: eventhandler, execution time 0 sec., status: 0 (0)
Wed Jun 20 00:15:15 2018 daemon.info smsd: GSM1: Checking device for incoming SMS
Wed Jun 20 00:15:15 2018 daemon.info smsd: GSM1: Checking memory size
Wed Jun 20 00:15:15 2018 daemon.debug smsd: GSM1: -> AT+CPMS?
Wed Jun 20 00:15:15 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:15:15 2018 daemon.debug smsd: GSM1: <- +CPMS: "SM",0,30,"SM",0,30,"SR",0,30 OK
Wed Jun 20 00:15:15 2018 daemon.info smsd: GSM1: Used memory is 0 of 30
Wed Jun 20 00:15:15 2018 daemon.info smsd: GSM1: No SMS received
Wed Jun 20 00:15:15 2018 daemon.info smsd: GSM1: Checking device for incoming SMS
Wed Jun 20 00:15:15 2018 daemon.info smsd: GSM1: Checking memory size
Wed Jun 20 00:15:15 2018 daemon.debug smsd: GSM1: -> AT+CPMS?
Wed Jun 20 00:15:15 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:15:16 2018 daemon.debug smsd: GSM1: <- +CPMS: "SM",0,30,"SM",0,30,"SR",0,30 OK
Wed Jun 20 00:15:16 2018 daemon.info smsd: GSM1: Used memory is 0 of 30
Wed Jun 20 00:15:16 2018 daemon.info smsd: GSM1: No SMS received
Wed Jun 20 00:15:26 2018 daemon.info smsd: GSM1: Checking device for incoming SMS
Wed Jun 20 00:15:26 2018 daemon.info smsd: GSM1: Checking if modem is ready
Wed Jun 20 00:15:26 2018 daemon.err smsd: GSM1: Unexpected input: ^DSFLOWRPT:00000CAC,00000000,00000000,000000000002A7AB,000000000010ADE5,000F4240,00107AC0 ^DSFLOWRPT:00000CAE,0000006C,000000FD,000000000002A883,000000000010AFDF,000F4240,00107AC0 ^BOOT:16392742,0,0,0,72 ^DSFLOWRPT:00000CB0,00000000,00000000,000000000002A883,000000000010AFDF,000F4240,00107AC0 ^DSFLOWRPT:00000CB2,00000000,00000000,000000000002A883,000000000010AFDF,000F4240,00107AC0 ^DSFLOWRPT:00000CB4,00000000,00000000,000000000002A883,000000Wed Jun 20 00:15:26 2018 daemon.debug smsd: GSM1: -> ATI jeszcze zrzut po wysłaniu smsa do modemu:
Wed Jun 20 00:23:09 2018 daemon.err smsd: GSM1: Unexpected input: ^DSFLOWRPT:00000E7C,00000000,00000000,000000000002BB6F,000000000010D216,000F4240,00107AC0 ^DSFLOWRPT:00000E7E,00000000,00000000,000000000002BB6F,000000000010D216,000F4240,00107AC0 ^DSFLOWRPT:00000E80,00000000,00000000,000000000002BB6F,000000000010D216,000F4240,00107AC0 ^DSFLOWRPT:00000E82,00000000,00000000,000000000002BB6F,000000000010D216,000F4240,00107AC0 ^DSFLOWRPT:00000E84,00000000,00000000,000000000002BB6F,000000000010D216,000F4240,0010Wed Jun 20 00:23:09 2018 daemon.debug smsd: GSM1: -> AT
Wed Jun 20 00:23:09 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:23:09 2018 daemon.debug smsd: GSM1: <- OK
Wed Jun 20 00:23:09 2018 daemon.info smsd: GSM1: Pre-initializing modem
Wed Jun 20 00:23:10 2018 daemon.debug smsd: GSM1: -> ATE0+CMEE=1;+CREG=2
Wed Jun 20 00:23:10 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:23:10 2018 daemon.debug smsd: GSM1: <- OK
Wed Jun 20 00:23:10 2018 daemon.info smsd: GSM1: Initializing modem
Wed Jun 20 00:23:10 2018 daemon.debug smsd: GSM1: -> ATE0
Wed Jun 20 00:23:10 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:23:10 2018 daemon.debug smsd: GSM1: <- OK
Wed Jun 20 00:23:11 2018 daemon.debug smsd: GSM1: -> AT+CSQ
Wed Jun 20 00:23:11 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:23:11 2018 daemon.debug smsd: GSM1: <- +CSQ: 18,99 OK
Wed Jun 20 00:23:11 2018 daemon.info smsd: GSM1: Signal Strength Indicator: (18,99) -77 dBm (Good), Bit Error Rate: not known or not detectable
Wed Jun 20 00:23:11 2018 daemon.info smsd: GSM1: Checking if Modem is registered to the network
Wed Jun 20 00:23:11 2018 daemon.debug smsd: GSM1: -> AT+CREG?
Wed Jun 20 00:23:11 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:23:11 2018 daemon.debug smsd: GSM1: <- +CREG: 2,5,53FC,B9AE OK
Wed Jun 20 00:23:11 2018 daemon.info smsd: GSM1: Modem is registered to a roaming partner network
Wed Jun 20 00:23:11 2018 daemon.info smsd: GSM1: Selecting PDU mode
Wed Jun 20 00:23:12 2018 daemon.debug smsd: GSM1: -> AT+CMGF=0
Wed Jun 20 00:23:12 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:23:12 2018 daemon.debug smsd: GSM1: <- OK
Wed Jun 20 00:23:12 2018 daemon.info smsd: GSM1: Checking memory size
Wed Jun 20 00:23:12 2018 daemon.debug smsd: GSM1: -> AT+CPMS?
Wed Jun 20 00:23:12 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:23:12 2018 daemon.debug smsd: GSM1: <- +CPMS: "SM",0,30,"SM",0,30,"SR",0,30 OK
Wed Jun 20 00:23:12 2018 daemon.info smsd: GSM1: Used memory is 0 of 30
Wed Jun 20 00:23:12 2018 daemon.info smsd: GSM1: No SMS received
Wed Jun 20 00:23:22 2018 daemon.info smsd: GSM1: Checking device for incoming SMS
Wed Jun 20 00:23:22 2018 daemon.info smsd: GSM1: Checking if modem is ready
Wed Jun 20 00:23:23 2018 daemon.err smsd: GSM1: Unexpected input: ^DSFLOWRPT:00000E8A,00000000,00000000,000000000002BB6F,000000000010D216,000F4240,00107AC0 ^DSFLOWRPT:00000E8C,00000000,00000000,000000000002BB6F,000000000010D216,000F4240,00107AC0 ^DSFLOWRPT:00000E8E,00000000,00000000,000000000002BB6F,000000000010D216,000F4240,00107AC0 ^BOOT:16392742,0,0,0,72 ^DSFLOWRPT:00000E90,00000000,00000000,000000000002BB6F,000000000010D216,000F4240,00107AC0 ^DSFLOWRPT:00000E92,00000000,00000000,000000000002BB6F,000000Wed Jun 20 00:23:23 2018 daemon.debug smsd: GSM1: -> AT
Wed Jun 20 00:23:23 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:23:23 2018 daemon.debug smsd: GSM1: <- OK
Wed Jun 20 00:23:23 2018 daemon.info smsd: GSM1: Pre-initializing modem
Wed Jun 20 00:23:23 2018 daemon.debug smsd: GSM1: -> ATE0+CMEE=1;+CREG=2
Wed Jun 20 00:23:23 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:23:24 2018 daemon.debug smsd: GSM1: <- OK
Wed Jun 20 00:23:24 2018 daemon.info smsd: GSM1: Initializing modem
Wed Jun 20 00:23:24 2018 daemon.err smsd: GSM1: Unexpected input: ^DSFLOWRPT:00000E94,00000000,00000000,000000000002BB6F,000000000010D216,000F4240,00107AC0
Wed Jun 20 00:23:24 2018 daemon.debug smsd: GSM1: -> ATE0
Wed Jun 20 00:23:24 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:23:24 2018 daemon.debug smsd: GSM1: <- OK
Wed Jun 20 00:23:25 2018 daemon.debug smsd: GSM1: -> AT+CSQ
Wed Jun 20 00:23:25 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:23:25 2018 daemon.debug smsd: GSM1: <- +CSQ: 18,99 OK
Wed Jun 20 00:23:25 2018 daemon.info smsd: GSM1: Signal Strength Indicator: (18,99) -77 dBm (Good), Bit Error Rate: not known or not detectable
Wed Jun 20 00:23:25 2018 daemon.info smsd: GSM1: Checking if Modem is registered to the network
Wed Jun 20 00:23:25 2018 daemon.debug smsd: GSM1: -> AT+CREG?
Wed Jun 20 00:23:25 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:23:25 2018 daemon.debug smsd: GSM1: <- +CREG: 2,5,53FC,B9AE OK
Wed Jun 20 00:23:25 2018 daemon.info smsd: GSM1: Modem is registered to a roaming partner network
Wed Jun 20 00:23:25 2018 daemon.info smsd: GSM1: Selecting PDU mode
Wed Jun 20 00:23:26 2018 daemon.debug smsd: GSM1: -> AT+CMGF=0
Wed Jun 20 00:23:26 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:23:26 2018 daemon.debug smsd: GSM1: <- OK ^DSFLOWRPT:00000E96,00000000,00000000,000000000002BB6F,000000000010D216,000F4240,00107AC0
Wed Jun 20 00:23:26 2018 daemon.info smsd: GSM1: Checking memory size
Wed Jun 20 00:23:26 2018 daemon.debug smsd: GSM1: -> AT+CPMS?
Wed Jun 20 00:23:26 2018 daemon.debug smsd: GSM1: Command is sent, waiting for the answer
Wed Jun 20 00:23:26 2018 daemon.debug smsd: GSM1: <- +CPMS: "SM",0,30,"SM",0,30,"SR",0,30 OK
Wed Jun 20 00:23:26 2018 daemon.info smsd: GSM1: Used memory is 0 of 30
Wed Jun 20 00:23:26 2018 daemon.info smsd: GSM1: No SMS received
Wed Jun 20 00:23:36 2018 daemon.info smsd: GSM1: Checking device for incoming SMS
Wed Jun 20 00:23:36 2018 daemon.info smsd: GSM1: Checking if modem is ready
Wed Jun 20 00:23:37 2018 daemon.err smsd: GSM1: Unexpected input: ^DSFLOWRPT:00000E98,00000000,00000000,000000000002BB6F,000000000010D216,000F4240,00107AC0 ^DSFLOWRPT:00000E9A,00000000,00000000,000000000002BB6F,000000000010D216,000F4240,00107AC0 ^DSFLOWRPT:00000E9C,00000000,00000000,000000000002BB6F,000000000010D216,000F4240,00107AC0 ^DSFLOWRPT:00000E9E,00000000,00000000,000000000002BB6F,000000000010D216,000F4240,00107AC0 ^DSFLOWRPT:00000EA0,00000000,00000000,000000000002BB6F,000000000010D216,000F4240,0010Wed Jun 20 00:23:37 2018 daemon.debug smsd: GSM1: -> ATok wygląda na to, że znalazłem odpowiedź.
Zmieniłem init na
init = AT+CPMS="SM","SM","SM"Mam jeszcze inną ciekawostkę, mianowicie przy restarcie znika mi katalog /var/spool/sms/report ,ale już tego nie drążę tylko wyhashowałem to w configu.
Każdy katalog z /var zniknie bo to w pamięci ram jest. Zrób katalogi na nośniku, np. usb i wskaż w konfigu ścieżkę do niego.
Strony 1
Zaloguj się lub zarejestruj by napisać odpowiedź
eko.one.pl → Oprogramowanie / Software → Reboot przy pomocy gsm/sms
Forum oparte o PunBB, wspierane przez Informer Technologies, Inc