bambulab / BambuStudio

PC Software for BambuLab and other 3D printers
GNU Affero General Public License v3.0
1.69k stars 230 forks source link

Add printer in LAN mode by IP address #702

Open rkarlsba opened 1 year ago

rkarlsba commented 1 year ago

Since the WAN mode is utterly insecure, adding a printer by its IP address would be nice in LAN mode when mDNS isn't available. Either because the printer is on a different subnet and the router doesn't route multicast, which is quite normal or if you have an enterprise wifi system (for instance from Cisco), which also may drop mDNS.

c2h5oh commented 1 year ago

Multicast being blocked between wired and wireless connections is fairly common even on consumer/SOHO devices, so this would be nice even just for better connectivity.

merasil commented 1 year ago

+1 i have multiple vlans and adding the printer via ip would be awsome. mDNS is pain in the ass for subnets...

gashton commented 1 year ago

+1 Not sure why this wasn't done in the first place... definitely a must-have! Bambu appear to have implemented Multicast SSDP instead of mDNS, Which is a shame as Avahi does not support this.

rkarlsba commented 1 year ago

From Wikipedia [SSDP] was formally described in an IETF Internet Draft by Microsoft and Hewlett-Packard in 1999. Although the IETF proposal has since expired (April, 2000),[1] SSDP was incorporated into the UPnP protocol stack, and a description of the final implementation is included in UPnP standards documents

Doesn't seem very sane to use with anything, tbh.

c2h5oh commented 1 year ago

Even fallback to regular DNS would be an improvement - I can always setup a local DNS entry for the printer..

rkarlsba commented 1 year ago

Which reminds me that IPv6 support would be nice. Seems the printer is running Linux after all, so it really can't be that hard.

merasil commented 1 year ago

+1 Not sure why this wasn't done in the first place... definitely a must-have! Bambu appear to have implemented Multicast SSDP instead of mDNS, Which is a shame as Avahi does not support this.

That explains why i cant get the Printer working in lan mode in my vlan network… i should have used wireshark in the first Place…

pls bambu: add „printer by ip“ support

rkarlsba commented 1 year ago

That explains why i cant get the Printer working in lan mode in my vlan network… i should have used wireshark in the first Place…

You can remedy that by enabling multicast routing or forwarding between VLANs if the router understands that sort of stuff. Still, adding by IP or DNS name shouldn't be very hard to fix and is the good solution to this.

gashton commented 1 year ago

As a temporary solution. I've written a script to generate an unsolicited response to the upnp/ssdp discover, to tell BambuStudio the IP of the printer. It's meant to be run on Linux, but may work on Windows too if run in a VM/Container/Cygwin.

It has to be run each time BambuStudio is restarted, as Bambu will forget until it receives the response to its M-SEARCH ssdp:discover.

rkarlsba commented 1 year ago

Better fix this in source. Such workarounds just make Bambu relax since "there's a workaround". The Bambu printers aren't cheap and this should be easy to fix.

R1N4x commented 1 year ago

Lots of fixes and improvements with v1.4 but this one is still missing.

rkarlsba commented 1 year ago

Can it really be that hard?

rehashedsalt commented 1 year ago

With today's outage, this is now especially pertinent. There is already an existing dialogue for this feature as of 1.4.2 -- there should be very few blockers for this now.

julie777 commented 1 year ago

My thoughts on this. It should not require an app using bluetooth to set up the printer for LAN mode. The selection for lan mode should always be available. After selecting LAN mode only there needs to be a way to connect the printer to the network. A simple way would be to allow putting a file "network credentials.txt" on the SD card and the printer can use network name and password from that file to connect to the network.

When the printer connects to the network it should display its ip address and passcode for bambu studio to connect to it. I am not a network expert so I am not sure about broadcasting its availability on the network. I think this should be okay on a LAN, which makes it discoverable without having to type in the IP address in bambu studio.

kriordan37 commented 11 months ago

+1 i should be able to use static ip addresses and point bambu studio to that. this issue is preventing me from using the printer in lan mode with a vpn

tinuva commented 10 months ago

With the latest issue happening now: https://www.reddit.com/r/BambuLab/comments/15rznpy/printer_started_printing_by_itself_damaged_itself/

This issue should really receive priority asap!

ellenhp commented 9 months ago

I posted this in another issue but it looks like this is the primary issue for adding printers by IP address so I'm going to post it here too, sorry about the spam. I can delete the comment in the other issue if it's a problem :)

I got a little bit frustrated with this issue because having command and control in the slicer is a key feature IMO. So I reimplemented the networking plugin to add this feature (and others).

https://github.com/ellenhp/bambu-farm

timothyzalusky commented 8 months ago

Another +1 for this feature.

fritzw commented 7 months ago

As a temporary solution. I've written a script to generate an unsolicited response to the upnp/ssdp discover, to tell BambuStudio the IP of the printer. It's meant to be run on Linux, but may work on Windows too if run in a VM/Container/Cygwin.

It has to be run each time BambuStudio is restarted, as Bambu will forget until it receives the response to its M-SEARCH ssdp:discover.

I've converted the SSDP script to PowerShell, so that it can be used on Windows as well.

TonyAlberto commented 6 months ago

As a temporary solution. I've written a script to generate an unsolicited response to the upnp/ssdp discover, to tell BambuStudio the IP of the printer. It's meant to be run on Linux, but may work on Windows too if run in a VM/Container/Cygwin. It has to be run each time BambuStudio is restarted, as Bambu will forget until it receives the response to its M-SEARCH ssdp:discover.

I've converted the SSDP script to PowerShell, so that it can be used on Windows as well.

I just tested it and it's ok, it works, thanks! I will only add that it may be necessary to change the port, in my case it is listening on port 1990 instead of 2021 (here is information about these ports: https://wiki.bambulab.com/en/general/printer-network-ports). The $TARGET_IP line itself is not needed in the powershell script because it is not used at all in this case.

hoegge commented 4 months ago

It is quite crazy you cannot add a printer by IP - it means a lot of user simply cannot connect to it and means you can return the printer and get a refund, since it does not work.

ellenhp commented 4 months ago

I imagine it's hard to find time to figure out the user experience, but if anyone from Bambu is reading this, I think I'd like to suggest that you add a way to configure printers by static IP in the config file, and worry about the slicer UI code for that configuration later when you have more time available. A lot of users would be okay editing a config file if it means not having to return the printer (or in my case, re-implement the entire networking plugin in Rust).

To anyone here who runs linux and likes fiddling around with semi-broken software, the bambu-farm repo I linked earlier will get you up and running. It's not perfect. Immediately after a print it drops into an infinite loop on a worker thread so you have to close the slicer and restart the server-side program too, but it gets the job done for me and might be useful for someone else at their wit's end.

RagingRoosevelt commented 4 months ago

Yeah, without this, the X1E that my employer bought doesn't work on our corporate network. I can ping the printer and it's on the same subnet as my computer, but because it's trying to auto-discover, I can't add it to Bambu Studio.

rehashedsalt commented 4 months ago

Yeah, without this, the X1E that my employer bought doesn't work on our corporate network.

Corporate environments are an especially pertinent example -- mDNS is oftentimes disabled as a basic security measure.

RagingRoosevelt commented 4 months ago

mDNS is oftentimes disabled as a basic security measure

That's exactly what's causing the issues I'm running into. And for Bambu to sell the printer specifically on the merits of compatibility with a corporate environment, but not support this direct IP / hostname specification seems disingenuous at best.

walterwongbbl commented 4 months ago

We are considering this feature, and recently it's the Chinese New Year holiday, so our responses might be slower. We apologize for any inconvenience caused.

rkarlsba commented 4 months ago

Happy new Chinese year! But I wonder - it's been more than 14 months since I posted this. Does it really take that long to fix such a minor thing?

kluppy commented 2 months ago

Without the ability to add printers via IP the software is not fit for purpose in a corporate environment. I think I will be returning my X1E as such.

Kablahz commented 2 months ago

+1. Currently have an X1E in a corporate environment and have had to resort to FTPS to allow users to upload 3mf files from Studio. Company wants to purchase additional X1E units but we have put this on hold until we can statically address these printers and not rely on mDNS(not going to happen) or FTPS. Please make this a priority, should have been implemented before the X1E release.

M1-Olsson commented 2 months ago

So the X1E has the same problem, lol Enterprise edition with a extreme premium in price and still not working.

We could use another printer but I guess we stick to actual enterprise brands and not the hobby ones.

rkarlsba commented 2 months ago

+1. Currently have an X1E in a corporate environment and have had to resort to FTPS to allow users to upload 3mf files from Studio. Company wants to purchase additional X1E units but we have put this on hold until we can statically address these printers and not rely on mDNS(not going to happen) or FTPS. Please make this a priority, should have been implemented before the X1E release.

As gashton wrote above, it's not even mDNS, it's SSDP, which isn't described in any valid IETF document, but later implemented in uPnP, but who on earth would allow uPnP on an enterprise network…

ColColonCleaner commented 2 months ago

I hope this is fixed soon. Just got an X1C and cannot use it over my network because of this issue.

rkarlsba commented 2 months ago

