From e137f75e3bff88687a059c57e36977d1f790370b Mon Sep 17 00:00:00 2001 From: Jara Date: Wed, 23 Oct 2024 02:28:07 +0200 Subject: [PATCH] Final few fixes for Buttons and Traceroute --- LoraDB.pkl | Bin 21582 -> 21582 bytes LoraLog.py | 20 ++++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/LoraDB.pkl b/LoraDB.pkl index cd47efa216df700527b7eb5894447745ee5d01cf..46806a900ef0ee1220fa6ef1c51e7838698ba113 100644 GIT binary patch delta 958 zcmY*YOH30{6y?2{VoO93NoeI`E!GdpWTx|L31FEBg{cAxrUU`SmXF9+C?OgkB3tvr5bj|PyEM?nz&G-CNA_%#i*P6a^HRT-FwctcX1vq&ZAT3 z@i*=Cg?{`>gB9q|*1(8qINT!#+uXf_!^5VLs&YO#rkP>fZrDXpkt9)$nl0ug{iOz1 zP`52rp${MvFW|2l+`-LRjzGZcmN>ybVs_b$WknLF%A}C#L^w+WV8cj+mux<6E`gtH z!%}+0HiKn9e6Yn>o5Jy=A$2^Hsq#7Dq0^(z%#45bZU_Z)J-6z2PJIkx!>(6$`6I)6 zziHU^)YMlrnEJURPdd8nT`t4QxB6vC&=tfeK_+uPA(VjOyiV#o%PXc1$zJ=yy8G(x zptfb*0<~$Ly)@9_$+O~91$(Uc)Ah~Ns@@p2v)(&2(6XTsr6*8IiXPebh!*UQkh>eN zB4_gI=FsB~BTcUreW6A*P}693M_^*}B2B9)l##7_mgd39Ed@Bc6cSr@vKDnWw)P=h zS_%V2qxh``?~8U|Q3OBd#t$@T;+kx!0#6CK#nES^918i}YtjUsPcp1fhFz550A<*M zoC2r$H+a4r;=H`Fhauf5nG{*oi9{;*#DWR0fRFif0i-6)%pca6%ck%UrT9Lo(DT!Y3sX_g_P( z6>^LBqkb4G?m?~OeX$eal|f)j>O4}i;pD_v{W5f4}wl3{&C32>A5~0;3dsj2IB#75P`2|z(Fg5@H delta 855 zcmYLHOK4MR6z(}Uw@H<@&{j>YF@1RBqvm>Fxk+PjI-SPaB-3_GwLvpRP5L0#7h097 zWn9dnki|^Tb<<7-DV5HkNcmj|&O+3UI23Us6)hryh@v1}2!r5%Q^d`IbIx~O-}&Ze zVSX0=n8YW(Kc|l42OpKe5g~ZSqHQIsDzPu`(sk1?^gzb?)!G#O*GDsubBLy_P!(Rc z@%J!QCK|G)p0Nh2^I||&m?jJWew1j^5d(wXIM$<9O-`|Ax$dAij+N_ZNz97HrW_2g zRPktq@Zf$Gy>Qnnmp5hpOX}?{HDCIgC+=Vj@~-I4!BFq%=y5Awx+@aziTsrAO~liC zbt^hCvOrr)+)%{K>K24KcDCjdz#Qc~1KfGy33G>)dKc~3``UhP6Lr^NZoGa!kEiNA zc6y{?kDY$JA;qm<%5pm{-Q|gdFA1e{P*fD{O+W1)bmfxl_Qn|-dtmcwNYe1;d5&t^ z5&&0T+|!we^jI|7*nl;aG~M{Kz&T<|jmH3gb5YiR4)6PD(H}>xiMGnM_>Ye|<$c9Y zRgtv-yCHMjm_#0B_p0w)I{i(Yo@}cXbJCdd3U6(oqv}aqyPjUE)nyfrZe3a6JpKNx zYp8RPoSI)SWsL>3ArNy@d~Ld^58xCqxA7LBh0r{JcaRR75-v5+m^tb)Bu z5nuagcE=%?t4Wt?4OwLsKb*%>uY>cr^!%O8V;xQWcm?AUg z>~ohi1q*d%VH#J6R@hRYOOZDB4diY9l0Wz7S46vXt)n{>+L^R+Gwek~1(>Gt_Wxm; zt=v@s_})j}js$4zREGh!Q2&nhaW$65y!dVnDY2+*Yjydi?^F0uhJM)0WR+#XUzFSf rc}H98F@;9s9`-PHLcsER+TPV&Vtf-kyWDjNpo*>eC51M{!-<8j`;848 diff --git a/LoraLog.py b/LoraLog.py index 052c19c..43b0425 100644 --- a/LoraLog.py +++ b/LoraLog.py @@ -14,7 +14,7 @@ import html import pygame import threading -import yaml +# import yaml # Tkinter imports from PIL import Image, ImageTk @@ -434,7 +434,7 @@ def on_meshtastic_message(packet, interface, loop=None): text_raws += TraceFrom if snrBack and snrBack[index] != -128 and snrBack[index] != 0: text_raws += f" ({snrBack[index] / 4:.2f}dB)" - text_raws += '\n' + (' ' * 11) + 'To : ' + TraceFrom + ' --> ' + text_raws += '\n' + (' ' * 11) + 'Back : ' + TraceFrom + ' --> ' index = 0 if route: for nodeuuid in route: @@ -793,22 +793,30 @@ def send_trace(nodeid): # Hadnle the buttons def buttonpress(info, nodeid): global ok2Send + text_from = LoraDB[MyLora][1] + " (" + LoraDB[MyLora][2] + ")" if ok2Send == 0: stop_event.clear() print("Button " + str(info) + " node !" + str(nodeid)) - ok2Send = 18 + ok2Send = 15 node_id = '!' + str(nodeid) if info == 'ReqInfo': + insert_colored_text(text_box2, "[" + time.strftime("%H:%M:%S", time.localtime()) + "] " + html.unescape(text_from) + "\n", "#d1d1d1") + insert_colored_text(text_box2, (' ' * 11) + "Node Telemetry sending Telemetry request\n", "#02bae8") telemetry_thread = threading.Thread(target=send_telemetry, args=(node_id,)) telemetry_thread.start() elif info == 'ReqPos': + insert_colored_text(text_box2, "[" + time.strftime("%H:%M:%S", time.localtime()) + "] " + html.unescape(text_from) + "\n", "#d1d1d1") + insert_colored_text(text_box2, (' ' * 11) + "Node Position sending Position request\n", "#02bae8") position_thread = threading.Thread(target=send_position, args=(node_id,)) position_thread.start() elif info == 'ReqTrace': + insert_colored_text(text_box2, "[" + time.strftime("%H:%M:%S", time.localtime()) + "] " + html.unescape(text_from) + "\n", "#d1d1d1") + insert_colored_text(text_box2, (' ' * 11) + "Node TraceRoute sending Trace Route request\n", "#02bae8") trace_thread = threading.Thread(target=send_trace, args=(node_id,)) trace_thread.start() else: - print('please wait a before re requesting (30sec)') + insert_colored_text(text_box2, "[" + time.strftime("%H:%M:%S", time.localtime()) + "] " + html.unescape(text_from) + "\n", "#d1d1d1") + insert_colored_text(text_box2, (' ' * 11) + "Please wait before the next request, 30 secconds inbetween requests\n", "#02bae8") overlay = None def click_command(marker): @@ -871,13 +879,13 @@ def click_command(marker): button_frame2 = Frame(overlay, bg='#242424') button_frame2.pack(pady=2) - button4 = tk.Button(button_frame2, image=btn_img, command=lambda: print("Button 4 clicked"), borderwidth=0, border=0, bg='#242424', activebackground='#242424', highlightthickness=0, highlightcolor="#242424", text="Delete Node", compound="center", fg='#d1d1d1', font=('Fixedsys', 10)) + button4 = tk.Button(button_frame2, image=btn_img, command=lambda: print("Button 4 clicked"), borderwidth=0, border=0, bg='#242424', activebackground='#242424', highlightthickness=0, highlightcolor="#242424", text=" ", compound="center", fg='#d1d1d1', font=('Fixedsys', 10)) button4.pack(side=tk.LEFT, padx=1) button5 = tk.Button(button_frame2, image=btn_img, command=overlay.destroy, borderwidth=0, border=0, bg='#242424', activebackground='#242424', highlightthickness=0, highlightcolor="#242424", text="Close", compound="center", fg='#d1d1d1', font=('Fixedsys', 10)) button5.pack(side=tk.LEFT, padx=1) - button6 = tk.Button(button_frame2, image=btn_img, command=lambda: print("Button 6 clicked"), borderwidth=0, border=0, bg='#242424', activebackground='#242424', highlightthickness=0, highlightcolor="#242424", text="Send Msg", compound="center", fg='#d1d1d1', font=('Fixedsys', 10)) + button6 = tk.Button(button_frame2, image=btn_img, command=lambda: print("Button 6 clicked"), borderwidth=0, border=0, bg='#242424', activebackground='#242424', highlightthickness=0, highlightcolor="#242424", text=" ", compound="center", fg='#d1d1d1', font=('Fixedsys', 10)) button6.pack(side=tk.LEFT, padx=1) frame_middle = tk.Frame(frame, bg="#242424", borderwidth=0, highlightthickness=0, padx=0, pady=0)