A Python solution running on Raspberry Pi (Raspbian)
A Raspberry Pi-based solution to help elder people take their medicines at the right date & time.
My mother-in-law is (was) having a hard time remembering her medicine's schedule and using a simple smartphone alarm-clock/schedules is not an option as she's not very fond of such devices.
I decided to create a quite simple Python application that runs on Raspberry Pi's Raspbian so I could use a simple 3.2 inches TFT LCD display as UI.
I'm also learning Python and wanted something to do with my newly learned language.
This small guide is aimed at configuring the same (or similar) environments as the one I used, so we have:
- Raspberry Pi 3 B board (probably works on other RPi boards too);
- Raspbian on a micro-SD (I used the Stretch with Desktop and recommended software);
- 3.2 inches TFT LCD (will certainly work with other displays too);
After doing all that, you should be good to go and run PyQt5-based apps with python3
(please note that Raspbian comes with both Python 2 and Python 3)
It's a bit tricky to run Python apps that use PyQt5 to create GUI, but after some work, I figured that you should (as of June 2019):
sudo apt-get install qt5-default
wget https://www.riverbankcomputing.com/static/Downloads/sip/4.19.17/sip-4.19.17.zip
wget https://www.riverbankcomputing.com/static/Downloads/PyQt5/5.12.2/PyQt5_gpl-5.12.2.zip
tar -xzfv sip-4.19.17.zip (on your download directory)
tar -xzfv PyQt5_gpl-5.12.2.zip (on your download directory)
CD to sip-4.19.17
folder:
python3 configure.py
make (this will take a shit-load of time)
CD to PyQt5_gpl-5.12.2
folder:
python3 configure.py --sip \your-sip-dir-location\sip-4.19.17\sipgen\sip
make
After all theses steps you should be able to run the Python script with PyQt5 GUI.
I've developed the application and the UI on Windows 10 using Visual Studio Code for IDE and QT designer as GUI designer.
In order to develop on Windows, you must have Python 3 installed on your machine.
- You can download the installer and find instructions on the official Python Software Foundation's page. Make sure you allow the installer to add
python
to yourPATH
environment variable.
After installing Python 3 on your machine, you should be able to install the PyQt5
and pyqt5-tools
(QT designer included) by running these on your command prompt
:
C:\Users\YourName>python -m pip install PyQt5
C:\Users\YourName>python -m pip install pyqt5-tools
When all is done, you can go to pyqt5-tools
folder inside your site packages folder (you can get where it is by python -m site
) and find the QT designer executable.
In my case, the site-package
folder user is at C:\Users\myName\AppData\Roaming\Python\Python37\site-packages\pyqt5_tools
. Create a shortcut to designer.exe
on your Desktop
.
You're all set!
If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.
Articles and posts that helped me throughout my adventure: