Duet3D Logo

    Duet3D

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Documentation
    • Order

    Using pydsfapi on windows

    DSF Development
    pydsfapi
    2
    2
    89
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • kaoshihchuan
      kaoshihchuan last edited by

      Hi Experts,

      I am new to Duet. Please forgive me if this question has been answered somewhere...

      I am trying to use/modify the python API (pydsfapi) to communicate to my printer (Duet2 WiFi/Ethernet). Since the system has been connected to a PC which running
      DuetWebControl, I would like to use the same computer to control the printer instead of using a pi to do it. Because I am working on integrating another sensor to the system, this is the reason I would like to write my own code to control it.

      My problems are listed below :

      1. When I connected to the system, instead of using socket.AF_UNIX, I used socket.AF_INET. However, I got the error message for decoding the receiving. (Error message shows below)
        ....
        File "C:\Users\JB3D - F30-B1\AppData\Local\Programs\Python\Python37\lib\json\decoder.py", line 337, in decode
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
        File "C:\Users\JB3D - F30-B1\AppData\Local\Programs\Python\Python37\lib\json\decoder.py", line 355, in raw_decode
        raise JSONDecodeError("Expecting value", s, err.value) from None
        json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

      2. Based on the code, it seems the return/receiving message is in JSON format. Is there any more information about this?

      Thank you very much!

      Kevin

      JoergS5 1 Reply Last reply Reply Quote 0
      • JoergS5
        JoergS5 @kaoshihchuan last edited by JoergS5

        @kaoshihchuan the following two links will help you understanding the new object model of RepRapFirmware version 3 (RRF3):
        https://duet3d.dozuki.com/Wiki/Object_Model_of_RepRapFirmware
        https://duet3d.github.io/DuetSoftwareFramework/api/DuetAPI.Machine.MachineModel.html#properties

        In the first link is explained, how the Duet can be accessed and explaining of the json structure.
        You should use the current RRF version (today: 3.1.1).

        1 Reply Last reply Reply Quote 1
        • First post
          Last post
        Unless otherwise noted, all forum content is licensed under CC-BY-SA