Jan-28-2024, 05:39 PM
Yeah!!! It runs, after I made some changes to get the GUI window working. I added a few print statements to follow progress. Still fails to connect.
Some of the results:
****
Test button MAC: b'MAC\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
IP is: 192 . 168 . 0 . 168
UDP-IP is: 192.168.0.168
Test button device address: ('192.168.0.168', 50000)
message sent
message sent
message sent
message sent
message sent
*** and then I get the device not found message. Looks like either the socket is not working as expected or the UDP port has changed. I have a query out to a forum for the radio asking what is the default UDP address.
I'm puzzled about the single quotes around the IP address in the "device address". I do not see where they come from or even if they are a problem.
In the mean time, I'd like some input on setting the window, if you are not fed up with me yet. :)
Here is the unaltered code:
The resulting error:
Some of the results:
****
Test button MAC: b'MAC\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
IP is: 192 . 168 . 0 . 168
UDP-IP is: 192.168.0.168
Test button device address: ('192.168.0.168', 50000)
message sent
message sent
message sent
message sent
message sent
*** and then I get the device not found message. Looks like either the socket is not working as expected or the UDP port has changed. I have a query out to a forum for the radio asking what is the default UDP address.
I'm puzzled about the single quotes around the IP address in the "device address". I do not see where they come from or even if they are a problem.
In the mean time, I'd like some input on setting the window, if you are not fed up with me yet. :)
Here is the unaltered code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# ---------------------------------- # User Interface #------------------------------------ def close(): sock.close() root.destroy() root.quit() root = Tk() root.title( 'Bootloader 2.1' ) x = str ((root.winfo_screenwidth() - root.winfo_reqwidth()) / 3 ) y = str ((root.winfo_screenheight() - root.winfo_reqheight()) / 3 ) root.geometry( '400x300+' + x + '+' + y) root.maxsize( 400 , 330 ) root.minsize( 400 , 330 ) root.protocol( 'WM_DELETE_WINDOW' , close) |
Error:Traceback (most recent call last):
File "E:\HamStuff\Odyssey\BL2.1\Bootloader2to3Results.pyw", line 24, in <module>
root.geometry('400x300+'+x+'+'+y)
File "C:\Program Files\Python312\Lib\tkinter\__init__.py", line 2114, in wm_geometry
return self.tk.call('wm', 'geometry', self._w, newGeometry)
_tkinter.TclError: bad geometry specifier "400x300+573.3333333333334+293.3333333333333"
My guess is that the intent is to place the GUI in a place dependent on the screen size. Also, I suspect the geometry specifier should be an integer, since it is pixels. I modified the code to have fixed values for "x" and "y" or 100 each. That put the GUI in the upper left of the screen.