# Activating correct camera in the Light Sheet configuration

**URL:** <https://openuc2.discourse.group/t/activating-correct-camera-in-the-light-sheet-configuration/63>\
**Category:** Support and Help Desk\
**Created:** [July 26, 2024, 3:42pm UTC](https://openuc2.discourse.group/t/activating-correct-camera-in-the-light-sheet-configuration/63 "2024-07-26T15:42:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![MakerTobey](https://yyz2.discourse-cdn.com/free1/user_avatar/openuc2.discourse.group/makertobey/32/49_2.png) [@MakerTobey](https://openuc2.discourse.group/u/MakerTobey)\
**Post date:** [July 26, 2024, 3:42pm UTC](https://openuc2.discourse.group/t/activating-correct-camera-in-the-light-sheet-configuration/63/1 "2024-07-26T15:42:07Z")

</div>

Dear Benedict,  
We have built a light-sheet microscope and installed the ImSwitch software from the UC branch, selecting the light-sheet configuration.  
But don’t know how to change the Mock camera to the Daheng one (drivers and image works on SQUID software on same Linux Ubuntu pc). It also loads a Hiki camera manager that does not seem to apply to us and we still have a few package errors.

 ![WhatsApp Image 2024-07-25 at 17.45.46](https://global.discourse-cdn.com/free1/uploads/openuc2/original/1X/44f1fb256a14c69514ba2efc8842c6cdb3156672.jpeg)  
 ![WhatsApp Image 2024-07-25 at 17.43.40](https://global.discourse-cdn.com/free1/uploads/openuc2/original/1X/c6cb2f26a44cc0d41e0484ba81885fed9a63882a.jpeg)

---

<div class="post-metadata">

**Author:** ![benedictdied](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@benedictdied](https://openuc2.discourse.group/u/benedictdied)\
**Post date:** [July 27, 2024, 8:42pm UTC](https://openuc2.discourse.group/t/activating-correct-camera-in-the-light-sheet-configuration/63/2 "2024-07-27T20:42:36Z")

</div>

Hey @MakerTobey, thanks for reaching out! Super cool, you’re building another light-sheet!  
Did you follow the following tutorial:  
[ImSwitch Installation on Mac and Windows](https://openuc2.discourse.group/t/imswitch-installation-on-mac-and-windows/37) ?

If possible, I would need to have access to the full stacktrace (i.e. pervious outputs). Did you check if the camera works with the “normal” python scripts from Daheng?  
Also, I would need the configuration file, just to see if there is maybe an error with the numbering of the camera.

Does the below code work?

```py
# version:1.0.1905.9051
import gxipy as gx
from PIL import Image

def main():
    # print the demo information
    print("")
    print("-------------------------------------------------------------")
    print("Sample to show how to acquire mono image continuously and show acquired image.")
    print("-------------------------------------------------------------")
    print("")
    print("Initializing......")
    print("")

    # create a device manager
    device_manager = gx.DeviceManager()
    dev_num, dev_info_list = device_manager.update_device_list()
    if dev_num is 0:
        print("Number of enumerated devices is 0")
        return

    # open the first device
    cam = device_manager.open_device_by_index(1)

    # exit when the camera is a color camera
    if cam.PixelColorFilter.is_implemented() is True:
        print("This sample does not support color camera.")
        cam.close_device()
        return

    # set continuous acquisition
    cam.TriggerMode.set(gx.GxSwitchEntry.OFF)

    # set exposure
    cam.ExposureTime.set(10000)

    # set gain
    cam.Gain.set(10.0)

    # start data acquisition
    cam.stream_on()

    # acquire image: num is the image number
    num = 1
    for i in range(num):
        # get raw image
        raw_image = cam.data_stream[0].get_image()
        if raw_image is None:
            print("Getting image failed.")
            continue

        # create numpy array with data from raw image
        numpy_image = raw_image.get_numpy_array()
        if numpy_image is None:
            continue

        # show acquired image
        img = Image.fromarray(numpy_image, 'L')
        img.show()

        # print height, width, and frame ID of the acquisition image
        print("Frame ID: %d Height: %d Width: %d"
              % (raw_image.get_frame_id(), raw_image.get_height(), raw_image.get_width()))

    # stop data acquisition
    cam.stream_off()

    # close device
    cam.close_device()

if __name__ == " __main__":
    main()

```

The

---

<div class="post-metadata">

**Author:** ![the\_alquemist](https://yyz2.discourse-cdn.com/free1/user_avatar/openuc2.discourse.group/the_alquemist/32/53_2.png) [@the\_alquemist](https://openuc2.discourse.group/u/the_alquemist)\
**Post date:** [August 1, 2024, 10:12pm UTC](https://openuc2.discourse.group/t/activating-correct-camera-in-the-light-sheet-configuration/63/3 "2024-08-01T22:12:52Z")

</div>

Hello @benedictdied ! I’m working with @MakerTobey in the implementation of the new light-sheet. Thank you for your response.

We followed the documentation in the [github repo](https://github.com/openUC2/ImSwitch). I would like to add that I made a mistake here and used the `example_uc2_lightsheethik.json` config file instead of the _daheng_ based one. Even when correcting that, we still had problems. Additionaly, for some reason the _ImSwitch_ software is always creating and using an _ImSwitchConfig_ folder at the Home folder and not using the _ImSwitchConfig_ that we downloaded in the Documents folder, as stated in your repo [documentation](https://github.com/openUC2/ImSwitch).

I was able to make the camera work with the `example_uc2_lightsheethik_gxipy.json` config file. However, the _daheng_ `.json` file gave me errors. I was able to use the camera in another [software](https://github.com/hongquanli/octopi-research/tree/master/software), so drivers shouldn’t be an issue. For the purpose of making this troubleshooting process cleaner I decided to make a clean install following the steps included in the URL you shared.

Since _ImSwitch_ is using the _ImSwitchConfig_ folder from Home. I pasted the `.json` config files I needed for testing there. After installation I run `python -m imswitch`. The software started with the `example_virtual_microscope.json` config file and the GUI is up and running but the following errors are present in the terminal:

- `[ImConMainView] Could not add widget imswitch_arkitekt to dock imswitch_arkitekt`
- `[HistoScanManager] Could not load default config from /home/wenzel-lab/ImSwitchConfig/histoController: [Errno 2] No such file or directory: '/home/wenzel-lab/ImSwitchConfig/histoController/config.json'`

While moving the mouse over the GUI it also gives me this error:

- 

```auto
[ExceptionHandler] Traceback (most recent call last):
  File "/home/wenzel-lab/.local/lib/python3.9/site-packages/pyqtgraph/dockarea/Dock.py", line 345, in mouseMoveEvent
    self.mouseMoved = (lpos - self.pressPos).manhattanLength() > QtWidgets.QApplication.startDragDistance()
AttributeError: 'DockLabel' object has no attribute 'pressPos'

```

Ok, now I want to use my _daheng_ camera. So, I change to the `example_uc2_lightsheetdaheng.json` config file. Unfortunately, the GUI throws me an error `JSONDecodeError: Expecting property name enclosed in double quotes: line 8 column 1 (char 169)`. The terminal has the following output:

- 

```auto
[main] Traceback (most recent call last):
  File "/home/wenzel-lab/Documents/wenzel_repositories/imswitch/imswitch/ __main__.py", line 126, in main
    view, controller = modulePkg.getMainViewAndController(
  File "/home/wenzel-lab/Documents/wenzel_repositories/imswitch/imswitch/imcontrol/ __init__.py", line 50, in getMainViewAndController
    setupInfo = configfiletools.loadSetupInfo(options, ViewSetupInfo)
  File "/home/wenzel-lab/Documents/wenzel_repositories/imswitch/imswitch/imcontrol/model/configfiletools.py", line 19, in loadSetupInfo
    return setupInfoType.from_json(setupFile.read(), infer_missing=True)
  File "/home/wenzel-lab/.local/lib/python3.9/site-packages/dataclasses_json/api.py", line 58, in from_json
    kvs = json.loads(s,
  File "/home/wenzel-lab/miniforge3/envs/imswitch/lib/python3.9/json/ __init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/home/wenzel-lab/miniforge3/envs/imswitch/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/home/wenzel-lab/miniforge3/envs/imswitch/lib/python3.9/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 8 column 1 (char 169)

```

In this step, the software breaks and I can’t change the config file with the interface. If I delete the _imcontrol\_setups_ folder from _ImSwitchConfig_ in the Home folder it kind of resets and I’m able to add the necessary `.json` for testing. As I mentioned before, I discovered that the camera works with the `example_uc2_lightsheethik_gxipy.json` config file. So, this is fortunately fixed, but I still can’t move the stage. The output from the terminal is the following:

- `[ImConMainView] Could not add widget LightSheet to dock LightSheet`
- `[ESP32Manager -> ESP32] [OpenDevice]: Wrong Firmware.`
- `[LasersManager -> MultiManager] module 'imswitch.imcontrol.model.managers.lasers.ESP32LightSheetManager' has no attribute 'ESP32LightSheetManager'`
- `[LasersManager -> MultiManager] module 'imswitch.imcontrol.model.managers.lasers.ESP32LightSheetManager' has no attribute 'ESP32LightSheetManager'`
- `[ESP32StageManager -> LightsheetStage] argument of type 'int' is not iterable`
- `[ESP32StageManager -> LightsheetStage] Could not register callback: 'Motor' object has no attribute 'register_callback'`
- `[HistoScanManager] Could not load default config from /home/wenzel-lab/ImSwitchConfig/histoController: [Errno 2] No such file or directory: '/home/wenzel-lab/ImSwitchConfig/histoController/config.json'`

It seems that it could be a firmware problem from the _ESP32_ device. I did try to install the drivers from this [resource](https://learn.sparkfun.com/tutorials/how-to-install-ch340-drivers/all#linux) you gave, but it is giving me driver installation problems due to secure boot. I didn’t have much time so I left it there. Maybe flashing a new firmware into the _ESP32_ device could solve the issue?

Attached here is a screenshot of the GUI running with `example_uc2_lightsheethik_gxipy.json`. I also made an `output.log` file made with `python -m imswitch > output.log 2>&1` and the `.json` files I used during this process but I can’t attach it here, where can I send it to you?

We would greatly appreciate any insights or guidance you can provide. Thank you for your time and patience.

Have a nice week,

J.

 ![Screenshot from 2024-08-01 17-58-34](https://global.discourse-cdn.com/free1/uploads/openuc2/original/1X/e5dcd82e69a328e6ac9fcac435a99ec6bee8c0c7.png)

---

<div class="post-metadata">

**Author:** ![benedictdied](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@benedictdied](https://openuc2.discourse.group/u/benedictdied)\
**Post date:** [August 5, 2024, 7:08pm UTC](https://openuc2.discourse.group/t/activating-correct-camera-in-the-light-sheet-configuration/63/4 "2024-08-05T19:08:26Z")

</div>

Hey @the_alquemist thanks a lot for your detailed report. There is a lot of errors you found. Thanks! 🙂

Maybe to clear things up a bit I’d try to give a point-by-point explanation of the errors you’re writing about:

> [@the\_alquemist](#):
>
> I was able to make the camera work with the `example_uc2_lightsheethik_gxipy.json` config file. However, the _daheng_ `.json` file gave me errors. I was able to use the camera in another [software](https://github.com/hongquanli/octopi-research/tree/master/software), so drivers shouldn’t be an issue. For the purpose of making this troubleshooting process cleaner I decided to make a clean install following the steps included in the URL you shared.

It’s important that we update the documentation (e.g. the first steps/landing docs…). Would you mind to file a pull request so that others better understand which will be the first thing they should do (or point me what would be a better place to explain it anyway)? Right now we have this forum ,the [openuc2.github.io](http://openuc2.github.io) docs, the read-the-docs from Imswitch and the readme of the repo. We should have one unified version (at least for the openUC2 fork of ImSwitch).

> [@the\_alquemist](#):
>
> Since _ImSwitch_ is using the _ImSwitchConfig_ folder from Home. I pasted the `.json` config files I needed for testing there. After installation I run `python -m imswitch`. The software started with the `example_virtual_microscope.json` config file and the GUI is up and running but the following errors are present in the terminal:
> 
> - `[ImConMainView] Could not add widget imswitch_arkitekt to dock imswitch_arkitekt`
> - `[HistoScanManager] Could not load default config from /home/wenzel-lab/ImSwitchConfig/histoController: [Errno 2] No such file or directory: '/home/wenzel-lab/ImSwitchConfig/histoController/config.json'`

Indeed, on Mac/Linux it’s in the `~` / `home` folder and not in documents. I hope I explained it here: [GitHub - openUC2/ImSwitchConfig](https://github.com/openUC2/imswitchconfig?tab=readme-ov-file#setting-up-this-repository) in more depth… also here, please let me know where I should add the information.

> [@the\_alquemist](#):
>
> While moving the mouse over the GUI it also gives me this error:
> 
> ```auto
> [ExceptionHandler] Traceback (most recent call last):
> File "/home/wenzel-lab/.local/lib/python3.9/site-packages/pyqtgraph/dockarea/Dock.py", line 345, in mouseMoveEvent
> self.mouseMoved = (lpos - self.pressPos).manhattanLength() > QtWidgets.QApplication.startDragDistance()
> AttributeError: 'DockLabel' object has no attribute 'pressPos'
> 
> ```

This is a new error. I have not found it’S cause (maybe napari/qt version related…). Chatgpt gives me this : [ChatGPT](https://chatgpt.com/share/0a8f0cbd-900d-4b0a-bf95-c94872574336) Need to digg into it when i have some time. Is not really an issue. Deactivating the histoscan plugin should help getting rid of the error messages…

> [@the\_alquemist](#):
>
> In this step, the software breaks and I can’t change the config file with the interface. If I delete the _imcontrol\_setups_ folder from _ImSwitchConfig_ in the Home folder it kind of resets and I’m able to add the necessary `.json` for testing. As I mentioned before, I discovered that the camera works with the `example_uc2_lightsheethik_gxipy.json` config file. So, this is fortunately fixed, but I still can’t move the stage. The output from the terminal is the following:

Can you tell me what’s the baudrate under the ESP32 tag?  
[ImSwitchConfig/imcontrol\_setups/example\_uc2\_multicolour\_daheng\_lena.json at master · openUC2/ImSwitchConfig · GitHub](https://github.com/openUC2/ImSwitchConfig/blob/master/imcontrol_setups/example_uc2_multicolour_daheng_lena.json#L47) (You can use this file, should work…)  
In between I changed the baudrate from 50000 to 115200 due to stability reasons. You can check it on this website: [openUC2 WebSERIAL Demonstration](https://youseetoo.github.io/indexWebSerialTest.html)

Good luck! 🙂

---

<div class="post-metadata">

**Author:** ![the\_alquemist](https://yyz2.discourse-cdn.com/free1/user_avatar/openuc2.discourse.group/the_alquemist/32/53_2.png) [@the\_alquemist](https://openuc2.discourse.group/u/the_alquemist)\
**Post date:** [August 6, 2024, 9:22pm UTC](https://openuc2.discourse.group/t/activating-correct-camera-in-the-light-sheet-configuration/63/5 "2024-08-06T21:22:25Z")

</div>

Hello @benedictdied ! Thank you for the reply and additional comments. I will follow the same point-by-point scheme you used:

> [@benedictdied](#):
>
> It’s important that we update the documentation (e.g. the first steps/landing docs…). Would you mind to file a pull request so that others better understand which will be the first thing they should do (or point me what would be a better place to explain it anyway)? Right now we have this forum ,the [openuc2.github.io](http://openuc2.github.io) docs, the read-the-docs from Imswitch and the readme of the repo. We should have one unified version (at least for the openUC2 fork of ImSwitch).

I’m happy to contribute in any way I can. I agree with you in that a unified version is the better approach for this. In my mind, the first thing to do is look up the git-hub repo from the project. When I visit the [UC2 main repo](https://github.com/openUC2/UC2-GIT) there is a section that talks about the repos associated to it which are divided in 3: [hardware](https://github.com/openUC2/UC2-GIT), [REST](https://github.com/openUC2/UC2-REST) and [ImSwitch](https://github.com/beniroquai/ImSwitch). However, _ImSwitch_ repo is associated to a fork born from [beniroquai’s git ecosystem](https://github.com/beniroquai/ImSwitch) and not [UC2’s official fork](https://github.com/openUC2/ImSwitch). This leads me to some confusion, so I’m already not sure where to make a pull request for a documentation update. Consolidating this would be a great start.

If the [URL](https://openuc2.discourse.group/t/imswitch-installation-on-mac-and-windows/37) you provided is the updated installation protocol, the defined _ImSwitch_ main repo should harbor this same set of instructions. Other documentation sources such as _this forum_, [_openuc2.github.io_](http://openuc2.github.io) docs, [_read-the-docs_](https://imswitch.readthedocs.io/en/stable/) and _readme_ from the non-main or conflicting fork, should serve as additional information where time-stamps help make the difference between updated and obsolete information, when compared to the main repo.

> [@benedictdied](#):
>
> Indeed, on Mac/Linux it’s in the `~` / `home` folder and not in documents. I hope I explained it here: [GitHub - openUC2/ImSwitchConfig](https://github.com/openUC2/imswitchconfig?tab=readme-ov-file#setting-up-this-repository) in more depth… also here, please let me know where I should add the information.

It’s indeed explained there, sorry I missed that. I think that the focus of the main repo should be for Linux based systems and present macOS and Windows as optional installation methods. I followed _[Option C: Install from Github (UC2 version)](https://github.com/beniroquai/ImSwitch)_ but it wasn’t obvious to me that we weren’t talking about Linux based systems, leading to the confusion on working directories I mentioned before. That way it’s easier to follow the thread of information.

> [@benedictdied](#):
>
> Can you tell me what’s the baudrate under the ESP32 tag?  
> [ImSwitchConfig/imcontrol\_setups/example\_uc2\_multicolour\_daheng\_lena.json at master · openUC2/ImSwitchConfig · GitHub](https://github.com/openUC2/ImSwitchConfig/blob/master/imcontrol_setups/example_uc2_multicolour_daheng_lena.json#L47) (You can use this file, should work…)  
> In between I changed the baudrate from 50000 to 115200 due to stability reasons. You can check it on this website: [openUC2 WebSERIAL Demonstration](https://youseetoo.github.io/indexWebSerialTest.html)

Unfortunately, no luck here. I tried to run _ImSwitch_ with the new `.json` file and I get the following error:

> ERROR [main] Traceback (most recent call last):  
> File “/home/wenzel-lab/Documents/wenzel\_repositories/imswitch/imswitch/imcontrol/controller/ImConMainController.py”, line 56, in **init**  
> self.controllers[widgetKey] = self.\_\_factory.createController(  
> File “/home/wenzel-lab/Documents/wenzel\_repositories/imswitch/imswitch/imcommon/controller/basecontrollers.py”, line 46, in createController  
> controller = controllerClass(\*self.\_\_args, \*args,  
> File “/home/wenzel-lab/Documents/wenzel\_repositories/imswitch/imswitch/imcontrol/controller/controllers/DPCController.py”, line 96, in **init**  
> self.frameShape = self.detector.getLatestFrame().shape  
> AttributeError: ‘NoneType’ object has no attribute ‘shape’  
> During handling of the above exception, another exception occurred:  
> Traceback (most recent call last):  
> File “/home/wenzel-lab/Documents/wenzel\_repositories/imswitch/imswitch/ **main**.py”, line 126, in main  
> view, controller = modulePkg.getMainViewAndController(  
> File “/home/wenzel-lab/Documents/wenzel\_repositories/imswitch/imswitch/imcontrol/ **init**.py”, line 80, in getMainViewAndController  
> raise e  
> File “/home/wenzel-lab/Documents/wenzel\_repositories/imswitch/imswitch/imcontrol/ **init**.py”, line 75, in getMainViewAndController  
> controller = ImConMainController(options, setupInfo, view, moduleCommChannel)  
> File “/home/wenzel-lab/Documents/wenzel\_repositories/imswitch/imswitch/imcontrol/controller/ImConMainController.py”, line 72, in **init**  
> raise ValueError(f’No controller found for widget {widgetKey}')  
> ValueError: No controller found for widget DPC

I also had problems with the _openUC2 WebSERIAL Demonstration_ where no compatible devices were found. I tried changing the baudrate but nothing happened.

Regarding the documentation, as I mentioned earlier, I can make a pull request and I can attach the description with all the details regarding the information layout I have in mind.

I hope you find this information useful and we really appreciate your help.

Thank you for your time!

---

<div class="post-metadata">

**Author:** ![the\_alquemist](https://yyz2.discourse-cdn.com/free1/user_avatar/openuc2.discourse.group/the_alquemist/32/53_2.png) [@the\_alquemist](https://openuc2.discourse.group/u/the_alquemist)\
**Post date:** [August 22, 2024, 10:23pm UTC](https://openuc2.discourse.group/t/activating-correct-camera-in-the-light-sheet-configuration/63/6 "2024-08-22T22:23:21Z")

</div>

Hello @benedictdied ! So, in the end we followed the [Docker method](https://openuc2.github.io/docs/ImSwitch/ImSwitchDocker/) to solve the “it doesn’t run on my machine” issue. In our case, we have Ubuntu 24.04 LTS installed and we had to use Canonical’s app catalogue because Docker isn’t directly supported yet by the developer. Docker must be called as `sudo`, but it works great, here is what I did:

```auto
sudo docker run -it --rm -p 8001:8001 -p 2222:22 -e HEADLESS=1 -e HTTP_PORT=8001 -e UPDATE_GIT=1 -e CONFIG_PATH=/config -v ~/Downloads:/config -e UPDATE_CONFIG=0 --privileged ghcr.io/openuc2/imswitch-noqt-x64:latest

```

At the end it gave us the following text:

```auto

INFO: Uvicorn running on https://0.0.0.0:8001 (Press CTRL+C to quit)

```

We accessed the URL and gave it access. Since the default configuration of the container is to use the `example_virtual_microscope.json` config file, it worked right away when making use of the web interface from the following domain:

```auto

https://0.0.0.0:8001/imswitch/index.html

```

The file that stores which config `.json` is going to be used is the one named _imcontrol\_options.json_ under the _/Downloads/ImSwitchConfig/config_ path. So, to test my Daheng Camera and stage controller, I switched the parameters to point the correct config file. In this case:

1.- From _imcontrol\_options.json_

```auto
{
    "setupFileName": "example_uc2_lightsheet_gxipy.json",
    "recording": {
        "outputFolder": "./ImSwitch/ImSwitch/recordings",
        "includeDateInOutputFolder": true
    },
    "watcher": {
        "outputFolder": "/config/ImSwitchConfig/scripts"
    }
}

```

2.- Added the respective `.json` config file to the _imcontrol\_setups_ folder under the _/Downloads/ImSwitchConfig/imcontrol\_setups/_ path.

After this, I rerun the previous steps to activate the docker container and as expected it used the new `.json` configuration file. The camera does work but the stage controller still doesn’t.

When trying to locate the device with the [flashing tool](https://youseetoo.github.io/) in a chrome based web browser, the window that pops up says that it’s unable to locate the device.

I can confirm this from the terminal’s output too that details the following:

```auto
2024-08-22 21:30:03 DEBUG [ESP32Manager -> ESP32] No USB device connected! Using DUMMY!

```

When trying to use the stage controller from the web interface it throws the following error:

```auto
INFO: 172.17.0.1:59728 - "GET / HTTP/1.1" 422 Unprocessable Entity
INFO: 172.17.0.1:59728 - "GET /favicon.ico HTTP/1.1" 404 Not Found
INFO: 172.17.0.1:59728 - "GET /imswitch/index.html HTTP/1.1" 200 OK
INFO: 172.17.0.1:59728 - "GET /imswitch/static/js/main.fa009905.js HTTP/1.1" 200 OK
INFO: 172.17.0.1:59728 - "GET /path_to_your_logo.png HTTP/1.1" 404 Not Found
INFO: 172.17.0.1:59728 - "GET /path_to_your_logo.png HTTP/1.1" 404 Not Found
INFO: 172.17.0.1:36918 - "GET /PositionerController/movePositioner?axis=X&dist=1000&isAbsolute=false&isBlocking=false&speed=1000 HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
  File "/opt/conda/envs/imswitch/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi
    result = await app( # type: ignore[func-returns-value]
  File "/opt/conda/envs/imswitch/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
    return await self.app(scope, receive, send)
  File "/opt/conda/envs/imswitch/lib/python3.10/site-packages/fastapi/applications.py", line 1054, in __call__
    await super(). __call__ (scope, receive, send)
  File "/opt/conda/envs/imswitch/lib/python3.10/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/opt/conda/envs/imswitch/lib/python3.10/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/opt/conda/envs/imswitch/lib/python3.10/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/opt/conda/envs/imswitch/lib/python3.10/site-packages/starlette/middleware/cors.py", line 85, in __call__
    await self.app(scope, receive, send)
  File "/opt/conda/envs/imswitch/lib/python3.10/site-packages/starlette/middleware/httpsredirect.py", line 19, in __call__
    await self.app(scope, receive, send)
  File "/opt/conda/envs/imswitch/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/opt/conda/envs/imswitch/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/opt/conda/envs/imswitch/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/opt/conda/envs/imswitch/lib/python3.10/site-packages/starlette/routing.py", line 754, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/opt/conda/envs/imswitch/lib/python3.10/site-packages/starlette/routing.py", line 774, in app
    await route.handle(scope, receive, send)
  File "/opt/conda/envs/imswitch/lib/python3.10/site-packages/starlette/routing.py", line 295, in handle
    await self.app(scope, receive, send)
  File "/opt/conda/envs/imswitch/lib/python3.10/site-packages/starlette/routing.py", line 77, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/opt/conda/envs/imswitch/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/opt/conda/envs/imswitch/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/opt/conda/envs/imswitch/lib/python3.10/site-packages/starlette/routing.py", line 74, in app
    response = await f(request)
  File "/opt/conda/envs/imswitch/lib/python3.10/site-packages/fastapi/routing.py", line 278, in app
    raw_response = await run_endpoint_function(
  File "/opt/conda/envs/imswitch/lib/python3.10/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
    return await dependant.call(**values)
  File "/tmp/ImSwitch/imswitch/imcontrol/controller/server/ImSwitchServer.py", line 194, in wrapper
    return func(*args, **kwargs)
  File "/tmp/ImSwitch/imswitch/imcontrol/controller/controllers/PositionerController.py", line 218, in movePositioner
    positionerName = self._master.positionersManager.getAllDeviceNames()[0]
IndexError: list index out of range

```

After some troubleshooting, the usb extensor that we used was broken, so we switched to another one and we were able to detect the usb connection from `lsusb`:

```auto
Bus 001 Device 007: ID 10c4:ea60 Silicon Labs CP210x UART Bridge

```

So I’m not sure why the flashing tool is not detecting it. I also tried switching to other versions just in case but nothing. `lsmod` shows these entries:

```auto
cp210x 40960 0
usbserial 69632 1 cp210x

```

In the case of `sudo dmesg | tail`:

```auto
[27190.409721] docker0: port 1(veth6e8ad5b) entered disabled state
[27190.409726] veth6e8ad5b: entered allmulticast mode
[27190.409762] veth6e8ad5b: entered promiscuous mode
[27190.512888] eth0: renamed from veth7beafa3
[27190.522877] docker0: port 1(veth6e8ad5b) entered blocking state
[27190.522880] docker0: port 1(veth6e8ad5b) entered forwarding state
[27209.048170] usb 6-1: reset SuperSpeed USB device number 4 using xhci_hcd
[27233.721187] audit: type=1400 audit(1724362228.994:495): apparmor="DENIED" operation="open" class="file" profile="snap-update-ns.firefox" name="/proc/24735/maps" pid=24735 comm="5" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[29029.235521] audit: type=1400 audit(1724364024.485:496): apparmor="DENIED" operation="open" class="file" profile="snap-update-ns.firmware-updater" name="/proc/25736/maps" pid=25736 comm="5" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[29029.365111] audit: type=1400 audit(1724364024.615:497): apparmor="DENIED" operation="open" class="file" profile="snap.firmware-updater.firmware-notifier" name="/proc/sys/vm/max_map_count" pid=25705 comm="firmware-notifi" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

```

And `ls /dev/tty*` shows a `/dev/ttyUSB0` file.

Thank you for your help and time. Looking forward to your comments.

---

<div class="post-metadata">

**Author:** ![benedictdied](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@benedictdied](https://openuc2.discourse.group/u/benedictdied)\
**Post date:** [August 23, 2024, 7:28am UTC](https://openuc2.discourse.group/t/activating-correct-camera-in-the-light-sheet-configuration/63/7 "2024-08-23T07:28:15Z")

</div>

Thanks a lot @the_alquemist for the detailed reporting here! This is very helpful for future generations 🙂  
One more thing that pops up to my mind is the ownership of the serial devices in linux. In python you typically have to change the user permissions in order to access it via pyserial for example. Maybe it’S the same for chromium?  
Can you test another OS like windows? if you see the esp already then it should work.

Here is the user-group issue for pyserial  
[https://forums.raspberrypi.com/viewtopic.php?t=199171](https://forums.raspberrypi.com/viewtopic.php?t=199171)

---

<div class="post-metadata">

**Author:** ![the\_alquemist](https://yyz2.discourse-cdn.com/free1/user_avatar/openuc2.discourse.group/the_alquemist/32/53_2.png) [@the\_alquemist](https://openuc2.discourse.group/u/the_alquemist)\
**Post date:** [August 23, 2024, 9:38pm UTC](https://openuc2.discourse.group/t/activating-correct-camera-in-the-light-sheet-configuration/63/8 "2024-08-23T21:38:05Z")

</div>

Hey @benedictdied ! No problem. Unfortunately, I wasn’t able to connect the stage yet. This is what I tried:

1.- Add user to dialout group (checked with `groups`)

```auto
sudo usermod -a -G dialout <user>

```

2.- Enable _Experimental Web Platform features_ option under `chrome://flags` from Chrome web browser.

3.- Specific permissions for ttyUSB0

```auto

sudo chmod 666 /dev/ttyUSB0

```

4.- Windows does recognize a device but with the warning sign, meaning a problem with the drivers.

Looking forward to your comments!

---

<div class="post-metadata">

**Author:** ![benedictdied](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@benedictdied](https://openuc2.discourse.group/u/benedictdied)\
**Post date:** [August 24, 2024, 7:11pm UTC](https://openuc2.discourse.group/t/activating-correct-camera-in-the-light-sheet-configuration/63/9 "2024-08-24T19:11:18Z")

</div>

Thanks again. I remember I had issues with Ubuntu a while ago. You replaced the user with yours I guess?

On Windows, you would need to install the driver:

> **[CP210x USB to UART Bridge VCP Drivers - Silicon Labs](https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers)**
>
> The CP210x USB to UART Bridge Virtual COM Port (VCP) drivers are required for device operation as a Virtual COM Port to facilitate host communication with CP210x products. These devices can also interface to a host using the direct access driver.

---

<div class="post-metadata">

**Author:** ![the\_alquemist](https://yyz2.discourse-cdn.com/free1/user_avatar/openuc2.discourse.group/the_alquemist/32/53_2.png) [@the\_alquemist](https://openuc2.discourse.group/u/the_alquemist)\
**Post date:** [August 24, 2024, 10:16pm UTC](https://openuc2.discourse.group/t/activating-correct-camera-in-the-light-sheet-configuration/63/10 "2024-08-24T22:16:54Z")

</div>

> Thanks again. I remember I had issues with Ubuntu a while ago. You replaced the user with yours I guess?

That’s correct.

> On Windows, you would need to install the driver:

This is for the purpose of re-flashing it on Windows? We migrated to Linux and our setup is built around that OS so it’s not really an option to use Windows as a main thing.

---

<div class="post-metadata">

**Author:** ![benedictdied](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@benedictdied](https://openuc2.discourse.group/u/benedictdied)\
**Post date:** [September 1, 2024, 9:37pm UTC](https://openuc2.discourse.group/t/activating-correct-camera-in-the-light-sheet-configuration/63/11 "2024-09-01T21:37:09Z")

</div>

Hey, sorry for my late reply. I just wanted to check if the board actually works on windows.  
A colleague of mine tested Ubuntu yesterday with a new cable, all over sudden it worked. USB Micro cable seem to be tricky. Perhaps you find yet another cable and test it again? Sorry.

---

<div class="post-metadata">

**Author:** ![the\_alquemist](https://yyz2.discourse-cdn.com/free1/user_avatar/openuc2.discourse.group/the_alquemist/32/53_2.png) [@the\_alquemist](https://openuc2.discourse.group/u/the_alquemist)\
**Post date:** [September 13, 2024, 3:15pm UTC](https://openuc2.discourse.group/t/activating-correct-camera-in-the-light-sheet-configuration/63/12 "2024-09-13T15:15:24Z")

</div>

Hello @benedictdied , sorry for the late reply. Thank you for your time and patience. I tested the device on a Windows machine with the drivers reinstalled from the source you provided and it worked. By worked I mean that the flashing tool was able to recognize the device.

This also confirms that the cable is working as intended. Unfortunately, when retesting on Ubuntu, the device is still not being recognized by the flashing tool but it does appear with the `lsusb` command.

I will try to keep tweaking the permissions but the issue could be driver related too. If you have any other ideas or comments I would really appreciate it.

---

<div class="post-metadata">

**Author:** ![benedictdied](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@benedictdied](https://openuc2.discourse.group/u/benedictdied)\
**Post date:** [September 13, 2024, 7:38pm UTC](https://openuc2.discourse.group/t/activating-correct-camera-in-the-light-sheet-configuration/63/13 "2024-09-13T19:38:29Z")

</div>

Do you happen to have a raspberry pi at hand? I’m working with it + docker all the time (I have updated a lot of things here: [GitHub - openUC2/ImSwitchDockerInstall: This is the repository to install and launch ImSwitch in Docker](https://github.com/openUC2/ImSwitchDockerInstall)  
This works always without installing any drivers.

---

<div class="post-metadata">

**Author:** ![the\_alquemist](https://yyz2.discourse-cdn.com/free1/user_avatar/openuc2.discourse.group/the_alquemist/32/53_2.png) [@the\_alquemist](https://openuc2.discourse.group/u/the_alquemist)\
**Post date:** [September 24, 2024, 3:10pm UTC](https://openuc2.discourse.group/t/activating-correct-camera-in-the-light-sheet-configuration/63/14 "2024-09-24T15:10:37Z")

</div>

Hello @benedictdied , sorry for the delay. Yes we do. I think we have the Raspberry Pi 4. Is there any specific OS version needed for compatibility?

Additionally, I remembered we also have an old Windows PC so I will also test that platform too from the following [URL (Option A)](https://github.com/beniroquai/ImSwitch). However, artifacts are already expired. Which one should I download?

If you have any additional comments please let me know.

Thanks for your time

---

<div class="post-metadata">

**Author:** ![benedictdied](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@benedictdied](https://openuc2.discourse.group/u/benedictdied)\
**Post date:** [September 24, 2024, 6:13pm UTC](https://openuc2.discourse.group/t/activating-correct-camera-in-the-light-sheet-configuration/63/15 "2024-09-24T18:13:42Z")

</div>

Hey @the_alquemist I have started pushing the imswitch+docker forward to work on raspi. You can test this: It installs all the necessary components and creates the ImSwitchConfig in the homfolder. It runs in headless mode and works on my Raspi 4 and 5 🙂

Here comes the link: [GitHub - openUC2/ImSwitchDockerInstall: This is the repository to install and launch ImSwitch in Docker](https://github.com/openUC2/ImSwitchDockerInstall)

---

<div class="post-metadata">

**Author:** ![the\_alquemist](https://yyz2.discourse-cdn.com/free1/user_avatar/openuc2.discourse.group/the_alquemist/32/53_2.png) [@the\_alquemist](https://openuc2.discourse.group/u/the_alquemist)\
**Post date:** [September 25, 2024, 8:08pm UTC](https://openuc2.discourse.group/t/activating-correct-camera-in-the-light-sheet-configuration/63/16 "2024-09-25T20:08:38Z")

</div>

Hello @benedictdied I tested the Raspberry Pi method and the following happened:

1. I was able to run the script specified [here](https://github.com/openUC2/ImSwitchDockerInstall) and the command:

```auto
sudo docker run -it --rm -p 8001:8001 -e HEADLESS=1 -e HTTP_PORT=8001 -e UPDATE_GIT=1 -e UPDATE_CONFIG=0 -e CONFIG_PATH=/config -v ~/Downloads:/config --privileged -e DATA_PATH=/dataset -v /media/uc2/SD2:/dataset ghcr.io/openuc2/imswitch-noqt-x64:latest

```

1. After taking the same precautions I [mentioned](https://openuc2.discourse.group/t/activating-correct-camera-in-the-light-sheet-configuration/63/6) before, I stumbled with some errors when testing the program with these files: `example_uc2_lightsheet.json` `example_uc2_lightsheetdaheng.json` `example_uc2_lightsheet_gxipy.json`.

- `example_uc2_lightsheet.json`:

```auto
ERROR [main] Traceback (most recent call last):
  File "/tmp/ImSwitch/imswitch/ __main__.py", line 146, in main
    view, controller = modulePkg.getMainViewAndController(
  File "/tmp/ImSwitch/imswitch/imcontrol/ __init__.py", line 61, in getMainViewAndController
    setupInfo = configfiletools.loadSetupInfo(options, ViewSetupInfo)
  File "/tmp/ImSwitch/imswitch/imcontrol/model/configfiletools.py", line 20, in loadSetupInfo
    return setupInfoType.from_json(setupFile.read(), infer_missing=True)
  File "/opt/conda/envs/imswitch/lib/python3.10/site-packages/dataclasses_json/api.py", line 58, in from_json
    kvs = json.loads(s,
  File "/opt/conda/envs/imswitch/lib/python3.10/json/ __init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/opt/conda/envs/imswitch/lib/python3.10/json/decoder.py", line 340, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 28 column 2 (char 586)

```

- `example_uc2_lightsheetdaheng.json`:

```auto
ERROR [main] Traceback (most recent call last):
  File "/tmp/ImSwitch/imswitch/ __main__.py", line 146, in main
    view, controller = modulePkg.getMainViewAndController(
  File "/tmp/ImSwitch/imswitch/imcontrol/ __init__.py", line 61, in getMainViewAndController
    setupInfo = configfiletools.loadSetupInfo(options, ViewSetupInfo)
  File "/tmp/ImSwitch/imswitch/imcontrol/model/configfiletools.py", line 20, in loadSetupInfo
    return setupInfoType.from_json(setupFile.read(), infer_missing=True)
  File "/opt/conda/envs/imswitch/lib/python3.10/site-packages/dataclasses_json/api.py", line 58, in from_json
    kvs = json.loads(s,
  File "/opt/conda/envs/imswitch/lib/python3.10/json/ __init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/opt/conda/envs/imswitch/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/opt/conda/envs/imswitch/lib/python3.10/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 42 column 1 (char 1004)

```

- `example_uc2_lightsheet_gxipy.json`:

```auto
ERROR [ESP32Manager -> ESP32] [OpenDevice]: Wrong Firmware.
DEBUG [ESP32Manager -> ESP32] Trying out port /dev/ttyUSB0 failed: 'utf-8' codec can't decode bytes in position 2-3: invalid continuation byte
DEBUG [ESP32Manager -> ESP32] No USB device connected! Using DUMMY!

```

The first 2 won’t initiate at all and the last one corresponding to _gxipy_ is able to run but with the firmware error. Fortunately, the flashing tool is able to recognize the device this time so maybe it just needs a re-flash? If that is the case could you confirm if the image we need is from _ESP32 DEV-based UC2 standalone board V3_ ?

Looking forward to your comments and thanks for your time.

---

<div class="post-metadata">

**Author:** ![benedictdied](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@benedictdied](https://openuc2.discourse.group/u/benedictdied)\
**Post date:** [October 1, 2024, 9:56pm UTC](https://openuc2.discourse.group/t/activating-correct-camera-in-the-light-sheet-configuration/63/17 "2024-10-01T21:56:52Z")

</div>

Hey, thanks for your ongoing effort to get it going. Can you please paste the json files here or point them on github? There must be a typo.  
Could you reflash it with the V3 standalone (not rework):

 ![image](https://global.discourse-cdn.com/free1/uploads/openuc2/original/1X/48a371975f22745b1860b171dfd8c9de023b26ea.jpeg)

---

<div class="post-metadata">

**Author:** ![the\_alquemist](https://yyz2.discourse-cdn.com/free1/user_avatar/openuc2.discourse.group/the_alquemist/32/53_2.png) [@the\_alquemist](https://openuc2.discourse.group/u/the_alquemist)\
**Post date:** [October 2, 2024, 1:33pm UTC](https://openuc2.discourse.group/t/activating-correct-camera-in-the-light-sheet-configuration/63/18 "2024-10-02T13:33:10Z")

</div>

Hello @benedictdied, sure thing.

1. `example_uc2_lightsheet.json`:

```auto
{
  "positioners": {
    "LightsheetStage": {
        "managerNameESP32": "ESP32StageManager",
        "managerName": "GRBLStageManager",
        "managerProperties": {
            "rs232device": "ESP32"
        },
        "axes": ["X", "Y", "Z"],
        "forScanning": true,
        "forPositioning": true
    }
},
"rs232devices": {
    "ESP32": {
      "managerName": "ESP32Manager",
      "managerProperties": {
        "host": "192.168.137.113"
      }
    }
  },
  "ESP32": {
    "managerName": "ESP32Manager",
    "managerProperties": {
      "host": "192.168.137.95"
    }
  }
},
"lasers": {
  "488 Laser": {
    "analogChannel": null,
    "digitalLine": null,
    "managerName": "ESP32LEDLaserManager",
    "managerProperties": {
        "rs232device": "ESP32",
        "channel_index": "B",
        "filter_change": true
    },
    "wavelength": 488,
    "valueRangeMin": 0,
    "valueRangeMax": 32768
},
"635 Laser": {
  "analogChannel": null,
  "digitalLine": null,
  "managerName": "ESP32LEDLaserManager",
  "managerProperties": {
      "rs232device": "ESP32",
      "channel_index": "R",
      "filter_change": true
  },
  "wavelength": 635,
  "valueRangeMin": 0,
  "valueRangeMax": 32768
},
"LED": {
  "analogChannel": null,
  "digitalLine": null,
  "managerName": "ESP32LEDLaserManager",
  "managerProperties": {
      "rs232device": "ESP32",
      "channel_index": "W",
      "filter_change": false
  },
  "wavelength": 635,
  "valueRangeMin": 0,
  "valueRangeMax": 32768
}
},
"detectors": {
  "WidefieldCamera": {
    "analogChannel": null,
    "digitalLine": null,
    "managerName1": "GXPIPYManager",
    "managerName": "AVManager",
    "managerProperties1": "gxipycam",
    "managerProperties": {
      "cameraListIndex": 1,
      "avcam": {
        "exposure": 0,
        "gain": 0,
        "blacklevel": 100,
        "image_width": 1000,
        "image_height": 1000
      }
    },
    "forAcquisition": true
  }
},
"rois": {
  "Full chip": {
    "x": 600,
    "y": 600,
    "w": 1200,
    "h": 1200
  }
},
  "availableWidgets": [
    "Settings",
    "View",
    "Recording",
    "Image",
    "Laser",
    "Positioner"
  ]
}

```

1. `example_uc2_lightsheetdaheng.json`:

```auto
{
  "positioners": {
    "ESP32Stage": {
      "managerName": "ESP32StageManager",
      "managerProperties": {
        "rs232device": "ESP32",
        "enableauto": 0,
        "isEnable": 1,
        "homeXenabled": true, 
        "homeStepsX":10000, 
        "homeOnStartX": true,
        "homeEndposReleaseX":5000,
        "homeYenabled": true, 
        "homeStepsY":10000, 
        "homeOnStartY": true,
        "homeEndposReleaseY":5000,
        "homeAenabled": true, 
        "homeStepsA":10000, 
        "homeOnStarta": true,
        "homeEndposReleaseA":5000,
        "stepsizeX": -0.3125,
        "stepsizeY": -0.3125,
        "stepsizeZ": 0.3125
      },
      "axes": [
        "X",
        "Y",
        "Z",
        "A"
      ],
      "forScanning": true,
      "forPositioning": true
    }
  },
  "rs232devices": {
    "ESP32": {
      "managerName": "ESP32Manager",
      "managerProperties": {
        "host_": "192.168.43.129",
        "serialport_": "COM3",
        "serialport": "COM3",
<<<<<<< Updated upstream
        "baudrate":500000, 
        "debug":1
=======
        "baudrate":115200
>>>>>>> Stashed changes
       }
    }
  },
  "lasers": {
    "488 Laser": {
      "analogChannel": null,
      "digitalLine": null,
      "managerName": "ESP32LEDLaserManager",
      "managerProperties": {
        "rs232device": "ESP32",
        "channel_index":1,
        "filter_change": false,
        "laser_despeckle_period": 10,
        "laser_despeckle_amplitude": 0
      },
      "wavelength": 488,
      "valueRangeMin": 0,
      "valueRangeMax": 512
    },
    "LED Matrix": {
      "analogChannel": null,
      "digitalLine": null,
      "managerName": "ESP32LEDLaserManager",
      "managerProperties": {
        "rs232device": "ESP32",
        "channel_index": "LED",
        "filter_change": false,
        "filter_axis": 3,
        "filter_position": 32000,
        "filter_position_init": -0
      },
      "wavelength": 635,
      "valueRangeMin": 0,
      "valueRangeMax": 255
    }
  },
  "detectors": {
    "WidefieldCamera": { "analogChannel": null,
      "digitalLine": null,
      "managerName": "GXPIPYManager",
      "managerProperties": {
        "cameraListIndex": 1,
        "gxipycam": {
          "exposure": 20,
          "gain": 0,
          "blacklevel": 10,
          "image_width": 1000,
          "image_height": 1000
        }
      },
      "forAcquisition": true,
      "forFocusLock": true
    }
    },
  "rois": {
    "Full chip": {
      "x": 600,
      "y": 600,
      "w": 1200,
      "h": 1200
    }
  },
  "LEDMatrixs": {
    "ESP32 LEDMatrix": {
      "analogChannel": null,
      "digitalLine": null,
      "managerName": "ESP32LEDMatrixManager",
      "managerProperties": {
        "rs232device": "ESP32",
        "Nx": 4,
        "Ny": 4
      },
      "wavelength": 488,
      "valueRangeMin": 0,
      "valueRangeMax": 32768
    }
  },
  "mct": {
    "monitorIdx": 2,
    "width": 1080,
    "height": 1920,
    "wavelength": 0,
    "pixelSize": 0,
    "angleMount": 0,
    "patternsDirWin": "C:\\Users\\wanghaoran\\Documents\\ImSwitchConfig\\imcontrol_slm\\488\\",
    "patternsDir": "/users/bene/ImSwitchConfig/imcontrol_sim/488"
  },
  "webrtc":{},
  "PixelCalibration": {},
  "availableWidgets": [
    "Settings",
    "Positioner",
    "View",
    "Recording",
    "Image",
    "Laser",
    "Lightsheet",
    "UC2Config",
    "Joystick",
<<<<<<< Updated upstream
    "LEDMatrix",
    "HistoScan", 
    "ROIScan",
    "Lightsheet"
=======
    "LEDMatrix", 
    "ROIScan"
>>>>>>> Stashed changes
  ],
  "nonAvailableWidgets":[
    "STORMRecon",
    "LEDMatrix",
    "MCT",
    "ImSwitchServer",
    "PixelCalibration",
    "Hypha",
    "FocusLock",
    "HistoScan", 
    "FocusLock"]
}

```

1. `example_uc2_lightsheet_gxipy.json`:

```auto
{
    "detectors": {
        "LightSheet": {
            "analogChannel": null,
            "digitalLine": null,
            "managerName": "GXPIPYManager",
            "managerProperties": {
                "cameraListIndex": 1,
                "gxipycam": {
                    "exposure": 0,
                    "gain": 0,
                    "blacklevel": 100,
                    "image_width": 1000,
                    "image_height": 1000,
                    "binning": 2
                }
            },
            "forAcquisition": true,
            "forFocusLock": true
        }
    },
    "lasers": {
        "488 Laser": {
            "analogChannel": null,
            "digitalLine": null,
            "managerName": "ESP32LEDLaserManager",
            "managerProperties": {
                "rs232device": "ESP32",
                "channel_index": "",
                "filter_change": false
            },
            "valueRangeMin": 0,
            "valueRangeMax": 32768,
            "wavelength": 488,
            "freqRangeMin": 0,
            "freqRangeMax": 0,
            "freqRangeInit": 0,
            "valueRangeStep": 1.0
        },
        "LED": {
            "analogChannel": null,
            "digitalLine": null,
            "managerName": "ESP32LEDLaserManager",
            "managerProperties": {
                "rs232device": "ESP32",
                "channel_index": "W",
                "filter_change": false
            },
            "valueRangeMin": 0,
            "valueRangeMax": 32768,
            "wavelength": 1000,
            "freqRangeMin": 0,
            "freqRangeMax": 0,
            "freqRangeInit": 0,
            "valueRangeStep": 1.0
        },
        "Lightsheet X-position": {
            "analogChannel": null,
            "digitalLine": null,
            "managerName": "ESP32LightSheetManager",
            "managerProperties": {
                "rs232device": "ESP32",
                "axis": "pos_x"
            },
            "valueRangeMin": 0,
            "valueRangeMax": 255,
            "wavelength": 0,
            "freqRangeMin": 0,
            "freqRangeMax": 0,
            "freqRangeInit": 0,
            "valueRangeStep": 1.0
        },
        "Lightsheet Y-Amplitude": {
            "analogChannel": null,
            "digitalLine": null,
            "managerName": "ESP32LightSheetManager",
            "managerProperties": {
                "rs232device": "ESP32",
                "axis": "amp_y"
            },
            "valueRangeMin": 0,
            "valueRangeMax": 255,
            "wavelength": 0,
            "freqRangeMin": 0,
            "freqRangeMax": 0,
            "freqRangeInit": 0,
            "valueRangeStep": 1.0
        }
    },
    "positioners": {
        "LightsheetStage": {
            "analogChannel": null,
            "digitalLine": null,
            "managerName": "ESP32StageManager",
            "managerProperties": {
                "rs232device": "ESP32"
            },
            "axes": [
                "X",
                "Y",
                "Z"
            ],
            "isPositiveDirection": true,
            "forPositioning": true,
            "forScanning": true
        }
    },
    "rs232devices": {
        "ESP32": {
            "managerName": "ESP32Manager",
            "managerProperties": {
                "host_": "192.168.137.95",
                "serialport": "COM3"
            }
        }
    },
    "slm": null,
    "focusLock": null,
    "autofocus": null,
    "scan": null,
    "nidaq": {
        "timerCounterChannel": null,
        "startTrigger": false
    },
    "pulseStreamer": {
        "ipAddress": null
    },
    "pyroServerInfo": {
        "name": "ImSwitchServer",
        "host": "127.0.0.1",
        "port": 54333
    },
    "rois": {
        "Full chip": {
            "x": 600,
            "y": 600,
            "w": 1200,
            "h": 1200
        },
        "feptube": {
            "x": 916,
            "y": 948,
            "w": 896,
            "h": 620
        }
    },
    "laserPresets": {},
    "defaultLaserPresetForScan": null,
    "availableWidgets": [
        "Settings",
        "View",
        "Recording",
        "Image",
        "Laser",
        "Positioner",
        "LightSheet"
    ]
}

```

---

<div class="post-metadata">

**Author:** ![the\_alquemist](https://yyz2.discourse-cdn.com/free1/user_avatar/openuc2.discourse.group/the_alquemist/32/53_2.png) [@the\_alquemist](https://openuc2.discourse.group/u/the_alquemist)\
**Post date:** [October 2, 2024, 6:49pm UTC](https://openuc2.discourse.group/t/activating-correct-camera-in-the-light-sheet-configuration/63/19 "2024-10-02T18:49:49Z")

</div>

I re-flashed it but it still says the “_wrong firmware_” error.

---

<div class="post-metadata">

**Author:** ![the\_alquemist](https://yyz2.discourse-cdn.com/free1/user_avatar/openuc2.discourse.group/the_alquemist/32/53_2.png) [@the\_alquemist](https://openuc2.discourse.group/u/the_alquemist)\
**Post date:** [November 11, 2024, 3:40pm UTC](https://openuc2.discourse.group/t/activating-correct-camera-in-the-light-sheet-configuration/63/20 "2024-11-11T15:40:40Z")

</div>

Hello @benedictdied ! In the end it was a hardware problem. For some reason the esp32 device needed a hard reset by unplugging and replugging the power supply. All installation methods described in this thread are now working as intended.

The issue in this topic can be solved and summarized in:

- Proper selection of `.json` file depending on your hardware
- Check USB cable is not power-only
- Recognition of the USB device by your OS
- Check ESP32 firmware installation is correct
- Proper COM/USB port path in the config file
- Set baudrate to proper values
- If everything fails, soft or hard reset and check again.

Thank you for your help and patience.

[Next page](https://openuc2.discourse.group/t/activating-correct-camera-in-the-light-sheet-configuration/63.md?page=2)
