30 lines
1.1 KiB
Plaintext
30 lines
1.1 KiB
Plaintext
# <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ESP8266 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
|
#Setelah identifikasi wajah berhasil
|
|
# def activate_relay():
|
|
# esp32_ip = "192.168.98.34"
|
|
# endpoint = "http://" + esp32_ip + "/activate_relay"
|
|
|
|
# # Kirim permintaan HTTP ke ESP32
|
|
# try:
|
|
# response = requests.get(endpoint)
|
|
# if response.status_code == 200:
|
|
# print("Relay telah diaktifkan")
|
|
# else:
|
|
# print("Gagal mengaktifkan relay")
|
|
# except Exception as e:
|
|
# print("Error:", e)
|
|
|
|
# def activate_buzzer():
|
|
# esp32_ip = "192.168.80.34"
|
|
# endpoint = "http://" + esp32_ip + "/activate_buzzer"
|
|
|
|
# # Kirim permintaan HTTP ke ESP32
|
|
# try:
|
|
# response = requests.get(endpoint)
|
|
# if response.status_code == 200:
|
|
# print("Buzzer telah diaktifkan")
|
|
# else:
|
|
# print("Gagal mengaktifkan Buzzer.")
|
|
# except Exception as e:
|
|
# print("Error:", e)
|