Getting Started
This tutorial walks you through setting up and running your first FMU simulation with MicroPython.
Prerequisites
MicroPython source code: Clone the MicroPython repository.
MicroFMU Test Library: Clone this repository inside MicroPython.
Functional Mock-up Unit (FMU): Obtain an .fmu file for testing.
Development environment: Linux/macOS/WSL (Windows).
Installation Steps
Clone the MicroPython repository
git clone -b v1.24.1 --depth 1 --recurse-submodules --shallow-submodules https://github.com/micropython/micropython.git micropython_dir="$(pwd)/micropython"
Clone the MicroFMU library
cd $micropython_dir git clone https://github.com/Imaginus02/MicroFMU-library.git cd MicroFMU-library
Place your FMU file in the library directory
Example: .. code-block:: bash
cp path/to/fmu/BouncingBall.fmu .
Ensure required scripts are executable
chmod +x parseFMU.sh changeCode.sh
Build the MicroFMU library
make
Compile MicroPython with MicroFMU (Unix target)
cd "$micropython_dir/ports/unix" make submodules make USER_C_MODULES=$micropython_dir/MicroFMU-library
Run MicroPython with FMU support
./build-standard/micropython