BAB V KESIMPULAN DAN SARAN
5.2. Saran
Saran yang diberikan untuk pengembangan dan penyempurnaan penelitian ini dimasa mendatang adalah :
1. Sistem ini masih terdepat keterbatasan untuk mengamankan ruangan yang ada, karena sistem ini hanya memiliki satu alat pendeteksi yaitu sensor PIR. Sehingga disarankan untuk menambahkan alat pendeteksi baik sensor PIR ataupun sensor – sensor yang lain sesuai kebutuhan.
2. Pengembangan terhadap sistem ini sehingga terdapat fitur – fitur lain seperti live streaming dan lain sebagainya.
58
DAFTAR PUSTAKA
[1] CNN Indonesia : “Kejahatan Tertinggi di Yogya Terjadi di Sleman “ : https://www.cnnindonesia.com/nasional/20161031065421-20-168981/kejahatan- tertinggi-di-yogya-terjadi-di-sleman (Diakses Desember 2020)
[2] http://bappeda.jogjaprov.go.id/dataku/uu23/data_dasar/index/447-jumlah-kasus- pencurian?id_skpd=39 (Diakses Desember 2020)
[3] Angga Yolanda Putra, Hidayat Srihendayana dan Neilcy Tjahjamooniarsuh, 2015,
“Monitoring Kamera Pengintai Jarak Jauh Terintegrasi Dengan Google Drive Berbasis Raspberry Pi Via Internet”. Jurnal Teknik Elektro, Fakultas Teknik Universitas Tanjungpura (Diakses Desember 2021)
[4] Malik, Shadan. 2005. Enterprise Dashboards – Design and Best Practices for IT. John Wiley & Sons, Inc
[5] Few, Stephen. 2006. Information Dashboard Design. O’Reily;ISBN:0-59610016-7
[6] Indra Dharma Wijaya, Usman Nurhasan, Mula Agung Barata, 2017 “ Implementasi Raspberry Pi Untuk Rancang Bangun Sistem Keamanan Pintu Ruang Server Dengan Pengenalan Wajah Dengan menggunakan Metode Triangle Face”. Jurnal Informatika Polinema (Diakses pada Februari 2021)
[7] RaspberryPi,”Raspberry Pi 4 Model B Datasheet,” Datasheet P. 6,2019, [Online].
Available: https://static.raspberrypi.org/files/productbriefs/RaspberryPi4Product -Brief.pdf.
[8] “Raspberry Pi 4 Model B Community by element14 | element14.” [Online]. Available:
https://www.element14.com/community/community/raspberry-pi.
[9] “GPIO - Raspberry Pi Documentation,” Raspberry Pi. 2019, Accessed: Feb. 25, 2021.
[Online]. Available: https://www.raspberrypi.org/documentation/usage/gpio/.
[10] Encyclopedia, “Arsitektur Raspberry Pi,” J. Chem. Inf. Model., vol. 53, no. 9, pp.
1689–1699, 2019.
[11] “Raspberry Pi Camera Pinout - Arducam.” https://www.arducam.com/raspberry-pi- camera-pinout/ (accessed Feb. 22, 2021).
59
[12] Madcoms. 2010. Sistem Jaringan Komputer untuk Pemula. Yogyakarta: Penerbit ANDI. (Diakses Desember 2020).
[13] Raspberry Pi Foundation, “Camera Module,” Prod. Data, p. 10400, 2016, [Online]. Available:
https://www.raspberrypi.org/documentation/hardware/camera/README.md.
[14] Gambar Sensor PIR (Passive Infrared Receiver), [Online]. Available:
https://www.hwlibre.com/id/sensor-pir/
[15] …,…, Sensor PIR [Online]. Available :
http://sainsdanteknologiku.blogspot.com/2011/07/sensor-pir-passive-infra-red.html (Diakses Februari 2021)
[16] Ayudilah Triwahida. 2000 Sistem Pengaman Rumah Dengan Sensor PIR (Passive Infared Receiver berbasis ATMEGA 8535.
[17] Sensor PIR – Media Pembelajaran Elektronika, [Online]. Avaliable : http://ferballcompany.blogspot.com/2012/04/pir-sensor.html (Diakses pada Desember 2021)
[18] Gde Sastrawangsa; Pemanfaatan Telegram Bot Untuk Automatisasi Layanan Dan Informasi Mahasiswa Dalam Konsep Smart; Konferensi Nasional Sistem &
Informatika 2017; STMIK STIKOM Bali. (Diakses Februari 2021)
[19] Y. P. Atmojo, "Bot Alert Snort dengan Telegram Bot API padaInstrusion Detection System: Studi Kasus IDS pada ServerWeb," in Seminar Nasional Sistem Informasi dan TeknologiInformasi 2018, Pontianak, 2018. ( Diakses Februari 2021)
[20] https://cloudborneo.com/cara-install-dan-konfigurasi-rclone-untuk-backup-data-ke- berbagai-layanan-cloud/ (Diakses Februari 2021)
[21] Pengertian Raspbian , http://www.raspbian.org/ (Diakses 06 April 2021 )
[22] D. Triasanti, “Konsep dasar python,” Python, pp. 1–6, 2000. (Diakses 06 April 2021)
[23] A. Muhardian, "Membuat Bot Telegram Tanpa Menulis Kode Program (Coding),"
petanikode.com, 2016. [Online]. Available: https://www.petanikode.com/bot- telegram-tanpacoding/. (Diakses Februari 2021)
LAMPIRAN 1 LISTING PROGRAM
LAMPIRAN 1 LISTING PROGRAM 1
A. Program Sistem Keamanan
import collections
def movement_detected(self):
return bool(self.pir.motion_detected) #Fungsi boolean
#Telebot
class Telebot(telepot.Bot):
def __init__(self, token_id, chat_id):
super().__init__(token_id)
self._handle = collections.defaultdict(list) self.message_loop(self._postreceive)
self.chat_id = chat_id
L-2
return tuple(args[1:])
def _authorized_chat_id(self, incoming_chat_id):
return bool(int(self.chat_id) == int(incoming_chat_id)) def _postreceive(self, msg):
incoming_chat_id = msg['chat']['id']
self.command = msg['text']
if self._authorized_chat_id(incoming_chat_id):
args = self._get_args()
def __init__(self, folder): #deklarasi
self.camera = PiCamera() #self.camera menyimpan nilai dari Pi Camera dari
self.registration_folder = os.path.abspath(folder)
#self.registration_folder menyimpan nilai dari directori folder untuk menyimpan video
self.record = {} #Tempat u/ menyimpan nilai dari dict yang nantinya akan berisi nilai nama dan error pada start recording def start_recording(self, delay=60):
video_h264 = os.path.join(self.registration_folder,
'vid-' + time.strftime("%H%M%S-%Y%m%d") + '.h264') #Untuk merekam video berformat .h264
video_mp4 = os.path.join(self.registration_folder,
'vid-' + time.strftime("%H%M%S-%Y%m%d") + '.mp4') #Untuk merekan video berformat .mp4
self.camera.start_recording(video_h264) #self.camera memanggil fungsi start recording yang mempunyai nilai video .h264
time.sleep(int(delay))
self.camera.stop_recording()
error = self.__convert_h264_to_mp4(video_h264, video_mp4) self.record = {
def __convert_h264_to_mp4(h264, mp4):
command = "MP4Box -add {} {}".format(h264, mp4) #konversi format dari .h264 ke mp4
try:
subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) #saat konveresi berhasil
except subprocess.CalledProcessError as err:
error = 'FAIL:\ncmd:{}\noutput:{}'.format(err.cmd,
err.output) #saat konversi gagal, menampilkan pesan error di terminal python
subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True)
except subprocess.CalledProcessError as err:
result = 'FAIL:\ncmd:{}\noutput:{}'.format(err.cmd, err.output) #Untuk menampilkam pesan error kerika folder kosong tapi user menjalan perintah /clean
return result else:
result = 'Rekaman telah dihapus.' #jika video yang telah dibuat berhasil
return result #dihapus semua maka akan menghasilkan output bertipe String yaitu 'Rekaman telah di hapus'
B. Program Config
TOKEN_ID = '2035105776:AAHVjXZDfUMNwj0IDEBBwOcmSvgr1p87dNg' CHAT_ID = '1131238925'
VIDEO_TIME = 5
REGISTRATION_FOLDER ='/home/pi/Documents/SKRIPSI'
C. Program untuk Bot Telegram
import time
from config import TOKEN_ID, REGISTRATION_FOLDER, VIDEO_TIME, CHAT_ID from GABUNGAN import Camera, MotionDetector, Telebot
camera = Camera(REGISTRATION_FOLDER) bot = Telebot(TOKEN_ID, CHAT_ID) pir = MotionDetector()
L-4
@bot.handler("/activated") def on_start():
bot.is_listen = True
return bot.send_message("Security Camera Is Activated")
@bot.handler("/stop") def on_stop():
bot.is_listen = False
return bot.send_message("Security Camera Disabled")
@bot.handler("/status") def on_status():
return bot.send_message("Sistem Aktifkan") \
if bot.is_listen else bot.send_message("Sistem dinonaktifkan")
@bot.handler("/help") def on_help():
msg = "command usage:\n"
msg += "\t/activated : Menjalankan Sistem Keamanan\n"
msg += "\t/stop : Memberhentikan Sistem Keamanan\n"
msg += "\t/status : Status Sistem Keamanan \n"
msg += "\t/clean : Hapus Semua File Pada Google Drive\n"
msg += "\t/help : Menampilkan Bantuan\n"
return bot.send_message(msg)
@bot.handler("/clean") def on_clean():
return bot.send_message(camera.purge_records()) print('Sistem Keamanan Berjalan . . .')
try:
while True:
if bot.is_listen and pir.movement_detected():
bot.send_message("Pergerakan Terdeteksi\nSistem Mulai Merekam.")
D. Program untuk Sincronisasi Google Drive
# Edit this file to introduce tasks to be run by cron.
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
# For more information see the manual pages of crontab(5) and cron(8)
# m h dom mon dow command
* * * * sleep 10; /usr/bin/rclone sync /home/pi/Documents/SKRIPSI GDrive_TA:/backup &>/dev/null 2>&1
* * * * * sleep 20; /usr/bin/rclone sync /home/pi/Documents/SKRIPSI GDrive_TA:/backup &>/dev/null 2>&1
* * * * * sleep 30; /usr/bin/rclone sync /home/pi/Documents/SKRIPSI GDrive_TA:/backup &>/dev/null 2>&1
* * * * * sleep 40; /usr/bin/rclone sync /home/pi/Documents/SKRIPSI GDrive_TA:/backup &>/dev/null 2>&1
* * * * * sleep 50; /usr/bin/rclone sync /home/pi/Documents/SKRIPSI GDrive_TA:/backup &>/dev/null 2>&1
* * * * * sleep 59; /usr/bin/rclone sync /home/pi/Documents/SKRIPSI GDrive_TA:/backup &>/dev/null 2>&1
L-6
LAMPIRAN 2 DATASHEET
LAMPIRAN 2 DATASHEET 1
A. Datasheet Kamera
B. Datasheet Raspberry Pi 4 Model B
L-8
L-10
C. Datasheet Sensor PIR
L-12
LAMPIRAN 3
LAMPIRAN 3 1
A. Lembaran Revisi Pra-TA
L-14
B. Lembaran Monitoring TA
C. Lembaran Revisi TA
L-16