control multiple printer with node.js server



  • hello,
    i want to control multiple duet3D - printer with a server. my plan is, to register every printer at my node.js server.

    how can i send a print status from my duet3D - wifi to the server ? and how did i receive the message with node.js ?

    i usually implement endpoints with node.js and receive the messages through post http requests.
    is this possible and is this a good solution , if i want to manage multiple printer ?

    best regards





  • thanks,

    but i know the first link.

    is the documentation and code at the second link for online communication with the printer, or just for the same network ?



  • @eberlin said in control multiple printer with node.js server:

    thanks,

    but i know the first link.

    is the documentation and code at the second link for online communication with the printer, or just for the same network ?

    Second link is a "multi printer" monitor, with some control capability. Intended to run on the same LAN... but really, all it "knows" is a list of Names (or addresses) that YOU tell it... so if those names/IPs are 'reachable', for example via VPN or reverse proxy, it would work from anywhere.

    As mentioned, as it stands, it is an "in browser" Javascript/HTML5... It could potentially serve as inspiration, or even some reuse, for a node.js implementation. I am the author (of the second link, the multi-printer monitor) if you have questions.



  • @eberlin said in control multiple printer with node.js server:

    how can i send a print status from my duet3D - wifi to the server ? and how did i receive the message with node.js ?

    thanks, but i know the first link.

    The README documents at the first link ARE the answer to your questions... The Duet does not "send status" to a server, ever. The server (or in-browser javascript) 'polls' the printer.

    Perhaps I'm not understanding your question... perhaps ask it a different way?



  • I want to control my printer over the Internet.
    I know that the duet3D firmware has method headers prepared to open TCP connections.
    My problems is, I don't now how to implement them in cpp and how to receive any sended status message with my node. Js server



  • @eberlin said in control multiple printer with node.js server:

    I want to control my printer over the Internet.

    Why not just vpn in to DWC?

    Frederick



  • @eberlin said in control multiple printer with node.js server:

    I want to control my printer over the Internet.
    I know that the duet3D firmware has method headers prepared to open TCP connections.
    My problems is, I don't now how to implement them in cpp and how to receive any sended status message with my node. Js server

    Two parts to this.

    First, establishing a connection between the printer, which is an IP address on your private network, and your node.js on the public internet. There are MANY ways to do this SECURELY. Personally, I would run a reverse proxy... The details of setting this up are HEAVILY dependent your your LAN and Router setup, ISP, etc, etc. Therefore, you won't get that much help here on the Duet forum. There are many tutorials, or seek the help of someone who knows.

    .

    Second, how to have node.js talk to the printer. That is what is documented at chrishamm's github. It is all simple HTTP GET requests. That is the only thing the printer fully supports for control and status.

    You can see this in action by entering a few of the commands in a browser. Something like:

    http://192.168.86.100/rr_status?type=2

    Will result in:

    {"status":"I","coords":{"axesHomed":[1,1,1],"xyz":[0.000,0.000,622.124],"machine":[0.000,0.000,622.124],"extr":[4935.9]},"speeds":{"requested":0.0,"top":0.0},"currentTool":0,"params":{"atxPower":0,"fanPercent":[0,100,0,0,0,0,0,0,0],"fanNames":["","","","","","","","",""],"speedFactor":100.0,"extrFactors":[100.0],"babystep":0.000},"seq":93,"sensors":{"probeValue":0,"fanRPM":0},"temps":{"bed":{"current":21.0,"active":0.0,"state":2,"heater":0},"current":[21.0,19.9,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0],"state":[2,2,0,0,0,0,0,0],"names":["","","","","","","",""],"tools":{"active":[[0.0]],"standby":[[0.0]]},"extra":[{"name":"MCU","temp":34.5}]},"time":1027270.0,"coldExtrudeTemp":160.0,"coldRetractTemp":90.0,"compensation":"Mesh","controllableFans":5,"tempLimit":290.0,"endstops":4088,"firmwareName":"RepRapFirmware for Duet 2 WiFi/Ethernet","geometry":"delta","axes":3,"axisNames":"XYZ","volumes":2,"mountedVolumes":1,"name":"Danal's BFD","probe":{"threshold":100,"height":-0.10,"type":5},"tools":[{"number":0,"heaters":[1],"drives":[0],"axisMap":[[0],[1]],"fans":1,"filament":"","offsets":[0.00,0.00,0.00]}],"mcutemp":{"min":32.5,"cur":34.5,"max":38.3},"vin":{"min":24.8,"cur":25.0,"max":25.3}}

    The printer never "originates" anything. It MUST be "polled".


 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.