Tibus / TouchScreen-For-NanoDLP

Nextion Touch Screen => NodeJS => NanoDLP By Mango3D
http://fb.com/mango3dslicer
MIT License
79 stars 74 forks source link

Interface not working correctly when NanoDLP password is set. #4

Closed robpower closed 6 years ago

robpower commented 6 years ago

Interface stops working if you set up a password on NanoDLP. Plates do not show up ("Undefined") and commands do not work (Z-axis, etc). Looks like authentication needs be implemented. This should mean adding user/pass parameters to the HTTP request or using a cookie. I'm new to node.js, but I could try to help adding it. I guess it should be in the "_request" function.

Tibus commented 6 years ago

Hello, never tested the authentication on NanoDLP. It could be a problem indeed. Don't have time now so feel free to add it and make a pull request ;D

robpower commented 6 years ago

Working on it, I already figured out part of the process. Just a question, what is the difference between src and bin folders? Should I change files in /bin?

Tibus commented 6 years ago

/bin folder are build from /src with gulp so you need to install node, gulp in global and run gulp work and every file in /src folder will be build in /bin when you edit a file.

robpower commented 6 years ago

Thanks. A question: which version of nodejs have you been using? I get a compile error when I run gulp, both in Windows and in Ubuntu. In both cases I did the same: first I installed nodejs and then gulp with needed dependencies: npm install --global gulp-cli Then inside the cloned project dir: npm install --save-dev gulp npm install gulp-plumber gulp-babel babel-core del array-includes When I try to run gulp work I get the following output:

Using gulpfile ~/Sources/PHD/TouchScreen-For-NanoDLP/gulpfile.js [13:47:03] Starting 'build-compile'... [13:47:03] Finished 'build-compile' after 10 ms [13:47:03] Starting 'build-copy'... [13:47:03] Finished 'build-copy' after 1.92 ms [13:47:03] Starting 'build'... [13:47:03] Finished 'build' after 14 μs [13:47:03] Starting 'watch'... [13:47:03] Finished 'watch' after 33 ms [13:47:03] Starting 'work'... [13:47:03] Finished 'work' after 1.68 μs [13:47:03] [Compilation Error] [13:47:03] Plugin 0 specified in "base" was expected to return an object when invoked but returned "boolean"base0 [13:47:03] [Compilation Error] [13:47:03] Plugin 0 specified in "base" was expected to return an object when invoked but returned "boolean"base0

Same compilation error is repeated about 20 times, I cut the output. Possibly a nodejs version incompatibility? Any other hints? I already found a solution which should work to authenticate, so I really would like to give it back to project. PS: module array-includes is not set as required in gulpfile.js, but if missing throws a compile error; I will also add the requirement in the pull request.

EDIT: found a solution to compile error (running npm install --savedev). I was a little busy and took me a few trial and error to figure out how request-promise works, but it seems I have a working solution. I am gonna fill a PR as soon as I have tested it extensively.

Tibus commented 6 years ago

I merged it today. Will make a new realease with other bug fix asap