Update transmit.py FC send stored image if no camera

fc-jy-img
Alan Johnston 11 months ago committed by GitHub
parent 30aa9bb422
commit 6baa23169e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -136,10 +136,17 @@ def increment_mode():
print("can't write to .mode file")
def camera_photo():
stored_image = False
try:
system("raspistill -o /home/pi/CubeSatSim/camera_out.jpg -w 320 -h 256") # > /dev/null 2>&1")
f = open("/home/pi/CubeSatSim/camera_out.jpg")
f.close()
print("Photo taken")
except:
system("cp /home/pi/CubeSatSim/sstv//sstv_image_2_320_x_256.jpeg /home/pi/CubeSatSim/camera_out.jpg")
print("Using stored image")
stored_image = True
if (stored_image == False):
file='/home/pi/CubeSatSim/camera_out.jpg'
font1 = ImageFont.truetype('DejaVuSerif.ttf', 20)
font2 = ImageFont.truetype('DejaVuSerif-Bold.ttf', 16)
@ -155,8 +162,8 @@ def camera_photo():
img = Image.open(file)
draw = ImageDraw.Draw(img)
# draw.text((10, 10), callsign, font=font2, fill='white')
# draw.text((120, 10), telem_string, font=font2, fill='white')
# draw.text((10, 10), callsign, font=font2, fill='white')
# draw.text((120, 10), telem_string, font=font2, fill='white')
draw.text((12, 12), callsign, font=font1, fill='black')
draw.text((10, 10), callsign, font=font1, fill='white')
draw.text((122, 12), telem_string, font=font2, fill='black')

Loading…
Cancel
Save

Powered by TurnKey Linux.