Luban icon indicating copy to clipboard operation
Luban copied to clipboard

Feature Request: Add Raspberry Pi support

Open soberwalder opened this issue 4 years ago • 17 comments

I tried to compile Luban for my Raspberry Pi 4 but I failed somewhere in the long list of dependencies. It would be great if you can provide a binary package for Raspberry.

soberwalder avatar Nov 27 '20 21:11 soberwalder

Which distro of Pi are you using, Raspbian? Not sure if the .deb version can be used.

parachvte avatar Dec 01 '20 08:12 parachvte

pi@raspberrypi:~ $ cat /etc/os-release 
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

I'm afraid I can't use the .deb version because it is compiled for x86 and the Raspberry has an ARM processor. But I have not tried it either.

soberwalder avatar Dec 01 '20 08:12 soberwalder

Just tested the install of the .deb file which failed as expected.

soberwalder avatar Dec 01 '20 09:12 soberwalder

@soberwalder have you also tried to use Ubuntu 20.04/20.10 on the raspberry instead of Raspbian?

deimi avatar Jan 27 '21 14:01 deimi

Hi @deimi no, I've not yet tried to install on Ubuntu but it will not install because of the different CPU architecture of the Raspberry Pi (arm64). The current deb file has amd64 architecture.

soberwalder avatar Jan 27 '21 15:01 soberwalder

yes, I'm aware of this, so I was not talking about the deb file but maybe the compilation works there

deimi avatar Jan 27 '21 15:01 deimi

Took me a few days - needed to order a new SD card for testing this

Installed Ubuntu 20.10

lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.10 Release: 20.10 Codename: groovy

Installed git, libgconf, binutils, rpm and nvm Cloned the Luban repo

npm install gave me following ouput

npm install

@serialport/[email protected] install /home/stefan/prog/Luban/node_modules/@serialport/bindings prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=10.23.2 runtime=node arch=arm64 libc= platform=linux) gyp ERR! build error gyp ERR! stack Error: not found: make gyp ERR! stack at getNotFoundError (/home/stefan/.nvm/versions/node/v10.23.2/lib/node_modules/npm/node_modules/which/which.js:13:12) gyp ERR! stack at F (/home/stefan/.nvm/versions/node/v10.23.2/lib/node_modules/npm/node_modules/which/which.js:68:19) gyp ERR! stack at E (/home/stefan/.nvm/versions/node/v10.23.2/lib/node_modules/npm/node_modules/which/which.js:80:29) gyp ERR! stack at /home/stefan/.nvm/versions/node/v10.23.2/lib/node_modules/npm/node_modules/which/which.js:89:16 gyp ERR! stack at /home/stefan/.nvm/versions/node/v10.23.2/lib/node_modules/npm/node_modules/isexe/index.js:42:5 gyp ERR! stack at /home/stefan/.nvm/versions/node/v10.23.2/lib/node_modules/npm/node_modules/isexe/mode.js:8:5 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:153:21) gyp ERR! System Linux 5.8.0-1006-raspi gyp ERR! command "/home/stefan/.nvm/versions/node/v10.23.2/bin/node" "/home/stefan/.nvm/versions/node/v10.23.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/stefan/prog/Luban/node_modules/@serialport/bindings gyp ERR! node -v v10.23.2 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/watchpack/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm64"})

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @serialport/[email protected] install: prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @serialport/[email protected] install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /home/stefan/.npm/_logs/2021-02-01T20_36_05_852Z-debug.log

Logfile attached 2021-02-01T20_36_05_852Z-debug.log

Same error as on Raspbian by the way.

Tried npm run dev with the following output

npm run dev

[email protected] dev /home/stefan/prog/Luban npm run build-dev && npm run start-dev

[email protected] prebuild-dev /home/stefan/prog/Luban bash build/prebuild-dev.sh

[email protected] pkgsync /home/stefan/prog/Luban node build/pkgsync.js

~/prog/Luban/src ~/prog/Luban

Successfully compiled 3 files with Babel. Successfully compiled 5 files with Babel. ~/prog/Luban

