Return to Level1Techs.com

P-Clock - Devember devlog

P-Clock is a smart clock application that I’ve been wanting to build for a while. I like the idea of a smart clock that contains relevant information at a moments glance, but the idea of having an device made by Google or Facebook that has an always listening microphone has turned me away from readily made solutions on the market.

Since i still want a smart clock, i decided that for my Devember project, i will make an application that offers the basic functionality of those solutions. For now, my goals are for it to:

Display Time (Include ability to switch between analog face to digital face.)

Display Weather Forecast

Act as a digital picture frame

Play Music that is stored internally or over the network.

Depending on my progress throughout the month, I may add more functionality to the to do list. This project is also an opportunity to get familiar with a source control software and a proper development workflow. In school I got used to working alone and in an unorganized fashion but I hope to finally change that and develop some good habits. For now this is my goal for the month and i hope I come through with it.

Link

Thanks for reading!

6 Likes

Subbed.

1 Like

Are you developing with certain hardware in mind? Something like Raspberry Pi?

1 Like

I have a very quick and dirty prototype made in C#/WPF. But given that WPF is a Windows exclusive, I’m probably gonna start from scratch with Java/JavaFX or a similiar Cross-Platform framework so it can be installed on a Rasberry Pi.

Although if I remember correctly, Linus did do an overview of the LattePanda with runs full blown Windows 10. Maybe that could be an option for me.

3 Likes

With that you’d either have the watermark, buy a license or crack it… it’s an extra cost… if you’re interested in doing something else with the device it’s ok, but for what you listed I’d go for javafx

1 Like

You could also try GTK with Python (or any other language, whatever you prefer) or maybe even Qt. Both are cross-platform and work on Windows and Linux.

In any case, good luck with the project.

1 Like

Spent most of my coding time getting IntelliJ setup for JavaFX work. Once I got that done, I quickly got an animation going that displays the current time.

It’s constantly lagging behind a second or two. And while the fact it’s consistently behind a second shouldn’t bother me too much, it does. I’ll probably investigate a more efficient way to update the JavaFX label in the future. But for now, I think I’ll leave it here for tonight and come back tomorrow to add the weather widget.

4 Likes

I would love something simple that does all of the above. Looking forward to your progress!

When you finally get some code to compile after 2 days of banging your head…
giphy

Anyways, today i learned a very valuable lesson. Don’t reinvent the wheel. Chances are that someone has done most of the hard work, wrapped it up in an elegant class and has made it freely available for others to use. They are the true MVP’s of this world.

3 Likes

I got the widget to work! I separated both the clock and weather labels into their respective animations. Clock is updating every second but i set the weather forecast to update every minute. I’m not sure how often i should update the animation. From my very quick research, OpenWeatherMaps updates the forcast every couple of minutes. So i will probably set the animation to request the forecast every 5-10 minutes.

2 Likes

Great job

IMHO the forecast itself doesn’t need to be updated so often… maybe every 30 minutes or even an hour?

You could also add a function to update the forecast manually, cause you won’t be looking at the clock everytime (?)

Not sure how you could do it, but might as well keep the auto-update separate from manual updates…

An manual update can be done quite easily. I can simply call upon a function to request the latest forecast and parse the JSON file it responds with. I will probably end up setting the forecast update to a default of 15 minutes but adjustable by the end user. It’s mostly about not going over my 60 calls be minutes limit for OWM.

1 Like