wheeler-microfluidics / mr-box-peripheral-board.py

Firmware for MR-Box controller board for various peripherals (e.g., motorized magnet, LED panels, micro pump, temperature/humidity sensor)
MIT License
0 stars 0 forks source link

SerialException: could not open port u'COMX': WindowsError(5, 'Access is denied.') #1

Open ryanfobel opened 7 years ago

ryanfobel commented 7 years ago

Steps to reproduce the problem

  1. Install MicroDrop v2.7
  2. Install and enable microdrop.mr-box-peripheral-board-plugin 0.3

Result

The DropBot is able to connect, but the peripheral board cannot. Here's the traceback:

2017-08-03 12:35:39 [WARNING:mr_box_peripheral_board_plugin]: Serial connection to peripheral board could not be established.
Traceback (most recent call last):
  File "C:\Users\Ryan\MicroDrop\etc\microdrop\plugins\enabled\mr_box_peripheral_board_plugin\__init__.py", line 118, in open_board_connection
    self.board = mb.SerialProxy()
  File "C:\Users\Ryan\MicroDrop\lib\site-packages\mr_box_peripheral_board\proxy.py", line 111, in __init__
    super(ProxyMixin, self).__init__(*args, **kwargs)
  File "C:\Users\Ryan\MicroDrop\lib\site-packages\base_node_rpc\proxy.py", line 164, in __init__
    settling_time_s=settling_time_s, retry_count=retry_count)
  File "C:\Users\Ryan\MicroDrop\lib\site-packages\base_node_rpc\proxy.py", line 246, in _connect
    raise self.serial_thread.error.exception
SerialException: could not open port u'COM30': WindowsError(5, 'Access is denied.')
cfobel commented 7 years ago

I think this might be specific to the microdrop.mr-box-peripheral-board-plugin MicroDrop plugin.

Prior to v0.3.1, the baudrate was not being set to 57600, and settling_time_s was not set. The settling time is to allow atmega328p Arduino boards to restart and pass the bootloader startup time before trying to connect.

As of v0.3.1 of the [microdrop.mr-box-peripheral-board-plugin]

Proposed long-term solution

The SerialProxy class SHOULD be updated to use default settings that will successfully connect, i.e., baudrate=57600, settling_time_s=2.5.