Do Snapmaker 2.0 Devices Have a Webpage?

Maybe I missed it somewhere… but I was wondering if the Snapmaker 2.0 (I have an A350) has a simple webpage it hosts for the device itself somewhere. A status page that could say what it is working on, estimated time remaining, % complete, temperatures, any problems, firmware version, etc… just general, simple information. Does not even need to be fancy as a .xml with the information would be fine.

The reason I ask is that I want to add it into my home automation system! That way I can have a task set to check it regularly for the status then change some lights or other methods to let me know when it is done or if there are problems it is reporting. Easier than having to constantly go down and check it especially with how long some of my builds are taking.

If this page exists, I would love to know what the address is expected to be, maybe something like http://<snapmaker’s IP>/status.xml?

If one does NOT exist and the reasons above (simple status and integration with home automation) are interesting… please let me know. I will happily discuss it in more detail and I volunteer to write a driver in .groovy for Hubitat (easily ported to SmartThings as well, but not something I can do since I do not own one).

1 Like

Luban can be run from a web page. Under the “View” menu you can select the"View in Browser" item and then it’s pretty much the same as the Luban App. You may only be able to get to it from the local network.Mine open the address: http://127.0.0.1:62799/#/workspace. Is 127.n.n.n a local domain space?

Anyway, that may be a start for you to play.

1 Like

But Luban is running from the PC itself, and is not really what I am talking about. I just want to be able to check it’s status. Not me directly of course, but allow my home automation to check it and let me know if I need to.

I am talking about directly on the A350. Most jobs I print (only 3D printing so far) and run off the USB plugged directly into it. Yes, it is connected to the WiFi but I have yet to connect to it from my computer. I would want the status directly from it, without intermediary. I do not really have any intention of controlling the A350 via a webpage.

@fillibar

Checkout latest TS version (>v1.6.1.2), you can check the IP address of the machine on Settings -> About page.

You can use the APIs below to connect and then request status of machine, the annoying thing here is you have to tap “Confirm” to confirm the connect request on TS. We will add option to skip the confirmation later.

Edit: The server port is 8080, you should use http://<IP>:8080/api/v1/xxx to request.

API Parameters Response
POST /api/v1/connect {“token”: “9b114b52-22f7-4384-b5d1-2de897474722”,“series”: “Snapmaker 2.0 A150”,“headType”: 3,“hasEnclosure”: false}
POST /api/v1/disconnect token
GET /api/v1/status token {“status”: “IDLE”,“x”: 0.775479114230594,“y”: 0.752309041211271,“z”: 0.44320964820751263,“homed”: true,“offsetX”: 0,“offsetY”: 0, …}
8 Likes

Just to confirm… Do you mean with v1.6.1.2 (I just upgraded my A350 to it) or do you mean something coming out? Since you put >v1.6.1.2… not >=…

Not trying to be difficult… Just wanting to make sure because I sent a variety of attempts to the API listings you provided and only got “Connection Refused” type of responses and no request to confirm when I sent the connect (it does work properly when I am using Luban).
Here is an example of what I sent (all tried by a browser first, then using specific POST and GET methods) via browser:
http://<My_A350_IP_Address>/api/v1/connect

From your example the response is pretty close to what I would hope for. Is there more documentation around the API somewhere? I tried searching without luck, but it would be useful (in my mind) to have it show the model, firmware versions, temperatures, etc…

Oh Sorry, forget to add the port. http://<My_A350_IP_Address>:8080/api/v1/connect.

3 Likes

That made all the difference… I had even tried port 8000 myself but forgot 8080 is another common one. That “Connect” at the screen really is annoying for this use case, but at least I can make some progress now. Thanks!

1 Like

Many users complained about the annoying confirmation. We will try to improve the interact experience of connection, maybe add an additional argument to let developer connect to TS programmatically without the confirmation.

1 Like

I had seen that, but since I usually only run my prints via USB (and do not hang around it) it never struck me until now.

If the API can allow a “read only” access that does not require a token or such, that is optimal. But I have already got my sample attempting the Connect/status/disconnect method, just need to try it out when I am back on the same network tonight.

On a positive note, after a bunch of trial and error I have a working driver. It pulls in all the data from the API and sends events for it (and keeps state variables) to my Hubitat. I want to give it a bit more time before I publish it in their forum, to make sure it is stable.

The big problem… The API takes over the device. While it is connected you cannot be DOING anything else at it directly. So my idea of being able to monitor my jobs while they are printing from the USB… not useful. There really needs to be a way to connect without this overriding effect.

There are a few things I did not see that I would have expected to:

  1. The name that you have given the Snapmaker. This might be good in the info returned with the connect to help identify the device.
  2. For the 3D head I would have thought there would be status information for the heated bed temperature and for the print head temperature. I would also expect it to indicate if the filament out sensor has been tripped. Current % completed and time remaining would be good.
  3. For the CNC head (not using it yet) I would expect it to provide the RPM (if it knows).
  4. For the laser head (not using it yet) I would expect it to provide whether it is presently “lasing”.
  5. For the enclosure (not using it yet) I assume it will indicate if the enclosure is open or closed.

Basically anything it can provide that a person might care about. Happy to incorporate them all.

1 Like

For 1, actually we send a UDP4 broadcast on <broadcast address>:20054 with message “discover”. The tiny socket server on TS will reply with their name given to Snapmaker and its model and IP address too. This is how we discover Snapmaker on local network in Luban.
For 2, Temperatures, filament out, laser power, spindle RPM, etc. They are already in the status API.

#2) Hmm… maybe the status does not send them if the machine is idle? Because all I got back was the coordinates, offsets, was it homed, and the IDLE status.

#1) I will have to check about that broadcast… Maybe I can save users of the driver from having to know their IP.

As Luban is open source, you can see here how Luban does use the API connection with the SnapMaker: https://github.com/Snapmaker/Luban/…/src/app/flux/machine/Server.js

Not only the confirmation is annoying, but also that the display is locked when Luban is connected to the API. This way I cannot see the status or control directly from the printer. Disconnect will cancel the print-job.

With a 20 hour print, my desktop PC goes to sleep (like me :grin:) and then from the display you have no control at all anymore…

I would expect the display always shows status etc, and allows to interact with the printer, for pausing to change fillament colors for example. The connection from Luban is then an addition on top of that.

This makes it also possible to use other tools (Node-Red for example) to monitor the status through the API and send status messages, without taking the lead of controlling the print.

So it should also allow multiple connections to the API at the same time (different tokens).

1 Like

Yes, the API is accessible and I did actually manage to write a Hubitat driver to monitor my Snapmaker using the API. However, it is completely useless in that respect so I did not make the driver too advanced or publish it at all.

The two problems you mention are “insurmountable” for my driver, until Snapmaker changes the system and fixes them.

  1. Locking the UI when API is in use: I print EVERYTHING using a USB driver plugged into it, I do not use Luban to do “direct” printing, so I wanted to be able to monitor the job and let me know (wherever I might be) that it had completed, etc… Once the API is connected, the touchscreen is locked. No option to use the USB… so my workflow is now dead in the water.
  2. Only 1 connection allowed. This does not directly impact me because I do not print from Luban BUT the solution to it SHOULD fix things for me anyways. The solution I see it is to allow an API connection that is READ-ONLY. That will allow other mechanisms (such as my driver) to monitor the job but have absolutely no impact on it or the device. Thus there is no need to lock the UI. I would recommend that Snapmaker only allow 1 “controlling” connection (the PC running Luban) through the API (or the touchscreen if that is how they are using that) and any further connections or ones set as such be set to read-only (ex: if no token is used for the API request, it is read only, or some similar mechanism). I can understand limiting it to a single control at least, to help prevent mixed commands being set to the device.
3 Likes

Just curious if you guys are working on the other issues mentioned in the thread related to locking the display or requiring confirmation.

Thanks for the valuable info. I am able to connect to the api of my snapmaker A350 but it says readonly . Does that mean we can not set anything by the api. I tried to put the leds on from my enclosure but I returned 403 forbidden. I also want to send G codes to my printer , I see several methods available in the server.js file of luban for setting operations but they all give me 403 forbidden.
I also tried to set the readonly flag to false when connecting but this seems not possible to change this.
Anybody can help here?

Seems I can write now through the api by setting the snapmaker first in the home position.
Wondering if this can be automated? Is there a command to put it in the home position first when connecting?

@parachvte Would it be possible to make the status API not require a token?

That’s the one thing that I actually care about, seeing if my print is in progress or not. I’d also like to set off notifications using home assistant when prints are done (and in some cases turn off the power from the power point).

1 Like

This will be very great. I’m trying to use notifications with Octoprint, but it will not work reliably. Furthermore, OCTOprint randomly drops off commands and filament will not be extracted.