Members:
- Do Duy Huy Hoang
- Nguyen Dinh Mau
- Control raspberry Pi via smartphone
- Student internship: Set up a Raspberry Pi to send SMS notifications
- Features:
- Number images record
- Free storage capacity of SD card
- Number images record
- Power of the battery
- ...(More to come!)
- Linux ≥ 2.6.13
- Python ≥ 2.4 (including Python 3.x)
- Bash
- Gammu
- An USB Huawei Dcom or GSM module 800l
Python 2.7 code to interface a cheap 2G SIM800L to a cheap Raspberry Pi 3
- Hook up the SIM800 to the Pi Zero with a few wires:
SIM800 Pin | Pi Zero Pin |
---|---|
5V | Pin 2 - 5V |
GND | Pin 6 - GND |
VDD | Pin 4 - 5V |
TX | Pin 10 - GPIO15 - RX |
RX | Pin 8 - GPIO14 - TX |
GND | Pin 14 - GND |
RST | Pin - |
- | - |
- Insert your SIM card into the SIM800
Check python is installed on your computer
python --version
python3 --version
Use command
sudo apt-get update & apt-get upgrade
sudo apt-get install gammu
sudo apt-get install python-gammu
sudo apt-get install gammu-smsd
sudo apt-get install libgammu-dev
Connect your DCOM to your Raspberry Pi then:
dmesg | grep tty
[7.578478] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB0
[7.697942] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB1
gammu-config
set port /dev/ttyUSB0
sudo gammu-config
set port /dev/ttyUSB0
sudo gammu --identify
Device : /dev/ttyUSB0
Manufacturer : Huawei
Model : E220 (E220)
Firmware : 11.117.03.01.156
IMEI : 3XX19301XXXXXX3
SIM IMSI : 2XXXX923271XXX1
echo "some message" | gammu --sendsms TEXT 07921XXXXXX
git clone https://github.com/huyhoang8398/IOT-USTH
cd IOT-USTH
cd GSM
python GSM.py
To install pip follow http://www.pip-installer.org/en/latest/installing.html
sudo pip install pyinotify
Install pyinotify and run this command from a shell:
$ python -m pyinotify -v /my-dir-to-watch
git clone https://github.com/huyhoang8398/IOT-USTH
cd IOT-USTH
cd pyinotify
python inotify.py >> /home/pi/scann/test.txt
Test the result
cd /home/pi/scann
touch test.jpg
vi test.txt
sudo apt-get install crontab
To config crontab use:
crontab -e
cd bin
chmod +x info.sh
./info.sh
sudo apt-get install inotifytools
inotifywait -e modify,delete,create -m -r --timefmt '%F-%T' --format '%:e | %f | %T' <watch-dir> -o <output-file>