1 (edited by rhys 2017-11-30 12:25:15)

Topic: Web UI and relay for Davinci printers using a Raspberry pi or windows

Hi,
I don't know if there was an already existing project for this but,
I've created a simple web interface and wifi <> usb relay for Davinci Jr
just thought I would share the project  in case others were after a similar thing

Background
I wanted to make my existing Davinci Jr to work over WiFi to remove the need to the usb cable running across the room. (I did not want to use the sdcard )

my solution was to use a raspberry pi zero w as a "relay" between XYZWare and the printer.

http://soliforum.com/i/?od5dXeb.png
the project is written in golang aka go and is located at https://github.com/rhysbryant/goprinterrelay

While I use it on the Raspberry Pi it there is a build for most platforms under releases on the project page.

for thre latest release  go to releases page

https://github.com/rhysbryant/goprinter … ses/latest

Demo: https://htmlpreview.github.io/?https:// … index.html

2

Re: Web UI and relay for Davinci printers using a Raspberry pi or windows

Excellent.  I was wanting to do something like this.  I'll give it a try.  It should work on a RPi2, correct?
Do you have all the status codes that the printer generates? 
I'm downloading as we speak

3 (edited by mjf55 2017-09-03 02:25:04)

Re: Web UI and relay for Davinci printers using a Raspberry pi or windows

Ok, how would you like to handle bugs?  Thru this thread or an issues page on the project.  Since this are minor, I'll just post here to start.  (edit:solutions in bold )

EDIT 1 and 2 you already covered in the readme that I just glanced at.

EDIT That works.  Very nice.  Sure beats my little command line Status app.

Now to play with it.

PS still no emulator.

EDIT2- Bug3 - Well, I started the command in a putty window, since my RPi is headless ( prro thing ;-) ) .  Every few seconds I get a screen fu;; of data.  I t looks like the app is polling the printer and also dumps the data to the console in addition to formatting it to the web page.  Make it very hard to use the command window.
Temp solution : Pipe output to null like this :./goprinter_linux_arm &>/dev/null &  (EDIT Fixed this command)

Bug4 - While app is running, cannot use threedub to start another print.  Seems it keeps the USB port and makes it unavailable for other apps to use.

Request- make this a deemon.

4 (edited by rhys 2017-09-03 00:43:13)

Re: Web UI and relay for Davinci printers using a Raspberry pi or windows

EDIT2- Bug3 - Well, I started the command in a putty window, since my RPi is headless ( prro thing ;-) ) .  Every few seconds I get a screen fu;; of data.  I t looks like the app is polling the printer and also dumps the data to the console in addition to formatting it to the web page.  Make it very hard to use the command window.
Temp solution : Pipe output to null like this : ./goprinter_linux_arm >> null &

Bug4 - While app is running, cannot use threedub to start another print.  Seems it keeps the USB port and makes it unavailable for other apps to use.

Request- make this a deemon.


I am thinking I'll add integration with threedub. i.e upload file UI on the webpage. it will then run  threedub  to upload the file. the command to execute would be configurable in config so could be changed to work with other tools too.

I'll was already thinking I'll an example to the readme for running as a daemon
but do it correctly it needs a install script that will to create it's own user with access to the serial device so running as root it not needed. that's also on my to do list

5

Re: Web UI and relay for Davinci printers using a Raspberry pi or windows

rhys wrote:

I am thinking I'll add integration with threedub. i.e upload file UI on the webpage. it will then run  threedub  to upload the file. the command to execute would be configurable in config so could be changed to work with other tools too.

I'll was already thinking I'll an example to the readme for running as a daemon
but do it correctly it needs a install script that will to create it's own user with access to the serial device so running as root it not needed. that's also on my to do list

I like it.  To me, adding threedub integration would be more important, or at least a better feature.  For know, I can kill the process to end the program. 

