• Tags
  • Documentation
  • Order
  • Register
  • Login
Duet3D Logo Duet3D
  • Tags
  • Documentation
  • Order
  • Register
  • Login

Duet 3 w/o SBC and RRF3 multiple probe detection

Scheduled Pinned Locked Moved
Duet Web Control
1
2
136
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.
  • undefined
    warpster
    last edited by warpster 18 Feb 2022, 22:08

    I have a remote python script running on my PC that aligns my tools on my TC. It first aligns the x an y and then aligns the Z in order for all tools. It may be run in a situation where the Z alignment is not supported (if no K1 sensor) so I need a way to determine in python whether the printer has the second K1 Z probe or not. My printer responds as if it were a Duet 2 running RRF3 so I need to use /rr_status?type=2 but that only returns info on one probe???? K0 but not K1 for some reason. I can't seem to get a G31 K1 to work....anyone have a python snippet to execute a G31 K1 through the DuetWebApi? I've been trying to get this code to work to no avail. Or if there is some other way to determine if the probe exists or not....

    def getTriggerHeight(self):
    _errCode = 0
    _errMsg = ''
    triggerHeight = 0
    if (self.pt == 2):
    if not self._rrf2:
    #RRF 3 on a Duet Ethernet/Wifi board, apply buffer checking
    sessionURL = (f'{self._base_url}'+'/rr_connect?password=reprap')
    r = self.requests.get(sessionURL,timeout=2)
    buffer_size = 0
    while buffer_size < 150:
    bufferURL = (f'{self._base_url}'+'/rr_gcode')
    buffer_request = self.requests.get(bufferURL,timeout=2)
    try:
    buffer_response = buffer_request.json()
    buffer_size = int(buffer_response['buff'])
    except:
    buffer_size = 149
    if buffer_size < 150:
    logger.debug('Buffer low - adding 0.6s delay before next call: ' + str(buffer_size))
    time.sleep(0.6)
    URL=(f'{self._base_url}'+'/rr_gcode?gcode=G31')
    r = self.requests.get(URL,timeout=2)
    replyURL = (f'{self._base_url}'+'/rr_reply')
    reply = self.requests.get(replyURL,timeout=2)
    # Reply is of the format:
    # "Z probe 0: current reading 0, threshold 500, trigger height 0.000, offsets X0.0 Y0.0 U0.0"
    start = reply.find('trigger height')
    triggerHeight = reply[start+15:]
    triggerHeight = float(triggerHeight[:triggerHeight.find(',')])
    if not self._rrf2:
    #RRF 3 on a Duet Ethernet/Wifi board, apply buffer checking
    endsessionURL = (f'{self._base_url}'+'/rr_disconnect')
    r2 = self.requests.get(endsessionURL,timeout=2)
    1 Reply Last reply Reply Quote 0
    • undefined
      warpster
      last edited by 18 Feb 2022, 23:26

      Well I did find something that works
      {ip address of printer}/rr_model?key=sensors.probes

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