finalizare
This commit is contained in:
BIN
__pycache__/config.cpython-311.pyc
Normal file
BIN
__pycache__/config.cpython-311.pyc
Normal file
Binary file not shown.
9
app.py
9
app.py
@@ -8,6 +8,8 @@ import subprocess
|
|||||||
import urllib3
|
import urllib3
|
||||||
import threading
|
import threading
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
from datetime import datetime, timedelta # Import datetime and timedelta
|
||||||
|
|
||||||
urllib3.disable_warnings()
|
urllib3.disable_warnings()
|
||||||
|
|
||||||
# Configure logging
|
# Configure logging
|
||||||
@@ -131,7 +133,7 @@ def post_info_thread(info):
|
|||||||
led1 = OutputDevice(23)
|
led1 = OutputDevice(23)
|
||||||
led2 = OutputDevice(24)
|
led2 = OutputDevice(24)
|
||||||
name = "idmasa"
|
name = "idmasa"
|
||||||
logging.info(f"Variabila Id Masa A fost initializata", name)
|
logging.info("Variabila Id Masa A fost initializata ")
|
||||||
f = open("./data/idmasa.txt", "r") # deschid fisierul
|
f = open("./data/idmasa.txt", "r") # deschid fisierul
|
||||||
name = f.readline().strip() # citesc toate liniile
|
name = f.readline().strip() # citesc toate liniile
|
||||||
f.close() # inchid fisierul
|
f.close() # inchid fisierul
|
||||||
@@ -158,6 +160,7 @@ class Reader(rdm6300.BaseReader):
|
|||||||
post_info_thread(info)
|
post_info_thread(info)
|
||||||
led1.on()
|
led1.on()
|
||||||
logging.info(f"card inserted {card}")
|
logging.info(f"card inserted {card}")
|
||||||
|
logging.info(f"card removed {card}")
|
||||||
|
|
||||||
def card_removed(self, card):
|
def card_removed(self, card):
|
||||||
if card.value == 12886709:
|
if card.value == 12886709:
|
||||||
@@ -174,9 +177,9 @@ class Reader(rdm6300.BaseReader):
|
|||||||
else:
|
else:
|
||||||
logging.info(info)
|
logging.info(info)
|
||||||
post_info_thread(info)
|
post_info_thread(info)
|
||||||
led1.of()
|
led1.off()
|
||||||
logging.info(f"card removed {card}")
|
logging.info(f"card removed {card}")
|
||||||
|
logging.info(f"card removed {card}")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
29
data/log.txt
29
data/log.txt
@@ -0,0 +1,29 @@
|
|||||||
|
2025-02-28 11:19:01,515 - INFO - Log file is not older than 10 days: log.txt
|
||||||
|
2025-02-28 11:19:01,535 - INFO - Internet connection check loaded
|
||||||
|
2025-02-28 11:19:01,537 - INFO - Log file is not older than 10 days: log.txt
|
||||||
|
2025-02-28 11:19:01,574 - INFO - Internet is up! Waiting 45 minutes.
|
||||||
|
2025-02-28 11:19:01,575 - INFO - Reading backup data from tag.txt...
|
||||||
|
2025-02-28 11:19:01,580 - INFO - Posting backup data: https://dataswsibiusb01.sibiusb.harting.intra/RO_Quality_PRD/api/record/notconfig/4028355/1/2025-02-28&11:13:59
|
||||||
|
2025-02-28 11:19:01,580 - INFO - Variabila Id Masa A fost initializata
|
||||||
|
2025-02-28 11:19:01,586 - INFO - notconfig
|
||||||
|
2025-02-28 11:19:02,443 - INFO - Request sent, awaiting response...
|
||||||
|
2025-02-28 11:19:02,445 - ERROR - An error occurred: 404 Client Error: Not Found for url: https://dataswsibiusb01.sibiusb.harting.intra/RO_Quality_PRD/api/record/notconfig/4028355/1/2025-02-28&11:13:59
|
||||||
|
2025-02-28 11:19:02,448 - INFO - Backup data updated.
|
||||||
|
2025-02-28 11:19:11,167 - INFO - https://dataswsibiusb01.sibiusb.harting.intra/RO_Quality_PRD/api/record/notconfig/4028355/1/2025-02-28&11:19:11
|
||||||
|
|
||||||
|
2025-02-28 11:19:11,171 - INFO - Starting to post data...
|
||||||
|
2025-02-28 11:19:11,176 - INFO - card inserted CardData(value=4028355, checksum=219, type=82, is_valid=True)
|
||||||
|
2025-02-28 11:19:11,176 - INFO - card removed CardData(value=4028355, checksum=219, type=82, is_valid=True)
|
||||||
|
2025-02-28 11:19:11,887 - INFO - Request sent, awaiting response...
|
||||||
|
2025-02-28 11:19:11,891 - ERROR - An error occurred: 404 Client Error: Not Found for url: https://dataswsibiusb01.sibiusb.harting.intra/RO_Quality_PRD/api/record/notconfig/4028355/1/2025-02-28&11:19:11
|
||||||
|
2025-02-28 11:19:11,892 - INFO - Value https://dataswsibiusb01.sibiusb.harting.intra/RO_Quality_PRD/api/record/notconfig/4028355/1/2025-02-28&11:19:11
|
||||||
|
was saved to tag.txt
|
||||||
|
2025-02-28 11:19:14,529 - INFO - https://dataswsibiusb01.sibiusb.harting.intra/RO_Quality_PRD/api/record/notconfig/4028355/0/2025-02-28&11:19:14
|
||||||
|
|
||||||
|
2025-02-28 11:19:14,531 - INFO - Starting to post data...
|
||||||
|
2025-02-28 11:19:14,533 - INFO - card removed CardData(value=4028355, checksum=219, type=82, is_valid=True)
|
||||||
|
2025-02-28 11:19:14,536 - INFO - card removed CardData(value=4028355, checksum=219, type=82, is_valid=True)
|
||||||
|
2025-02-28 11:19:15,169 - INFO - Request sent, awaiting response...
|
||||||
|
2025-02-28 11:19:15,170 - ERROR - An error occurred: 404 Client Error: Not Found for url: https://dataswsibiusb01.sibiusb.harting.intra/RO_Quality_PRD/api/record/notconfig/4028355/0/2025-02-28&11:19:14
|
||||||
|
2025-02-28 11:19:15,171 - INFO - Value https://dataswsibiusb01.sibiusb.harting.intra/RO_Quality_PRD/api/record/notconfig/4028355/0/2025-02-28&11:19:14
|
||||||
|
was saved to tag.txt
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
https://dataswsibiusb01.sibiusb.harting.intra/RO_Quality_PRD/api/record/notconfig/4028355/1/2025-02-28&11:13:59
|
||||||
|
https://dataswsibiusb01.sibiusb.harting.intra/RO_Quality_PRD/api/record/notconfig/4028355/0/2025-02-28&11:14:07
|
||||||
|
https://dataswsibiusb01.sibiusb.harting.intra/RO_Quality_PRD/api/record/notconfig/4028355/1/2025-02-28&11:17:29
|
||||||
|
https://dataswsibiusb01.sibiusb.harting.intra/RO_Quality_PRD/api/record/notconfig/4028355/0/2025-02-28&11:17:34
|
||||||
|
https://dataswsibiusb01.sibiusb.harting.intra/RO_Quality_PRD/api/record/notconfig/4028355/1/2025-02-28&11:19:11
|
||||||
|
https://dataswsibiusb01.sibiusb.harting.intra/RO_Quality_PRD/api/record/notconfig/4028355/0/2025-02-28&11:19:14
|
||||||
|
|||||||
Reference in New Issue
Block a user