×

INDI Library v1.9.9 Released (30 Nov 2022)

Bi-monthly INDI Library released with new drivers and bug fixes.

ttyUSB0 issues on OnStepp and RasPi4

  • Posts: 81
  • Thank you received: 0
Hi,

I don't find into the forums how to solve the issue about ttyUSB0 (Raspi4) and OnStep that I have. I use the last (and upgrade) astroberry 2.

My configuration is:

onstep <=> raspi4 (astroberry) <=> Ethernet <=> PC client (Ekos)

I start the session and OnStep indi not connect and it give the next warning: (Check on the photos I attached)

[WARNING] Port /dev/ttyUSB0 is already used by another driver or process.



I only connect the onstep and give the same error again.

and the raspi4 recognize the onstep CP2102/CP2109 device (like you could check on the photos I attached)



How can I to resolve this issue?

Thanks in advance for your answers.

Pep
3 years 1 week ago #48215
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 146
  • Thank you received: 24
hi!
i would guess the first step would be to find out what blocks your USB0 - is the CP210x the converter of the onstep?
yours wolfi
Last edit: 3 years 1 week ago by Wolfgang Birkfellner.
3 years 1 week ago #48220

Please Log in or Create an account to join the conversation.

  • Posts: 81
  • Thank you received: 0
Hi ;-)
How do I find which blogs are on ttyUSB0?
In my 1st post I uploaded a photo where I took "lsusb" and raspi4 recognizes the devices in the CP210x family. (My OnStep uses a STM32 microcontroller.)
Pep
Last edit: 3 years 1 week ago by Pep.
3 years 1 week ago #48221

Please Log in or Create an account to join the conversation.

  • Posts: 146
  • Thank you received: 24
hi!
is this the microcontroller:
www.google.com/url?sa=t&rct=j&q=&esrc=s&...d6I_7fuhTLdZOoycvGV5

???

it features native USB, as far as i can tell ... i don't have one here, so i cannot check it. is your USB cable plugged directly onto the microcontroller, or is it connected to a second board that is wired with the microcontroller????

yours wolfi
3 years 1 week ago #48222

Please Log in or Create an account to join the conversation.

  • Posts: 146
  • Thank you received: 24
hi!
i checked the prints from howard - yes, the CP2102 is apparently your /dev/ttyUSB0 ... most likely you don't have the udev rules set so that it can be accessed by anyone else but the superuser (although the message that it is occupied might be misleading in that case). maybe this helps: unix.stackexchange.com/questions/299599/...assign-cp210x-driver

yours wolfi
3 years 1 week ago #48227

Please Log in or Create an account to join the conversation.

  • Posts: 81
  • Thank you received: 0
Hi Wolfi,
Yes the microcontroller is this one.
And the USB connected directly from microcontroller to usb of raspi4.
Do you know the superuser of "astroberry"? (is a "pi" user?)
Thanks and today I check it and will tell you some news when I' do it.

Pep
3 years 1 week ago #48229

Please Log in or Create an account to join the conversation.

  • Posts: 146
  • Thank you received: 24
hi!
from what i see, you are most likely not connected directly to the microcontroller (that should not be a ttyUSBx device according to the specs) but to the the little extra board on the right hand side of the PCB. a photo might help.

and isn't "astroberry" the default password? i have very little experience with astroberry ...
yours wolfi
3 years 1 week ago #48230

Please Log in or Create an account to join the conversation.

  • Posts: 81
  • Thank you received: 0
Hi Wolfi,

The guys who mounted the onstep board told me it was straight but I attached the photo to check it (the USB port cables are the ones above the battery {White, Green, Black and red, goes from battery to other side of the board in same high.})



I'm not sure if the "astroberry" user is a root user or is "pi" user the root? (pi user is disabled for security reasons (he says) I can able again if is necessary).

Then I understand that the issue should cames from the permision, doesn't it?
Last edit: 3 years 1 week ago by Pep.
3 years 1 week ago #48233
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 930
  • Thank you received: 432
I'm not familiar with OnStep, but I am a bit (unfortunately) familiar with ttyUSB0 issues. Whenever you have more than on serial device, I believe it's wise to use symbolic links rather than the specific device filenames that linux seems to randomly assign.

So, first, if you setup, and you're having this issue, figure out which device your OnStep was assigned. E.g. in a terminal type:
ls /dev/ttyUSB*
and perhaps you'll see /dev/ttyUSB0 and /dev/ttyUSB1.

Then you know your device is one of the two, and you can change the port (in your picture above) to the right device (test the both) and see if things are working.
If this doesn't work, sorry, I guess I misunderstand and ignore the rest of this post. If it does, continue.

