internet_connection_watchdog

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
internet_connection_watchdog [17.06.2018 18:49] – created Pascal Suterinternet_connection_watchdog [17.06.2018 22:21] (current) – [GSM Link] Pascal Suter
Line 3: Line 3:
  
 so far, this is just a collection of snippets of information and links, i'll write it up into a nice article one day, but not today ;)  so far, this is just a collection of snippets of information and links, i'll write it up into a nice article one day, but not today ;) 
 +
 +===== software installation =====
 +  apt update && apt install wvdial gammu gammu-smsd picocom 
  
 ===== SMS ===== ===== SMS =====
Line 8: Line 11:
   * Hardware: TP-Link MA260   * Hardware: TP-Link MA260
   * on the tp-link stick the last serial device seems to be the one that can be used for sms (''gammu identify'' only gets information from that device). <code>gammu-detect | grep -B1 TP-LINK | grep ttyUSB | tail -n 1</code> to get the device name for the config   * on the tp-link stick the last serial device seems to be the one that can be used for sms (''gammu identify'' only gets information from that device). <code>gammu-detect | grep -B1 TP-LINK | grep ttyUSB | tail -n 1</code> to get the device name for the config
 +  * ''/etc/gammu-smsdrc.template''<code># Configuration file for Gammu SMS Daemon
 +
 +# Gammu library configuration, see gammurc(5)
 +[gammu]
 +port = %PORT%
 +connection = at
 +#logformat = textall
 +
 +# SMSD configuration, see gammu-smsdrc(5)
 +[smsd]
 +service = null
 +logfile = syslog
 +# Increase for debugging information
 +debuglevel = 0
 +RunOnReceive = /opt/process-sms.sh
 +</code>
 +  * ''/root/.gammurc''<code>[gammu]
 +device = %PORT%
 +connection = at
 +</code>
 +  * ''/opt/updateModemPort.sh'' <code bash updateModemPort.sh>
 +#!/bin/bash
 +port=$(gammu-detect | grep -B1 TP-LINK | grep ttyUSB | tail -n 1 | awk -F = '{print $2}' | tr -d " ")
 +sed -e "s|%PORT%|${port}|" /etc/gammu-smsdrc.template > /etc/gammu-smsdrc
 +sed -e "s|%PORT%|${port}|" /root/.gammurc.template > /root/.gammurc
 +</code>
   * installation: <code>apt install gammu gammu-smsd</code>   * installation: <code>apt install gammu gammu-smsd</code>
-  * +  * <code bash process-sms.sh>#!/bin/bash 
 +for i in `seq $SMS_MESSAGES` ; do 
 +    numvar="SMS_${i}_NUMBER" 
 +    textvar="SMS_${i}_TEXT"; 
 +    echo "${!numvar}:${!textvar}" >> /tmp/messages 
 +    if [ "${!textvar}" == "connect" ]; then 
 +      echo "connect!" >> /tmp/messages 
 +    fi 
 +done 
 +</code>
 ===== GSM Link ===== ===== GSM Link =====
-  * See above +  * Hardware: See above 
-  * +  * Software: wvdial  
 +  * config: ''/etc/wvdial.conf.template'' <code>[Dialer Defaults] 
 +Init1 = ATZ 
 +Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 
 +Init3 = AT+CGDCONT=1,"IP","internet" 
 +Modem Type = Analog Modem 
 +Baud = 960000 
 +New PPPD = yes 
 +Modem = %PORT%       
 +ISDN = 0 
 +Phone = *99# 
 +Password = { } 
 +Username = { } 
 +</code>
 ===== Relay Card ===== ===== Relay Card =====
   * Hardware: Conrad electronics, part number 967720 (Relaiskarte 8Fach Seriell)   * Hardware: Conrad electronics, part number 967720 (Relaiskarte 8Fach Seriell)
Line 20: Line 71:
   * via dual prolific basead usb to serial converter, one link goes to the relay card, the other to the serial terminal of the pfsense router.    * via dual prolific basead usb to serial converter, one link goes to the relay card, the other to the serial terminal of the pfsense router. 
   * usb link is extended down to the basement via cat7 link, I simply cut a usb extension cord into two and attached RJ45 plugs to both ends with identical pin layout. works like a charm :)    * usb link is extended down to the basement via cat7 link, I simply cut a usb extension cord into two and attached RJ45 plugs to both ends with identical pin layout. works like a charm :) 
 +  * software: ''picocom''
  
  
  
  • internet_connection_watchdog.1529254153.txt.gz
  • Last modified: 17.06.2018 18:49
  • by Pascal Suter