🇹🇷 Türkçe versiyon için tıklayın
Linux SPI Simulator provides a configurable SPI driver system with a web interface that can be tested in virtual machines. This project can be used to simulate and test the SPI protocol.
- Web-based user interface
- Real-time SPI message monitoring
- Customizable SPI configuration
- Sequence-based response system
- Detailed logging and debugging
- Linux operating system (Ubuntu 20.04 or higher recommended)
- Python 3.8 or higher
- Node.js 16 or higher
- Linux kernel headers
- Build tools (make, gcc, cmake)
- Install required packages:
sudo apt-get update
sudo apt-get install -y build-essential linux-headers-$(uname -r) python3-pip nodejs npm
- Clone the project:
git clone https://github.com/haknkayaa/SPI_Simulator.git
cd spi-simulator
- Install Python dependencies:
cd simulator/userspace
pip3 install -r requirements.txt
- Install Frontend dependencies:
cd frontend
npm install
- Build the kernel module:
cd ../../kernelspace
make
- Build the frontend:
cd ../userspace/frontend
npm run build
- Start the backend:
cd ../userspace
python3 app.py
- Start the frontend (in a new terminal window):
cd frontend
npm run dev
- Open
http://localhost:5173
in your browser.
The web interface consists of three main sections:
-
Configuration Panel
- SPI device path
- Bus number
- Chip Select number
- SPI speed
- SPI mode
- Bits per word
-
Sequence Management
- Add new sequences
- View existing sequences
- Delete sequences
- Import/export sequences
-
Terminal
- Real-time log viewing
- Command history
- SPI messages
- Enter the command in hex format in the "Command Interface" section
- Click the "Send" button
- The response will be displayed in the terminal section
- In the "Sequence Management" section:
- Enter the expected command in the "Received Data" field
- Enter the response in the "Response" field
- Click the "Add Sequence" button
Main screen view
Sequence management panel
Terminal and log viewing
-
Driver won't load
- Ensure kernel headers are installed
- Check your sudo permissions
- Check dmesg output
-
Cannot access web interface
- Ensure backend and frontend services are running
- Check for port conflicts
- Check firewall settings
- Kernel logs:
dmesg | grep "SPI Simulator"
- Backend logs:
simulator/userspace/app.log
- Frontend logs: Browser developer console
- Fork this repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Hakan Kaya - @haknkayaa
Project Link: https://github.com/haknkayaa/SPI_Simulator