Before we move to Doton2 we will extract module from Doton1, a digital fonts module. Such font is loaded from an image and a number is served on a function call. A returned resource is an image resource. All in all, it is an image helper 🙂
I have four such ‘fonts’ that are used in Doton. Each class differ in font size and colour.
There was a need for two upgrades, one to flush all chars without skipping existing and second for custom characters. There was also a bug with shutdown() function in GPIO driver that detached all pins and not only used by a driver.
All three things are done.
PyPi updated (v0.6) and git repo updated.
The best test for developed software is to deploy it and run o clean machine. I have my first RPi1b still working so I cloned repo to it and started the app. It went quite good. But I hit the wall when I tried to change workers frequency.
It is hardcoded.
Something that we have to change.
We will explore gRPC protocol some more. In the last post, we had a problem with the fact that we have to ask for data. If we want to react to events ASAP we have to know about them instantly.
There is an option of using gRPC as a stream. So the server can send data to the client many times after an initial request.
I’m thinking about new function get_changes that would return all changes happening in the storage.
But first, we have to explore gRPC and streams.
– code @ GitHub
We are gathering some data and store it in the storage but how to make data available for other apps?
We will try and use gRPC, I wanted to do this for some time. If it fails miserably we will use rest API or socket server. (more…)
We already have a worker for air pollution but with a huge disadvantage, it works only in Poland. Quick research over the internet and I found out a global air pollution data. It is https://openaq.org and they have an API.
What is funny, they use GIOŚ data for Poland 🙂
It is a good choice for the next worker.
There may be a reason to disable some workers or handlers. Like disabling GIOŚ Worker when outside of Poland. Currently, there is no way to do this.
I think we have to expand the config file and add enabled value to each worker and handler.
I hope that at some point we won’t have hardcoded services and everything would be in the config file. Easy to extend or change.
We in Poland have an official API for getting air pollution data. I think it is a good case for a new worker.
In the previous part, we prepared the main engine and handler execution.
We also have workers and we need to add support for them. As always we will start with a weather worker.
I have the Doton and the Tenchi project, both are getting readings from sensors and external sources and both are parsing and returning the results, Doton to LCD and Tenchi as a voice via Google Assistant.
The problem is we have different ways of gathering those data. I think we should extract it as one module – SensorListener
Then in each project, we can focus only on serving data and not writing data gathering all the time.