Update fc_block_decode.py and Vy and Vz

fc-7
Alan Johnston 10 months ago committed by GitHub
parent d007ddeb05
commit f162b67e2e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -48,8 +48,10 @@ if __name__ == "__main__":
print("CubeSatSim Frametype RT2+IMG2")
sequence = data_block[extended + 51] + data_block[extended + 50] * 2^16 + data_block[extended + 49] * 2^32
print("Sequence number: {:d}".format(sequence))
Vx = (data_block[extended + FC_EPS + 0] << 2) + (0x03 & data_block[extended + FC_EPS + 1])
print("Vx: {:d} mV".format(Vx))
Vx = (data_block[extended + FC_EPS + 0] * 2^6) + (data_block[extended + FC_EPS + 1] >> 2)
Vy = (0x03 & data_block[extended + FC_EPS + 1]) * 2^12 + data_block[extended + FC_EPS + 2] * 2^4 + (data_block[extended + FC_EPS + 3] >> 4)
Vz = (0x0f & data_block[extended + FC_EPS + 3]) * 2^10 + data_block[extended + FC_EPS + 4] * 2^2 + (data_block[extended + FC_EPS + 5] >> 6)
print("Vx: {:d} mV Vy: {:d} mV Vz: {:d} mV".format(Vx, Vy, Vz))
print('Payload {:x} {:x} \n'.format(data_block[FC_PAYLOAD + extended], data_block[FC_PAYLOAD + extended + 1]))
if (data_block[FC_PAYLOAD + extended] == 0x55) and (data_block[FC_PAYLOAD + extended + 1] == 0x68):
try:
@ -98,7 +100,7 @@ if __name__ == "__main__":
system("cp " + filename + " /home/pi/CubeSatSim/groundstation/public_html/image_file.jpeg")
head_string = '<HEAD><meta http-equiv="refresh" content="5"></HEAD>\n<HTML>\nFunCube CubeSatSim Telemetry\n<p>\n<img src="image_file.jpeg"><p>'
# telem_string = "\nSequence number: " + str(sequence) + "\nImage ID: " + str(image_id) + " count: " + str(image_count)
telem_string = f"\nSequence number: {sequence} Image ID: {image_id} count: {image_count}\nVx: {Vx} mV"
telem_string = f"\nSequence number: {sequence} Image ID: {image_id} count: {image_count}<p>Vx: {Vx} mV Vy: {Vy} mV Vz: {Vz} mV"
foot_string = "</p>\n</HTML>"
with open("/home/pi/CubeSatSim/groundstation/public_html/index.html", "w") as html_file:
html_file.write(head_string)

Loading…
Cancel
Save

Powered by TurnKey Linux.