A macOS-based development environment for Raspberry Pi Compute Module 4 (Lite, Wi-Fi). Includes system configuration, remote access setup, and example scripts for GPIO, camera, and sensor interfacing.
| Component | Specification |
|---|---|
| Module | Raspberry Pi CM4 Lite (no eMMC) |
| SoC | BCM2711, Quad-core Cortex-A72 @ 1.5GHz |
| RAM | 4GB LPDDR4 |
| Storage | 32GB MicroSD (Raspbian Trixie) |
| Wireless | Dual-band WiFi 802.11ac, Bluetooth 5.0 |
| USB | 4x USB 3.0 |
| GPIO | 40-pin header, I2C, SPI, UART |
| Carrier Board | Hiwonder CM4 Board (RPi 4B compatible) |
| Power | USB-C 5V/3A |
- OS: Raspbian GNU/Linux 13 (trixie)
- Kernel: Linux 6.18.34+rpt-rpi-v8 aarch64
- Python: 3.13.5
- IP (WiFi): 192.168.0.153
- User: yuanji
Use Raspberry Pi Imager to write Raspberry Pi OS to a MicroSD card. Configure username, password, WiFi, and SSH in the Imager settings before flashing.
ssh yuanji@192.168.0.153For passwordless access, copy your SSH key:
ssh-copy-id yuanji@192.168.0.153# GPIO blink test
python3 examples/blink.py
# I2C device scan
python3 examples/i2c_scan.py
# Camera capture
python3 examples/camera_capture.pyrpi-cm4-dev/
├── README.md
├── docs/
│ └── setup.md # Detailed setup guide
├── examples/
│ ├── blink.py # GPIO LED blink
│ ├── i2c_scan.py # I2C bus scanner
│ ├── camera_capture.py # PiCamera2 capture
│ └── servo_control.py # PWM servo control
├── scripts/
│ ├── deploy.sh # Deploy code to CM4 via rsync
│ └── system_info.sh # Print system diagnostics
└── config/
└── interfaces.md # Pin mapping & wiring reference
| Interface | Device | Status |
|---|---|---|
| I2C | /dev/i2c-20, /dev/i2c-21 | Active |
| SPI | /dev/spidev* | Needs enabling |
| UART | /dev/ttyAMA* | Needs enabling |
| Camera | CSI (libcamera) | Available via picamera2 |
| GPIO | gpiozero / lgpio | Ready |
gpiozero/lgpio/gpiod— GPIO controlpicamera2— Camera interfacesmbus2/spidev— I2C/SPI communicationnumpy/pillow— Data & image processingpygame— Display & inputsense-hat— Sense HAT sensor suitepyserial— Serial communication
Mac (VS Code / Terminal)
│
├── Edit code locally
├── rsync/scp to CM4
│ ↓
└── SSH → Run & Debug on CM4
Or use VS Code Remote-SSH extension for seamless editing directly on the Pi.
# Sync project files to CM4
./scripts/deploy.shMIT