×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

USB-Focus-V3 connexion problem

  • Posts: 474
  • Thank you received: 168
One useful addition to the udev-rule is also create a symlink in case there are also other devices using ttyACM*, mine is:

SUBSYSTEM=="tty", ATTRS{product}=="USB_Focus", SYMLINK+="focuser", ENV{ID_MM_DEVICE_IGNORE}="1"

so it's always /dev/focuser
4 years 10 months ago #40058

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

  • Posts: 145
  • Thank you received: 8

Replied by Lars on topic USB-Focus-V3 connexion problem

Hi.
I also try to instal USB-focuser,

I tried the suggested command in terminal:

sudo apt remove modemmanager

But it was interupted and I was told to set it up in manuell mode:

sudo dpkg --configure -a

I gave that command and a lot of things happened.

Still didn't get it to connect to USB-focus

I think it's connected to /dev/ttyUSB01 (or shall it be USB1 ?)

When I scan for ports I get this:

2020-02-27T23:15:28: [INFO] Scan complete. Found 1 port(s).
2020-02-27T23:15:20: [ERROR] Failed to connect to port (/dev/ttyUSB01). Error: Port failure Error: No such file or directory. Check if device is connected to this port.
2020-02-27T23:14:37: [INFO] Error retrieving data from USBFocusV3, please ensure controller is powered and the port is correct.
2020-02-27T23:14:37: [ERROR] No valid resync response.
2020-02-27T23:14:34: [INFO] Retry 6...
2020-02-27T23:14:31: [INFO] Retry 5...
2020-02-27T23:14:28: [INFO] Retry 4...
2020-02-27T23:14:25: [INFO] Retry 3...
2020-02-27T23:14:22: [INFO] Retry 2...
2020-02-27T23:14:19: [INFO] Retry 1...
2020-02-27T23:14:19: [INFO] Error retrieving data from USBFocusV3, trying resync...

It sugest System Ports /dev/ttyACM0

I try that to but didn't work either.

When I give usb-devices in terminal I see that it is connected to port01.

I'm almost new to Raspberry, I tried it two years ago, then I had KStar installed in Raspberry, but the it overloaded Raspberry. Now I have KStar installed on a client with Windows10. I have installed Astroberry in the Raspberry which to be the correct way to go, or ?

Linux is a bit confusing for me :-), Windows man.

By the way, in my old computer system have the USB-focus running in a Astro-server with Windows8, all working correct. But the USB-focus had the port number 12 in my Window system, I tried that to in the Raspberry, and then I tried all port numbers from 0 to 24.

I changing to Raspberry because I want to lower the power and get it more compact, I really want it to work.

/Lars
4 years 1 month ago #50208

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

  • Posts: 211
  • Thank you received: 104
The port is /dev/ttyACM0 , the USBfocus never connect as ttyUSB.

Try this command to show the process that can lock the port:
sudo lsof /dev/ttyACM0

Note it can be /dev/ttyACM1 if you unplug and replug.
To be sure, just after you plug, type dmesg and look for the last messages.

Patrick
4 years 1 month ago #50210

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

  • Posts: 145
  • Thank you received: 8

Replied by Lars on topic USB-Focus-V3 connexion problem

Hi,
Thanks for a quick reply.

It looks like I don't have the command Isof installd in my Astroberry. But I have ls and I tried that:

Before installed the USB cable to USB-focus:

astroberry@astroberry:~ $ ls /dev/tty*
/dev/tty /dev/tty19 /dev/tty3 /dev/tty40 /dev/tty51 /dev/tty62
/dev/tty0 /dev/tty2 /dev/tty30 /dev/tty41 /dev/tty52 /dev/tty63
/dev/tty1 /dev/tty20 /dev/tty31 /dev/tty42 /dev/tty53 /dev/tty7
/dev/tty10 /dev/tty21 /dev/tty32 /dev/tty43 /dev/tty54 /dev/tty8
/dev/tty11 /dev/tty22 /dev/tty33 /dev/tty44 /dev/tty55 /dev/tty9
/dev/tty12 /dev/tty23 /dev/tty34 /dev/tty45 /dev/tty56 /dev/ttyAMA0
/dev/tty13 /dev/tty24 /dev/tty35 /dev/tty46 /dev/tty57 /dev/ttyprintk
/dev/tty14 /dev/tty25 /dev/tty36 /dev/tty47 /dev/tty58 /dev/ttyS0
/dev/tty15 /dev/tty26 /dev/tty37 /dev/tty48 /dev/tty59
/dev/tty16 /dev/tty27 /dev/tty38 /dev/tty49 /dev/tty6
/dev/tty17 /dev/tty28 /dev/tty39 /dev/tty5 /dev/tty60
/dev/tty18 /dev/tty29 /dev/tty4 /dev/tty50 /dev/tty61

After I have installed the USB cable to USB-focus:

