diff --git a/celestron.py b/celestron.py index 499d710..b41159e 100644 --- a/celestron.py +++ b/celestron.py @@ -5,7 +5,7 @@ __copyright__ = "Copyright 2021, Patricio Latini" __credits__ = "Patricio Latini" __license__ = "GPLv3" -__version__ = "0.9.27" +__version__ = "0.9.30" __maintainer__ = "Patricio Latini" __email__ = "p_latini@hotmail.com" __status__ = "Production" @@ -20,7 +20,7 @@ import argparse import os from datetime import datetime,timezone -#from PIL import Image +from PIL import Image, ImageDraw global triggerscan triggerscan = ' ' @@ -35,7 +35,7 @@ global verbose verbose = False global starsensesave -starsensesave = False +starsensesave = True global filecsvoutput filecsvoutput = False global rawfileoutput @@ -50,13 +50,28 @@ mounts = { 0x01 : 'Nexstar GPS Legacy', 0x0001 : 'Nexstar GPS', + ### 0x05xx : 'CGE', + ### 0x06xx : 'Advanced GT', 0x0783 : 'Nexstar SLT', + ### 0x09xx : 'CPC', + ### 0x0axx : 'GT', + 0x0b83 : '4/5SE', + 0x0c82 : '6/8SE', + ### 0x0dxx : 'CGE Pro', + ### 0x0exx : 'CGEM DX', + ### 0x0fxx : 'LCM', + ### 0x10xx : 'Skyprodigy', 0x1189 : 'CPC Deluxe', 0x1283 : 'GT Series', + ### 0x13xx : 'Starseeker', 0x1485 : 'AVX', + ### 0x15xx : 'Cosmos', 0x1687 : 'Nexstar Evolution', - 0x1788 : 'CGX', - 0x0c82 : '6/8SE'} + 0x1788 : 'CGX'} + ### 0x18xx : 'CGXL', + ### 0x19xx : 'Astrofi', + ### 0x1axx : 'SkyWatcher'} + devices = { 0x01 : 'Main Board', @@ -263,12 +278,11 @@ (0xb3, 0xfe) : 'WIFI_GET_FW_VER', (0xb4, 0x3e) : 'SS_SET_ALIGN_CENTER', (0xb4, 0x3f) : 'SS_GET_ALIGN_CENTER', - (0xb4, 0x90) : 'SS_GET_ALIGN_CAPTUR', - (0xb4, 0x91) : 'SS_GET_STAR_COUNT', - (0xb4, 0x92) : 'SS_GET_IMAGE2', - (0xb4, 0x94) : 'SS_GET_IMAGE1', + (0xb4, 0x90) : 'SS_RESET_CAPTURE', + (0xb4, 0x91) : 'SS_GET_STATUS', + (0xb4, 0x92) : 'SS_GET_CAPTURE_DATA', + (0xb4, 0x94) : 'SS_START_CAPTURE', (0xb4, 0x9f) : 'SS_GET_IMAGE3', - (0xb4, 0x3f) : 'SS_ALIGN_CENTER', (0xb4, 0xfe) : 'SS_GET_FW_VER', (0xb5, 0xfe) : 'WIFI_GET_FW_VER', (0xb6, 0x10) : 'BAT_GET_VOLTAGE', @@ -379,6 +393,10 @@ def decodecommandvalue(sender,device,command,commandvalue): commandvalue = format(int(centerx, 16)) + ' - ' + format(int(centery, 16)) else: commandvalue = format(int(commandvalue[0],16)) + if hex(command) == '0x91' or hex(command) == '0x92' or hex(command) == '0x94' or hex(command) == '0x9f': + if hex(int(commandvalue[0],16)) == '0x1': commandvalue = '1 (Error)' + ' - Stars: ' + format(int(commandvalue[1], 16)) + elif hex(int(commandvalue[0],16)) == '0x3': commandvalue = '3 (Ready)' + ' - Stars: ' + format(int(commandvalue[1], 16)) + elif hex(int(commandvalue[0],16)) == '0x9': commandvalue = '9 (Finished)' + ' - Stars: ' + format(int(commandvalue[1], 16)) elif hex(device) == '0x17': if hex(command) == '0x0': commandvalue = format(int(''.join([format(int(c, 16), '02x') for c in commandvalue[0:2]]), 16)/1000) + ' V - ' + format(int(''.join([format(int(c, 16), '02x') for c in commandvalue[2:4]]), 16)/1000) + ' A ' @@ -517,7 +535,7 @@ def decodemsg(msg): xprint (output) def decodestarsensestar(msg): - ssxfov=6.88 + ssxfov=5.16 ssyfov=5.16 msg="".join(reversed([msg[i:i+2] for i in range(0, len(msg), 2)])) bx,px,by,py=int(msg[0:2],16)-64,int(msg[2:8],16),int(msg[8:10],16)-64,int(msg[10:16],16) @@ -532,14 +550,14 @@ def starsensepixel(msg,ssxres,ssyres): msg="".join(reversed([msg[i:i+2] for i in range(0, len(msg), 2)])) bx,px,by,py=int(msg[0:2],16)-64,int(msg[2:8],16),int(msg[8:10],16)-64,int(msg[10:16],16) pixelx = int(ssxres/2+(twos_comp(int(msg[2:8],16),24)*ssxres/pow(2,24))) - pixely = int(ssyres/2+(twos_comp(int(msg[10:16],16),24)*ssyres/pow(2,24))) + pixely = int(ssyres/2-(twos_comp(int(msg[10:16],16),24)*ssyres/pow(2,24))) return pixelx,pixely,bx,by def decodemsg3c(msg): global starsensesave starlen=2*8 pixellist = [] - ssxres=1280 + ssxres=960 ssyres=960 byte=0 sum=0 @@ -566,39 +584,27 @@ def decodemsg3c(msg): dumptext = ' --- ' + str(msg) else: dumptext = '' - output = str(format(round(time.time()-starttime,6),'14.6f')) + " - " + "Starsense HC Data - " + str(int(length)/8) + " Stars" + msg[5*2:-2] + dumptext + output = str(format(round(time.time()-starttime,6),'14.6f')) + " - " + "Starsense HC Data - " + str(int(length)/8) + " Stars " + msg[5*2:-2] + dumptext xprint (output) data=msg[5*2:-2] stars=[data[i:i+starlen] for i in range(0, len(data), starlen)] for star in stars: if star!="0000000000000000": - xprint(" Star ",stars.index(star)+1," - ",decodestarsensestar(star)) + xprint(" Star",stars.index(star)+1," - ",decodestarsensestar(star)) pixellist.append(starsensepixel(star,ssxres,ssyres)) if starsensesave: img = Image.new('L', (ssxres, ssyres)) - imagedata = [0] * ssxres * ssyres for pixel in pixellist: - imagedata[pixel[0]+pixel[1]*ssxres] = 255 - if pixel[2]>1: - imagedata[(pixel[0]+1)+pixel[1]*ssxres] = 255 - if pixel[2]>2: - imagedata[(pixel[0]-1)+pixel[1]*ssxres] = 255 - if pixel[2]>3: - imagedata[(pixel[0]+2)+pixel[1]*ssxres] = 255 - if pixel[3]>1: - imagedata[pixel[0]+(pixel[1]+1)*ssxres] = 255 - if pixel[3]>2: - imagedata[pixel[0]+(pixel[1]-1)*ssxres] = 255 - if pixel[3]>3: - imagedata[pixel[0]+(pixel[1]+2)*ssxres] = 255 - img.putdata(imagedata) - img.save('starsense-image.png') + shape = [pixel[0],pixel[1],pixel[0]+pixel[2]-1,pixel[1]+pixel[3]] + img1 = ImageDraw.Draw(img) + img1.rectangle(shape, fill ="white", outline ="white") + imgfilename = 'starsense-image-' + datetime.now().strftime("%Y%m%d-%H%M%S") + '.png' + img.save(imgfilename) if filecsvoutput: - fileoutput = str(format(round(time.time()-starttime,6),'14.6f')) + "," + "Starsense Camera" + "," + "0xb4" + "," + "All" + "," + "0x00" + "," + "Data" + "," + "0x00" + "," + "[]" + "," + str(msg) - print(fileoutput, file=open('auxbuslog.csv', 'a')) + fileoutput = str(format(round(time.time()-starttime,6),'14.6f')) + "," + "Starsense Camera" + "," + "0xb4" + "," + "All" + "," + "0x00" + "," + "Data" + "," + "0x00" + "," + "[]" + "," + str(msg) + print(fileoutput, file=open('auxbuslog.csv', 'a')) else: - xprint ("Starsense HC Data - CRC FAIL!") - + xprint ("Starsense HC Data - CRC FAIL!") def processmsgqueue(): global msgqueue @@ -660,19 +666,23 @@ def encodemsg(sender,receiver,command,value): def encodemsg3c(): global preamble2 global msgqueue -# data = "5eda6942894f6b4406ea6942ebc25144d9f66942dbe241449d7d6a42b06bca43d95b6942c914a743b94a6c4252ed38433d9d694289d4204400006a4201203744f7c56942f4a8ba4212f16942ce74134359b56942e1adea42ef0e6a4299571b443ee169427734ed43485c6a423c9a3e44922f6a4288b34743477f6a42d77d474201006a4200201644ff7f784300203344b21a6b420000e14343946a4298f75a4443946a426788004416ed68422bc26144d60f6942a8bb274456556942b0486544ffbf764441f94f4444a96942be4666445fdc6a4251892c44bfb869420080b043a123694252c90a445fdc6a42528953440bf86a4254f60144a52e6942fce21e43b6a26942a0b2634256556942ac89844379c56a42f3f5be43a8937644cbd74843cfa4764406059143883a6942ccd7dd42883a694207c5074479c56a42fafa3244449d6a42fafa9a43ea646a423b05bb4362476942760a41439eb86a42b453e041c48e6a420000b34317649a44c91a1a445555784300002943abaa6a4200004b444dd66a422f08124466ad764417f55b43087f6a42ba0264440dc96a420000d3437a9b6a42d9821e440dc96a420000b54387646942da42674487646942dac246440000000000000000" -# data = "13166b4290b09842ddac7644a8dc5044819f6942fc415644a6e56c42cc3138439a998a43cd4c324434246b42e66d0a4311fe6842e00f3744fc920344af170d44e6a374438c5d6b42cb476942270a134300c08a43000073435555784300808f4301006c4200403544d0bfea420d100c445555694200405c44df7e684219a030437aa186433958e442096469423fbd1d44025978437c7ae74323649a44c41b1a4402597843c2422044045d784308ba9e429a85694204432a44a3a4e64356956d44333d9f42519209444dcf8243128c9643386669438e59d34300809143abe6e3425419564339531044e550b143b4ca7342c6eb764400002544520d6f431baf3443abaa554455553a430000000000000000" -# data = "8d79484417a6074467708a44023f4b449d247144a34c004428b50a44e331e843c58104444dd2e44311718d44dadb4e4486391d445f79a4434e70cb43631dcb432d3f2e442df1cd4343274e44aa0f09447fdb9844d5cd2244701834449e69d243d3379644b4981f44cc355f44b508be43fa492344f745aa43a2b53d44c3b7034466a76b44bb8c0e4494923844bec7374475cb6444b873c2431fa482442cb92a4422a93944279dd6434dad8144ad3b1c44e09d0b44b4c81844dc143f4497063b44ca2c06448683fe43400a6843390cb2430c3f3f44da64a0434f357b44a2280f44dc044943aa65b843bee38f4482a0144461e07e440f0e2744715d4c43b883b04304f719446476f143f7b76e44e79bca4312ed06433a3cde43d0641744f69b9e432877a3431f4abe43263db64355211644df4b1144c64feb4355de104413011944f4660c4482230144b1d47c44af2f19443c020144a4f4fb439e6d75437e2da443631e11449a471b440a5a294437d5ca43643b0b433fc5254314d08244dde71d440b3f16446554ef4355906644dc060b448bcc9a44f19b26444d250944ae2929440dfd59431e68a2432bf3fc43de52944317072744d3081f44ce973b447d3e39446c9448432be3dd43355bae43b1bfc44370ce3443e62b0444d8fb26441b75c8431782fe439db88d4321e3aa4373521444fb681244ca79ed435e844743721a30431a24f64381d1f7430e241c44681af34365048444bbc91044fbed5c4454f72a44c7a37244f41ab143369a0444a75c97433a65354410c7364412278544623b2e445f2d3644d37036446ddc17447f9ff043eb379b4467d22744a54dfd43d9179143954984445db21e4405bf8f4472ed6e44ac6b6243e1eaba43fbdf5b42b30f9f4318c62744fbbc1b44dee47e44a869c6439bfb6c446023c843c8e20344173e25446fdab243aa1771438d9d2244f5c81944f69c1344cd6beb43e5d0fc43183c97432c984443b452e043838a3744ac9d35442d97904338dca643d545a843d2121544dd158744ccd2444460c08444017d1f44b5a04c43ba110644fc3ed7439604cf43a1cc2d44839d3444239a8744d13c48444a350a440cea26440000000000000000" -# data = "09ff664493113644e345c6435595c44387760d441c7dad431ae33544271b1a443cc29944bc591f44f6fa4e445122e043b86d6c4448c13944a4bf5d4494d70e44606e3b440f171d440cef8f43f5998c43562ad3431eecc64355968d445d0f4a44a7709c43e9e68f4348f62344cb0dfb438ebd81448e0b0e44cb525843997e4f43f6d7af43cb7fc04398fb08440b96c94369dc2744a404e343c1f6b0427e6e31432d687043453d594368c38443eecef74303848543c8d98943891377435599f1431019de42b5203d43e101114326c6c84360456544cad9cf43c8b52f44ed7b17444223b743c8521544885a0944c890724349002244076cde4311721f446377f6432b52a84374859243b187b1432cbd3843aba4f243d0fd61436e299a4487a1684484c084449738124463995544eb19e743bb0afe433dbf6943180a0344d77fc343ed819c44c56e23443c7aaa43af631244a0ed0c44e3cb43430b71ab43de8d95438abbd0428b45c443b0e34243b0ba4443584a1043e922af431ccf36445c6ac443070f9a4383dcd943b9323e448ed9cb43c2197c44f12b364405fd19449042d94372d855443757e943d8bafb4381f3fa4383c3144382ffac43e9a01c44025ff543aa9e4e43e746b343df7cff43370802446221064486fea6434d78cf43e47ac843f430de428704ab43259f2e44eb8315449baaa343c819be43496143448587ce4399d08344d28d1044416cbe432fcd3e43e57ba34351631244c23a0a43764baf436ae22344ca87e143a89cfe421419c643ab2a3e4320af46431f004044f9c7cb43a007c543e40886433ac2aa43b20b144402d79e43e9c5b743c18ef4429e97c543be91454491f2d7433333ed4247f7c543ef744843780eb3433d24a743fc59bb430911ef43ebd0d043b19dd743a49bc143d02bb343842299432cf323449742b443c4ba2944bc3dff43a5ae30444da1be4343380744249ca8434affa543786f12448e0df6434bb262434cde0d434a7fac4351eaa9436d307443a283074472759743cef4034404426d434d197844b6333344428b9c44de382a44103f7f44da3b0b4467801e442e7daf4351397344dfa53e44299086437d02f4430000000000000000" - data = "8c832644e88592436d0a6244b57d5b449d941a434e5626426638ad43402d054438af88443780214454c0274447334f446e1f8b44742330443f52b3438287864333dbed43114a1c444e3143444622f143eac52f441ae35844ecc527449db62744dd9a5a44413624448af01144fab93843bba9ea4366991244ded72844f5a11244a219f143c84437446df098424538944398386e44deb27e430b8e8a44448a1a445f973e44dd0f0a4475784844a7f43c44ee4b4e4441f7334430ae814428670c44140aa5434d3e29448ebdb442af5a5043b8084742ce225543af866044542bda437dd300447a1d53440cb492442466fd43fc84f14350206344f1286b44735a6344c58a48444d2303443c719244b902ef43c553304496648443e98a0d436aebc64382cf094497401d44c97d984419f01944e7b33f44b9ac1944f9e68b4326a43b43aadb1344e49f3044a4577b440d719c43cc797644bc180f44e8bd1d441dd80b447c977944673a4844fea5534311c8b5431df19044b105ed43b9a769444225f343d29b1c44836b03444bc5184487604a44d493c243a7cd5c44bf43624428e81c44c74f40447c0f9c43b28b12440b7ec043f1f7a5432addf9432fce7943e46a1a447feb69445451d9436fea8044d31fa043e69b7a43e9f410446df48d440e49ce4317edff43e83629448d60cc436c5bfa43b83c754433f120434442aa430543e0432b6a3444c1c04243fb0a1144afde404308395a43c96530443f8529449ebf7d434a787344df662b44b35add432f6e434457d5674434d854448f49014468a5d543ff472b448c528e4355c1e143eff24a448eb33c4457391044a38b0e44840caa4365a85a442f887d433ffc06448a27be43389419442b8801441cbd45445edde6435ef62743c0e7ef43d5ea5444d0d0fb4203727943fb38224452ab34447b39b543c5188a4446995c44a941e5428240ed43638663442672bc4322083c44609e63442453f143383156445539574465dcd14356704a43161302442baf2344c5ab3f441be97d4394ed7642f54a6e4439b60343b71f7e44ebc21343f2f2fe433e8ee9428da37944090d4a4471335244aa774c438b6f8e43c5ca80430000000000000000" -# data = "01922744b63b96436e90cb4307c13c44136e8a4305c58943ef2721448c572f4442988b44b392904319110944a3b563445f38424412e29543726fbd430666d5426032354403490343ea882b44b2ce30444b68c043a1352a44fcad11442194e443f6e040441bd6fa43b36f8f4492ecdc416698ac438ab3dc43d4010b42e8fe1a44abc09c43ee6cd1433c981644019a4944c316a843a0e70943c58493425ea70844534ba64306071442f804c24390011244d4fd5744d0ab0b427679cd431286c4437beaba4348d7c14356d93a4488a17543a7b20144400e1e442f4024446a430e441e99b442693820447fe55c4480865644ecc00744524de44395599a44317aaf4390b9454413bd454496239444b84a51448bfe9a44b6e8c2434c41d94298546444200d19444af003442b8a3e4431469c4321b4d6439bbb1744003721445c2d6244d1798844967fd7439904ca422ecd2b448944d5436df46044ef158b4380c46244f25e4b4462c2dc43c7d84344b78f1e442b8ba4437e49f2435a7a664472ff0b4342834544b53b85435d1fca4302475042cfb56b445916604370345a4406825944a8cb9a44bd83f8439c2447446ebc1344363b7444a253e243f08951433ec184430e44114341ab82430b7378441160de42ec5d5e44163c5643367a7e448da2a443c62e8944c82b3c44e7b33543a8bd3d44fe1d3a440fc6a2434e6a39448ebded436a6c4544aaf9634486d41844302b2144a30e4044abb14c44d31d2644850ef7413026fd434d08b0438d6203445e2cf343b15c994425432844fb011644cae9df4288b5f143c77c2c442b7fd343bc4e0044d28e5c44433c3344d12cb843d4119143ee06ec43f053df429870b443d8edec437ad47242f2b51b444d306543ae4ac843debb5444d3434943d3596e44eb751b443a200b44435d3a432721364430f2ad4207d0854359bad14350e8a8431c2a3544d6fb88449261604410cc7d440a57b743583c7d44b315c74340155c44c8da5c44a86b5f441db19c4353e88d445b4f2044b0a0e0437e85fc43c7028d43172e5c44a0a84f448c9baf43b7976f44b5d75f440e0f654447c22444d923024427bc5644717edf43a3ce24440000000000000000" -# data = "769ffe43debb53446ed65b443f04724377e72e446bfcfd4309284644ffec21428c86d3435517154202e51144fef74143cf506a4433dc6e4464ab264487e81a4416dfbc4397b94244520e144400401044c926bc437351f84355968d445d0f4a44" +# data = "8c832644e88592436d0a6244b57d5b449d941a434e5626426638ad43402d054438af88443780214454c0274447334f446e1f8b44742330443f52b3438287864333dbed43114a1c444e3143444622f143eac52f441ae35844ecc527449db62744dd9a5a44413624448af01144fab93843bba9ea4366991244ded72844f5a11244a219f143c84437446df098424538944398386e44deb27e430b8e8a44448a1a445f973e44dd0f0a4475784844a7f43c44ee4b4e4441f7334430ae814428670c44140aa5434d3e29448ebdb442af5a5043b8084742ce225543af866044542bda437dd300447a1d53440cb492442466fd43fc84f14350206344f1286b44735a6344c58a48444d2303443c719244b902ef43c553304496648443e98a0d436aebc64382cf094497401d44c97d984419f01944e7b33f44b9ac1944f9e68b4326a43b43aadb1344e49f3044a4577b440d719c43cc797644bc180f44e8bd1d441dd80b447c977944673a4844fea5534311c8b5431df19044b105ed43b9a769444225f343d29b1c44836b03444bc5184487604a44d493c243a7cd5c44bf43624428e81c44c74f40447c0f9c43b28b12440b7ec043f1f7a5432addf9432fce7943e46a1a447feb69445451d9436fea8044d31fa043e69b7a43e9f410446df48d440e49ce4317edff43e83629448d60cc436c5bfa43b83c754433f120434442aa430543e0432b6a3444c1c04243fb0a1144afde404308395a43c96530443f8529449ebf7d434a787344df662b44b35add432f6e434457d5674434d854448f49014468a5d543ff472b448c528e4355c1e143eff24a448eb33c4457391044a38b0e44840caa4365a85a442f887d433ffc06448a27be43389419442b8801441cbd45445edde6435ef62743c0e7ef43d5ea5444d0d0fb4203727943fb38224452ab34447b39b543c5188a4446995c44a941e5428240ed43638663442672bc4322083c44609e63442453f143383156445539574465dcd14356704a43161302442baf2344c5ab3f441be97d4394ed7642f54a6e4439b60343b71f7e44ebc21343f2f2fe433e8ee9428da37944090d4a4471335244aa774c438b6f8e43c5ca80430000000000000000" + data = "01922744b63b96436e90cb4307c13c44136e8a4305c58943ef2721448c572f4442988b44b392904319110944a3b563445f38424412e29543726fbd430666d5426032354403490343ea882b44b2ce30444b68c043a1352a44fcad11442194e443f6e040441bd6fa43b36f8f4492ecdc416698ac438ab3dc43d4010b42e8fe1a44abc09c43ee6cd1433c981644019a4944c316a843a0e70943c58493425ea70844534ba64306071442f804c24390011244d4fd5744d0ab0b427679cd431286c4437beaba4348d7c14356d93a4488a17543a7b20144400e1e442f4024446a430e441e99b442693820447fe55c4480865644ecc00744524de44395599a44317aaf4390b9454413bd454496239444b84a51448bfe9a44b6e8c2434c41d94298546444200d19444af003442b8a3e4431469c4321b4d6439bbb1744003721445c2d6244d1798844967fd7439904ca422ecd2b448944d5436df46044ef158b4380c46244f25e4b4462c2dc43c7d84344b78f1e442b8ba4437e49f2435a7a664472ff0b4342834544b53b85435d1fca4302475042cfb56b445916604370345a4406825944a8cb9a44bd83f8439c2447446ebc1344363b7444a253e243f08951433ec184430e44114341ab82430b7378441160de42ec5d5e44163c5643367a7e448da2a443c62e8944c82b3c44e7b33543a8bd3d44fe1d3a440fc6a2434e6a39448ebded436a6c4544aaf9634486d41844302b2144a30e4044abb14c44d31d2644850ef7413026fd434d08b0438d6203445e2cf343b15c994425432844fb011644cae9df4288b5f143c77c2c442b7fd343bc4e0044d28e5c44433c3344d12cb843d4119143ee06ec43f053df429870b443d8edec437ad47242f2b51b444d306543ae4ac843debb5444d3434943d3596e44eb751b443a200b44435d3a432721364430f2ad4207d0854359bad14350e8a8431c2a3544d6fb88449261604410cc7d440a57b743583c7d44b315c74340155c44c8da5c44a86b5f441db19c4353e88d445b4f2044b0a0e0437e85fc43c7028d43172e5c44a0a84f448c9baf43b7976f44b5d75f440e0f654447c22444d923024427bc5644717edf43a3ce24440000000000000000" +# data = "908086434f114844b3707144fb581c44b3e02a4472103644c014fe43b3b4c443372e934458245044232e5143fed1f04377709b445b440e4419355944d59ebb4274dbf6415fb65a443eff2e439b9d5d44a8a57244433f384458fb3944f5085b4444cb3f4306152e4466ca8a440c844d44928939449a141b4451a1e943afa54842ad8f2f440cbc2d4458e98f4492de4f43bd318c44f017e242913f3343eebf5444538883442cbb0b443581594376c34f44ce359944a1816b430e2ff843bf26b743b31c1c43f164c043f96c1644a155b343b5fb2e44d0756c44894b79441b956b44203a3d44e0744d4404d8744467ed5243c1b24444e745bf43e2d17344ee63e243c88ba6438d432f44959be643ab3c3344f1fabc436a03e7430e148344fd245f44e8698344e74c05433ecb93444941b9437f6a8d4469d6c942e6ae6e444f32d943b66d1a44e9600144575a4c449b591f431d41a0432a0cfb436ced664356ddc941a1f25e447fec674343d6d44285ea9e43cfa69044e72536448de978449c424f44071193447b408a42a9000044166f63443188dd43672d48433b020250c24324ccc543d5140c44c75d324308de51444fe63c449809a44327415f4498078143d7e58043057a6b44fb018543c0ed064471fb8a431a6c1e447b8d2c43cc6b6d4463c7bc43b3113144535a6c44b7094b4419432144e2a410441ada25444a76e343a4b46644e74d7144a3de2e44d808974446521e44f0545344d0c39a42c7d05a4453143644389690429188db4398a38d438da25d44b7d4d442f8b4e643ad787a425d1aa7436c072e443c9e4944ecdc7b43d32827447b21e84223633a442efab2439d159443a4e865446d70bb438d073144d8856444456f6a42bcfaa54342a71644a5ca4a438f6f6c43d501d1432ca47544d6f46c440987ca4201c0024446a2c443ebd78a43552a4d44a9983a44f03ee3431c591744d6a2b2437a38c94371938d43054d404476241d446cda3944d1964f445ed2414369f604449c446a449998664340012c443f346a42aa329a428f6e6a42314a3f44978246445aaf3244b302e2430040334454132944d2911b44dc6a7d4344a2314401006a42306629440000000000000000" +# data = "908086434f114844b3707144fb581c44b3e02a4472103644c014fe43b3b4c443372e934458245044232e5143fed1f04377709b445b440e4419355944d59ebb4274dbf6415fb65a443eff2e439b9d5d44a8a57244433f384458fb3944f5085b4444cb3f4306152e4466ca8a440c844d44928939449a141b4451a1e943afa54842ad8f2f440cbc2d4458e98f4492de4f43bd318c44f017e242913f3343eebf5444538883442cbb0b443581594376c34f44ce359944a1816b430e2ff843bf26b743b31c1c43f164c043f96c1644a155b343b5fb2e44d0756c44894b79441b956b44203a3d44e0744d4404d8744467ed5243c1b24444e745bf43e2d17344ee63e243c88ba6438d432f44959be643ab3c3344f1fabc436a03e7430e148344fd245f44e8698344e74c05433ecb93444941b9437f6a8d4469d6c942e6ae6e444f32d943b66d1a44e9600144575a4c449b591f431d41a0432a0cfb436ced664356ddc941a1f25e447fec674343d6d44285ea9e43cfa69044e72536448de978449c424f44071193447b408a42a9000044166f63443188dd43672d48433b50c24324ccc543d5140c44c75d324308de51444fe63c449809a44327415f4498078143d7e58043057a6b44fb018543c0ed064471fb8a431a6c1e447b8d2c43cc6b6d4463c7bc43b3113144535a6c44b7094b4419432144e2a410441ada25444a76e343a4b46644e74d7144a3de2e44d808974446521e44f0545344d0c39a42c7d05a4453143644389690429188db4398a38d438da25d44b7d4d442f8b4e643ad787a425d1aa7436c072e443c9e4944ecdc7b43d32827447b21e84223633a442efab2439d159443a4e865446d70bb438d073144d8856444456f6a42bcfaa54342a71644a5ca4a438f6f6c43d501d1432ca47544d6f46c440987ca4201c0024446a2c443ebd78a43552a4d44a9983a44f03ee3431c591744d6a2b2437a38c94371938d43054d404476241d446cda3944d1964f445ed2414369f604449c446a449998664340012c443f346a42aa329a428f6e6a42314a3f44978246445aaf3244b302e2430040334454132944d2911b44dc6a7d4344a2314401006a42306629440000000000000000" +# data = "ae286544861549444a0283446305bf432eba75449bb32b4465095a4373bc6b443ba977443039cf42947b2344694e454466c94444f46f0e4375547d44198f36441b41a3438b959f437bb78344dec8f54353b0f541e517ec4379281f446ce41043d7b0084302c60944d27a1044ae864644012e824415d39f43a36e85441332f64125a48643124b64448ef52f4423d388423fdc46443e7b0f4443ce95426ced0d444eb04c448afba04343d52344b961fc4395eb3c448582e9434b5b514487e0424491828e447ece03426deb0c447fec664319e58c42e5462a44f7ba94441ae5394446681d4345a2c9433e0f73443fad0a44fdd3a04266fa994393216a43f7a1d142febacf4343950b44284c8244123888433d024744f169c243ab793a44d6de6243ca126844e0760d44ea0e3544d62ac643356d5944cd815744ad71354437c05144d91873432b9f0143bbbaa94370529043d0c040441f5d0542b7125144a11a5e44e086ee43c8bdbc435999d8434cdb52443df72f4453cdfa4309028d4394eab043c882bc43c234e443431f34443cd455446e0a4944d51b2644ccfdb243d48bbf4380f74444103d0a44d8509f43f22d2d441aef93438eb142440a7a30444a4b4f44274e9a4479f7b84323827244215e6944a9606d4421f167431a30474457d015433707af430d43134454df5f448e423643edb10c44259c604453111e4402f969442518a44354ed0643ccd28a44cd001644bfcbcb433cac2a44d840e743a0295d44b16a03442957d84396dd9a44cd8cc74394bf9044974d4044f66bf643a8a51c444fc146445f1a21443ea2bb4335dfff43bbe0a6434f08c84339a1bb437c2a20449ae8664479375744dcd45c4487a2574313c6014239bd61449e99d7431b341f434f13834457ec5043649e1b4417f8444492ad3044f3be544406308b43375b2144c414934401aafe4306de4b44759b9343b92feb430a46fc433362fa437230ec437765fe431f875e4341149543e5d236441d128744ce20db43d1054844697443444b1b2b44a648dc41cce48e437c791143b75a46437eaf3344c0374f447dcd6b43bc80484481c70844786595444b07374440949b44c23d47440000000000000000" +# data = "19fb6c44e0c35d434c1e0943fda04744f44f6044aca99043fbae674484a06244baa7dc43eff9ba43d22b1e44728c96436f3e7b437d6d3444cd65e643583526441dd06e434aba3844b04b2643f168a643e3946b4427565c44fb3c59443072774344798f4459bcec43e1d8ad43d1af494419522643d8b1ca430cbcbe433d410c4486800b444748cb4318509a4334c8c6437d883543d14b2443d9f36143d8114e44645c3d441b15c343c72121438acf5144c7fd9a44e8689f4267da9444cb43eb4164eb95441063fe4363ee8d442b5f274443c84044a7b58b43b5325d4493d71244b49cb543bac8074449e69744c9b65f440e6c9443ad83d7427f8fcf4222dd3044ff9f9d43d3c43d4368645c44abbb5e4481667f4434244e424a474d44ac835e44963fa5433cf41342dab0104498890e440eb2fb43108ed0439ea57644d50cb042cd9fb743e715ed43cb806b44d1859543336ed5435e24144426e6c14361c03843eff03544b13b68444c718a44380d95420f2fb84381b24543186fbb427e4d8343e3b1b043ba0fe0432f587044f7d91a4466778c44c4a73544c3ec9b44796a7e433b3307439eaadd4369e501441ccc5a43c8ecd943037101443ea391441453ac43014483445f77c643dceb824464e70e4414d89444b99a3244c8678b44e7be1f43e3c5bf4305082d44a6d224443a921143abb21d447e790c44dcbe0d420dbfb44305ac82441d26194400c365439da80944684186433db4e943f8c83643e2113344ca5d8144e1a74c44deb69842cda33b4455432f43cf14f543180a544482ea784319907b44f35f2d44c5a18444fe62ce43621f3144022218424dea2a440f735843c69609446868c043b94064445664594418c24d444f81ef43b7838d43de5c4b439ed4f6435a141e43d27d4d4375baad434b28f64285974543b4e61444f14c8843cfaa8f43a7026e44021c6942cd40b24361d791443f1623446fa94b44e9b2574419d2c44349de4d4449cb91445df23a444cb28c439098f6424f4ad943c5c4b5430bdd95446cc2aa429d485544844ef64258a436440ed44b447bc79744a225be4264daff43b0c082439a3f92441c7c6e44ffeb4d447eb15e430000000000000000" length = "{:08x}".format(int(len(data)/2)) data = length + data valuesum = sum(int(data[c:c+2],16) for c in range(0,len(data),2)) summa = 0 + valuesum summa=65536-summa summa=summa&255 + c=0 + while c