diff --git a/groundstation/fc_block_decode.py b/groundstation/fc_block_decode.py index a1a03efb..c3f87ac2 100644 --- a/groundstation/fc_block_decode.py +++ b/groundstation/fc_block_decode.py @@ -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 = '
\n\nFunCube CubeSatSim Telemetry\n\n
' # 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}
Vx: {Vx} mV Vy: {Vy} mV Vz: {Vz} mV" foot_string = "
\n" with open("/home/pi/CubeSatSim/groundstation/public_html/index.html", "w") as html_file: html_file.write(head_string)