Showing posts with label raspberry pi. Show all posts
Showing posts with label raspberry pi. Show all posts

Friday, December 05, 2025

My PiThon Project

Pardon the really terrible pun - but I'm working on a small side project on a Raspberry Pi in Python.

Ok, now that we got the Pi jokes done, here's what I'm doing:

I'm a building an station display (board) for nearby train and other public transprt stations with real-time data and more importantly potential delays. Idea is to have a brief glance at it before leaving the house, so you know whether to rush or leisurely stroll to the station.

For that I'm re-using and old PI (3B+ to be precise, not really the fastest one) with a Raspberry Touch Display 2 and a bit of Python code.

So easy do develop (in PyCharm) and test (on my PC), then "stage" it to a Raspberry OS within a virtualbox, and then deploy to a real bare metal RaspPi.

I get the data from the ÖBB online timetable (as json) and the Wiener Linien open real time data (german description here). I chose those 2 because that's really all I need in my neighborhood. ÖBB (the Austrian federal railways) timetable covers all train journeys within Austria, and as I'm living in Vienna, I only need the Vienna public transport timetable. *

For the GUI I started the tkinter but started to regret this almost immediately. It is a terrible API without proper control for tables for example - and yes, showing an online timetable needs a proper table - it's sort of in the name.

When I then first deployed this to a real Raspberry the performance was abysmal - and I'm talking about fetching the data from their soures, but presenting that data (once loaded) in a tkinter window/table.

Think of old terminals connected via a serial V.32bis modem... where you can watch the lines being popuplated - almost that bad. You could see the table being drawn... really.

So, terrible API, hardly control over table formatting, terrible performance on the target HW, lets look for a different GUI library.

PyQt to the rescue. I found the API and the constructs more familiar (from Swing, Android, even back OS/2 and Windows ;)) and it is definitely more performant.

So PyQt it is. Rewrite was done in less then an hour. No visible rendering/drawing artifacts.

Right now, the configuration of the stations is right still in the source code (yuck), but that's the next step then - one needs to fill their spare time, right?

More to follow.

---

* yes, my code is modular enough to plug-in any other transport provider as long as they have machine readable online timetable data via whatever over HTTP without logins ;)

Sunday, May 11, 2025

Set fixed IP on LibreElec on RaspBerry

Well, go to settings ... duuuh.

Yeah, alright, but what if I have to run headless, i.e. not have a monitor or TV attached.

So as long as you can ssh into it (i.e. you know the current IP address) you can do

connmanctl config "$(connmanctl services | awk '/^\*/ {print $3}')" --ipv4 manual 10.0.0.22 255.0.0.0 10.0.0.1

The "inner" connmanctl finds the service name for the active IP connection, the "outer" one changes it to the new IP

Saturday, September 29, 2012

A New Baby - Raspberry Pi

Finally - thanks to Max, I got my new baby:

a Raspberry Pi.

What for, you ask?

Don't know yet... I'm thinking along the lines of

  • a thermostat - with some fancy features
  • a power meter - for some "private" smart metering
Any other ideas welcome.

Today I finally found the time to get the beast running: only needed an SD card (believe it or not, I could not find any SD card at home... probably because my Nikon uses CF). 

I also got myself a new Logitech wireless keyboard and mouse; the first time I'm using a wireless... but only because the Pi is next to the TV (via HDMI cable), and I don't want any more cables lying around.


Apache is running, the dhcp lease is permanent... cool times ahead.