在 Orange Pi One 上安裝 CNCJS
參考
- https://www.misterngan.com/4698/remote-control-your-grbl-cnc-machine-using-cncjs/
- https://www.misterngan.com/4779/grbl-installing-and-setting-cncjs/
- https://github.com/cncjs/cncjs
安裝 "Node Version Manager" 來管理多個 Node.js 版本。
# 安裝 nvm
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
$ source .profile
$ source .bashrc
#安裝最新的 node.js
$ nvm install 22
$ nvm use 22
# 執行 node 會出現錯誤
# node: error while loading shared libraries: libatomic.so.1: cannot open shared object file: No such file or directory
$ sudo apt install libatomic1
# 更新 npm
$ npm install npm@latest -g
# 安裝 cncjs
$ npm install -g cncjs
# 更新 cncjs
$ npm install -g cncjs@latestsudo apt install xinit xinput x11-xserver-utils xserver-xorg-input-evdev xserver-xorg-input-libinput xserver-xorg-legacy xserver-xorg-video-fbdev
sudo apt install chromium-browser
修改 /etc/X11/Xwrapper.config,"allowed_users=anybody"
-------------
# 建立 start_tinyweb.sh
chromium-browser --noerrdialogs --disable-suggestions-service --disable-translate --disable-save-password-bubble --disable-session-crashed-bubble --disable-infobars --touch-events=enabled --disable-gesture-typing --kiosk http://localhost:8000/pendant/
-------------
-------------
cncjs -m /tinyweb:/home/klipper/cncjs-pendant-tinyweb-1.2.4/src &
執行 xinit ./start_tinyweb.sh。
Add a shutdown widget to CNCjs
Go to Settings > Commands, click "+ New," title it "Shutdown," and enter "sudo shutdown -h now" as the command.
sudo visudo
your_username ALL=NOPASSWD: /sbin/shutdown