delete kurts version
This commit is contained in:
parent
eb0f8caeb4
commit
b1d0d2d681
73
REAME.md
73
REAME.md
|
|
@ -1,33 +1,30 @@
|
||||||
# RASPBERRY PI ALS ZENTRALRECHNER FUER BIENENSTOCKUEBERWACHUNG
|
# RASPBERRY PI ALS ZENTRALRECHNER FUER BIENENSTOCKUEBERWACHUNG
|
||||||
|
|
||||||
## Hardware Variante A
|
## Hardware
|
||||||
- Raspberry Pi Zero W
|
- Raspberry Pi Zero W
|
||||||
- 3G Stick Huawei E3531
|
- 3G/4G Stick Huawei E3533
|
||||||
|
|
||||||
## Hardware Variante B (Kurt Jakob)
|
|
||||||
- Raspberry Pi 3 Model B
|
|
||||||
- Itead Raspberry Pi GSM/GPRS Board (SIM800)
|
|
||||||
- ModMyPi Itead GSM Board Gehäuse
|
|
||||||
|
|
||||||
## INSTALLATION
|
## INSTALLATION
|
||||||
|
|
||||||
### Grundinstallation
|
### Grundinstallation
|
||||||
```
|
```
|
||||||
Image: 2017-09-07-raspbian-stretch-lite.zip von https://www.raspberrypi.org/downloads/raspbian/
|
Image: 2018-04-18-raspbian-stretch-lite.zip von https://www.raspberrypi.org/downloads/raspbian/
|
||||||
|
|
||||||
Installation auf SD:
|
Installation auf SD:
|
||||||
# unzip -p 2017-09-07-raspbian-stretch-lite.zip |dd of=/dev/sdXXX bs=4M conv=fsync
|
# unzip -p 2018-04-18-raspbian-stretch-lite.zip |dd of=/dev/sdXXX bs=4M conv=fsync
|
||||||
|
|
||||||
# raspi-config
|
# raspi-config
|
||||||
- Change User Password: meielis-...
|
- Change User Password: meielis-b...
|
||||||
- Hostname: beielipi
|
- Hostname: beielipi
|
||||||
|
- enable predicatble network interface names
|
||||||
- locale: en_US.utf8 (auch Default)
|
- locale: en_US.utf8 (auch Default)
|
||||||
- locale: de_CH.utf8
|
- locale: de_CH.utf8
|
||||||
- Timezone: Europe/Zurich
|
- Timezone: Europe/Zurich
|
||||||
- Change Wifi Country: CH
|
- Change Wifi Country: CH
|
||||||
- Keyboard: Generic 105-key (Intl), German (Switzerland)
|
- Keyboard: Generic 105-key (Intl), German (Switzerland)
|
||||||
- Enable SSH Server
|
- Enable SSH Server
|
||||||
- Fuer Variante A: WLAN einrichten (siehe "per WLAN")
|
- WLAN einrichten (siehe "per WLAN")
|
||||||
|
- reboot
|
||||||
|
|
||||||
# apt-get update
|
# apt-get update
|
||||||
# apt-get upgrade
|
# apt-get upgrade
|
||||||
|
|
@ -43,9 +40,6 @@ Software installieren:
|
||||||
# apt-get install ntpdate
|
# apt-get install ntpdate
|
||||||
# apt-get install dnsmasq
|
# apt-get install dnsmasq
|
||||||
# apt-get install python-bottle
|
# apt-get install python-bottle
|
||||||
|
|
||||||
Firmware-Update:
|
|
||||||
# rpi-update
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Zugang ermöglichen
|
### Zugang ermöglichen
|
||||||
|
|
@ -61,18 +55,28 @@ network={
|
||||||
ssid="haerdoepfu27" psk="XXXXXXXXXXXX"
|
ssid="haerdoepfu27" psk="XXXXXXXXXXXX"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
#### per LAN
|
|
||||||
|
### Boot Config anpassen
|
||||||
|
|
||||||
|
in /boot/config.txt
|
||||||
|
|
||||||
```
|
```
|
||||||
root@beielipi:~# cat /etc/network/interfaces.d/eth0
|
dtparam=audio=off
|
||||||
auto eth0
|
|
||||||
iface eth0 inet static
|
|
||||||
address 192.168.0.50
|
|
||||||
netmask 255.255.255.0
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Variante A
|
### Strom sparen
|
||||||
|
|
||||||
|
```
|
||||||
|
/etc/rc.local einfuegen:
|
||||||
|
# Disable HDMI to save power
|
||||||
|
# Joerg Lehmann, 2.4.2018
|
||||||
|
/usr/bin/tvservice -o
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
```
|
||||||
|
|
||||||
|
### Einrichten GSM
|
||||||
```
|
```
|
||||||
Einrichten GSM:
|
|
||||||
/etc/usb_modeswitch.d/12d1:157d:
|
/etc/usb_modeswitch.d/12d1:157d:
|
||||||
#Huawei E3533
|
#Huawei E3533
|
||||||
TargetVendor=0x12d1
|
TargetVendor=0x12d1
|
||||||
|
|
@ -81,6 +85,7 @@ MessageContent="55534243123456780000000000000011063000000000010000000000000000"
|
||||||
NoMBIMCheck=1
|
NoMBIMCheck=1
|
||||||
|
|
||||||
/etc/usb_modeswitch.conf:
|
/etc/usb_modeswitch.conf:
|
||||||
|
DisableMBIMGlobal=1
|
||||||
SetStorageDelay=8
|
SetStorageDelay=8
|
||||||
|
|
||||||
Workaround fuer USB disconnects:
|
Workaround fuer USB disconnects:
|
||||||
|
|
@ -116,22 +121,6 @@ OK AT+CPMS="SM";+CNMI=2,0,0,2,1
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Variante B
|
|
||||||
```
|
|
||||||
# systemctl disable hciuart.service
|
|
||||||
|
|
||||||
# cat /boot/config.txt
|
|
||||||
...
|
|
||||||
# Wegen GSM Modul
|
|
||||||
dtoverlay=pi3-miniuart-bt
|
|
||||||
#dtoverlay=pi3-disable-bt
|
|
||||||
enable_uart=1
|
|
||||||
===
|
|
||||||
|
|
||||||
# cat /boot/cmdline.txt
|
|
||||||
dwc_otg.lpm_enable=0 root=PARTUUID=61612258-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
|
|
||||||
===
|
|
||||||
```
|
|
||||||
|
|
||||||
### Test SMS-Versand:
|
### Test SMS-Versand:
|
||||||
```
|
```
|
||||||
|
|
@ -167,14 +156,8 @@ beieli@beielipi:~ $ exit
|
||||||
# for i in $(find . -type f); do echo cp $i /$i ; done
|
# for i in $(find . -type f); do echo cp $i /$i ; done
|
||||||
# for i in $(find . -type f); do cp $i /$i ; done
|
# for i in $(find . -type f); do cp $i /$i ; done
|
||||||
|
|
||||||
Fuer Variante A wieder loeschen:
|
|
||||||
# rm /etc/cron.d/gsm_poweron
|
|
||||||
|
|
||||||
# systemctl enable beielimon
|
# systemctl enable beielimon
|
||||||
# systemctl enable smsmon
|
# systemctl enable smsmon
|
||||||
Fuer Variante B:
|
|
||||||
# systemctl disable dhcpcd
|
|
||||||
|
|
||||||
|
|
||||||
Reboot:
|
Reboot:
|
||||||
# init 6
|
# init 6
|
||||||
|
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
#!/usr/bin/python
|
|
||||||
#
|
|
||||||
# Simuliert das Druecken des Powerkeys, um das GSM-Modul an- oder abzuschalten
|
|
||||||
#
|
|
||||||
import time
|
|
||||||
import RPi.GPIO as GPIO
|
|
||||||
|
|
||||||
# RPi.GPIO Layout verwenden (wie Pin-Nummern)
|
|
||||||
GPIO.setmode(GPIO.BOARD)
|
|
||||||
|
|
||||||
# Pin 11 (GPIO 17) auf Output setzen
|
|
||||||
GPIO.setup(11, GPIO.OUT)
|
|
||||||
|
|
||||||
# Druecken simulieren
|
|
||||||
GPIO.output(11, GPIO.HIGH)
|
|
||||||
|
|
||||||
# Pause, mindestens eine Sekunde gemaess https://www.itead.cc/wiki/RPI_SIM800_GSM/GPRS_ADD-ON_V2.0
|
|
||||||
time.sleep(1.5)
|
|
||||||
|
|
||||||
# Weg vom Taster...
|
|
||||||
GPIO.output(11, GPIO.LOW)
|
|
||||||
|
|
||||||
# Cleanup
|
|
||||||
GPIO.cleanup()
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
#!/usr/bin/python
|
|
||||||
#
|
|
||||||
# GSM-Modul anschalten, falls ein keine Antwort gibt...
|
|
||||||
#
|
|
||||||
import time
|
|
||||||
import RPi.GPIO as GPIO
|
|
||||||
import serial
|
|
||||||
|
|
||||||
def PowerOn():
|
|
||||||
# RPi.GPIO Layout verwenden (wie Pin-Nummern)
|
|
||||||
GPIO.setmode(GPIO.BOARD)
|
|
||||||
|
|
||||||
# Pin 11 (GPIO 17) auf Output setzen
|
|
||||||
GPIO.setup(11, GPIO.OUT)
|
|
||||||
|
|
||||||
# Druecken simulieren
|
|
||||||
GPIO.output(11, GPIO.HIGH)
|
|
||||||
|
|
||||||
# Pause, mindestens eine Sekunde gemaess https://www.itead.cc/wiki/RPI_SIM800_GSM/GPRS_ADD-ON_V2.0
|
|
||||||
time.sleep(1.5)
|
|
||||||
|
|
||||||
# Weg vom Taster...
|
|
||||||
GPIO.output(11, GPIO.LOW)
|
|
||||||
|
|
||||||
# Cleanup
|
|
||||||
GPIO.cleanup()
|
|
||||||
|
|
||||||
with serial.Serial('/dev/ttyAMA0', 115200, timeout=2) as ser:
|
|
||||||
ser.write(b'AT\n')
|
|
||||||
line = ser.readline()
|
|
||||||
line = ser.readline()
|
|
||||||
print "Feedback: %s" % (line)
|
|
||||||
if line.strip() != "OK":
|
|
||||||
print "Modem reagiert nicht, evtl. abgeschaltet... wir schalten es ein..."
|
|
||||||
PowerOn()
|
|
||||||
ser.close() # close port
|
|
||||||
Loading…
Reference in New Issue