astroberry@astroberry:~ $ ls /dev/tty*
/dev/tty /dev/tty19 /dev/tty3 /dev/tty40 /dev/tty51 /dev/tty62
/dev/tty0 /dev/tty2 /dev/tty30 /dev/tty41 /dev/tty52 /dev/tty63
/dev/tty1 /dev/tty20 /dev/tty31 /dev/tty42 /dev/tty53 /dev/tty7
/dev/tty10 /dev/tty21 /dev/tty32 /dev/tty43 /dev/tty54 /dev/tty8
/dev/tty11 /dev/tty22 /dev/tty33 /dev/tty44 /dev/tty55 /dev/tty9
/dev/tty12 /dev/tty23 /dev/tty34 /dev/tty45 /dev/tty56 /dev/ttyACM0
/dev/tty13 /dev/tty24 /dev/tty35 /dev/tty46 /dev/tty57 /dev/ttyAMA0
/dev/tty14 /dev/tty25 /dev/tty36 /dev/tty47 /dev/tty58 /dev/ttyprintk
/dev/tty15 /dev/tty26 /dev/tty37 /dev/tty48 /dev/tty59 /dev/ttyS0
/dev/tty16 /dev/tty27 /dev/tty38 /dev/tty49 /dev/tty6
/dev/tty17 /dev/tty28 /dev/tty39 /dev/tty5 /dev/tty60
/dev/tty18 /dev/tty29 /dev/tty4 /dev/tty50 /dev/tty61

The ttyACM0 has appered.

Great now I got a connection ! Thanks a lot !

Still some problem, it looks to have problem to read the temperature:

2020-02-28T11:47:09: [ERROR] Unknown error: focuser temperature value ()
2020-02-28T11:47:09: [WARNING] Error writing command FTMPRO: Write Error: Input/output error.
2020-02-28T11:47:09: [WARNING] Error writing command FTMPRO: Write Error: Input/output error.
2020-02-28T11:47:09: [WARNING] Error writing command FTMPRO: Write Error: Input/output error.
2020-02-28T11:47:09: [WARNING] Error writing command FTMPRO: Write Error: Input/output error.
2020-02-28T11:47:09: [WARNING] Error writing command FTMPRO: Write Error: Input/output error.
2020-02-28T11:47:09: [WARNING] Error writing command FTMPRO: Write Error: Input/output error.
2020-02-28T11:47:09: [ERROR] Unknown error: focuser position value ()

But still a big progress.

/Lars
4 years 1 month ago #50213

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

  • Posts: 211
  • Thank you received: 104
Check baud rate is 9600.

If it still not work, in the Option tab enable Debug then Driver Debug to log file to get more information.
4 years 1 month ago #50219

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

  • Posts: 145
  • Thank you received: 8

Replied by Lars on topic USB-Focus-V3 connexion problem

After some restarts the problem came once again. Maybe the problem is that some other device occupy the port.

Someone gave this information, setup a rule.

And this:
SUBSYSTEM=="tty", ATTRS{product}=="USB_Focus", SYMLINK+="focuser", ENV{ID_MM_DEVICE_IGNORE}="1"

Is there a file I shall open and add this string to ?

As you see I know almost nothing about Linux world.

/Lars
4 years 1 month ago #50312

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

  • Posts: 145
  • Thank you received: 8

Replied by Lars on topic USB-Focus-V3 connexion problem

Update:
I found a file with the name '99-com.rules'

In this file I found:

SUBSYSTEM=="input", GROUP="input", MODE="0660"
SUBSYSTEM=="i2c-dev", GROUP="i2c", MODE="0660"
SUBSYSTEM=="spidev", GROUP="spi", MODE="0660"
SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660"
SUBSYSTEM=="argon-*", GROUP="video", MODE="0660"
SUBSYSTEM=="rpivid-*", GROUP="video", MODE="0660"

SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660"
SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\
chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\
chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770 /sys/devices/virtual/gpio;\
chown -R root:gpio /sys$devpath && chmod -R 770 /sys$devpath\
'"

KERNEL=="ttyAMA[01]", PROGRAM="/bin/sh -c '\
ALIASES=/proc/device-tree/aliases; \
if cmp -s $ALIASES/uart0 $ALIASES/serial0; then \
echo 0;\
elif cmp -s $ALIASES/uart0 $ALIASES/serial1; then \
echo 1; \
else \
exit 1; \
fi\
'", SYMLINK+="serial%c"

KERNEL=="ttyS0", PROGRAM="/bin/sh -c '\
ALIASES=/proc/device-tree/aliases; \
if cmp -s $ALIASES/uart1 $ALIASES/serial0; then \
echo 0; \
elif cmp -s $ALIASES/uart1 $ALIASES/serial1; then \
echo 1; \
else \
exit 1; \
fi \
'", SYMLINK+="serial%c"

Is it here I shall place my rules for the focuser:
SUBSYSTEM=="tty", ATTRS{product}=="USB_Focus", SYMLINK+="focuser", ENV{ID_MM_DEVICE_IGNORE}="1"

??

When I try to edit the file I can't save it, can't get access to it.

/Lars
4 years 1 month ago #50314

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

  • Posts: 145
  • Thank you received: 8

