File Transfer via WiFi

Great work on this, ill have to give it a try, thank you for sharing!

Yeah such a feature would be very nice to see implemented directly into Cura :slight_smile: Is that possible as a plugin!?

1 Like

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.

@ppmendonca This probably isn’t what you’re looking for, but it’s all that exists. The Luban Github page: https://github.com/Snapmaker/Luban/blob/767fdd048eb1c141ce539dd2f12aeb076ab9582d/src/app/flux/machine/Server.js

2 Likes

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.

1 Like

Well it isn’t pretty and it will probably fail silently if you try to upload without confirming the connection on the printer first. You’re going to have to change the ip manually.
https://gist.github.com/zvalentine22/bda7d1379f796a514fb7b32a317d9e95

4 Likes

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

5 Likes

@zvalentine22 That batch file is perfect, thanks!

I added the context menu on .GCode files, now I can do this:
image

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.

Send to Snapmaker 2.0 via Wifi v2.zip (1.9 KB)

13 Likes

This is really cool!!
Thank’s a lot @zvalentine22 and @brent113

1 Like

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

1 Like

@zvalentine22 and @brent113 this is way beyond cool!!! Amazing work and attitude!!!

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

Again THANK YOU for the help!

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.
image

Guess that’s not how it works, good to know.

1 Like

@brent113,
Just FYI: I can’t change the registry without admin privileges. Very tight restrictions!

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.

I sent a .mp3 and the steppers are singing to me :grin:

1 Like

Even with an account in the administrator group I still had to run ‘_Add Context Menu.bat’ with elevated privileges. That said, worked perfectly. Thanks!

1 Like

I updated Windows to build 2004 yesterday. After that the connection via the context menu worked, but transfer does not. I removed the context menu and set it up again. Since that, no connection anymore. The printer is reachable via ping. Running the batch file I get the message that the IP is not reachable.

Remark: Problem is not the batch file rather the WiFi connection seems to be the issue. Batch file is working fine, even with built 2004.

After solving the WiFi issue by setting up another AP another strange thing came up. When transferring a file over Wi-Fi to the snapmaker, the Progress status on the touchscreen is gone?! It just says connected, after finishing I get the question if I would like to start the print now…
Anybody experienced that too?

I am not getting a progress bar with the laser .nc files I’m currently sending…Not enough data for a conclusion yet. Interesting. The file is small, only about 85kB, maybe transferring too fast for a progress bar?

In my case the file has been sent before, with progress bar. So this is a new issue for me.
Last time I saw the progress bar, ist was flickering with showing alternating numbers 0% and the value that was counting up?!