How about adding a video window so this would be a substitute for Octoprint ( which does not support xyzprinting.

6

Re: Web UI and relay for Davinci printers using a Raspberry pi or windows

mjf55 wrote:

Temp solution : Pipe output to null like this :./goprinter_linux_arm &>/dev/null &  (EDIT Fixed this command)
.

edited the above line.  Correct command is ./goprinter_linux_arm &>/dev/null &

7

Re: Web UI and relay for Davinci printers using a Raspberry pi or windows

mjf55 wrote:
rhys wrote:

I am thinking I'll add integration with threedub. i.e upload file UI on the webpage. it will then run  threedub  to upload the file. the command to execute would be configurable in config so could be changed to work with other tools too.

I'll was already thinking I'll an example to the readme for running as a daemon
but do it correctly it needs a install script that will to create it's own user with access to the serial device so running as root it not needed. that's also on my to do list

I like it.  To me, adding threedub integration would be more important, or at least a better feature.  For know, I can kill the process to end the program. 

How about adding a video window so this would be a substitute for Octoprint ( which does not support xyzprinting.


I've updated the github project with a new release that includes support for custom actions in the WebUI with any number of fields
simply add a file to tools directory with the command and fields see example json file and help link in the Web page.

I would like to see if the format/process makes any sense to someone else so your challenge if you wish to accept is to add a custom command for threedub should be simple (I hope). remember that the tool file is only read on start of the program
should be simple I hope -- I'll fix this soon.

let me know how you go with getting threedub  to work with it.


Video support was something I wanted to get working in the first release but still requires a bit more experimentation I was trying to get vlc to transcode my USB webcam but short of using flash and rtmp, I need to use http live streaming but that requires caching to the file system I was trying to avoid that It would add to the latency.

8

Re: Web UI and relay for Davinci printers using a Raspberry pi or windows

Ok, here is a thought on the video/picture idea. Since you are already using a PI, why not implement the motion program? It already has the interface for the video built-in and if you would like to display updated stills on the screen it could provide that also. Just a thought.

9

Re: Web UI and relay for Davinci printers using a Raspberry pi or windows

mjf55 wrote:
mjf55 wrote:

Temp solution : Pipe output to null like this :./goprinter_linux_arm &>/dev/null &  (EDIT Fixed this command)
.

edited the above line.  Correct command is ./goprinter_linux_arm &>/dev/null &



You know you could run the program with the following command and not have to worry about it:

nohup ./goprinterrelay-master &

10 (edited by mjf55 2017-09-04 16:59:04)

Re: Web UI and relay for Davinci printers using a Raspberry pi or windows

Bozotclown1970 wrote:
mjf55 wrote:
mjf55 wrote:

Temp solution : Pipe output to null like this :./goprinter_linux_arm &>/dev/null &  (EDIT Fixed this command)
.

edited the above line.  Correct command is ./goprinter_linux_arm &>/dev/null &



You know you could run the program with the following command and not have to worry about it:

nohup ./goprinterrelay-master &

I have been using linux for 15 years or so and never heard of this command.  Learn something new all the time.  thanks for that. 
I'll give it a go.

edit:  still need redirection to eliminate any output. 
using nohup ./goprinter_linux_arm &>/dev/null &

11

Re: Web UI and relay for Davinci printers using a Raspberry pi or windows

rhys wrote:
mjf55 wrote:
rhys wrote:

I am thinking I'll add integration with threedub. i.e upload file UI on the webpage. it will then run  threedub  to upload the file. the command to execute would be configurable in config so could be changed to work with other tools too.

I'll was already thinking I'll an example to the readme for running as a daemon
but do it correctly it needs a install script that will to create it's own user with access to the serial device so running as root it not needed. that's also on my to do list

I like it.  To me, adding threedub integration would be more important, or at least a better feature.  For know, I can kill the process to end the program. 

How about adding a video window so this would be a substitute for Octoprint ( which does not support xyzprinting.


I've updated the github project with a new release that includes support for custom actions in the WebUI with any number of fields
simply add a file to tools directory with the command and fields see example json file and help link in the Web page.

I would like to see if the format/process makes any sense to someone else so your challenge if you wish to accept is to add a custom command for threedub should be simple (I hope). remember that the tool file is only read on start of the program
should be simple I hope -- I'll fix this soon.

let me know how you go with getting threedub  to work with it.


Video support was something I wanted to get working in the first release but still requires a bit more experimentation I was trying to get vlc to transcode my USB webcam but short of using flash and rtmp, I need to use http live streaming but that requires caching to the file system I was trying to avoid that It would add to the latency.

I accept the challenge, but I am golang literate.  But, that wont stop me. (I hope)

12

Re: Web UI and relay for Davinci printers using a Raspberry pi or windows

So I downloaded the new stuff on GITHUB, but there is no executable file.  Do I need to compile it?   If so, what packages are needed for the RPI.  Looking into it now.

13

Re: Web UI and relay for Davinci printers using a Raspberry pi or windows

mjf55 wrote:
Bozotclown1970 wrote:
mjf55 wrote:

edited the above line.  Correct command is ./goprinter_linux_arm &>/dev/null &



You know you could run the program with the following command and not have to worry about it:

nohup ./goprinterrelay-master &

I have been using linux for 15 years or so and never heard of this command.  Learn something new all the time.  thanks for that. 
I'll give it a go.

edit:  still need redirection to eliminate any output. 
using nohup ./goprinter_linux_arm &>/dev/null &


There you go!  smile

I thought of that after I posted it.

14 (edited by Bozotclown1970 2017-09-04 17:20:40)

Re: Web UI and relay for Davinci printers using a Raspberry pi or windows

mjf55 wrote:

So I downloaded the new stuff on GITHUB, but there is no executable file.  Do I need to compile it?   If so, what packages are needed for the RPI.  Looking into it now.


Yes you will need to compile it. I can zip up my go folder for you if you want me to.

15

Re: Web UI and relay for Davinci printers using a Raspberry pi or windows

Bozotclown1970 wrote:
mjf55 wrote:

So I downloaded the new stuff on GITHUB, but there is no executable file.  Do I need to compile it?   If so, what packages are needed for the RPI.  Looking into it now.


Yes you will need to compile it. I can zip up my go folder for you if you want me to.

I'll give an apt-get install a try first.  I'll let you know tonight.  Thanks for the offer.

16

Re: Web UI and relay for Davinci printers using a Raspberry pi or windows

I'm not sure, but I don't think that is going to work.

17 (edited by rhys 2017-09-04 22:19:13)

Re: Web UI and relay for Davinci printers using a Raspberry pi or windows

Bozotclown1970 wrote:
mjf55 wrote:

So I downloaded the new stuff on GITHUB, but there is no executable file.  Do I need to compile it?   If so, what packages are needed for the RPI.  Looking into it now.


Yes you will need to compile it. I can zip up my go folder for you if you want me to.

On The github project site there is a releases tab. I'll add a link to it in the readme later.
You should need to compile it. There is pre built versions for each platform

18

Re: Web UI and relay for Davinci printers using a Raspberry pi or windows

rhys wrote:
Bozotclown1970 wrote:
mjf55 wrote:

So I downloaded the new stuff on GITHUB, but there is no executable file.  Do I need to compile it?   If so, what packages are needed for the RPI.  Looking into it now.


Yes you will need to compile it. I can zip up my go folder for you if you want me to.

On The github project site there is a releases tab. I'll add a link to it in the readme later.
You should need to compile it. There is pre built versions for each platform


This is what I did. I downloaded the most current version then compiled it.

Thank you very much. Looks great.

19

Re: Web UI and relay for Davinci printers using a Raspberry pi or windows

mjf55 wrote:

So I downloaded the new stuff on GITHUB, but there is no executable file.  Do I need to compile it?   If so, what packages are needed for the RPI.  Looking into it now.


Did you get it working? I've added a link to the release builds to the original post in this thread.

20

Re: Web UI and relay for Davinci printers using a Raspberry pi or windows

Bozotclown1970 wrote:
rhys wrote:
Bozotclown1970 wrote:

Yes you will need to compile it. I can zip up my go folder for you if you want me to.

On The github project site there is a releases tab. I'll add a link to it in the readme later.
You should need to compile it. There is pre built versions for each platform


This is what I did. I downloaded the most current version then compiled it.

Thank you very much. Looks great.

I downloaded the recent released version and untar'd it.  Works great.  Thanks......................
p.s. I did compile golang on my pi, but have a few path issues i need to resolve.

21 (edited by mjf55 2017-09-05 02:24:15)

Re: Web UI and relay for Davinci printers using a Raspberry pi or windows

So I took your challenge and created threedubExample.json.   the intent is to execute the simple threedub command to convert a gcode file to 3w file.
I have attached it here.

Where do these tools show up on the web page?  I would expect to see your grepExample, but I do not.

22

Re: Web UI and relay for Davinci printers using a Raspberry pi or windows

mjf55 wrote:

So I took your challenge and created threedubExample.json.   the intent is to execute the simple threedub command to convert a gcode file to 3w file.
I have attached it here.

Where do these tools show up on the web page?  I would expect to see your grepExample, but I do not.

Do you see a commands menu item at the top of the page?

23 (edited by mjf55 2017-09-05 02:55:32)

Re: Web UI and relay for Davinci printers using a Raspberry pi or windows

rhys wrote:
mjf55 wrote:

So I took your challenge and created threedubExample.json.   the intent is to execute the simple threedub command to convert a gcode file to 3w file.
I have attached it here.

Where do these tools show up on the web page?  I would expect to see your grepExample, but I do not.

Do you see a commands menu item at the top of the page?

Dumb of me.  I understand the page now.  Time to restart and see if my command is there.

EDIT:  Looks like i need a little work on the json file.  Not exactly what I want.  Its not exactly obvious, but not too bad. 

Now, all the commands run on the local system, in my case my laptop.  However, all my set up items are on the RPi controlling the printer.  Can you make these json command work on the RPi?

24

Re: Web UI and relay for Davinci printers using a Raspberry pi or windows

mjf55 wrote:
rhys wrote:
mjf55 wrote:

So I took your challenge and created threedubExample.json.   the intent is to execute the simple threedub command to convert a gcode file to 3w file.
I have attached it here.

Where do these tools show up on the web page?  I would expect to see your grepExample, but I do not.

Do you see a commands menu item at the top of the page?

Dumb of me.  I understand the page now.  Time to restart and see if my command is there.

EDIT:  Looks like i need a little work on the json file.  Not exactly what I want.  Its not exactly obvious, but not too bad. 

Now, all the commands run on the local system, in my case my laptop.  However, all my set up items are on the RPi controlling the printer.  Can you make these json command work on the RPi?

Sorry I'm not sure what you mean. The commands are executed server side i.e on the system serving the web page. In your case the rpi

25 (edited by mjf55 2017-09-05 04:48:31)

Re: Web UI and relay for Davinci printers using a Raspberry pi or windows

rhys wrote:
mjf55 wrote:
rhys wrote:

Do you see a commands menu item at the top of the page?

Dumb of me.  I understand the page now.  Time to restart and see if my command is there.

EDIT:  Looks like i need a little work on the json file.  Not exactly what I want.  Its not exactly obvious, but not too bad. 

Now, all the commands run on the local system, in my case my laptop.  However, all my set up items are on the RPi controlling the printer.  Can you make these json command work on the RPi?

Sorry I'm not sure what you mean. The commands are executed server side i.e on the system serving the web page. In your case the rpi

For me, when I go to the Command page and select the grepExample - choose file button, the window that pops up is a Windows ( client ) file dialogue box, not an RPi one.  See picture here

Post's attachments

Capture.JPG
Capture.JPG 112 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.