diff --git a/companion_software/BasicBot.py b/companion_software/BasicBot.py new file mode 100644 index 0000000..d06675a --- /dev/null +++ b/companion_software/BasicBot.py @@ -0,0 +1,23 @@ +from discord_webhook import DiscordWebhook +from picamera import PiCamera +from time import sleep + + +def get_uptime(): + with open('/proc/uptime', 'r') as f: + uptime_seconds = float(f.readline().split()[0]) + + return uptime_seconds + +webhookURL = "https://discord.com/api/webhooks/856609966404534272/TR9tnLq2sIGZoOeADNswmGRNlzBcqM5aKihfU6snVTP9WhSSoVVvi7nT6i-ZfZS7Hcqm" + +webhook = DiscordWebhook(url=webhookURL, content="Uptime: " + str( round( ((get_uptime() / 60) / 60 ), 2 )) + " hours") + +camera = PiCamera() +sleep(3) # let iso settle out +camera.capture('still.jpg') + +with open("still.jpg", "rb") as f: + webhook.add_file(file=f.read(), filename='still.jpg') +response = webhook.execute() # Hit send + diff --git a/crawler_software/config/hardware.yaml b/crawler_software/raspberry_pi/config/hardware.yaml similarity index 100% rename from crawler_software/config/hardware.yaml rename to crawler_software/raspberry_pi/config/hardware.yaml diff --git a/requirements.txt b/crawler_software/raspberry_pi/requirements.txt similarity index 100% rename from requirements.txt rename to crawler_software/raspberry_pi/requirements.txt diff --git a/crawler_software/servo_test.py b/crawler_software/raspberry_pi/servo_test.py similarity index 100% rename from crawler_software/servo_test.py rename to crawler_software/raspberry_pi/servo_test.py diff --git a/crawler_software/sstv.py b/crawler_software/raspberry_pi/sstv.py similarity index 100% rename from crawler_software/sstv.py rename to crawler_software/raspberry_pi/sstv.py