This time we will work with drawing functions. Displaying pixel is easy but next, we have a line, circle and arc. I wonder how hard or easy moving functions from Python to C gonna be.
In Python implementation of GfxLCD, we use @property to access width, height or set colours. We need to do same with C implementation. I see two ways, one we will use Python class that would translate property to function call in C or maybe we can use some ability of Python-C wrapper.
GfxLCD and ILI9325 C driver – part 1
We know that we can get a decent performance with C and ILI based display, so let’s make the next step and add ili9325 and the ili9486 driver written in C to our GfxLCD package.
There is no repository for now – sorry 🙂
I have some crazy idea but before we need to do something with GfxLCD performance. Using ILI9325 with Python is a way to slow:
pi@raspberrypi2b:~/workspace/gfxlcd/gfxlcd/demos $ time python3 ili9325.py
Filling screen with size 240×320 in 14s is not impressive. Let’s see what happens when we move a layer down to C.
This time is something different. On the journey between shops, I saw a wooden Christmas tree. I looked at it and then it hit me! Mount some LEDs, attach ESP and use PWMs and this should work! We should have a beautiful blinking tree, small but tree 😀
Some time ago my RPi with running Doton crashed. It was quite a surprise but happens:) Reason was trivial, I moved it and SD card was pressed against the wall and ejected 🙂 But after a restart, it crashed again but this time with a fatal error. This hits me! We have no way of showing a temperature that is under zero!
This also remembered me that I didn’t do anything with the project for some time. I still have a window manager to redesign and rewrite.
But let’s start low and first clean up a GIT repository by removing submodules and changing a readme.
This project started its life with Daj się poznać competition but competition is over. Time to clean it up from additional modules and leave only files that are used.
The fastest method was to manually delete .gitsubmodule and directories 🙂
Creating an RFID reader that works in the real environment and not only on my shelf was the very refreshing experience. The whole process went rather smoothly. But life is a life and a few issues occurred. I grouped them in this post.
I mentioned a magical switch to enable configuration mode. In this post, we will write a configuration module for RFID node. Why not for boilerplate?
Because first, we will analyse the problem and create a tailored solution. After gaining some experience we will rewrite module and create a universal configurator.
What is to configure? An AP credentials and an URL for a server.
There are a hardware and a software but this is not all, there is also a case that holds all together 😀 and makes project look good 🙂
The Client wants a nice looking case and this is easy to understand. So new area for me, how to make nice holes for connectors, LEDs, switches and so, last time (with NodeONE) it wasn’t all good.
But today there is no room for failure! Let’s get to work!
- part 1: NODEMCU AND RC522 CARD READER
- part 2: NODEMCU AND RC522 AND REST COMMUNICATION
Last time we made a device that reads RFID card and communicates with devices by broadcasting a message. This implies that on the same network a server must be. We can use another device to work as a proxy between reader and remote server but why? We can communicate directly with the server via HTTP requests and box can inform other devices about the result.
Code added to NodeMCU Boilerplat@GitHub
Some time ago an opportunity knocked on my door. A friend needs a device that would read a card, send the id to the server and react to response.
Today we will work on code and create a class and a handler for the RC522 module.
Module and handler added to NodeMCU boilerplate @ GitHub