Lightburn + Wifi on XTool D1 Pro Howto

You’re welcome, hope it helps increase the efficiency of your workflow. :slight_smile:

1 Like

My USB port is loose so any nudge was canceling the burn. This worked great. A few times it ran the old file but I think that may be because it didn’t transfer fully before I started it. The last 3 have been good. Thanks!

1 Like

Thanks @Skreelink any options for mac :frowning:

Hello

First of all - I have not tested it since I do not own a MAC.
MAC uses a shell. So you can do the same procedure. You can copy the code from Skreelink.
You may have to install curl first.

The file is then not called .bat but .sh.
Probably you have to make the file executable
chmod +x <filename.sh> (without the <>)

After that you should be able to call the file with ./filename.sh.

Thanks @Kil1phil sure will give it a shot.
For now have been using VBox :slight_smile:

You can try what @Kil1phil put, as I have no experience with Mac. However, you can always use the curl command manually. Just save it somewhere with your info, paste it into a terminal window, and replace %~1 with your filename. i.e.
curl -X POST -f file="laser.nc" "http://XXX.XXX.XXX.XXX:8080/cnc/data?filetype=1" The quotes around the filename might not be necessary.

@Skreelink
curl -X POST -F file=@“//Users/NAME/Desktop/Laser/Test.gc” “http://XXX.XXX.XXX.XXX:8080/cnc/data?filetype=1

Save as .sh file and run via terminal worked and tested.
100% noob here :slight_smile:

Oh I also installed curl via google :slight_smile:

This has saved me a lot of time

THANK YOU

1 Like

Great work @Skreelink. Your solution works like a charm.

I have a question regarding the workflow when using this method:
how do you go about homing the xTool D1 Pro via Wifi?

Is there a command I can add to the GCode file so it will home first before executing the job?

M17
M106 S0
$H
G90
G92 X0.4 Y12.3
G0 X5 Y17 F10000

This is my header gcode for my IR toolhead (the G92 line changes for my 10W head). A breakdown of it as follows;

M17 Enable steppers, required for running via SD.
M106 S0 Not entirely sure why, but XTool’s XCS puts this line in, so I did for safety. Should be a Marlin fan control.
$H Homing! :upside_down_face:
G90 Safety line to ensure it’s in absolute coordinate mode.
G92 X0.4 Y12.3 Sets my 0,0 origin offset from the home position.
G0 X5 Y17 F10000 Moves away from home a little and sets G0 travel speed, not needed, just helps move across the field a little faster.

That’s how the homing works, as far as actual workflow, after finding your proper home is rather simple.

I’ll either do a quick drawing of my object to scale (since I mostly do rectangular objects, this is quite easy) on a non-output layer and slap it down in the lower left corner of the page.


This represents my object and I use absolute coords. Afterwards, I’ll set my project as I want within those bounds. Wherever I put it, will be exactly where it engraves.

After exporting as GCode and sending it to my Xtool, I simply align my object into the ‘corner’ with spacers I’ve made to align to my mounting board.


If I’m doing an irregular object, I’ll take either a scan (if it’s flat) or a straight down picture, crop just the object, import that image into Lightburn, scale it to match the physical object and set to a non-output layer, and slam into the corner like above. I’ve been getting highly accurate results ever since.

EDIT: I’ll try to see about making a guide on finding this outside origin if people want it.

Awesome, works like a charm! :ok_hand:
Thanks @Skreelink !

I’ve been able to get this to work a few times, but a lot of the time when I start the program (via the button) the laser moves to a position and starts to engrave a very small area. Like 4mm x 4mm.

Any idea? Also, seems like if I add the M17 it won’t work. If I leave it out sometimes it will. Xtool D1 10w

That sounds like you’re setting a project up in inches, and forgetting to swap back to mm before sending it to the laser.

This sounds odd, as the M17 is to enable the stepper motors. It’s auto-inserted by even XCS. Otherwise, when you hit the run button, the stepper motors won’t move, because they’re unpowered.

You are correct, I am using inches. Would I just change that back in the settings then save thr gcode?

I think I need to start there first.

It’s actually really easy to do, I do projects in both and sometimes forget (might be why I knew :wink: ) but all you need to do is hit this little button to swap between inch and mm;

Screenshot 2023-11-07 075319

Click it so it says in, do up your project, and poke it again to say mm and run it.

EDIT: Another option would be to put G20 in the header gcode. G20/G21 tells the machine inch/mm respectively.

Awesome I will give it a shot. I’ll do this first and then tackle the M17 issue. When it did work the few times, sometimes the scan would all the sudden shift in the X direction mid scan, so something I will watch for.

But let’s take it one step at a time!

Ok. Changing to mm worked!

Added the M17, also worked.

But…I am having this issue where the scan suddenly shifts. I had this happen a few times in before when I got it to work, either uploading via wifi or writing to the SD card directly. It never does this via USB cable transmit.

Mechanically, everything seems tight and in great shape.

Any ideas? Sorry to hijack the thread!

It’s likely due to either engraving too fast (causing the stepper to skip), which is a little unlikely, belt skipping, again unlikely. Or the SD card is iffy and either could use a reflash or replacement. A small 4-8GB class 10 card should work good. Most included SD cards can be crap.

Likely what’s happening is the card is bogging down on read speed so the laser keeps moving until it finally receives the next command, at that point it’s already shifted over, and since Lightburn uses all relative commands, the machine has no idea it’s no longer aligned. You can try reducing your interval/DPI to reduce filesize/lines per row to reduce read speed. You didn’t post your settings, so I don’t know how fine they are. The higher the detail, the more lines need to be read, the faster the card needs to be.

Here are the settings.

I am using the SD card that came with the machine. I will get a quality card and try that.

That’s really fast, about 45% faster than I usually run. I should see what I can manage. :slight_smile: 220mm/sec is 13200mm/min, I usually engrave between 6000-9000mm/min or 100-150mm/sec.

Try slowing it down to maybe 175mm/sec and see how that goes. The faster your movement speed, the faster it has to read lines from the SD. Of course, test speeding back up once you get a faster card.

I will give it a shot! Thanks for all the tips. End goal is to be able to work on other projects offline while I’m burning, and I’m almost there!