Jump to content
Ultimaker Community of 3D Printing Experts

API Oddities and Questions


coderforlife
 Share

Recommended Posts

Posted · API Oddities and Questions

I have been working with the Ultimaker API for awhile and I have several questions about the API.

 

I noticed a few days ago that the entire /camera API is no longer working, I always get a 404 error. The camera stream is still available at the :8080/?action=stream URL, but the API no longer is usable for finding that URL. I have tried power cycling the machine with no difference. Did this change at some point?

 

Additionally, the /auth/check/{id} documentation doesn't seem to be clear. Does it only work for recently requested IDs? Like if I have an authorized ID from a day ago should it still remote "authorized"? For me it seems to only be reporting "unauthorized" unless I am actively in the approval process for the account (in which case it says "unknown"). I think that for a brief time after the "Accept" it does give "authorized" but I haven't confirmed this recently. I can each use the HTTP Digest Authorization with a particular ID/Key and it will still say "unauthorized". Seems strange. 

 

Is there any way to connect to a hidden wifi network?

 

Are only maintenance events (type id 4) post-able to /history/events?

 

Some of things listed in /printer are said to be settable (e.g. /printer/heads/#/max_speed or /printer/heads/#/jerk) however their value does not seem to change with a PUT. There are others that are actually settable and do support PUT that are not listed as such (e.g. /printer/bed/temperature/current).

 

My final question is what are the possible values to be reported from the following APIs? I know some of the values, but in many cases I am clearly missing several values. Is this documented?

  • /printer/status - I know booting, idle, printing, error, maintenance
  • /printer/head/#/extruder/#/hotend/offset/state - I know valid
  • /printer/network/wifi/mode - I know CABLE and AUTO
  • /print_job/source - I know WEB_API/*, WEB_API, and USB
  • /print_job/pause_source and in /history/print_jobs/* - I know api
  • /print_job/state - I know none, pre_print, printing, pausing, paused, resuming, and post_print
  • /print_job/result and in /history/print_jobs/* - I know "", Failed, Finished, and Aborted
  • /system/firmware/status - I know IDLE
 
Thanks for any inputs anyone may have on any of these topics.
 
Note: I am using an Ultimaker 3 Extended with the latest firmware
  • Link to post
    Share on other sites

    Posted · API Oddities and Questions

    All of these states are described in the swagger API documentation http://{printer-ip}/docs/api

     

    When checking one of the endpoints, press the "model" tab (right next to the example tab)

  • Link to post
    Share on other sites

    Posted · API Oddities and Questions

    Thanks! Great! Didn't know about that alternate view. It helped a bunch. Although, it doesn't have all of the states. For example, there seems to be no listing for "pause_source" or the history event IDs. I was able to dig through the griffin source and find some more of them.

     

    I have found a bug in the camera API and I think that the line in interfaces/html/um3server.py that is

    camera = Camera(self.__camera_service, api_v1)
    

    should be

    camera = Camera(self.__camera_service, "camera", api_v1)
    

    since otherwise it uses api_v1 as the "local_path" for the HTTPExposedItem and has no parent. I will be testing this out soon.

     

    Digging through the Griffin source I was also able to answer my question about the only maintenance events (type id 4) are post-able to /history/events. Still working on the remaining questions:

    • Things that are listed with a PUT but are not settable
    • The response of the /auth/check/{id} command
    • Connecting to a hidden command

     

  • Link to post
    Share on other sites

    • 4 months later...
    Posted · API Oddities and Questions
    On 5/31/2019 at 11:07 PM, coderforlife said:

    I have found a bug in the camera API and I think that the line in interfaces/html/um3server.py that is

    
    camera = Camera(self.__camera_service, api_v1)
    

    should be

    
    camera = Camera(self.__camera_service, "camera", api_v1)
    

     

    I just stumbled upon this thread and thanks for reporting. I can confirm this fixed in firmware 5.2.13 (not released yet) and 5.3 (S3 only).

  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
     Share

    • Our picks

      • New here? Get ahead with a free onboarding course
        Hi,
         
        Often getting started is the most difficult part of any process. A good start sets you up for success and saves you time and energy that could be spent elsewhere. That is why we have a onboarding course ready for
        Ultimaker S5 Pro Bundle, Ultimaker S5, Ultimaker S3 Ultimaker 2+ Connect.   
        They're ready for you on the Ultimaker Academy platform. All you need to do to gain access is to register your product to gain free access. 
        Ready? Register your product here in just 60 seconds.
          • Like
        • 11 replies
    ×
    ×
    • Create New...