Camera issue "Camera Disconnected"

Unfortunately once you get that screen I wasn’t able to get rid of it without re-flashing the SD card. It seems like there’s some order with starting the preview in Connect that’s causing a problem. I’ll talk to @jc2450 about it in the morning and see if we can fix it, but I seem to have a workaround if all else fails

Progress! Okay this is good. I’m super busy this week with an upcoming deadline but I’ll take a look as soon as possible.

Joe, can you dig out your log files from /var/openflexure/logs and email them to me? Might provide clues. Thanks.

SOLUTION:

Upgrade to server version 2.4.1. From your microscope terminal, run:

sudo ofm update
sudo ofm upgrade

CAUSE:

This issue seems to have emerged way upstream with a change that caused the RPi.GPIO Python module to fail on Pi 4 devices. This has been fixed in RPi.GPIO version 0.7.0. The dependency has been updated in OFM server 2.4.1

1 Like

Thank you!
I look forward to trying.
T

I’m still having this problem.
I loaded the most recent image, ran the standard Raspberry Pi update/upgrade and followed @jc2450’s recommendation to upgrade.
Even after the upgrade I’m getting the “Camera disconnected” error.
Unfortunately I’ve never been able to get the camera working with this microsocope.

I confirmed the camera is working by using the test command: ‘raspistill -v -o test.jpg’
Any recommendations?

Could you please attach a log file to a reply here?

On your pi, go to the folder /var/openflexure/logs and look for openflexure_microscope.log

If you’d rather not attach your log file to the forum, please email it to j.collins[at]bath.ac.uk

Thanks!

Unfortunately we aren’t allowed to upload log files into the forum.
Note that I’m using a Raspberry Pi 4 2 GB with the latest 7/30/2020 bootloader and the Pi 2.0 camera

