code: def auto_setup(self):
          
          self.add_cmd_handler(CAPABILITY_RESPONSE, self._handle_report_capability_response)
          self.send_sysex(CAPABILITY_QUERY, [])
          self.pass_time(0.1)  # Serial SYNC
  
          while self.bytes_available():
              self.iterate()
  
          # handle_report_capability_response will write self._layout
          if self._layout:
              self.setup_layout(self._layout)
          else:
              raise IOError("Board detection failed.")
docs: Automatic setup based on Firmata's "Capability Query"