xy-plotter / xy-server

:pencil2: raspberry pi node.js server for makeblock XY plotter v2.0
8 stars 2 forks source link

How to use the webinterface? #2

Closed jvolker closed 6 years ago

jvolker commented 6 years ago

I'm having trouble using the web interface.

After starting the server I'm getting the message: ✔︎ Success: Server up and running on http://192.168.1.25:8080

Accessing the URL via my browser I see the following screen:

screen shot 2018-02-18 at 21 12 18

Pressing the red button on the bottom left slowly fades the screen to black.

Or alternatively I tried drag and dropping an SVG file into the window which left me with:

screen shot 2018-02-18 at 20 33 47

What am I supposed to do? Or is the server not working correctly?

Thanks a lot!

arnaudjuracek commented 6 years ago

We are currently refactoring this whole repo, and will soon release a completely new version. In the meantime, check README.md : https://github.com/xy-plotter/xy-server#client-side

jvolker commented 6 years ago

Thanks!

I checked the Readme but couldn't find any info on how to use the web interface once it's up and supposedly running.

New version sounds great. Could you provide a rough time frame for this at this stage? I'm happy to help with testing.

arnaudjuracek commented 6 years ago

Sorry, my bad.

The README defines a way to programmatically add plotter jobs to the server queue. If you want to use the web interface, as in "dragging files into the browser to queue them", you'll have to use the file.save() api to create a valid .json file that you could drop in the browser.

I have to admit that I designed this server more as a proof of concept than as a production ready tool, and did not take much time for documentation.

The next version (which should be released in the next month or so, thanks to the new collaborator @pqml), will be well documented, support SVG drag and drop, and have a much cleaner architecture.

jvolker commented 6 years ago

Thanks for the explanation.

I have to admit that I designed this server more as a proof of concept than as a production ready tool, and did not take much time for documentation.

I'm totally aware of that and highly appreciate your (and @pqml's) work!

Not sure if the following is of any use since you are going to rewrite the code. I've tried the ways you explained. Unfortunately, both failed.

  1. Using file.save() and drag and dropping the JSON file in the browser again leaves the browser unresponsive with the message "queue file".

  2. Adding the jobs through the API from a different computer crashes the server with this error:

    
    queue.plotter.on('error', (err) => socket.emit('err', err.toString()));
                ^

TypeError: queue.plotter.on is not a function at Namespace.io.on (/home/pi/bin/xy-server/index.js:73:17) at emitOne (events.js:96:13) at Namespace.emit (events.js:188:7) at Namespace.emit (/home/pi/bin/xy-server/node_modules/socket.io/lib/namespace.js:209:10) at /home/pi/bin/xy-server/node_modules/socket.io/lib/namespace.js:177:14 at _combinedTickCallback (internal/process/next_tick.js:73:7) at process._tickCallback (internal/process/next_tick.js:104:9)```