This is the output of the log file:
[2020-08-12 19:15:35,239] [MainThread] [INFO] Starting OpenFlexure Microscope Server…
[2020-08-12 19:15:55,375] [Thread-10] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:15:55,421] [Thread-14] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:15:55,438] [Thread-15] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:15:55,452] [Thread-16] [INFO] Loading /var/openflexure/settings/microscope_configuration.json…
[2020-08-12 19:15:55,475] [Thread-18] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:15:55,485] [Thread-19] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:15:55,494] [Thread-20] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:15:55,506] [Thread-21] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:15:55,537] [Thread-22] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:15:55,675] [Thread-30] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:15:55,789] [Thread-33] [INFO] Loading /var/openflexure/settings/microscope_configuration.json…
[2020-08-12 19:15:55,827] [Thread-37] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:15:56,068] [Thread-40] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:15:59,104] [Thread-42] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:15:59,117] [Thread-44] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:15:59,126] [Thread-46] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:16:11,176] [Thread-55] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:16:11,192] [Thread-56] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:16:11,250] [Thread-60] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:16:11,268] [Thread-61] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:16:11,281] [Thread-62] [INFO] Loading /var/openflexure/settings/microscope_configuration.json…
[2020-08-12 19:16:11,299] [Thread-64] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:16:11,314] [Thread-65] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:16:11,349] [Thread-66] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:16:11,388] [Thread-68] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:16:11,478] [Thread-73] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:16:11,595] [Thread-76] [INFO] Loading /var/openflexure/settings/microscope_configuration.json…
[2020-08-12 19:16:11,640] [Thread-80] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:16:11,882] [Thread-82] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:16:13,854] [Thread-84] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:16:16,351] [Thread-86] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:16:16,603] [Thread-88] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:16:22,283] [Thread-91] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:16:23,792] [Thread-94] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:16:24,040] [Thread-96] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:16:24,458] [Thread-98] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:16:25,583] [Thread-101] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:16:25,832] [Thread-103] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:16:26,786] [Thread-105] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:16:26,798] [Thread-107] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:16:27,043] [Thread-109] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:16:29,437] [Thread-111] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:16:31,392] [Thread-113] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:16:31,409] [Thread-115] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:16:31,428] [Thread-117] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:18:15,487] [MainThread] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:18:15,489] [MainThread] [INFO] Saving /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:18:15,991] [MainThread] [INFO] Closing <openflexure_microscope.microscope.Microscope object at 0xb5e63810>
[2020-08-12 19:18:16,499] [MainThread] [INFO] Closing <openflexure_microscope.camera.mock.MissingCamera object at 0xb417d350>
[2020-08-12 19:18:16,695] [MainThread] [INFO] Closed <openflexure_microscope.camera.mock.MissingCamera object at 0xb417d350>
[2020-08-12 19:18:16,695] [MainThread] [INFO] Closing <openflexure_microscope.captures.capture_manager.CaptureManager object at 0xb4173090>
[2020-08-12 19:18:16,696] [MainThread] [INFO] Closed <openflexure_microscope.microscope.Microscope object at 0xb5e63810>
[2020-08-12 19:18:34,659] [MainThread] [INFO] Running with data path /var/openflexure
[2020-08-12 19:18:34,662] [MainThread] [INFO] Creating app
[2020-08-12 19:18:36,610] [MainThread] [ERROR] Exception loading builtin extension lens shading calibration:
Traceback (most recent call last):
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/init.py”, line 10, in handle_extension_error
yield
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/init.py”, line 28, in
from .picamera_autocalibrate import lst_extension_v2
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/picamera_autocalibrate/init.py”, line 1, in
from .extension import lst_extension_v2
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/picamera_autocalibrate/extension.py”, line 13, in
from .recalibrate_utils import (
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/picamera_autocalibrate/recalibrate_utils.py”, line 5, in
from picamera import PiCamera
File “/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/picamera/init.py”, line 89, in
from picamera.camera import PiCamera
File “/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/picamera/camera.py”, line 80, in
from RPi import GPIO
File “/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/RPi/GPIO/init.py”, line 23, in
from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!

[2020-08-12 19:18:37,155] [MainThread] [INFO] Starting OpenFlexure Microscope Server…
[2020-08-12 19:19:18,054] [Thread-8] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:19:18,138] [Thread-13] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:19:18,159] [Thread-12] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:19:18,168] [Thread-14] [INFO] Loading /var/openflexure/settings/microscope_configuration.json…
[2020-08-12 19:19:18,188] [Thread-16] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:19:18,196] [Thread-17] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:19:18,237] [Thread-18] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:19:18,258] [Thread-20] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:19:18,291] [Thread-21] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:19:18,353] [Thread-25] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:19:18,461] [Thread-29] [INFO] Loading /var/openflexure/settings/microscope_configuration.json…
[2020-08-12 19:19:18,499] [Thread-33] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:19:18,741] [Thread-35] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:19:20,316] [Thread-37] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:19:24,451] [Thread-39] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:19:24,695] [Thread-41] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:19:51,526] [MainThread] [INFO] Running with data path /var/openflexure
[2020-08-12 19:19:51,528] [MainThread] [INFO] Creating app
[2020-08-12 19:19:56,992] [MainThread] [ERROR] Exception loading builtin extension lens shading calibration:
Traceback (most recent call last):
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/init.py”, line 10, in handle_extension_error
yield
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/init.py”, line 28, in
from .picamera_autocalibrate import lst_extension_v2
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/picamera_autocalibrate/init.py”, line 1, in
from .extension import lst_extension_v2
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/picamera_autocalibrate/extension.py”, line 13, in
from .recalibrate_utils import (
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/picamera_autocalibrate/recalibrate_utils.py”, line 5, in
from picamera import PiCamera
File “/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/picamera/init.py”, line 89, in
from picamera.camera import PiCamera
File “/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/picamera/camera.py”, line 80, in
from RPi import GPIO
File “/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/RPi/GPIO/init.py”, line 23, in
from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!

[2020-08-12 19:19:57,618] [MainThread] [INFO] Starting OpenFlexure Microscope Server…
[2020-08-12 19:24:11,507] [MainThread] [INFO] Running with data path /var/openflexure
[2020-08-12 19:24:11,516] [MainThread] [INFO] Creating app
[2020-08-12 19:24:19,197] [MainThread] [ERROR] Exception loading builtin extension lens shading calibration:
Traceback (most recent call last):
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/init.py”, line 10, in handle_extension_error
yield
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/init.py”, line 28, in
from .picamera_autocalibrate import lst_extension_v2
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/picamera_autocalibrate/init.py”, line 1, in
from .extension import lst_extension_v2
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/picamera_autocalibrate/extension.py”, line 13, in
from .recalibrate_utils import (
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/picamera_autocalibrate/recalibrate_utils.py”, line 5, in
from picamera import PiCamera
File “/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/picamera/init.py”, line 89, in
from picamera.camera import PiCamera
File “/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/picamera/camera.py”, line 80, in
from RPi import GPIO
File “/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/RPi/GPIO/init.py”, line 23, in
from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!

[2020-08-12 19:24:19,777] [MainThread] [INFO] Starting OpenFlexure Microscope Server…
[2020-08-12 19:25:35,795] [Thread-10] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:25:35,824] [Thread-11] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:25:35,864] [Thread-15] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:25:35,885] [Thread-16] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:25:35,894] [Thread-17] [INFO] Loading /var/openflexure/settings/microscope_configuration.json…
[2020-08-12 19:25:35,907] [Thread-18] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:25:35,932] [Thread-21] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:25:35,949] [Thread-22] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:25:35,963] [Thread-23] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:25:36,138] [Thread-30] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:25:36,273] [Thread-32] [INFO] Loading /var/openflexure/settings/microscope_configuration.json…
[2020-08-12 19:25:36,305] [Thread-34] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:25:36,537] [Thread-37] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:25:38,794] [Thread-39] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:25:42,533] [Thread-41] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:25:42,789] [Thread-43] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:28:03,424] [MainThread] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:28:03,426] [MainThread] [INFO] Saving /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:28:03,929] [MainThread] [INFO] Closing <openflexure_microscope.microscope.Microscope object at 0xb4187210>
[2020-08-12 19:28:03,930] [MainThread] [INFO] Closing <openflexure_microscope.camera.mock.MissingCamera object at 0xb4187470>
[2020-08-12 19:28:03,971] [MainThread] [INFO] Closed <openflexure_microscope.camera.mock.MissingCamera object at 0xb4187470>
[2020-08-12 19:28:03,971] [MainThread] [INFO] Closing <openflexure_microscope.captures.capture_manager.CaptureManager object at 0xb4187310>
[2020-08-12 19:28:03,972] [MainThread] [INFO] Closed <openflexure_microscope.microscope.Microscope object at 0xb4187210>
[2020-08-12 19:28:17,969] [MainThread] [INFO] Running with data path /var/openflexure
[2020-08-12 19:28:17,976] [MainThread] [INFO] Creating app
[2020-08-12 19:28:23,355] [MainThread] [ERROR] Exception loading builtin extension lens shading calibration:
Traceback (most recent call last):
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/init.py”, line 10, in handle_extension_error
yield
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/init.py”, line 28, in
from .picamera_autocalibrate import lst_extension_v2
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/picamera_autocalibrate/init.py”, line 1, in
from .extension import lst_extension_v2
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/picamera_autocalibrate/extension.py”, line 13, in
from .recalibrate_utils import (
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/picamera_autocalibrate/recalibrate_utils.py”, line 5, in
from picamera import PiCamera
File “/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/picamera/init.py”, line 89, in
from picamera.camera import PiCamera
File “/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/picamera/camera.py”, line 80, in
from RPi import GPIO
File “/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/RPi/GPIO/init.py”, line 23, in
from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!

[2020-08-12 19:28:23,965] [MainThread] [INFO] Starting OpenFlexure Microscope Server…
[2020-08-12 19:29:12,440] [Thread-8] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:29:12,492] [Thread-11] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:29:12,532] [Thread-13] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:29:12,546] [Thread-14] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:29:12,553] [Thread-15] [INFO] Loading /var/openflexure/settings/microscope_configuration.json…
[2020-08-12 19:29:12,590] [Thread-17] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:29:12,605] [Thread-18] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:29:12,655] [Thread-20] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:29:12,681] [Thread-22] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:29:12,761] [Thread-26] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:29:12,869] [Thread-29] [INFO] Loading /var/openflexure/settings/microscope_configuration.json…
[2020-08-12 19:29:12,911] [Thread-32] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:29:13,163] [Thread-35] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:32:00,598] [Thread-57] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:32:04,362] [Thread-59] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:32:04,612] [Thread-61] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:32:38,431] [Thread-69] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:32:38,444] [Thread-73] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:32:38,450] [Thread-72] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:32:43,934] [Thread-84] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:32:43,949] [Thread-85] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:32:43,956] [Thread-87] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:32:43,988] [Thread-90] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:32:44,028] [Thread-92] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:32:44,060] [Thread-94] [INFO] Loading /var/openflexure/settings/microscope_configuration.json…
[2020-08-12 19:32:44,085] [Thread-96] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:32:44,108] [Thread-97] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:32:44,141] [Thread-99] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:32:44,161] [Thread-100] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:32:44,182] [Thread-101] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:32:44,219] [Thread-103] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:32:44,290] [Thread-107] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:32:44,435] [Thread-110] [INFO] Loading /var/openflexure/settings/microscope_configuration.json…
[2020-08-12 19:32:46,797] [Thread-114] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:32:49,429] [Thread-116] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:32:49,441] [Thread-118] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:32:49,447] [Thread-120] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:37:18,503] [MainThread] [INFO] Running with data path /var/openflexure
[2020-08-12 19:37:18,535] [MainThread] [INFO] Creating app
[2020-08-12 19:37:20,525] [MainThread] [ERROR] Exception loading builtin extension lens shading calibration:
Traceback (most recent call last):
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/init.py”, line 10, in handle_extension_error
yield
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/init.py”, line 28, in
from .picamera_autocalibrate import lst_extension_v2
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/picamera_autocalibrate/init.py”, line 1, in
from .extension import lst_extension_v2
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/picamera_autocalibrate/extension.py”, line 13, in
from .recalibrate_utils import (
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/picamera_autocalibrate/recalibrate_utils.py”, line 5, in
from picamera import PiCamera
File “/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/picamera/init.py”, line 89, in
from picamera.camera import PiCamera
File “/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/picamera/camera.py”, line 80, in
from RPi import GPIO
File “/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/RPi/GPIO/init.py”, line 23, in
from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!

[2020-08-12 19:37:21,135] [MainThread] [INFO] Starting OpenFlexure Microscope Server…
[2020-08-12 19:45:27,749] [MainThread] [INFO] Running with data path /var/openflexure
[2020-08-12 19:45:27,751] [MainThread] [INFO] Creating app
[2020-08-12 19:45:33,400] [MainThread] [ERROR] Exception loading builtin extension lens shading calibration:
Traceback (most recent call last):
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/init.py”, line 10, in handle_extension_error
yield
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/init.py”, line 28, in
from .picamera_autocalibrate import lst_extension_v2
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/picamera_autocalibrate/init.py”, line 1, in
from .extension import lst_extension_v2
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/picamera_autocalibrate/extension.py”, line 13, in
from .recalibrate_utils import (
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/picamera_autocalibrate/recalibrate_utils.py”, line 5, in
from picamera import PiCamera
File “/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/picamera/init.py”, line 89, in
from picamera.camera import PiCamera
File “/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/picamera/camera.py”, line 80, in
from RPi import GPIO
File “/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/RPi/GPIO/init.py”, line 23, in
from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!

[2020-08-12 19:45:34,007] [MainThread] [INFO] Starting OpenFlexure Microscope Server…
[2020-08-12 19:54:24,242] [Thread-8] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:54:24,301] [Thread-11] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:54:24,343] [Thread-13] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:54:24,352] [Thread-14] [INFO] Loading /var/openflexure/settings/microscope_configuration.json…
[2020-08-12 19:54:24,367] [Thread-16] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:54:24,383] [Thread-17] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:54:24,404] [Thread-18] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:54:24,420] [Thread-19] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:54:24,459] [Thread-20] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:54:24,560] [Thread-25] [INFO] Loading /var/openflexure/settings/microscope_settings.json…
[2020-08-12 19:54:24,703] [Thread-29] [INFO] Loading /var/openflexure/settings/microscope_configuration.json…
[2020-08-12 19:54:24,752] [Thread-33] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:54:24,990] [Thread-35] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:54:28,794] [Thread-37] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:54:33,979] [Thread-39] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:54:33,996] [Thread-41] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 19:54:34,012] [Thread-43] [WARNING] GPU preview not implemented in mock camera
[2020-08-12 20:00:35,801] [MainThread] [INFO] Running with data path /var/openflexure
[2020-08-12 20:00:35,804] [MainThread] [INFO] Creating app
[2020-08-12 20:00:48,692] [MainThread] [ERROR] Exception loading builtin extension lens shading calibration:
Traceback (most recent call last):
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/init.py”, line 10, in handle_extension_error
yield
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/init.py”, line 28, in
from .picamera_autocalibrate import lst_extension_v2
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/picamera_autocalibrate/init.py”, line 1, in
from .extension import lst_extension_v2
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/picamera_autocalibrate/extension.py”, line 13, in
from .recalibrate_utils import (
File “/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/default_extensions/picamera_autocalibrate/recalibrate_utils.py”, line 5, in
from picamera import PiCamera
File “/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/picamera/init.py”, line 89, in
from picamera.camera import PiCamera
File “/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/picamera/camera.py”, line 80, in
from RPi import GPIO
File “/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/RPi/GPIO/init.py”, line 23, in
from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!

[2020-08-12 20:00:49,284] [MainThread] [INFO] Starting OpenFlexure Microscope Server…

I’ve also tried this on a Raspberry Pi Zero with the same result using the same Buster image.

Okay that’s interesting. Maybe the latest image for some reason didn’t actually include the latest GPIO version.

Could you please run:

ofm activate
pip show RPi.GPIO

And paste the output here?

Thanks!

Here is the output of that command:

(.venv) pi@microscope:~ $ pip show RPi.GPIO
Name: RPi.GPIO
Version: 0.6.5
Summary: A module to control Raspberry Pi GPIO channels
Home-page: http://sourceforge.net/projects/raspberry-gpio-python/
Author: Ben Croston
Author-email: ben@croston.org
License: MIT
Location: /var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages
Requires: 
Required-by: 
(.venv) pi@microscope:~ $

That does look as though it still has the older RPi.GPIO. version 0.7.0 was mentioned in the post marked solution.
I don’t know if you can upgrade that separately?

As William mentioned you’re somehow still on the older version of the GPIO library.

Could you try running ofm upgrade again please? I’ve double checked the lockfile which determines our library versions and it’s definitely set to 0.7.0.

If that still doesn’t work, you can manually fix this by running

ofm activate
pip install RPi.GPIO==0.7.0

It appears that the correct RPi.GPIO is installed but it is still pointing at the old version. I suspect the python environment needs to be updated to use the correct version, I’m just not sure how to do it.

I ran ofm upgrade again and it clearly installed the correct RPi.GPIO version.
When trying to install RPi.GPIO 0.7.0 it claimed it was already installed.

This is the output:

(.venv) pi@microscope:~ $ sudo pip install RPi.GPIO==0.7.0
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: RPi.GPIO==0.7.0 in /usr/lib/python2.7/dist-packages (0.7.0)
(.venv) pi@microscope:~ $ pip show RPi.GPIO
Name: RPi.GPIO
Version: 0.6.5
Summary: A module to control Raspberry Pi GPIO channels
Home-page: http://sourceforge.net/projects/raspberry-gpio-python/
Author: Ben Croston
Author-email: ben@croston.org  
License: MIT
Location: /var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site- 
packages
Requires: 
Required-by:

After you run ofm activate, run pip install (without sudo) otherwise it’s installing into the system Python environment.

Still encountering problems. Unable to install due to what appears to be permissions.

Blockquote
(.venv) pi@microscope:~ $ pip install RPi.GPIO==0.7.0
[Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting RPi.GPIO==0.7.0
Using cached https://www.piwheels.org/simple/rpi-gpio/RPi.GPIO-0.7.0-cp37-cp37m-linux_armv7l.whl
Installing collected packages: RPi.GPIO
Found existing installation: RPi.GPIO 0.6.5
Uninstalling RPi.GPIO-0.6.5:
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: ‘/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/RPi.GPIO-0.6.5.dist-info/INSTALLER’
Consider using the --user option or check the permissions.

I used the recommended --user option but still encountered further issues

Blockquote
(.venv) pi@microscope:~ $ pip install RPi.GPIO==0.7.0 --user
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Will not install to the user site because it will lack sys.path precedence to RPi.GPIO in /var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages

Ok have you tried just running sudo ofm upgrade again?

If you connect to your microscope in the app, then go to the Info tab at the very bottom left, can you let me know what versions it reports?

If the upgrade works it really should have fixed this, so I can only assume it’s failing to install for some reason

I went ahead and ran

ofm update

and

sudo ofm upgrade

Still no luck.
Has anyone else had success with their camera after using the latest image build?
Is there an old image build I can test to confirm it’s not my hardware setup?

SOLVED!

Update: I grabbed the latest & greatest Raspberry Pi image and tried again and the camera is now working.
I made the mistake of downloading the latest earlier this week but not using it when flashing the SD card earlier.
Thank you @jc2450 for your help and patience!
Next up, getting motors, controllers, and Arduino Nano installed.

1 Like

That’s definitely interesting that upgrade didn’t seem to work. Glad the latest image is working. I’ll refer back to this thread if it becomes an issue for anyone else.