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

Opening remote serial shutter port: /dev/tty.usbserial-xxxx is blocked on Mac #584

Closed
captainchain opened this issue May 30, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@captainchain
Copy link

captainchain commented May 30, 2022

Describe the bug
open remote serial shutter port blocked when I set a 40 seconds exposure on Ekos (set Force BULB ON on INDI Control Panel),
then it blocked forever except I restart the KSTARS

CPU:Intel Core i7
OS: MacOS Monterey 12.3.1 (21E258)
KSTARS: Version 3.5.8 Stable
KDE Frameworks Version 5.92.0
DSLR: Nikon D5100
USBtoTTL chip: FT232R, Driver: https://www.ftdichip.com/Drivers/VCP/MacOSX/FTDIUSBSerialDextInstaller_1_4_7.zip

To Reproduce
Exact steps to reproduce the behavior.

  1. start kstars
  2. click Toggle Ekos
  3. click Start Button with Nikon D5100 profile on Ekos Panel
  4. after INDI Control Panel shown, click Nikon DSLR TAB, set my FT232R serial port No. on Shutter Release Port
  5. click connect button to connect to the DSLR
  6. click option tab on INDI Control Panel , set Force BULB to ON
  7. back to Ekos Panel, click CCD Tab and then set exposures at 40 seconds
  8. click Capture button

Expected behavior**
the shutter opens,then close after 40 seconds

Screenshots
If applicable, add screenshots to help explain your problem.

MacBookPro (please complete the following information):
CPU:Intel Core i7
OS: MacOS Monterey 12.3.1 (21E258)
KSTARS: Version 3.5.8 Stable
KDE Frameworks Version 5.92.0
DSLR: Nikon D5100
USBtoTTL chip: FT232R, Driver: https://www.ftdichip.com/Drivers/VCP/MacOSX/FTDIUSBSerialDextInstaller_1_4_7.zip

Log Files
INFO 20.704069 sec : Force BULB is enabled. All expsures shall be captured in BULB mode except for subsecond captures.
INFO 64.539492 sec : Starting 40 seconds exposure.
DEBUG 64.539565 sec : Starting exposure (exptime: 40 secs, mirror lock: 0, force bulb: true, exposure index: 1)
DEBUG 64.539613 sec : Mutex locked
DEBUG 64.539681 sec : Setting radio/menu widget iso: 0 (100)
DEBUG 64.540377 sec : Setting new configuration OK.
DEBUG 64.540442 sec : Setting radio/menu widget imagequality: 3 (NEF (Raw))
DEBUG 64.541012 sec : Setting new configuration OK.
DEBUG 64.541064 sec : Setting exposure widget bulb index: 52
DEBUG 64.541085 sec : Setting radio/menu widget shutterspeed2: 52 (Bulb)
DEBUG 64.541832 sec : Setting new configuration OK.
DEBUG 64.541882 sec : Opening remote serial shutter port: /dev/tty.usbserial-xxxx ...

Finally I searched the source code at:

gphoto->bulb_fd = open(gphoto->bulb_port, O_RDWR, O_NONBLOCK);

I did a test via CLion, then found that:
open() can not be written like : open(gphoto->bulb_port, O_RDWR, O_NONBLOCK);
must be written as: open(gphoto->bulb_port, O_RDONLY | O_NONBLOCK);

@captainchain captainchain added the bug Something isn't working label May 30, 2022
@knro
Copy link
Collaborator

knro commented May 31, 2022

oh I see that O_NONBLOCK was sent as the mode_t which is incorrect. Does O_RDWR | O_NONBLOCK work as well ?

@captainchain
Copy link
Author

captainchain commented May 31, 2022

@knro oh, I will test it tonight~~~

@knro knro closed this as completed in 3e2d9eb May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants