Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run detector_server.py or import_data_py3.py #107

Open
fbarradas opened this issue Jul 20, 2023 · 5 comments
Open

Cannot run detector_server.py or import_data_py3.py #107

fbarradas opened this issue Jul 20, 2023 · 5 comments

Comments

@fbarradas
Copy link

This is what happens if I try to run detector_server.py (from Spyder from MacOS 13.4.1):
Screenshot 2023-07-20 at 02 37 57

and if I try tro run import_data_py3.py:
Screenshot 2023-07-20 at 02 40 54

@fbarradas
Copy link
Author

And this is the same working from the Linux terminal
image

@spenceraxani
Copy link
Owner

spenceraxani commented Jul 20, 2023 via email

@anthfuller
Copy link

anthfuller commented Jul 26, 2023

I'm also seeing this error code, running "import_data_py3.py" as well. When running the script directly for Ubuntu 22.04 terminal, cd down into CosmicWatchDesktop-Muon detector cloned folder. After executing the script, there are five choices, the last being [h] for help. When selecting option "1", Record data on computer, the script prompts for a USB Port number, entering the number, I get this error:
Traceback (most recent call last):
File "/home/radiomuon/muon/CosmicWatch-Desktop-Muon-Detector-v2/Recording_Data/import_data_py3.py", line 195, in
port_name_list.append(str(port_list[int(ArduinoPort[i])-1]))
IndexError: list index out of range

Can you help with this, looks like an issue with the script on line 195?
Screenshot from 2023-07-26 19-44-52

I'm noticing no USB ports are shown in the terminal indicating the port the Muon detector is connected to. I've done a lsusb list and this is what's shown:
Screenshot from 2023-07-26 19-42-52

@spenceraxani
Copy link
Owner

spenceraxani commented Aug 1, 2023 via email

@JG-QuarkNet
Copy link

@anthfuller Your "IndexError: list index out of range" error is different from the previous errors in this thead and likely has a separate solution. Fortunately I had the exact same problem, which I traced to this issue: arduino/help-center-content#155

The Linux BRLTTY utility for braille displays is sometimes enabled by default, and has been in particular for recent versions of Ubuntu. Unfortunately, BRLTTY is programmed to take over serial ports automatically, which interferes with the import_data_py3.py script's scan of your ports.

You can confirm whether or not this is your problem by checking dmesg output related to tty and looking for a line that cites 'brltty' like the following:

$ sudo dmesg | grep tty 
[ 5339.669621] usb 3-4: usbfs: interface 0 claimed by ftdi_sio while 'brltty' sets config #1

If you don't need the brltty utility, the easiest solution is to uninstall it with $ sudo apt remove brltty (for Debian/Ubuntu, adapt for your distribution as necessary).

If you do need the brltty utility, you'll have to find another way to make it let go of the ports. There's more info on that Arduino GitHub issue I posted above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants