How to Use Vobot Mini Dock Simulator
Development Environment on MacOS
Prepare the XWindows on MacOS
- In order to show X11 windows with Docker on Mac:
- Go to https://www.xquartz.org and download latest XQuartz-2.x.x.pkg, install it;
- Launch "xQuartz.app". a "xterm" window should pop up, you can ignore or close it;
- Under the XQuartz menu -> Settings. Go to the "Security" tab and ensure "Allow connections from network - clients" is checked.
- Uncheck the "Authenticate connections", then restart xQuartz.app; Allow X11 forwarding from any clients: Open Mac's Terminal App, "run xhost +"
Run Simulator and Debug the Apps
- Open a Terminal software (e.g. Terminal, or iTerm2 on MacOS), then run:
mkdir -p ~/work/minidock cd ~/work/minidock docker run \ --rm -it \ -v ./disk:/work/disk \ -p 80:80 \ vobot/mini-dock-app-dev:latest
- If the 80 port is occupied, you can change the port mapping:
-p 8080:80
- If all of the above steps were completed successfully, a "LVGL Simulator" X window should open on your host which is forwarding from the container;
- The console logs output can be found on the terminal. Use
Ctrl-C
to stop running; - You can edit the
./disk/apps/hello_world/__init__.py
, and re-run the docker run ... command to reload and debug your apps; - You can visit
http://localhost
to edit the configuration, or modify the./disk/conf/*.json
files. - Operation description:
- Enter Key: Confirmation
- Escape Key: Cancel
- Left Arrow Key: Coder rotate counterclockwise
- Right Arrow Key: Code clockwise rotating clockwise
Development Environment on Linux (e.g. Ubuntu)
Prepare the XWindows on Linux
- If you have not installed the X server on your Linux host, you need to install it first:
sudo apt install -y xorg xinit startx
- Then, ensure the X server is running:
ps aux | grep X
- The X server typically disables TCP connections by default. To enable them, you need to modify the X server startup options. Edit the Xorg configuration file:
sudo nano /etc/X11/xinit/xserverrc
- Find the line that starts with exec /usr/bin/X and modify it to:
exec /usr/bin/X -listen tcp "$@"
- Save and exit the editor. Restart your X session for changes to take effect. After restarting X, try the telnet command again:
telnet 127.0.0.1 6000
- On the Linux host, run:
xhost +
, which allows X11 forwarding from any clients
Run Simulator and Debug the Apps
- Run this on terminal:
mkdir -p ~/work/minidock cd ~/work/minidock docker run \ --rm -it \ -v ./disk:/work/disk \ --network=host \ vobot/mini-dock-app-dev:latest
- If all of the above steps were completed successfully, a small X window should open on your Linux's screen;
- The console logs output can be found on the terminal. Use
Ctrl-C
to stop running; - You can edit the
./disk/apps/hello_world/__init__.py
, and re-run the docker run ... command to reload and debug your apps; - You can visit
http://localhost
to edit the configuration, or modify the./disk/conf/*.json
files. - If the 80 port is occupied, you can skip the --network=host option, and change the port mapping:
-p 8080:80
docker run \ --rm -it \ -v ./disk:/work/disk \ -p 8080:80 \ --add-host host.docker.internal:host-gateway \ vobot/mini-dock-app-dev:latest
- Operation description:
- Enter Key: Confirmation
- Escape Key: Cancel
- Left Arrow Key: Coder rotate counterclockwise
- Right Arrow Key: Code clockwise rotating clockwise
Development Environment on Windows (WSL2)
Install WSL2
1. Check System Version
- Ensure your Windows version supports WSL2: Windows 10 version 1903 or later, or Windows 11.
2. Enable WSL and Virtual Machine Platform
- Run PowerShell as an administrator and execute the following commands:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
- Restart your computer.
3. Install Linux Kernel Update Package
4. Set WSL 2 as the Default Version
wsl --set-default-version 2
wsl --set-version <distribution_name> 2
5. Install a Linux Distribution
- Search for and install Ubuntu from the Microsoft Store.
6. Initialize the Linux Distribution
- Open the installed Linux distribution and set up a username and password.
7. Check WSL Version
wsl -l -v
Install X Server
- Download and install VcXsrv.
- Configure VcXsrv: Run XLaunch, select Multiple windows and Start no client, and check Disable access control.
Install Docker
- Execute the following command in WSL2 to install dorker.
sudo apt-get update sudo apt-get upgrade sudo apt install -y docker.io sudo usermod -aG docker $USER newgrp docker
Run Emulator in WSL2
-
Run this on WSL2 terminal:
export DISPLAY="192.168.1.1:0" # Windows host address mkdir -p /mnt/d/work/minidock cd /mnt/d/work/minidock docker run \ --rm -it \ -v $(pwd)/disk:/work/disk \ --network=host \ -e DISPLAY=$DISPLAY \ vobot/mini-dock-app-dev:latest
-
If all of the above steps are completed successfully, a small X window will open on your computer screen;
- The console logs output can be found on the terminal. Use Ctrl-C to stop running;
- You can edit the
D:/work/minidock/disk/apps/hello_world/__init__.py
, and re-run thedocker run ...
command to reload and debug your apps; - You can visit
http://localhost
to edit the configuration, or modify the./disk/conf/*.json
files. - Operation description:
- Enter Key: Confirmation
- Escape Key: Cancel
- Left Arrow Key: Coder rotate counterclockwise
- Right Arrow Key: Code clockwise rotating clockwise