Update fc_block_decode.py change to 0 - Ic

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

@ -33,8 +33,8 @@ head_string = '<HEAD><meta http-equiv="refresh" content="5"></HEAD>\n<HTML>\n<H2
'<p><pre> <img height="256" width="320" src="image_file.jpeg"><br>'
foot_string = "</pre></p>\n</HTML>"
telem_string = f"\nSequence number: {sequence:5d} Image ID: {image_id:3d} count: {image_count:2d}<p>" + \
f"Vx (mv): {Vx:5d} Vy (mV): {Vy:5d} Vz (mV): {Vz:5d}<p>" + \
f"Ix (mA): {Ix:5d} Iy (mA): {Iy:5d} Iz (mA): {Iz:5d}<p> Vbat: {Vb:5d} mV Ibat: {Ib:5d} mA"
f" Vx(mV): {Vx:5d} Vy(mV): {Vy:5d} Vz(mV): {Vz:5d}<p>" + \
f" Ix(mA): {Ix:5d} Iy(mA): {Iy:5d} Iz(mA): {Iz:5d}<p> Vbat(mV): {Vb:5d} Ibat(mA): {Ib:5d}"
with open("/home/pi/CubeSatSim/groundstation/public_html/index.html", "w") as html_file:
html_file.write(head_string)
html_file.write(telem_string)
@ -83,7 +83,7 @@ if __name__ == "__main__":
Ic = (0x03 & data_block[extended + FC_EPS + 10]) * 2**8 + data_block[extended + FC_EPS + 11] * 2**2 + (data_block[extended + FC_EPS + 12] >> 6)
Ib = data_block[extended + FC_EPS + 12] * 2**4 + (data_block[extended + FC_EPS + 13] >> 4)
if (Ib == 0):
Ib = (-1) * Ic
Ib = 0 = Ic
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):
@ -133,9 +133,8 @@ if __name__ == "__main__":
system("/home/pi/ssdv/ssdv -d -J /home/pi/fctelem/image_file " + filename)
system("cp " + filename + " /home/pi/CubeSatSim/groundstation/public_html/image_file.jpeg")
telem_string = f"\nSequence number: {sequence:5d} Image ID: {image_id:3d} count: {image_count:2d}<p>" + \
f"Vx (mv): {Vx:5d} Vy (mV): {Vy:5d} Vz (mV): {Vz:5d}<p>" + \
f"Ix (mA): {Ix:5d} Iy (mA): {Iy:5d} Iz (mA): {Iz:5d}<p> Vbat: {Vb:5d} mV Ibat: {Ib:5d} mA"
with open("/home/pi/CubeSatSim/groundstation/public_html/index.html", "w") as html_file:
f" Vx(mV): {Vx:5d} Vy(mV): {Vy:5d} Vz(mV): {Vz:5d}<p>" + \
f" Ix(mA): {Ix:5d} Iy(mA): {Iy:5d} Iz(mA): {Iz:5d}<p> Vbat(mV): {Vb:5d} Ibat(mA): {Ib:5d}" with open("/home/pi/CubeSatSim/groundstation/public_html/index.html", "w") as html_file:
html_file.write(head_string)
html_file.write(telem_string)
html_file.write(foot_string)

Loading…
Cancel
Save

Powered by TurnKey Linux.