Replied by Lars on topic USB-Focus-V3 connexion problem

Now when I know how to log in as root adminstrator I could edit the '99-com.rules' file.

Content of file:

SUBSYSTEM=="tty", ATTRS{product}=="USB_Focus", SYMLINK+="focuser", ENV{ID_MM_DEVICE_IGNORE}="1" (my new row)
SUBSYSTEM=="input", GROUP="input", MODE="0660"
SUBSYSTEM=="i2c-dev", GROUP="i2c", MODE="0660"
SUBSYSTEM=="spidev", GROUP="spi", MODE="0660"
SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660"
SUBSYSTEM=="argon-*", GROUP="video", MODE="0660"
SUBSYSTEM=="rpivid-*", GROUP="video", MODE="0660"

SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660"
SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\
chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\
chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770 /sys/devices/virtual/gpio;\
chown -R root:gpio /sys$devpath && chmod -R 770 /sys$devpath\
'"

KERNEL=="ttyAMA[01]", PROGRAM="/bin/sh -c '\
ALIASES=/proc/device-tree/aliases; \
if cmp -s $ALIASES/uart0 $ALIASES/serial0; then \
echo 0;\
elif cmp -s $ALIASES/uart0 $ALIASES/serial1; then \
echo 1; \
else \
exit 1; \
fi\
'", SYMLINK+="serial%c"

KERNEL=="ttyS0", PROGRAM="/bin/sh -c '\
ALIASES=/proc/device-tree/aliases; \
if cmp -s $ALIASES/uart1 $ALIASES/serial0; then \
echo 0; \
elif cmp -s $ALIASES/uart1 $ALIASES/serial1; then \
echo 1; \
else \
exit 1; \
fi \
'", SYMLINK+="serial%c"


The first row is my new rule I got from this page.

It still doesn't connect, maybe I have wrong name id of the focuser, this is the response from INDI control panel:
2020-03-02T11:58:56: [INFO] Error retrieving data from USBFocusV3, please ensure controller is powered and the port is correct.
2020-03-02T11:58:56: [ERROR] No valid resync response.

I think there are commands to find the name of the connected device, if I find it I rewrite the rules if it's different, correct ?

Just have to find the command to get the names.

/Lars
4 years 1 month ago #50329

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

  • Posts: 145
  • Thank you received: 8

Replied by Lars on topic USB-Focus-V3 connexion problem

This is what I get with the command:

astroberry@astroberry:~ $ lsusb
Bus 001 Device 012: ID 0461:0033 Primax Electronics, Ltd
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I have only the focuser connected, the other USB ports are empty.

The 'Primax Electronics, Ltd' is the focuser.
Strange I thought the name should be USB_Focuser.

Should I change the rule with this name ?

/Lars
4 years 1 month ago #50331

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

  • Posts: 211
  • Thank you received: 104
Hi,

0461:0033 is the usbfocus but here it show the manufacturer of the usb chip in the device.
You must not change the file 99-com.rules because it will likely be replaced by a system update.

Create a new file in /etc/udev/rules.d/ . For example named it 80-usbfocuser.rules
In this file I have:
ATTRS{idVendor}=="0461", ATTRS{idProduct}=="0033", ENV{ID_MM_DEVICE_IGNORE}="1", SYMLINK+="usbfocus"

This make ModemManager to ignore this device and it also create a symbolic link /dev/usbfocus to the actual /dev/ttyACM0. The interest is you can always configure /dev/usbfocus in INDI and it work even if you re-plug the device and the ttyACM number change.

Patrick
4 years 1 month ago #50333

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

  • Posts: 145
  • Thank you received: 8

Replied by Lars on topic USB-Focus-V3 connexion problem

Hi Patrick,
Thanks, I have now restored the 99-com.rules file and create a new 80-usbfocuser.rules file according to your instructions.

But still there is another device that block the connection;

2020-03-02T13:49:06: [WARNING] Port /dev/ttyACM0 is already used by another driver or process.
2020-03-02T13:49:03: [WARNING] Port /dev/ttyACM0 is already used by another driver or process.
2020-03-02T13:48:47: [INFO] Scan complete. Found 1 port(s).
2020-03-02T13:48:11: [ERROR] Failed to connect to port (/dev/ttyUSB0). Error: Port failure Error: No such file or directory. Check if device is connected to this port.

Can I in some way see what device that is connected to ACM0 ?

I have reinstalled the Astroberry, this time I didn't do the command:

sudo apt remove modemmanager

What I understand it's not needed now with the 80-usbfocuser.rules, or I'm wrong ?

/Lars
4 years 1 month ago #50337

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

  • Posts: 211
  • Thank you received: 104
The rule just set the environment variable ID_MM_DEVICE_IGNORE=1
Normally this must make ModemManager to not take the device but it is possible your version of ModemManager do not obey to this variable.
Removing with "sudo apt remove modemmanager" is probably a safer solution.
4 years 1 month ago #50346

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

Time to create page: 0.338 seconds