It's rather interesting that this has been ignored for such a long time…

timothyzalusky commented 2 months ago

Maybe we can light a fire under bambu lab by mentioning the competitors that have IP address printing... Ultimaker Makerbot Creality Formlabs Markforged I could go on. We need this feature.

rkarlsba commented 2 months ago

Octoprint Fluidd Mainsail (anything, really, except Bambu)

ColColonCleaner commented 1 month ago

It's really strange there is no movement or comment about this problem from Bambu. Not sure why they are seemingly ignoring it, the issue has been around for a long time now.

rkarlsba commented 1 month ago

They are passively ignoring this, for reasons unknown. Perhaps they make their money out of cloud traffic?

M1-Olsson commented 1 month ago

They have LAN mode so the could traffic is optional already. I use the script mentioned above and it works great so the problem is that the client can't find the printer itself unless on the same network. I can't understand why they just don't fix this, maybe we will have better luck with the Orca guys fixing this... I did see a windows once when trying to start the video stream asking for an IP but that seems only be for the video.

ColColonCleaner commented 1 month ago

They have LAN mode so the could traffic is optional already. I use the script mentioned above and it works great so the problem is that the client can't find the printer itself unless on the same network. I can't understand why they just don't fix this, maybe we will have better luck with the Orca guys fixing this... I did see a windows once when trying to start the video stream asking for an IP but that seems only be for the video.

The script doesn't work for me for some reason. Not sure why. Is there a trick to using it that I'm missing? Printer never shows up.

The only way I can interact with the printer over the network is via FTP to drop gcode files in.

rkarlsba commented 1 month ago

I don't think you can fix this with orcaslicer either - I can only guess it's the bambu connectors that are doing this - otherwise, it'd be replaced long time ago. These are closed source, and AFAICT, breaks AGPL quite clearly. I wrote a piece about that a year and a half ago and got an answer from Bambu that wasn't very comforting, but I didn't follow up on it. I'll see what I can do in the future.

ColColonCleaner commented 1 month ago

@rkarlsba did you have to change that script at all to make it work, aside from filling in the printer attributes? It doesn't work for me. I'll try running wireshark to see what port bambustudio is expecting and see if that's different, but otherwise I'm not sure why others are able to use it but it doesn't work for me.

ellenhp commented 1 month ago

I can only guess it's the bambu connectors that are doing this - otherwise, it'd be replaced long time ago. These are closed source, and AFAICT, breaks AGPL quite clearly.

This is correct, but I reimplemented the networking plugin in a weekend or so for bambu-farm. This is very fixable.

rkarlsba commented 1 month ago

This is correct, but I reimplemented the networking plugin in a weekend or so for bambu-farm. This is very fixable.

That's really nice! Did you post that to the bambu studio github as well?

ellenhp commented 1 month ago

Yeah I've dropped the link a few different times in case it's helpful to people, but like I mention in the readme it's a very rough piece of software, not at all something an average person can just pick up and use. Also only builds and runs on linux, but it might be a good starting point for someone who wants to fix this once and for all (probably in collaboration with orcaslicer)

rkarlsba commented 1 month ago

btw, where can I find the dlopen()? Is it the one in NetworkAgent.cpp?

ellenhp commented 1 month ago

Yep, that's the one. You can see the public API later down in that file. They change it, sometimes in breaking ways, from release to release and if you return the wrong value in bambu_network_get_version your plugin will get replaced by the closed-source version which is why I say this needs to be solved in conjunction with orcaslicer.

rkarlsba commented 1 month ago

https://blogg.karlsbakk.net/2024/05/24/more-on-bambus-license-issues/

timothyzalusky commented 2 weeks ago

This is in the top 10 based on number of comments, but if you add up each separate issue thread. It is well into the 100s of comments on this issue. @walterwongbbl please give us a timeline (I was expecting this resolved in the first year, not two years later).

timothyzalusky commented 2 weeks ago

Add printer in LAN mode by IP address #702 Printer IP Dialog #3714 LAN mode does not work between VLANs #3272 [Feature Request] Ability to add Printer by IP address (Lan Only Mode) #2426 Add device by IP address, without needing to trigger a connection error first #1549 Ability to enter IP of Printer(s) #2232 Fixed IP Bambulab X1 Carbon and P1P #1737

@walterwongbbl that is 7 separate issues (possibly more that I missed) that will be resolved by this. Ulitmaker can do it so can you.

Alex-Schaefer commented 1 week ago

One could think they want all people, including companies, to use their cloud and upload everything there. Why, and what they are doing with the files, is up to you to assume.

Difficult to believe, that the ability to enter an IP address is such a difficult task.