Custom panel to display tide information

Thanks – I am away from the console until Wednesday. Will try then.

First attempt did not work with just the .kv and …py – My two existing files have a .tmpl extension. I tried adding that to the two new files without any success.

Huh ? That makes no sense.

Read @robert.jochim’s reply again. You need one file called customPanels.kv and one called customPanels.py with whatever content you want in there. You can’t just make up filenames.

Is it possible to add the UK Hydrographic Office data to this?

Possibly; I just need to change the endpoint. Looking into it now.
EDIT: Waiting on a license?! from The Crown. Ridiculous. You guys in the UK pay to collect the data, but you are unable to freely see the data you paid to collect without a license and/or subscription fee.

Would you expect anything less from the country that charges its citizens about $200 USD/year for the privilege of owning a colour television set???

My tides panel was working great until the most recent Wfpiconsole update now it shuts down the console when I select the tides panel. Both my custom panel files are located in the user directory. Any ideas ?

Looking into it. Just discovered that mine is behaving the same way as you describe after applying the latest wfpiconsole update. I’ll see if I can figure out what changed.

@peter Did the latest update for wfpiconsole or in main.py involve any changes related to Kivy imports or how modules are loaded? I tried to find some workarounds to keep from bugging you, but just going in circles.

I can’t think of anything off the top of my head, but clearly I have broken something :rofl:. Can you share the log output when the console crashes? The answer will be in there hopefully

This is what gets dumped to the console when crash occurs:

pi@raspberrypi:~ $ wfpiconsole start
[INFO ] [Logger ] Record log in /home/pi/.kivy/logs/kivy_24-07-27_1.txt
[INFO ] [Kivy ] v2.2.0
[INFO ] [Kivy ] Installed at “/home/pi/wfpiconsole/venv/lib/python3.9/site-packages/kivy/init.py”
[INFO ] [Python ] v3.9.2 (default, Mar 12 2021, 04:06:34)
[GCC 10.2.1 20210110]
[INFO ] [Python ] Interpreter at “/home/pi/wfpiconsole/venv/bin/python3”
[INFO ] [Logger ] Purge log fired. Processing…
[INFO ] [Logger ] Purge finished!
[INFO ] [Config ] Verifying station details
[INFO ] [Factory ] 190 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO ] [Window ] Provider: sdl2([‘window_egl_rpi’] ignored)
[INFO ] [GL ] Using the “OpenGL ES 2” graphics system
[INFO ] [GL ] Backend used
[INFO ] [GL ] OpenGL version <b’2.1 Mesa 20.3.5’>
[INFO ] [GL ] OpenGL vendor <b’Broadcom’>
[INFO ] [GL ] OpenGL renderer <b’VC4 V3D 2.1’>
[INFO ] [GL ] OpenGL parsed version: 2, 1
[INFO ] [GL ] Shading version <b’1.20’>
[INFO ] [GL ] Texture max size <2048>
[INFO ] [GL ] Texture max units <16>
[INFO ] [Window ] auto add sdl2 input provider
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[INFO ] [Text ] Provider: sdl2
[INFO ] [GL ] NPOT texture support is available
[INFO ] [Websocket ] 2024-07-27 03:40:15 - Opening connection
[INFO ] [ProbeSysfs ] device match: /dev/input/event1
[INFO ] [HIDInput ] Read event from </dev/input/event1>
[INFO ] [Base ] Start application main loop
[INFO ] [HIDMotionEvent] using <generic ft5x06 (79)>
[INFO ] [HIDMotionEvent] <generic ft5x06 (79)> range ABS X position is 0 - 799
[INFO ] [HIDMotionEvent] <generic ft5x06 (79)> range ABS Y position is 0 - 479
[INFO ] [HIDMotionEvent] <generic ft5x06 (79)> range position X is 0 - 799
[INFO ] [HIDMotionEvent] <generic ft5x06 (79)> range position Y is 0 - 479
[INFO ] [Websocket ] 2024-07-27 03:40:16 - Connection open
[INFO ] [Base ] Leaving application in progress…
Traceback (most recent call last):
File “/home/pi/wfpiconsole/main.py”, line 613, in
wfpiconsole_app.run()
File “/home/pi/wfpiconsole/venv/lib/python3.9/site-packages/kivy/app.py”, line 956, in run
runTouchApp()
File “/home/pi/wfpiconsole/venv/lib/python3.9/site-packages/kivy/base.py”, line 574, in runTouchApp
EventLoop.mainloop()
File “/home/pi/wfpiconsole/venv/lib/python3.9/site-packages/kivy/base.py”, line 339, in mainloop
self.idle()
File “/home/pi/wfpiconsole/venv/lib/python3.9/site-packages/kivy/base.py”, line 383, in idle
self.dispatch_input()
File “/home/pi/wfpiconsole/venv/lib/python3.9/site-packages/kivy/base.py”, line 334, in dispatch_input
post_dispatch_input(*pop(0))
File “/home/pi/wfpiconsole/venv/lib/python3.9/site-packages/kivy/base.py”, line 302, in post_dispatch_input
wid.dispatch(‘on_touch_up’, me)
[INFO ] [Websocket ] 2024-07-27 03:40:29 - Closing connection
File “kivy/_event.pyx”, line 731, in kivy._event.EventDispatcher.dispatch
File “/home/pi/wfpiconsole/venv/lib/python3.9/site-packages/kivy/uix/behaviors/button.py”, line 179, in on_touch_up
self.dispatch(‘on_release’)
File “kivy/_event.pyx”, line 727, in kivy._event.EventDispatcher.dispatch
File “kivy/_event.pyx”, line 1307, in kivy._event.EventObservers.dispatch
File “kivy/_event.pyx”, line 1191, in kivy._event.EventObservers._dispatch
File “/home/pi/wfpiconsole/venv/lib/python3.9/site-packages/kivy/lang/builder.py”, line 55, in custom_callback
exec(kvlang.co_value, idmap)
File “/home/pi/wfpiconsole/user/customPanels.kv”, line 57, in
on_release: app.CurrentConditions.switchPanel(self)
File “/home/pi/wfpiconsole/main.py”, line 597, in switchPanel
self.ids[button_data[1]].add_widget(eval(new_panel + ‘Panel’)(mode))
TypeError: init() takes 1 positional argument but 2 were given
[INFO ] [Websocket ] 2024-07-27 03:40:29 - Connection closed
pi@raspberrypi:~ $

Ah of course. I had to make a small tweak to the panelTemplate to enable the lightning panel to automatically open and close.

In your customPanels.py file, can you change the __init__ method for your tides panel to look like this

def __init__(self, mode=None, **kwargs):
    super().__init__(mode, **kwargs)

Note the new mode input argument

1 Like

That was it! Thanks again Peter.
@jhsnider2 the .py file at the top of this thread has been updated.
Also, currently looking into toning down the big color block and adding Last Tide and Next Tide fields above “the waterline”.

2 Likes

I updated the layout of Tides custom panel:

  • Reduced the background image so it’s not so in your face
  • Now shows Last Tide and Next Tide, their state indicated by both arrows and color
  • Changed scheme/colorway to match the other panels
  • List of tides is now 12 hours +/- of current time rather than just the current date

Updated files:
customPanels.py.txt (7.0 KB)
customPanels.kv.txt (3.2 KB)

Still, I’m not responsible if you run aground or drown. :no_mouth:

2 Likes