Project is an example with Tauri (VueJS
+ Vuetify
) as Desktop app to communicate with an Arduino in Serial.
Project aims to attempt development under a single language, Rust
.
/
/src # vuejs client
/src-arduino # arduino program in rust to upload
/src-tauri # rust backend
rust | 1.74.1 |
nodejs | >= 20.0 |
typescript | >= 5.0 |
vue-cli | >= 5.0 |
Please check Tauri documentation for additional packages: https://tauri.app/
For aarch64
compilation, additional packages are also required: https://tauri.app/v1/guides/building/linux#cross-compiling-tauri-applications-for-arm-based-devices
For Arduino compilation and build from Rust
, follow this tutorial: https://blog.logrocket.com/complete-guide-running-rust-arduino/
To consume Arduino C++
librairies (from Arduino Library Manger), follow this tutorial: https://dev.to/kgrech/five-simple-steps-to-use-any-arduino-c-library-in-a-rust-project-1k78
Default serial port used is /dev/ttyACM0
.
This can be changed in main.rs
.
Upload the script from arduino/arduino.ino
to an Arduino board.
In arduino/arduino.ino
, the GPIO pin #2
is used.
For full stack:
npm run tauri dev
Client only:
npm run serve
View Tauri building.
build
will be output in src-tauri/release/bundle/${APP_NAME}.${EXTENSION}
.
# default
npm run tauri build
# `aarch64` (Raspberry PI 64-bits):
export PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu/
npm run build:arm
The src-arduino
will get compiled and upload to the Arduino board.
avrdude
is used to compile for Arduino boards.
npm run upload:arduino
The default app will render 2 buttons to toggle a LED (on / off) via commands given through USB Serial to Arduino.
Some "logs" are printed in serial monitor (e.g VSCode):