This is an old revision of the document!
Table of Contents
WikiBASS Wikibase demo
wikiBASS is a Wikibase demo program that creates a Wikibase of STM32 microcontroller development boards and their microcontrollers.
WikiBASS requires STM32CubeMX to be installed in order to gather board information from its XML files. wikiBASS will also scrape additional information with Selenium Chrome/chromium automation.
If you do not have access to a Wikibase server then install Mediawiki with the Wikibase extension.
Setup
Debian
sudo apt install python3-full mercurial hg clone https://hg.kewl.org/pub/wikiBASS cd wikiBASS
Setup virtual environment
python3 -m venv ~/.venvs/wikiBASS
Activate virtual environment (TCSH)
source ~/.venvs/wikiBASS/bin/activate.csh
Install dotenv
python -m pip install dotenv
NB Adding dotenv as a pyproject dependency in the virtual environment does not work.
Windows
Install Python 3.13.2 for Windows AMD64
Download the tip archive and extract.
cd wikiBASS
Install requirements.
python -m pip install lxml python -m pip install beautifulsoup4 python -m pip install "WikibaseIntegrator>=0.12" python -m pip install selenium python -m pip install python-dotenv
WSL1
For WSL1, Selenium chrome automation will require Python for Windows.
Follow the instructions for Windows above and add an alias to run wikiBASS from within WSL1 using the Windows installation of Python.
`username' below is your Windows login
TCSH
alias py "/mnt/c/Users/username/AppData/Local/Programs/Python/Python313/python.exe" bash
BASH
alias py="/mnt/c/Users/username/AppData/Local/Programs/Python/Python313/python.exe"
Later you may invoke the script with
py stm32.py
Chrome
Selenium depends on chrome.exe on Windows or chromium on Linux.
Debian
sudo apt install chromium
Windows
STM32CubeMX
Install STM32CubeMX from st.com.
Take note of the installation directory.
Configure
In order to update Mediawiki and Wikibase using automation, a Mediawiki bot needs to be configured.
Login and visit the bot creation page to create a bot username. When a username is created a bot password is automatically generated.
Bot creation is found under Tools → Special pages → Account management → Bot passwords.
Once the bot is setup you must then configure the wikiBASS environment.
Rename `dotenv' to `.env' and edit appropriately.
WB_URL="https://mediawiki.example.com/" WB_USERNAME="username" WB_PASSWORD="botpass" STM32CUBEMX="c:/Program Files/STMicroelectronics/STM32Cube/STM32CubeMX"
STM32CUBEMX points to the installation directory which is probably the above on Windows.
The .env file must be found in the current directory to be used by the script when it is called.
For Debian shells the environment variables can be placed within the login profile instead of the .env file.
Install
Debian
Installation downloads the pyproject requirements and installs the wikiBASS module as a script in the virtual environment directory.
make install
Windows/WSL1
Installation is not necessary and the script is run from the install directory.
Run
Building the demo Wikibase is comprised of three steps.
- Parse XML board files
- Scrape board schematics
- Scrape chip datasheets
The XML board files need to processed prior to scraping.
Debian
In Debian the script is run from within the virtual environment.
stm32 xml stm32 board stm32 chip
Windows/WSL1
For Windows and WSL1 the script is run from the installation directory.
py src/wikiBASS/stm32.py xml py src/wikiBASS/stm32.py board py src/wikiBASS/stm32.py chip
Demo
Visit the demo site to navigate the board root.