[email protected] build-dev /home/stefan/prog/Luban gulp development

[21:38:12] Requiring external module @babel/register [21:38:16] Using gulpfile ~/prog/Luban/gulpfile.babel.js [21:38:16] Starting 'development'... [21:38:16] Starting 'prepareDevelopment'... [21:38:16] Finished 'prepareDevelopment' after 2.66 ms [21:38:16] Starting 'clean'... [21:38:16] Finished 'clean' after 483 ms [21:38:16] Starting 'serverCopyDevelopment'... [21:38:16] Starting 'serverBuildDevelopment'... [21:38:16] Starting 'appCopyDevelopment'... [21:38:54] [server:build] Hash: 3fa8c30478921923a24b Version: webpack 4.41.6 Time: 36835ms Built at: 2021-02-01 9:38:54 PM Asset Size Chunks Chunk Names index.js 4.46 MiB index [emitted] index Entrypoint index = index.js [0] multi ./index.js 28 bytes {index} [built] [../../node_modules/@babel/runtime/helpers/defineProperty.js] /home/stefan/prog/Luban/node_modules/@babel/runtime> /helpers/defineProperty.js 289 bytes {index} [built] [../../node_modules/@babel/runtime/helpers/typeof.js] /home/stefan/prog/Luban/node_modules/@babel/runtime/helpers/typeof.js 479 bytes {index} [built] [./DataStorage.js] 14.3 KiB {index} [built] [./app.js] 10.8 KiB {index} [built] [./config/settings.js] 453 bytes {index} [built] [./index.js] 5.27 KiB {index} [built] [./lib/logger.js] 2.05 KiB {index} [built] [./services/configstore/index.js] 6.38 KiB {index} [built] [./services/index.js] 9.1 KiB {index} [built] [./services/monitor/index.js] 1.59 KiB {index} [built] [bcrypt-nodejs] external "bcrypt-nodejs" 42 bytes {index} [built] [chalk] external "chalk" 42 bytes {index} [built] [dns] external "dns" 42 bytes {index} [built] [fs] external "fs" 42 bytes {index} [built] + 427 hidden modules

ERROR in ./lib/SerialConnection.js Module not found: Error: Can't resolve 'serialport' in '/home/stefan/prog/Luban/src/server/lib' @ ./lib/SerialConnection.js 18:0-36 22:15-25 215:22-32 @ ./controllers/Marlin/ScreenController.js @ ./services/socket/socket-serial.js @ ./services/index.js @ ./index.js @ multi ./index.js

ERROR in ./services/socket/socket-serial.js Module not found: Error: Can't resolve 'serialport' in '/home/stefan/prog/Luban/src/server/services/socket' @ ./services/socket/socket-serial.js 2:0-36 28:2-12 @ ./services/index.js @ ./index.js @ multi ./index.js [21:38:54] Finished 'serverBuildDevelopment' after 37 s [21:38:54] Finished 'serverCopyDevelopment' after 37 s [21:38:54] Finished 'appCopyDevelopment' after 38 s [21:38:54] Finished 'development' after 38 s

[email protected] start-dev /home/stefan/prog/Luban gulp serverStartDevelopment

[21:38:56] Requiring external module @babel/register [21:39:00] Using gulpfile ~/prog/Luban/gulpfile.babel.js [21:39:00] Starting 'serverStartDevelopment'... [21:39:00] [nodemon] 1.19.4 [21:39:00] [nodemon] to restart at any time, enter rs [21:39:00] [nodemon] ignoring: ./.git//* node_modules//node_modules [21:39:00] [nodemon] watching dir(s): src/server//* src/shared//* [21:39:00] [nodemon] watching extensions: js,json [21:39:00] [nodemon] bind restart -> osascript -e 'display notification "App restarted due to: '$FILENAME'" with title "nodemon"' [21:39:00] [nodemon] starting node ./bin/cli [21:39:00] [nodemon] forking [21:39:00] [nodemon] child pid: 50286 [21:39:00] [nodemon] watching 188 files Error: Error: There is no built binary for font-manager at Object. (/home/stefan/prog/Luban/node_modules/font-scanner/index.js:8:11) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at eval (webpack-internal:///font-scanner:1:18) at Object.font-scanner (/home/stefan/prog/Luban/output/server/index.js:4505:1) at webpack_require (/home/stefan/prog/Luban/output/server/index.js:21:30) at eval (webpack-internal:///./lib/FontManager.js:23:71) at Module../lib/FontManager.js (/home/stefan/prog/Luban/output/server/index.js:3118:1) at webpack_require (/home/stefan/prog/Luban/output/server/index.js:21:30) at eval (webpack-internal:///./lib/svg-convert.js:18:70) at Module../lib/svg-convert.js (/home/stefan/prog/Luban/output/server/index.js:3750:1) [21:39:03] [nodemon] clean exit - waiting for changes before restart

