I created a home security project using a few ESP8266 boards and a Raspberry Pi. I’m running the main app on python on the Pi and trying upload the log files to a file hosting site so I can use the file hosting site as the middleware and monitor them logs remotely. Most ideal solution would be a database. But I don’t want to port forward. Also I don’t wanna pay for hosting.
I’m trying to upload the log using this code but it doesn’t work.
import os
import requests
headers = {"User-Agent": "Mozilla/5.0"}
payload = {"days":30, "hours":0, "minutes":0, "uploaded-file":open(os.path.join("log.txt"), "rb")}
session = requests.Session()
session.post("https://use.run/app/handler", headers=headers, data=payload)
Can anyone spot the error?
Thanks
Luna