I am looking to build a toolchain to do writing as quickly as possible.
I use a product called GoToTags that writes NFC tags. My goal is to write the NFC tag and then immediately trigger an etch from a fiber laser.
How I will physically do it (to better help you visualize my method):
3D print a jig for the NFC writer, encase NFC writer in PETG for its protection.
Place this NFC writer on the laser bed.
Above the NFC writer will be a jig for NFC tag to ensure the correct orientation every time.
I am going to suggest an update to GoToTags to have an option to write a TXT file of what I write on the NFC tag, such as A1B2C3D4. Then what I would like to do is write a Python script to check when the file is updated, then send that to Lightburn to etch from the fiber laser.
These the steps I would like to achieve:
I place a tag on the jig I mentioned above.
GoToTags automatically attempts to write the NFC data on a tag.
If failure then it will stop and let me swap out the tag and attempt again.
On a successful NFC write, GoToTags will save a TXT file with the tag data (A1B2C3D4)
Python script will see the TXT file is updated and send data to Lightburn.
Lightburn will etch the code on the tag.
When the tag is written to I will take the tag and package it.
Start process over again
Of course in the future I am looking to automate this process, but for now this method is the easiest for a small scale startup.
The questions I have:
Lightburn expects a CSV file for variables, is this a steadfast rule?
One way I would see this work is to force open / force close an .lbrn file in Lightburn as seen in the link above. When you open the file the CSV should already be updated on the load. Then maybe have it auto-burn on load? I have no clue otherwise.
Let me know your thoughts, I would love to see how to make this a reality. Thanks!
We do plan to provide an API through Python in the future, but that will take time.
LightBurn currently provides a limited command line interface through UDP commands to do things like launch the program and launch the program + load a file + run the file. âSendUDPâ is a helper utility that is currently for Windows only, however the LightBurn âlistener socketâ should be available on all platforms. SendUDP just sends a UDP command to localhost, port 19840 (and gets replies on port 19841).
(2) Write/Save âA1B2C3D4â to test.txt file using any external program.
(3) Send the âSTARTâ UDP message to LightBurn - Python is useful for this (as above).
If you donât have Python setup just paste the line below into the Win+R Run dialog: powershell -Command "$c=New-Object System.Net.Sockets.UdpClient; $d=[Text.Encoding]::ASCII.GetBytes('START'); $c.Send($d,$d.Length,'127.0.0.1',19840); $c.Close()"
The job should output immediately with the new text, now you cycle back to (2), rinse and repeat.
what happens when there are multiple instances of lightburn running? There can only be one instance of the listening port. Maybe those âTABBED WINDOWSâ would be appropriate at this time instead of multiple instances.
I guess itâs first-in-first-served for the LightBurn process that gets allocated the UDP ports by the OS⌠so make sure the first instance you open is the one you have setup for the task.
I think it was probably anticipated that in an automation situation there would be a separate computer for each machine (they could be headless) with one LightBurn process running at each, listening at their own IP address. So you could command multiple machines from a central computer without any interference between them.
When I had a pair of computers on the network using the OMTech, it didnât seem to know or care where the UDP came from. I could send it commands from either computer..
I just think it hangs out there waiting for any kind of UDP packet thatâs addressed to it.
Good news, everyone! GoToTags is adding a data export option in the next release. Still need a way to parse the data from the JSON it sends BUT this will make it easy to toolchain. Excited to see this happen!
Another question about UDP, what if the file isnât local to that machine? Could I send the file contents over UDP? That would really be useful if I decided to use a Raspberry Pi to run the other processes.