Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOError communicating with dropbot-dx board after plugin is enabled #7

Closed
cfobel opened this issue Jan 4, 2017 · 1 comment
Closed
Labels

Comments

@cfobel
Copy link
Member

cfobel commented Jan 4, 2017

Set up

Hardware set up:

  • DropBot v2.0 control board connected via USB
  • dropbot-dx Teensy board connected via USB

Enable selected for the following plugins:

  • dmf_control_board_plugin==2.2.13
  • dropbot_dx_accessories==2.1.62

Attempt following steps:

  1. Enable dmf_control_board_plugin
    1. Connect DMFControlBoard() instance.
  2. Enable dropbot_dx_accessories
    1. Connect dropbot_dx.SerialProxy() instance.
    2. Try to read temperature/humidity from sensor over i2c bus through dropbot-dx board.

Expected behaviour

  • Successful connection to DMFControlBoard
  • Successful connection to dropbot_dx.SerialProxy
  • Successful read of temperature/humidity from sensor over i2c bus through dropbot-dx board.

Observed behaviour

  • Successful connection to DMFControlBoard
  • Successful connection to dropbot_dx.SerialProxy
  • Attempt to read temperature/humidity from sensor over i2c bus through dropbot-dx board causes dropbot-dx board to become unresponsive.

Once the dropbot-dx board becomes unresponsive, any further attempted communication with the board (e.g., setting the state of the magnet upon entering real-time mode) causes errors like:

image

Attempting to launch the DropBot DX configuration dialog like:

image

results in the following exception:

Reason: Timed out waiting for response.
2017-01-04 10:45:55 [INFO:root]: Traceback (most recent call last):
  File "C:\Users\MR-BOX2\MicroDrop\lib\site-packages\microdrop\plugin_manager.py", line 223, in emit_signal
    return_codes[observer.name] = f(*args)
  File "C:\Users\MR-BOX2\Documents\MicroDrop\plugins\dropbot_dx_accessories_plugin\__init__.py", line 568, in on_step_run
    self.dropbot_dx_remote.light_enabled = not options['dstat_enabled']
  File "C:\Users\MR-BOX2\MicroDrop\lib\site-packages\dropbot_dx\proxy.py", line 116, in light_enabled
    self.update_state(light_enabled=value)
  File "C:\Users\MR-BOX2\MicroDrop\lib\site-packages\base_node_rpc\proxy.py", line 369, in update_state
    return super(StateMixinBase, self).update_state(state)
  File "C:\Users\MR-BOX2\MicroDrop\lib\site-packages\dropbot_dx\node.py", line 1012, in update_state
    response = self._send_command(packet)
  File "C:\Users\MR-BOX2\MicroDrop\lib\site-packages\base_node_rpc\proxy.py", line 134, in _send_command
    result = self._read_response()
  File "C:\Users\MR-BOX2\MicroDrop\lib\site-packages\base_node_rpc\proxy.py", line 145, in _read_response
    raise IOError('Timed out waiting for response.')
IOError: Timed out waiting for response.
@cfobel
Copy link
Member Author

cfobel commented Jan 4, 2017

Unresponsive behaviour can be avoided by attempting to read the temperature sensor using the DropBot v2.0 control board first, i.e.:

        # If the DropBot v2.0 control board plugin is loaded and the DropBot
        # v2.0 control board is connected, try to read temperature/humidity
        # over i2c through control board.
        try:
            service = get_service_instance_by_name('wheelerlab.dmf_control_board_plugin')
        except KeyError:
            pass
        else:
            if service.enabled() and service.control_board.connected():
                try:
                    env = self.get_environment_state(service.control_board).to_dict()
                    logger.info('temp=%.1fC, Rel. humidity=%.1f%%' %
                                (env['temperature_celsius'],
                                 100 * env['relative_humidity']))
                    self.has_environment_data = True
                    self.environment_sensor_master = service.control_board
                except:
                    pass

        # If temperature/humidity has not been read (e.g., DropBot v2.0 control
        # board plugin not loaded) try to read temperature/humidity over i2c
        # through **DropBot DX** board.
        if not self.has_environment_data:
            try:
                env = self.get_environment_state(self.dropbot_dx_remote).to_dict()
                logger.info('temp=%.1fC, Rel. humidity=%.1f%%' %
                            (env['temperature_celsius'],
                             100 * env['relative_humidity']))
                self.has_environment_data = True
                self.environment_sensor_master = self.dropbot_dx_remote
            except:
                pass

        # Get instrument identifier, if available.
        self.dropbot_dx_id = getattr(self.dropbot_dx_remote, 'id', None)

Verified plugin:

dropbot_dx_accessories_plugin.zip

@cfobel cfobel added the bug label Jan 4, 2017
@cfobel cfobel closed this as completed in ee796e1 Jan 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant