|
| 1 | +Connecting a camera |
| 2 | +=================== |
| 3 | + |
| 4 | +The connect button -- the plug icon at the bottom of |
| 5 | +the left toolbar, or ``Ctrl+E`` -- is how every session |
| 6 | +starts. Clicking it scans the USB serial ports for |
| 7 | +cameras and connects to the one it finds. With more |
| 8 | +than one camera attached, a dialog asks which serial |
| 9 | +port to use, preselecting the previous pick; with |
| 10 | +none, the IDE says so and offers a recovery path for a |
| 11 | +camera that no longer enumerates (see |
| 12 | +:doc:`firmware`). |
| 13 | + |
| 14 | +What happens on connect |
| 15 | +----------------------- |
| 16 | + |
| 17 | +Connecting is more than opening a serial port. The IDE |
| 18 | +identifies the board, reads its firmware version, and |
| 19 | +compares it against the release bundled with the IDE. |
| 20 | +If the camera's firmware is older, a prompt offers to |
| 21 | +update it -- the normal way cameras get firmware |
| 22 | +updates is exactly this prompt. The update dialog |
| 23 | +includes checkboxes to also erase the internal flash |
| 24 | +filesystem and to reset the ROM file system; they |
| 25 | +start off, remember the last choice made, and neither |
| 26 | +is normally needed for an update. After the first |
| 27 | +successful connect the IDE also shows a one-time |
| 28 | +dialog explaining what the camera's LED blink colours |
| 29 | +mean. |
| 30 | + |
| 31 | +A camera that is attached in bootloader (DFU) mode |
| 32 | +rather than as a normal serial device gets its own |
| 33 | +dialog on connect, with options to install the latest |
| 34 | +release firmware, load a specific firmware file, erase |
| 35 | +the internal flash filesystem, or edit or reset the ROM |
| 36 | +file system. |
| 37 | + |
| 38 | +Two platform notes. On Windows, the IDE checks the |
| 39 | +system device list during connect and reports USB |
| 40 | +driver problems it finds, with the device names |
| 41 | +involved. On Linux, a permission error opening the |
| 42 | +serial port almost always means the user is not in the |
| 43 | +``dialout`` group; the error dialog shows the exact |
| 44 | +``adduser`` command to fix it. |
| 45 | + |
| 46 | +The status bar |
| 47 | +-------------- |
| 48 | + |
| 49 | +Once connected, the status bar along the bottom right |
| 50 | +of the window becomes the camera's dashboard: |
| 51 | + |
| 52 | +* *Board* -- the board type reported by the camera. |
| 53 | +* *Sensor* -- the attached camera sensor module. |
| 54 | +* *Firmware Version* -- the running firmware version. |
| 55 | + Clicking it re-checks the version against the bundled |
| 56 | + release and offers an update if one is available. |
| 57 | +* *Serial Port* -- the port the connection is using. |
| 58 | +* *Drive* -- the flash-drive mount point associated |
| 59 | + with the camera. Clicking it opens the drive in the |
| 60 | + platform's file manager, or -- when several |
| 61 | + candidate drives are attached -- asks which one |
| 62 | + belongs to the camera, remembering the answer per |
| 63 | + serial port. A camera connects and runs scripts fine |
| 64 | + without a drive association; only the drive-dependent |
| 65 | + actions, like opening the drive folder and saving a |
| 66 | + script as ``main.py``, stay disabled until one is |
| 67 | + set. |
| 68 | +* *FPS* -- the rate at which frames are arriving at the |
| 69 | + IDE. This is the preview rate, not necessarily the |
| 70 | + camera's capture rate -- a script can run faster than |
| 71 | + the USB link can stream its frames. |
| 72 | + |
| 73 | +.. admonition:: Screenshot needed |
| 74 | + |
| 75 | + ``figures/status-bar.png`` -- the bottom edge of the |
| 76 | + main window with a camera connected, showing the |
| 77 | + board, sensor, firmware version, serial port, drive, |
| 78 | + and FPS entries populated. Crop to the status bar. |
| 79 | + |
| 80 | +An *Unregistered* button also appears in the status |
| 81 | +bar for boards that require a one-time product |
| 82 | +registration, and the IDE offers the registration |
| 83 | +automatically on connect; once the camera is |
| 84 | +registered the button goes away. |
| 85 | + |
| 86 | +Disconnecting is forgiving. Clicking disconnect is the |
| 87 | +tidy way out, but unplugging the cable works too -- the |
| 88 | +IDE notices the camera is gone (or has stopped |
| 89 | +responding) and disconnects on its own. |
| 90 | + |
| 91 | +Auto reconnect |
| 92 | +-------------- |
| 93 | + |
| 94 | +Tools → Auto Reconnect to OpenMV Cam makes connection |
| 95 | +fully automatic: whenever a camera is detected on USB |
| 96 | +the IDE connects to it, and the manual connect and |
| 97 | +disconnect buttons are disabled while the option is |
| 98 | +active. With one camera and one IDE this is the |
| 99 | +convenient mode -- plug the camera in and it is |
| 100 | +connected. Turn it off when juggling several cameras or |
| 101 | +sharing the port with another program. |
| 102 | + |
| 103 | +The related Tools → Stop Script on Connect/Disconnect |
| 104 | +option (on by default) halts any running script when |
| 105 | +the IDE attaches or detaches, so a freshly connected |
| 106 | +camera is always in a known idle state. Turning it off |
| 107 | +lets a camera keep executing its stored script while |
| 108 | +the IDE connects to observe it. |
0 commit comments