×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

I need help to connect the pyxis driver to my arduino code !!

  • Posts: 250
  • Thank you received: 3
Well, I guess I'm not having much luck right now.
I'm waiting for someone to explain to me or to tell me that it's not possible either to modify the display of the driver in kstars or to know the commands and the returns that the driver sends.

see you soon
Christophe
2 years 5 months ago #76607

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

You can checkout the Nightcrawler driver source code and the implementation of the findHome function.

What is it you're trying to do exactly if I may ask? Using Arduino to make a Nightcrawler compatible rotator?
2 years 5 months ago #76617

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

  • Posts: 250
  • Thank you received: 3
Hello
So, indeed I would like to adapt an arduino code for this driver.
I already have the one for the driver, but it is too complicated because it is also for a focuser, so I would like to try to make a simpler one.

And my second question is to know if there is a way to modify the nightcrawler driver to make a simpler one, just for a rotator.

Like for example:
I would just need in the configurations, the "HOME" with the position that we want (from 0 to 360 °) to choose.
And to be able to do it either by pressing a button, or, automatically at the beginning of its use.

I don't know if it's possible

See you soon
Christophe
2 years 5 months ago #76623

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

Just copy over the nightcrawler.h & cpp files and edit them accordingly to remove the unnecessary bits. Of course, you need to have some understand of INDI code, but it's mostly straight forward.
2 years 5 months ago #76630

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

  • Posts: 250
  • Thank you received: 3
Last edit: 2 years 5 months ago by Porchet.
2 years 5 months ago #76636

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

  • Posts: 250
  • Thank you received: 3
Hello Jasem
then this is my problem, I'm really not expert in indi code, but if I look at the nightcrawler.h code there is a lot of parts I could remove, I think, that have nothing to do with the rotator, like ...

// Focus Sync
IUFillNumber(&SyncFocusN[0], "FOCUS_SYNC_OFFSET", "Ticks", "%.f", 0, 100000., 0., 0.);
IUFillNumberVector(&SyncFocusNP, SyncFocusN, 1, getDeviceName(), "FOCUS_SYNC", "Sync", MAIN_CONTROL_TAB, IP_RW, 0,
IPS_IDLE );

// Voltage
IUFillNumber(&VoltageN[0], "VALUE", "Value (v)", "%.2f", 0, 30., 1., 0.);
IUFillNumberVector(&VoltageNP, VoltageN, 1, getDeviceName(), "Voltage", "Voltage", MAIN_CONTROL_TAB, IP_RO, 0, IPS_IDLE );

// Temperature
IUFillNumber(&TemperatureN[0], "TEMPERATURE", "Value (C)", "%.2f", -100, 100., 1., 0.);
IUFillNumberVector(&TemperatureNP, TemperatureN, 1, getDeviceName(), "FOCUS_TEMPERATURE", "Temperature", MAIN_CONTROL_TAB,
IP_RO, 0, IPS_IDLE );

// Temperature offset
IUFillNumber(&TemperatureOffsetN[0], "OFFSET", "Offset", "%.2f", -15, 15., 1., 0.);
IUFillNumberVector(&TemperatureOffsetNP, TemperatureOffsetN, 1, getDeviceName(), "TEMPERATURE_OFFSET", "Temperature",
MAIN_CONTROL_TAB, IP_WO, 0, IPS_IDLE );

// Motor Step Delay
IUFillNumber(&FocusStepDelayN[0], "FOCUS_STEP", "Value", "%.f", 7, 100., 1., 7.);
IUFillNumberVector(&FocusStepDelayNP, FocusStepDelayN, 1, getDeviceName(), "FOCUS_STEP_DELAY", "Step Rate", SETTINGS_TAB,
IP_RW, 0, IPS_IDLE );


On the other hand I can't find the function that kstars sends to the arduino to tell it to do the GoHome

I'm not sure if you have the time to do it, but I'm sure you can figure out how to do it, so I'm not sure if you have the time.

Thanks again
Christophe
2 years 5 months ago #76637

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

  • Posts: 250
  • Thank you received: 3
Hello
One more question Jasem, how do I rename the driver that I modify so that I still have the original.
How do I install the modified driver and with which file do I have to do it?

Thanks again.
2 years 5 months ago #76646

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

You can rename the source files, and then look for nightcrawel in CMakeLists.txt and just copy the section for it and rename everything accordingly.

Regarding the driver, you need to make it only inherit INDI::Rotator, so remove INDI::FocuserInterface and all the Focuser related functions and variables. Alternatively, you can create a new driver based off one of the existing Rotator drivers.
2 years 5 months ago #76659

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

  • Posts: 250
  • Thank you received: 3
hello Jasem
so I'll try to modify the driver and remove the parts that I think are useless.
But where can I see the commands in the driver, that it sends to the arduino, because I need to find the "home" command of the rotator, and the command to give an angle from the serial terminal of the IDE, to control the modicication of the code without going through kstars for my tests.

And thank you for the link to the other rotator drivers, but is there also one online for the arduino.

Thanks again.
2 years 5 months ago #76661

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

  • Posts: 250
  • Thank you received: 3
sorry again,
but I didn't quite understand that
**
You can rename the source files, and then look for nightcrawel in CMakeLists.txt and just copy the section for it and rename everything accordingly.
**
what should I do?
I just have to find the files, copy them, modify and rename them ?
or do I have to make a new driver by modifying the original files ?
2 years 5 months ago #76662

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

You have two files, nightcrawler.h and .cpp. Copy them to something like myrotator.h and .cpp

In INDI CMakelists.txt, search for the nightcrawler section where it builds the executable. Just copy it and change the the source files and the executable (e.g. indi_myrotator_rotator). Also, edit drivers.xml and add an entry there for your rotator.
2 years 5 months ago #76663

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

  • Posts: 250
  • Thank you received: 3
ok
so I'm copying and changing the names here for me
/home/christophe/Projects/indi/drivers/rotator
and the new file I can call "mynightcrawler" in h. and cpp.

but i can't find the way to get there
INDI CMakelists.txt

I'm sorry again for my ignorance on the subject
Christophe
2 years 5 months ago #76665

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

Time to create page: 1.136 seconds