soberwalder avatar Feb 01 '21 21:02 soberwalder

serialport (https://github.com/serialport/node-serialport) is not properly installed.

In short:

  1. it doesn't have pre-built binary for (target=10.23.2 runtime=node arch=arm64 libc= platform=linux)
  2. and you don't have make installed to build on your local machine.

for 1), we need @serialport/bindings pre-built binary. I've searched @serialport/[email protected], The version of Electron we used is v76, but for some reason the binary is missing, only version up to bindings-v8.0.8-electron-v75-linux-x64.tar.gz.

To resolve this, either downgrade Electron version or upgrade serialport to v9. upgrade serialport to v9 is much simpler, you can start from there.

parachvte avatar Feb 02 '21 03:02 parachvte

  1. I've installed make and build-essentials (thx for the hint)

  2. npm install serialport

@serialport/[email protected] install /home/stefan/node_modules/@serialport/bindings prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild ...

added 64 packages from 43 contributors and audited 78 packages in 19.978s

5 packages are looking for funding run npm fund for details

found 0 vulnerabilities

  1. npm install

[email protected] prepare /home/stefan/prog/Luban npm run clean

[email protected] clean /home/stefan/prog/Luban bash -c 'rm -rf ./dist ./output'

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/stylint/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm64"})

audited 2491 packages in 44.493s

81 packages are looking for funding run npm fund for details

found 11 vulnerabilities (4 low, 5 moderate, 2 high) run npm audit fix to fix them, or npm audit for details

  1. npm run dev

... Error: Error: There is no built binary for font-manager at Object. (/home/stefan/prog/Luban/node_modules/font-scanner/index.js:8:11) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at eval (webpack-internal:///font-scanner:1:18) at Object.font-scanner (/home/stefan/prog/Luban/output/server/index.js:4505:1) at webpack_require (/home/stefan/prog/Luban/output/server/index.js:21:30) at eval (webpack-internal:///./lib/FontManager.js:23:71) at Module../lib/FontManager.js (/home/stefan/prog/Luban/output/server/index.js:3118:1) at webpack_require (/home/stefan/prog/Luban/output/server/index.js:21:30) at eval (webpack-internal:///./lib/svg-convert.js:18:70) at Module../lib/svg-convert.js (/home/stefan/prog/Luban/output/server/index.js:3750:1)

Installed font-manager with sudo apt-get install font-manager but it didn't change anything.

Tried npm install font-manager with a few warnings but the npm run dev still failed with the "There is no built binary for font-manager"

soberwalder avatar Feb 02 '21 16:02 soberwalder

I cloned the git repo in a new folder and it suddenly compiled. Going to test it with a clean install of Ubuntu again, write down the steps and try it under Raspian OS afterwards.

soberwalder avatar Feb 02 '21 20:02 soberwalder

When you describe the steps, please share them here. I've been working on a Dockerfile to make stand-alone containers with Luban installed and using the .deb is giving me missing dependencies. I haven't yet managed to determine what they should be, so I haven't yet created an issue to report it, but it seems related to your experience.

o

On Wed, 3 Feb 2021 at 04:31, soberwalder [email protected] wrote:

I cloned the git repo in a new folder and it suddenly compiled. Going to test it with a clean install of Ubuntu again, write down the steps and try it under Raspian OS afterwards.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Snapmaker/Luban/issues/590#issuecomment-771961358, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF4P4JGJJ5I5RMXHJVJDRSTS5BOLFANCNFSM4UFKHQPQ .

-- Onno Benschop

()/)/)() ..ASCII for Onno.. |>>? ..EBCDIC for Onno.. --- -. -. --- ..Morse for Onno..

