Webserver API not sending moves or logs

I've gotten the WebAPI working with websockets where commands work well, and I'm getting the right responses, but I'm not getting moves or logEvents, but I do get temp and other events, so I know that bi-directional is working.

Here's the command I'm using the send request moves.

{  "data": {},  "action": "sendMoves",  "printer": "Hictop",  "callback_id": 7 }

I do get back a response, but there's no real information:

{"callback_id":7,"data":{},"session":"XptyN53F80hS1kmCB*@4&;hE&A^C81p@k"}

Is there something different I should put to get the correct behavior?

Thanks

Comments

  • Should note: Running server 80.3 on Raspberry Pi. Just started 14 day trial period for this installation.
  • Read the event section. moves/logs are only send after you enable sending them. Then the moves or logs get send as events:

    move

    Payload: {"x":1,"y":1,"z":0,"e":67.233,"de":0.023}
    When moves are enabled (sendMoves action) you will get a event for every move the printer does. This can be used to provide a live preview of what the printer does.

    log

    Payload: {"id":1,"time":14535345345,"text":"ok","type":2}
    When the proper log level is set, you get events for each new log line you wish to see. Type indicates one of the following: 1 : Commands
    2 : ACK responses like ok, wait, temperature
    4 : Other responses
    8 : Non maskable messages

    Regasrding setting log level

    setLogLevel

    Parameter: level (int) = logging level you want events for.

    Response

    {}
    Select which logging messages you want to get as log events. Bit values for level types are:
    1 : Commands
    2 : ACK responses like ok, wait, temperature
    4 : Other responses
    8 : Non maskable messages

    I hope action setLogLevel is correct. I know it was wront at some time so might also be setLoglevel just not sure at the moment.
  • I'm aware that I have to enable them, as you can see from above, I posted a sample json blob that should enable sendMoves (in fact, that code did work at one point.)

    I'm asking if there is something additional that I need to send in the blob.

  • You only get moves for the active printer, so you need to send "activePrinter" with printer parameter to set which printer should report moves if enabled. That should be all needed.
  • In the above json, "Hictop" is the name of the active printer/slug that I want moves from. Should I send "Hictop" or "activePrinter". If it should be "activePrinter" how do I tell the API which one is the active printer before this?
  • Thats what I tried to say. action:"activePrinter" "printer":"Hictop", data empty. So you can use "printer" also to query other printers without them becoming active as it was before. 
  • Thank you. Sending activePrinter then sendMoves with no printer specified got things working again.

    You should add this to the API doc. There is nothing in the documentation that says to send the command "activePrinter"
Sign In or Register to comment.