×

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
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.

/home/christophe/Projects/indi/CMakeLists.txt

I suggest you download QtCreator and use it as your IDE.
2 years 5 months ago #76668

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

  • Posts: 250
  • Thank you received: 3
hello
so this is where I need to edit

################ NightCrawler Focusing Rotator ################

SET(nightcrawler_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/rotator/nightcrawler.cpp) !!! here only ? !!!

add_executable(indi_nightcrawler_focus ${nightcrawler_SRC})
target_link_libraries(indi_nightcrawler_focus indidriver)
install(TARGETS indi_nightcrawler_focus RUNTIME DESTINATION bin)

I have just taken QTCreator, it seems to me much more complex to use, I will look at it and try to understand its functioning
Last edit: 2 years 5 months ago by Porchet.
2 years 5 months ago #76669

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

  • Posts: 250
  • Thank you received: 3
hello Jasem
I have a question, would it not be easier to take the Pyxis driver which is only for a rotator and adapt the arduino code of the nightcrawler to the Pyxis driver or is it not possible?
Unless I find the Pyxis arduino code, but for the moment I haven't found anything.

See you soon
Christophe
2 years 5 months ago #76695

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

  • Posts: 250
  • Thank you received: 3
Hello
does anyone have an idea of the commands that Pyxis sends to the rotator and the denomination.
This would be to create arduino code that works with this driver, of course this is possible.

Thank you very much for your help.
2 years 5 months ago #76808

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

Time to create page: 1.706 seconds