Lightburn + Wifi on XTool D1 Pro Howto

I recently obtained an XTool D1 Pro a couple days ago and took a moment to figure out how to utilize lightburn gcode + the built in wifi so I didn’t need to either; pull the SD everytime, or tether. Overall, pretty simple! It was actually about the exact same process I use on my Snapmaker. I used wireshark to see how XCS communicated and it was the same way, just a different URL.

I made a simple .bat file to send the file to the XTool and drag/drop. To make it yourself, replace XXX.XXX.XXX.XXX with your XTool D1 IP and save as a .bat. Linux/Mac users will have to do their own respective files, this is for windows.

@echo on
curl -X POST -F file=@"%~1" "http://XXX.XXX.XXX.XXX:8080/cnc/data?filetype=1"
pause

Just do up your project as normal, but PUT M17 IN THE HEADER GCODE, click Save GCode, then simply drag and drop the file onto the .bat file and wait for it to upload and give you an ok response and hit enter to close the window. You can also remove the pause and the window will close when it’s done, I just like having the confirmation personally :upside_down_face: Afterwards, poke the button on the front of the machine!

3 Likes

I think you misinterpreted my post, this is a guide on how to. You save the code above as a .bat file after editing in your XTool IP address, then you can drag/drop your lightburn gcode file onto it and it sends it via wifi to the laser. Then just press the button on the front to start it, negating the need to tether your PC via USB.

Edit: Guess that was a spammer and/or troll. :upside_down_face:

So are you say that the IP address for the D1 Pro needs to be changed to xxx.xxx.xxx

No, replace the xxx.xxx.xxx.xxx with the IP address of your XTool.

Im sorry but I am very slow when it comes to computers. I am trying my hardest to learn the best i can so I can operate my laser better. Where do I edit in the IP address at? Im sorry if my questions are frustrating

In the file you need to make. Open a new notepad document and fill in as an example below, substituting your own IP into the url.

@echo on
curl -X POST -F file=@"%~1" "http://192.168.1.100:8080/cnc/data?filetype=1"
pause

Then save the document as “filesend.bat” making sure the filetype is set to ‘any type’ like this;
Screenshot 2023-05-14 172818

Ok so lets see if I got it right this time. So if I am creating a file to burn in lbrn software I should make the file name filesend.bat and save under all files. Once again I apologize for my lack of knowledge on this whole thing

After you save the .bat file I presented here, create your lightburn project as normal. Then click the save gcode button in lightburn to save the gcode to a file. Then drag and drop the gcode file onto the file send .bat.

EDIT: Make sure to have M17 in the header gcode in Lightburn.

Ok thanks. Sorry for the dumb questions

A quick demo.

After you get the ok result, simply push the button on the front of the XTool to begin the project.

You mentioned M17, I noticed M18 was identified by Steven Kidd here, as the closing ‘bookend’ for the M17. Does it make any difference to include M18?

Start GCode
M17 S1 (Enable Steppers)
M106 S0 (Cross-hair laser - Off)

End GCode
M18 (Disable Steppers)

It does not, the machine automatically disables the steppers when the program finishes, so it’s not needed in the footer.

Ok, that’s good - no point in having redundant code!

I guess another option with this whole concept would be to have something like a PowerShell program monitor a particular “XTool” folder, so anytime ‘Save GCode’ is used to that folder, the file will be immediately uploaded.

Would likely be an easy thing to add to Lightburn. :slight_smile: It’s pretty much just a curl post command. Have a box in device settings for the IP, and if one is set, make an upload gcode button appear next to save. That could simply save the gcode file to a temporary place, run it through curl, then delete the temp file. Maybe have it wait for the ok response to signify it’s done.

@NicholasL This would be a welcome addition to Lightburn to be honest with you…

Theoretically to make this viable you would need to be able to discover devices on the network and frame over WiFi (as well as printing over Wi-Fi).

@LightBurn is this possible?

Please upvote here:

Framing is done via XCS the exact same way the actual job is done. It simply makes a small gcode file to run the framing border with low power, sends it to the machine, and you push the button and watch the framing. So it shouldn’t be too hard to implement in Lightburn, since once you get the wifi sender done, just make the framing button save and send to the machine the boundary run.

Ok… that shouldn’t be that hard

I’ve made a few more discoveries and currently working on something, I think, users would really like and could be a feature in Lightburn. :slight_smile: It’s nothing major but to me, has been a very nice thing. I don’t want to hype too much until I do further testing, but keep an eye out in the next few days.

1 Like

Thank you for sharing. Running my first one now!