The above is a short-term solution, though, because you probably don't want to do this every time you boot up your RPi.
Assuming though that this solved your problem in the short term, the next step is to permanently assign symbolic names to your OnStep device.

I have only done this on Raspbian, so I can't say whether the advice below will work on your OS (not sure what you're using) but this is what I do on Raspbian:

I have two serial devices (focuser and mount) that are randomly assigned, one to /dev/ttyUSB0 and one to /dev/ttyUSB1. To avoid this randomness,
I create symbolic device names for them by adding the following four lines to /lib/udev/rules.d/99-observatory.rules

# MoonLite Focuser
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A601WGWD", MODE="0666", SYMLINK+="focuser"
# EQMod Mount
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="FTA663FB", MODE="0666", SYMLINK+="mount"

You'll always want to use "usb" and "0666" above, but the other magic strings in quotes (after idVendor, idProduct, and serial) come from the commands below:

(a) the output of the 'lsusb' command gives you vendor and product:

> lsusb
...
Bus 001 Device 008: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
...
Bus 001 Device 006: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
...

(b) you can get the value needed for "serial" from the below command:

# I'm sure the moonlite is connected to USB1 right now
udevadm info -a -n /dev/ttyUSB1 | grep '{serial}'
ATTRS{serial}=="A601WGWD"
ATTRS{serial}=="3f980000.usb"

(c) Of course, the SYMLINK name (in my case "mount" or "focuser" is arbitrary, but once you have chosen it, you
set your port for your OnStep to that, e.g. /dev/focuser
AP1100 & Orion Atlas Pro, WO/ZS105 w/Moonlight V2 focus, GSO RC10 w/RSF focus
ZWO ASI1600, Astronomik Filters, ST80, QHY 5L-IIm.
KStars/Ekos/Indi on NUC10 & RPi4 w/SSD -- Ubuntu
Projects: Greedy Scheduler, Terrain, Polar Align, Analyze, Linear Focuser, SEP MultiStar & GPG Guide, FITS autostretch.
3 years 1 week ago #48258

Please Log in or Create an account to join the conversation.

  • Posts: 930
  • Thank you received: 432
I didn't mention it above, but it's likely you have to reboot after you modify the /lib/udev/rules.d/99-observatory.rules file for the change to take effect.
AP1100 & Orion Atlas Pro, WO/ZS105 w/Moonlight V2 focus, GSO RC10 w/RSF focus
ZWO ASI1600, Astronomik Filters, ST80, QHY 5L-IIm.
KStars/Ekos/Indi on NUC10 & RPi4 w/SSD -- Ubuntu
Projects: Greedy Scheduler, Terrain, Polar Align, Analyze, Linear Focuser, SEP MultiStar & GPG Guide, FITS autostretch.
3 years 1 week ago #48259

Please Log in or Create an account to join the conversation.

  • Posts: 146
  • Thank you received: 24
hi!
the udev changes suggested by hy certainly make sense. i am not too familiar with the onstep either - however, there is one deviation of your device compared to the PCB i saw.
i commented your photo:

there is no serial-to-USB converter - the infamous CP2xxx something - where one is supposed be. i am not too aware of the variants of onstep, and i don't know the STM32. so i can only speculate.
- either the STM has an onboard converter like the various ESP32 chips. i have not seen this from the documentation, but it is possible. (teensies, on the other hand, have a native USB interface, and they are ARM chips, too). then you see this converter chip. i don't understand why howard should have foreseen a separate converter in this case, but maybe the PCB serves different versions.
- or your board uses a native UART (=serial port) of the STM, which it seems to have. then it is adressable as a /dev/ttyS0 or similar device, and the CP2xxx converter you see in lsusb is from a different device (focuser maybe or some other gadget). this port would not show up in lsusb ...
yours wolfi
3 years 1 week ago #48260
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 81
  • Thank you received: 0
Hi hy & wolfi,

I follow the way of hy and create aa new rule but continuous to tell me that other device use ttyUSB0.
I attach some pictures for to explain me and give you some light for help me.

Seems that recognise the device and is on ttyUSB0.
When I did the new rule for to check the serial



Really the are two devices on ttyUSB0, the serial 0001 is the cp210x nightmare zip, but the other one I don't know what it is. I have only connect OnStep USB and logitech camera.


And for other hand, I tried to purge from indi panel and appear this message about some file *. Xml that not exist.
.
Do you have any idea what is the next step?
Thanks for your suggestions
Pep
3 years 1 week ago #48273

Please Log in or Create an account to join the conversation.

Moderators: Radek Kaczorek
Time to create page: 0.771 seconds