Dear all, I know there is a discussion regarding “Connect Via WiFi”.
My question/request is to be able to transfer GCode files via WiFi (network connection).
Would it be possible to transfer to the Snapmaker Touchscreen drive via WiFi without using Luban?
I use Simplify3D and would prefer to still slice there and then transfer the files via WiFi.
The only method I could establish at the moment is;
Yes. The little App to transfer files will not be easier than Luban. You still have to export G-code file to your disk and than transfer it (via an App or Luban), or use and USB disk.
The only difference is that you don’t have to upload file to Luban backend and let Luban render G-code (for large files it may crash or stucked).
Just got my A350 setup today. Came to the forum looking for a way to upload without Luban/from the CLI. Found this post. Poked around a bit. The API seems pretty straight forward. Wrote this little python script as a proof of concept. Feed it an IP and path to your file and it’ll upload and fire off a print. Action is still required on touch screen, but I find it quicker than opening Luban/moving a thumb drive around just to start printing. Works for me on firmware 1.10.0: https://gist.github.com/zvalentine22/50a6bc18dd051aae32bf0c2dd4ac27ee
Requires requests
zvalentine22,
I just got my A250 and was able to print 3 files by slicing them in Onshape + Kiri:Moto, downloading to USB dongle from the kit and reading from the dongle.
I can’t install Luban or Python because I’m on a company computer.
Could you point me to the API you mention so I can try to figure out a way to send the gcode via wifi without using Luban or Python?
I read your code but am not learned enough in Python or the parser to distill what I need to do myself.
Kudos for sharing this with everyone btw.
Came here to post that same file from the Luban source but looks like @brent113 beat me to it. Discovered that this evening while trying to find something more comprehensive. I was originally just using Wireshark to pick apart the network traffic. I must have been about six deep by the time I wrote that script so things are a bit hazy. Feeling a bit inspired after seeing all the endpoints. Maybe I’ll revisit things tomorrow. I’m not very familiar with JavaScript but I’m sure it’s pretty trivial to make the two requests needed to get a file posted from a web browser and not have to install anything.
And one more approach with a batch file using curl. If you have Windows 10 1803 and up, it seems to be included now with no installation necessary. Once you set the ip address you can drag and drop your .gcode file onto the batch file and it should start up. With a little googling and a few minutes one could probably add it to their ‘Send to’ menu if one was so inclined. https://gist.github.com/zvalentine22/c4162f0cda3c7a68e1281d521a2d6cb1
I added the context menu on .GCode files, now I can do this:
I also changed your functionality slightly so there’s no pause after you confirm the connection - it immediately uploads. Saves my walking between rooms. I also added some error handling if the initial connection fails.
To get this running, unzip this folder into C:\Tools. Any other folder will require modifying the registry commands, as they are pointing to “C:\Tools\Send to Snapmaker 2.0 via Wifi”
Version V2: Added context menus for .nc and .cnc file extensions.
Nice. I don’t use Windows primarily so I’m not sure about the scopes of permission, but if someone is locked out of editing the registry I believe they can also navigate to something like ‘shell:send’ or ‘shell:sendto’ and drop in a shortcut to the script as well. Not as clean as a per-type context menu entry, but might be sufficient for some. My Windows machine has been collecting dust in the corner running preview builds and updating itself for years. Finally caught up with me and I can’t even right click anymore without the file manager freezing so I’m unable to play around with either.
As for error handling and potential issues in general I also never tested what kind of response codes the printer throws while printing and if it would cause issues with the script spamming the printer if an upload is attempted.
I’ll take a look at your changes this evening after a fresh install of Windows
Unfortunately the limitations on my work computer are tougher. None the less, with your help I was able to make the wifi transfer by placing the Upload GCode.bat file (see @brent113’s comment above) on my desktop and dropping the gcode file on it.
For those of you who might have the same limitations as I do:
1-have the printer on
2-disconnect form the VPN => use non-work network (to avoid firewall etc.)
3-drop the gcode file into the bat file
4-go to the printer and hit yes
I added the file association to the current user hive, so it should work even without administrative privilege? That’s a beyond me, I also don’t do a lot with the registry.
I suspected if you couldn’t install software, your group policy probably prevented registry modification as well. Try opening File Explorer, type literally:
shell:sendto
into the path/address bar and press Enter.
If you can right-click → New → Shortcut and successfully complete the wizard to create a shortcut to the ‘Upload Gcode.bat’ file, any file you subsequently right-click on should have an entry in the Send To menu. The batch script currently doesn’t check for the correct file type, so make sure you’re only sending .gcode. Not sure what behavior you’ll get otherwise.