If you need to know: "What computer should I buy?" http://goo.gl/spsb66

ITmaze - ABN: 56 178 057 063 - ph: 04 1219 8888 - [email protected]

ITmaze avatar Feb 03 '21 02:02 ITmaze

@ITmaze I've setup a fresh installation of Ubuntu 20.10 and installed the following packages before the Development section in the README.md sudo apt-get install git make build-essential libfontconfig-dev curl

I did the same on my Raspbian OS installation and it worked too.

@parachvte It looks like it worked with serialport 9.0.4. Do you want me to change this in packages.json? Besides this change I'd add libfontconfig-dev as additional package for the development environment in the README.md. It's needed to build the font-manager. After that it should be possible to provide binary packages for Raspberry Pi

soberwalder avatar Feb 03 '21 15:02 soberwalder

@soberwalder Yes please open a pull request merging branch master. We'll test it too on macOS and Windows.

If we use Travis-CI to build executable, probably we need to add configuration for Electron to build ARM version. Or do you think it is ok to add document instructions on compilation for Raspberry Pi / Dockerfile?

parachvte avatar Feb 04 '21 02:02 parachvte

I'm in two minds.

I've now attempted to install using the repo, the tgz and the deb inside Docker using a variety of options and dependencies. Normally I'd say that if there is a "standard" linux installation/build instructions, a Docker installation can pretty much follow the same path.

On the other hand, there are several different things you can build using Docker. There is the ability to have a Docker image represent a running instance of snapmaker-luban, complete with GUI, as-if it's running as a locally installed application. Another option is to use Docker to create the installation packages, the tgz, the deb, the exe, the rpm etc. This could be used to generate all the build artefacts. Finally, Docker could be used to run snapmaker-luban as a web-server that can be accessible from a browser.

I think we need to first update the README.md to have a complete set of instructions. For example, nvm isn't a standard package in any of the linux images I have seen and installing it seems non-trivial.

How about splitting README.md into two, with a DEVELOPMENT.md discussing the build process, and leaving the README.md with end-user artefact installation instructions. Installing nvm or build-essentials isn't something that an end-user would typically do.

Finally, I'd advocate for including a Docker based build process. I've started the process of making something that can build GUI app containers for each release, but that's only part of the puzzle.

Thoughts?

ITmaze avatar Feb 04 '21 03:02 ITmaze

A few months ago, I tried to do it on Raspberry 3 b+. Maybe you can try this. https://github.com/jane-rose/OctoLuban

jane-rose avatar Feb 04 '21 09:02 jane-rose

@parachvte Pull request created (#752) Adding the complete build configuration for arm64 and Linux would be awesome but as first step a document with the instructions would be sufficient.

@ITmaze I have just used docker container for compiling. No experience with container with GUI and apps running in it. In theory it could help with the deployment to different OS if you are using not-so-multi-platform technology/programming languages etc. For developers a docker container running a snapmaker-luban web-server would be useful. I think it would be almost the same as a compile container.

@jane-rose I will have a look - thanks

soberwalder avatar Feb 04 '21 22:02 soberwalder

Did you progress on this? I might just run it on a Windows pc and expose it to the network, but putting on the pi makes so much more sense. Also integrating with octoprint as a slicer style plugin would be awesome. I used plugins in the past running slicer and cura inside octoprint quite happily. It would need a tweak as to whether to have an extra queue in octoprint option as well as the usual export gcode / load in workspace.

Shortest solution is to run octoprint on the pi, with cura slicer (built in) but pointed at your tweaked snapmaker cura profiles included with Luban. I'm slicing on the pc and sending to octoprint so one extra step, but gives me full slicer interface and Windows 3d builder for model fixing.

tyeth avatar Mar 05 '22 13:03 tyeth