Skip to content

Commit ce1a669

Browse files
committed
final remakrs and iprovements
1 parent 14f7369 commit ce1a669

5 files changed

Lines changed: 83 additions & 16 deletions

File tree

docs/05_ImSwitch/01_Quickstart.md

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
The Raspberry Pi serves as a bridge between the UC2-ESP board and a USB3 camera, running the ImSwitch software inside a Docker container. The system allows you to control the microscope through a web interface accessible from a phone or laptop.
44

55
> **Note:** This setup is experimental! You can try a demo version of the latest ImSwitch here:
6-
> - [Live Demo](https://imswitch.openuc2.com/imswitch/index.html)
7-
> - [ImSwitch API](https://imswitch.openuc2.com/docs)
6+
> - [Live Demo](https://imswitch.openuc2.com/imswitch/index.html) (currently not active)
7+
> - [React Demo](https://youseetoo.github.io/imswitch)
8+
> - [ImSwitch API](https://youseetoo.github.io/api/api.html) (may be outdated)
89
910
---
1011

@@ -23,20 +24,20 @@ The system runs Raspberry Pi OS Lite and includes a Docker integration for ImSwi
2324
- **Password:** `youseetoo`
2425

2526
To configure the hotspot using RaspAP:
26-
1. Open a browser and go to [http://10.3.141.1/](http://10.3.141.1/)
27+
1. Open a browser and go to [http://192.168.4.1/](http://192.168.4.1/)
2728
2. Login with:
2829
- **Username:** `admin`
2930
- **Password:** `secret`
3031

3132
### Accessing ImSwitch
3233
If the Docker container starts automatically, access ImSwitch at:
33-
- [https://10.3.141.1:8001/imswitch/index.html](https://10.3.141.1:8001/imswitch/index.html)
34+
- [https://192.168.4.1:8001/imswitch/index.html](https://192.168.4.1:8001/imswitch/index.html)
3435
- Ignore self-signed certificate warnings (this will be fixed later).
3536

3637
### Connecting via SSH
3738
To manually start ImSwitch:
3839
```sh
39-
ssh uc2@10.3.141.1 # Password: youseetoo
40+
ssh pi@192.168.4.1 # Password: youseetoo
4041
cd ~/Desktop
4142
./launch_docker_container.sh
4243
```
@@ -66,7 +67,7 @@ More details: [ImSwitchConfig GitHub](https://github.com/openUC2/imswitchconfig)
6667
- Connect **USB3 Camera** to Raspberry Pi
6768

6869
To access ImSwitch via a browser:
69-
- Open: [https://10.3.141.1:8001/imswitch/index.html](https://10.3.141.1:8001/imswitch/index.html)
70+
- Open: [https://192.168.4.1:8001/imswitch/index.html](https://192.168.4.1:8001/imswitch/index.html)
7071

7172
![](./IMAGES/imswitchraspi/ImSwitchInTheWeb.png)
7273

@@ -80,6 +81,10 @@ There are two ways to set up the Raspberry Pi for ImSwitch:
8081

8182
### **Option 1: Manual Installation**
8283

84+
:::warning
85+
We provide the easier installation with the prebuild OS image from the forklifted ImSwitch-OS; Please scroll down to use this if you want to have a real quick start (TODO: Add link to Option2)
86+
:::
87+
8388
#### **Step 1: Install Raspberry Pi OS**
8489
1. Download and install the Raspberry Pi Imager: [Download Here](https://www.raspberrypi.com/software/)
8590

@@ -158,7 +163,7 @@ The image is built from the following workflow:
158163

159164
#### **Requirements**
160165
- microSD Card with >32GB
161-
- Raspberry Pi 4 or preferably Pi 5 (8GB RAM recommended)
166+
- Raspberry Pi 4 (*not recommended anymore as we need more RAM*) or preferably Pi 5 (8GB RAM recommended)
162167
- microSD Card reader
163168

164169
If you prefer a faster setup, you can use this **pre-built image** that includes all necessary software and drivers. This image was created with the [Forklift Project](https://github.com/forklift-run) and automates all setup steps.
@@ -179,25 +184,33 @@ Use the Raspberry Pi Imager to flash the image onto an SD card, then insert the
179184
4. Do **not** specify additional user-specific settings.
180185

181186
##### **Default Credentials**
182-
- **SSID:** `openUC2-unknown`
183-
- **WiFi Password:** `copepode`
187+
- **SSID:** `openUC2-XXXX` (`XXX` corresponds to a random number bsed on the MAC address)
188+
- **WiFi Password:** `copepode` (now: `youseetoo`)
184189
- **Username:** `pi`
185190
- **User Password:** `youseetoo`
186191

187192
> **Note:** The Forklift image is updated automatically and ensures all software is correctly configured.
188193
189194
:::warning
190-
If you want to have Internet on the Raspberry Pi, you can either plug the LAN port into a router with internet - then the wifi that is shared by the access point is automatically briding that connection. Alternatively, you can use an Android phone in USB access point mode and share the internet connection by that mean.
195+
**INTERNET ACCESS:** If you want to have Internet on the Raspberry Pi, you can either plug the LAN port into a router with internet - then the wifi that is shared by the access point is automatically briding that connection. Alternatively, you can use an Android phone in USB access point mode and share the internet connection by that mean.
191196
:::
192197

193-
:::error
194-
In case the GUI hangs - this might be due to an older version that expected internet to load javascript libraries/fonts. It times out after 60s and renders the ImSwitch webapp - please update the software.
198+
:::warning
199+
**GUI HANGS:** In case the GUI hangs - this might be due to an older version that expected internet to load javascript libraries/fonts. It times out after 60s and renders the ImSwitch webapp - please update the software.
195200
:::
196201

197-
198202
For a detailed breakdown of the image creation process, see:
199203
[ImSwitch OS GitHub Setup Script](https://github.com/beniroquai/imswitch-os/blob/main/setup.sh#L60)
200204

205+
#### **Updating Forklift configuration**
206+
207+
This will pull the latest pallet and forklift configuration. Be aware, that system rleated conifgurations may be overwritte. The command is the following:
208+
209+
```
210+
forklift pallet upgrade --force @main
211+
```
212+
213+
201214
#### **Connecting to the Raspberry Pi**
202215
1. Wait until the Raspberry Pi boots and you see the SSID `openUC2-unknown`.
203216
2. Connect to the SSID and navigate to `http://192.168.4.1:9090` to access Cockpit.
@@ -399,15 +412,27 @@ If you are facing a problem with a wrong docker configuration (i.e. Docker Compo
399412

400413
The filename of the file containing the tailscale auth token should be tailscale-auth-key. The file will need to exist on the boot partition in a new run subdirectory of the init-root directory.
401414

415+
You can start tailscale by entering the following in the command:
416+
417+
```
418+
sudo tailscale up # down for stopping
419+
```
420+
421+
If you haven't provided the token, you can simply follow the link and add this to your local tailscale network.
422+
423+
402424
#### Connect to Wifi
403425

426+
TODO: This needs a revision to make sure we have a direct way of connecting to a local network. Explain how we can use the cellphone's hotspot to get starting. Also: in case we lock ourselves out: We can use a LAN adapter and connect that to our network to access the pi via LAN on 192.168.5.1.
404427

405428
By default, the forklift configuration provides an access point and maps internet from the LAN to the AP conveniently. If you have an existing access point and you want to connect to that one using the raspberry pi can you can do that by following the follwoing steps.
406429

407430
**Problem (one‑sentence)**
408431
Saved profile contains a malformed `ssid=` (often a trailing space added by *nmtui*). NetworkManager then scans for a name that does not exist and returns *WLAN konnte nicht gefunden werden*.
409432

410433

434+
435+
411436
##### Quick‑fix workflow
412437

413438
| Goal | Command / action |
@@ -421,6 +446,8 @@ Saved profile contains a malformed `ssid=` (often a trailing space added by *nmt
421446

422447
##### Using *nmtui* instead of CLI
423448

449+
450+
424451
1. `sudo nmtui`*Activate a connection* → highlight your network → **Add** (or **Edit**)
425452
2. Enter **SSID** exactly (`openUC2`), security = *WPA & WPA2 Personal*, fill password.
426453
3. Leave *BSSID* blank.

docs/05_ImSwitch/Advanced/01_Installation/Native.md

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ImSwitch Native Python Installation
1+
# ImSwitch Native Python Installation (With QT GUI)
22

33
This guide covers installing ImSwitch directly on your system using Python, suitable for development and advanced users who need full control over the installation.
44

@@ -154,6 +154,44 @@ For advanced users who want full control over the installation process, here are
154154
- Qt5/Qt6 development libraries
155155
- OpenGL support
156156

157+
158+
In all cases, you can start the GUI (in case all the dependencies are properly installed) using the `is_headless=0` flag. For this create a python file (e.g. `main2.py`) and launch this:
159+
160+
```py
161+
if __name__ == '__main__':
162+
from imswitch.__main__ import main
163+
'''
164+
To start imswitch in headless with a remote config file, you can add additional arguments:
165+
main(is_headless=True, default_config="/Users/bene/ImSwitchConfig/imcontrol_setups/example_virtual_microscope.json", http_port=8001, ssl=True, data_folder="/Users/bene/Downloads")
166+
- is_headless: True or False
167+
- default_config: path to the config file
168+
- http_port: port number^
169+
- ssl: True or False
170+
- data_folder: path to the data folder => in docker this could be e.g. Volumes, media in combination with external scanning or any other volume that is direclty mapped as a folder to Imswitch
171+
- scan_ext_data_folder: True or False => we will look for any externally connected devices (usb) that is mounted under /Volumes or /media
172+
example:
173+
main(is_headless=True, data_folder="/Users/bene/Downloads")
174+
175+
# kill -9 $(lsof -ti:8001)
176+
'''
177+
#main(is_headless=False) ## this has to be maintained for DOCKER!
178+
#main(default_config="/Users/bene/ImSwitchConfig/imcontrol_setups/FRAME.json", is_headless=True, http_port=8001) ## this has to be maintained for DOCKER!
179+
#main(default_config="/Users/bene/ImSwitchConfig/imcontrol_setups/example_uc2_lightsheet_hik.json", is_headless=True, http_port=8001) ## this has to be maintained for DOCKER!
180+
main(default_config="/Users/bene/ImSwitchConfig/imcontrol_setups/example_virtual_microscope.json", is_headless=False, http_port=8001, socket_port=8002, scan_ext_data_folder=True, data_folder="~/Downloads", ext_drive_mount="/Volumes")
181+
```
182+
183+
With this we will see the qt app load:
184+
185+
![](../IMAGES/gui/qt_load.png)
186+
187+
Below you will find ways how to install the dependencies. In a nutshell: You install imswitch with the `PyQt5` flag which will install napari and its dependencies (e.g. `pip install .[PyQt5]` assuming you are in the same folder as the cloned ImSwitch (openUC2 version) repo). The ImSwitch app in QT looks as follows:
188+
189+
![](../IMAGES/gui/qt_imswitch.png)
190+
191+
:::warning
192+
**Discontinued support for QT**: We have stopped supporting the qt framework as we push towards the headless mode - please expect errors and unsupported functions!
193+
:::
194+
157195
#### Ubuntu/Debian (GUI)
158196

159197
```bash
@@ -195,7 +233,7 @@ imswitch-env\Scripts\activate
195233
# Clone and install
196234
git clone https://github.com/openUC2/imSwitch
197235
cd imSwitch
198-
pip install -e .
236+
pip install -e .[PyQt5]
199237
200238
# Install UC2-REST
201239
git clone https://github.com/openUC2/UC2-REST
@@ -220,7 +258,7 @@ source ~/imswitch-env/bin/activate
220258
# Install ImSwitch
221259
git clone https://github.com/openUC2/imSwitch ~/ImSwitch
222260
cd ~/ImSwitch
223-
pip install -e .
261+
pip install -e .[PyQt5]
224262

225263
# Install UC2-REST
226264
git clone https://github.com/openUC2/UC2-REST ~/UC2-REST

docs/05_ImSwitch/Advanced/02_Usage/Micromanager.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
ImSwitch now includes an official device adapter for µManager, enabling seamless integration between ImSwitch hardware control and µManager's powerful acquisition and analysis capabilities.
44

5+
TODO: Improve the text and explain a bit how we can use the device in micromanager
6+
57
:::warning
68
This is a work in progress
79
:::
956 KB
Loading
411 KB
Loading

0 commit comments

Comments
 (0)