155 lines
3.2 KiB
Markdown
155 lines
3.2 KiB
Markdown
# RASPBERRY PI ALS ZENTRALRECHNER FUER BIENENSTOCKUEBERWACHUNG
|
|
|
|
## Hardware Variante A
|
|
- Raspberry Pi Zero W
|
|
- 3G Stick Huawei E3531
|
|
|
|
## Hardware Variante B (Kurt Jakob)
|
|
- Raspberry Pi 3 Model B
|
|
- Itead Raspberry Pi GSM/GPRS Board (SIM800)
|
|
- ModMyPi Itead GSM Board Gehäuse
|
|
|
|
## INSTALLATION
|
|
|
|
### Grundinstallation
|
|
```
|
|
Image: 2017-09-07-raspbian-stretch-lite.zip von https://www.raspberrypi.org/downloads/raspbian/
|
|
|
|
Installation auf SD:
|
|
# unzip -p 2017-09-07-raspbian-stretch-lite.zip |dd of=/dev/sdXXX bs=4M conv=fsync
|
|
|
|
# raspi-config
|
|
- Change User Password: meielis-...
|
|
- Hostname: beielipi
|
|
- locale: en_US.utf8 (auch Default)
|
|
- locale: de_CH.utf8
|
|
- Timezone: Europe/Zurich
|
|
- Change Wifi Country: CH
|
|
- Keyboard: Generic 105-key (Intl), German (Switzerland)
|
|
|
|
# apt-get update
|
|
# apt-get upgrade
|
|
|
|
Software installieren:
|
|
# apt-get install gammu python-gammu
|
|
# apt-get install python-serial
|
|
# apt-get install python-yaml
|
|
# apt-get install minicom
|
|
# apt-get install ppp
|
|
# apt-get install python-pexpect
|
|
# apt-get install hostapd
|
|
# apt-get install ntpdate
|
|
# apt-get install dnsmasq
|
|
|
|
Firmware-Update:
|
|
# rpi-update
|
|
```
|
|
|
|
### Zugang ermöglichen per WLAN
|
|
```
|
|
# cat /etc/wpa_supplicant/wpa_supplicant.conf
|
|
country=CH
|
|
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
|
|
update_config=1
|
|
|
|
network={
|
|
ssid="haerdoepfu27"
|
|
psk="XXXXXXXXXXXX"
|
|
}
|
|
```
|
|
|
|
### Variante A
|
|
```
|
|
Einrichten GSM:
|
|
/etc/usb_modeswitch.d/12d1:1f01:
|
|
# Huawei E353 (3.se)
|
|
|
|
DefaultVendor=0x12d1
|
|
DefaultProduct=0x1f01
|
|
TargetVendor=0x12d1
|
|
TargetProduct=0x1f01
|
|
|
|
MessageContent="55534243123456780000000000000011062000000100000000000000000000"
|
|
NoDriverLoading=1
|
|
|
|
|
|
/root/.gammurc:
|
|
; Configuration file generated by gammu-detect.
|
|
; Please check The Gammu Manual for more information.
|
|
|
|
[gammu]
|
|
device = /dev/ttyUSB0
|
|
name = Phone on USB serial port HUAWEI HUAWEI_Mobile
|
|
connection = at
|
|
|
|
[gammu1]
|
|
device = /dev/ttyUSB1
|
|
name = Phone on USB serial port HUAWEI HUAWEI_Mobile
|
|
connection = at
|
|
|
|
[gammu2]
|
|
device = /dev/ttyUSB2
|
|
name = Phone on USB serial port HUAWEI HUAWEI_Mobile
|
|
connection = at
|
|
|
|
|
|
Quick Tutorial Gammu:
|
|
https://wammu.eu/docs/manual/quick/index.html
|
|
|
|
```
|
|
|
|
### Variante B
|
|
```
|
|
# systemctl disable hciuart.service
|
|
|
|
# cp install/files/etc/cron.d/gsm_poweron /etc/cron.d
|
|
|
|
# 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:
|
|
```
|
|
gammu sendsms TEXT 0765006123 -text "Halooo von beielipi"
|
|
```
|
|
|
|
|
|
### Installation Applikation
|
|
```
|
|
User/Gruppe erstellen:
|
|
# groupadd -g 2000 beieli
|
|
# useradd -m -g beieli beieli -s /bin/bash
|
|
# usermod -a -G gammu beieli
|
|
# usermod -a -G dialout beieli
|
|
|
|
Passwoerter anpassen:
|
|
# passwd pi => meielis-...
|
|
|
|
# Aus Git uebernehmen:
|
|
(auf anderem Rechner):
|
|
$ git clone https://git.nbit.ch/joerg/beielipi.git
|
|
$ cd beielipi
|
|
$ tar cvf /var/tmp/beielipi-git-files.tar .
|
|
|
|
# cd /home/beieli && tar xvf /var/tmp/beielipi-git-files.tar
|
|
# su - beieli
|
|
beieli@beielipi:~ $ mkdir config_backups data send_sms_queue tmp web-csv
|
|
beieli@beielipi:~ $ exit
|
|
# cd /home/beieli/install_files
|
|
# for i in $(find . -type f); do echo cp $i /$i ; done
|
|
|
|
Reboot:
|
|
# init 6
|
|
|
|
|
|
```
|