×

INDI Library v1.9.7 Released (29 Jul 2022)

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

Solved: JMI MOTOFOCUS driver for Astroberry / Raspberry

  • Posts: 18
  • Thank you received: 5
Hello All!

I am looking for JMI Motofocus (PCFC) controller driver for Astroberry Pi...
Appreciate your help/guidance for the same. 

Thanks!
Inder

PS: I am very new to INDI/Astroberry, please be gentle at my ignorance... :)
Last edit: 8 months 3 weeks ago by Inder.
8 months 3 weeks ago #77864

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

  • Posts: 18
  • Thank you received: 5
I saw that JMI MOTOFOCUS is available for Linux, BSD, OSX. indilib.org/focusers/jmi-motofocus.html

But it doesn't show up on Astroberry... 
8 months 3 weeks ago #77880

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

  • Posts: 18
  • Thank you received: 5
In case it helps, here is the device info:

[  583.792335] usb 1-1.3: new low-speed USB device number 4 using xhci_hcd
[  583.931422] usb 1-1.3: New USB device found, idVendor=134a, idProduct=903f, bcdDevice= 0.00
[  583.931432] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  583.931440] usb 1-1.3: Product: PCFC USB Focuser Controller
[  583.931447] usb 1-1.3: Manufacturer: JMI Telescopes
[  583.939532] hid-generic 0003:134A:903F.0002: hiddev96,hidraw0: USB HID v1.11 Device [JMI Telescopes PCFC USB Focuser Controller] on usb-0000:01:00.0-1.3/input0
 
Last edit: 8 months 3 weeks ago by Inder.
8 months 3 weeks ago #77893

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

  • Posts: 18
  • Thank you received: 5
Last edit: 8 months 3 weeks ago by Inder.
8 months 3 weeks ago #77913

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

  • Posts: 18
  • Thank you received: 5
I started looking into how to build INDI library on my Pi. 

I have had success . I will post my findings on this thread. 
8 months 3 weeks ago #77927

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

  • Posts: 18
  • Thank you received: 5
Hardware:
Raspberry Pi 4b 8GB
JMI Motofocus focus controller

OS:
Astroberry

Steps:
- Followed indilib.org/developers/deveioper-manual/...ent-environment.html to set up the Pi to compile INDI lib on Pi.
- cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ~/Projects/indi ran into following error:
Could NOT find the ogg and theora libraries (missing: OGGTHEORA_ogg_LIBRARY OGGTHEORA_theoraenc_LIBRARY OGGTHEORA_theoradec_LIBRARY OGGTHEORA_ogg_INCLUDE_DIR OGGTHEORA_theora_INCLUDE_DIR) CMake Error at cmake_modules/FindFFTW3.cmake:46 (message): FFTW3 not found. Please install libfftw3-dev

- Used following command to fix it:
 sudo apt-get install libfftw3-dev libfftw3-doc

Does the documentation on 'setting development environment' page need to be updated?



 
Last edit: 8 months 3 weeks ago by Inder.
8 months 3 weeks ago #77928

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

  • Posts: 18
  • Thank you received: 5
While searching on the internet, found that Shoestring Astronomy FCUSB is a similar piece of hardware. 
I tried using the Shoestring Astronomy FCUSB driver for the focuser. It resulted in a connection failure. 

Looked at the driver's code inside: github.com/indilib/indi/blob/master/drivers/focuser/fcusb.cpp

FCUSB::Connect() method is looking for a specific vendor and product ids. 

I added code for the product id shown by the JMI focuser.

by changing

    handle = hid_open(0x134A, 0x9023, nullptr);

    if (handle == nullptr)
    {
        handle = hid_open(0x134A, 0x9024, nullptr);

        if (handle == nullptr)
        {
            LOG_ERROR("No FCUSB focuser found.");
            return false;
        }
    }

to


    handle = hid_open(0x134A, 0x9023, nullptr);

    if (handle == nullptr)
    {
        handle = hid_open(0x134A, 0x9024, nullptr);

        if (handle == nullptr)
        {
            handle = hid_open(0x134A, 0x903f, nullptr);

            if (handle == nullptr)
            {
                LOG_ERROR("No FCUSB focuser found.");
                return false;
            }
        }
    }

Recompiled code using sudo make install

Retried connection. It was a success. I was able to connect and move the focuser.

Learned something new. Hurray!



 
Last edit: 8 months 3 weeks ago by Inder.
8 months 3 weeks ago #77929

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

  • Posts: 18
  • Thank you received: 5
Can the following change be reviewed and incorporated into the main library by experts so that others can also benefit? Also, it would be helpful to have the standard distribution running on the Pi so that the upgrades are smooth. 

File: github.com/indilib/indi/blob/master/drivers/focuser/fcusb.cpp

Change: added code for the product id shown by the JMI focuser by changing:

    handle = hid_open(0x134A, 0x9023, nullptr);

    if (handle == nullptr)
    {
        handle = hid_open(0x134A, 0x9024, nullptr);

        if (handle == nullptr)
        {
            LOG_ERROR("No FCUSB focuser found.");
            return false;
        }
    }

to


    handle = hid_open(0x134A, 0x9023, nullptr);

    if (handle == nullptr)
    {
        handle = hid_open(0x134A, 0x9024, nullptr);

        if (handle == nullptr)
        {
            handle = hid_open(0x134A, 0x903f, nullptr);

            if (handle == nullptr)
            {
                LOG_ERROR("No FCUSB focuser found.");
                return false;
            }
        }
    }
 
8 months 3 weeks ago #77930

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

8 months 3 weeks ago #77931

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

  • Posts: 18
  • Thank you received: 5
Thanks!

Looks like it is not liking a map because of duplicate keys... Changing the list of ids to the following fixed the issue.

static const std::multimap<uint16_t, uint16_t> USBIDs =
{
    {0x134A, 0x9023},
    {0x134A, 0x9024},
    {0x134A, 0x903F},
};

Pardon my basic knowledge of the language... 
 
The following user(s) said Thank You: Jasem Mutlaq
Last edit: 8 months 3 weeks ago by Inder.
8 months 3 weeks ago #77939

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

Sorry, dump mistake I didn't test. It's updated now, thanks for the fix!
Jasem Mutlaq
Support INDI & Ekos; Get StellarMate Astrophotography Gadget.
How to Submit Logs when you have problems?
Add your observatory info
The following user(s) said Thank You: Inder
8 months 3 weeks ago #77940

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

  • Posts: 18
  • Thank you received: 5
Worked great! 
8 months 3 weeks ago #77948

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

Time to create page: 1.313 seconds