I am still trying to debug why I cannot connect piface_focusers. I added some extra tracing into piface_focuser.cpp:
I find that I get my "FAILED" error message in the INDI Control Panel .
I do NOT get the original message "PiFace Focuser 1 device is not available" showing up anywhere.
I do see "PiFace Focuser is disconnected." in the main Ekos message panel; this message does not originate from the driver.
I see that the mcp23s17 libarary code sends extra details to stderr. I read on the INDI docs that driver stderr is passed on to the indiserver stderr.
My questions are:
(1) where is the error message the piface_focuser driver writing supposed to show up? IDMessage(getDeviceName(), "PiFace Focuser 1 device is not available.");
(2) I am running KStars/Ekos all locally on the RPi and starting the INDI server from Ekos. All my other devices work fine, so I known INDI server is doing something. With this configuration, where do I see or configure the STDERR output of the INDI server? I would like to see what specific error mcp23s17_open(0,0) is generating.
(3) Any other board setup that I have likely missed causing this error? I have verified the address jumpers on the Relay+ board.
OK, partly answered one of my questions. From main Ekos screen I pressed "Logs" button. I configured verbose file logging for INDI and focuser drivers. I then pressed "Open Logs Directory" and found the following appear in a file after trying to reconnect the piface.
As an alternative to finding the log for stderr, I tried modifying mcp23s17.c to return different error codes for the 4 possible failure conditions. However, the piface build automatically pulls a fresh copy of mcp23s17.c as part of its generated make.
This is absolutely normal. mcp23s17 is a dependency and is not part of the astroberry-piface project. If you need to change mcp23s17 sources you can do it by forking mcp23s17 project and changing CMakeLists.txt - just set URL parameter to your forked project in ExternalProject_Add clause.
Thanks Kaczorek, though I have not solved the missing stderr problem, I have figured out why the device was not connecting. The "Enable SPI" setting under raspi-config somehow reset itself back to disabled.
Thanks, that solves that problem .... stepper motor is finally turning! Very exciting.
Due to the gearing ratio between my stepper and the crayford (I am driving the fine-focus knob), I had to bump up MAX_STEPS from 20,000 to 100,000 in the driver code. Thanks for exposing that as a #define.
When you set an absolute tick position in Ekos, what controls how fast the steps are made by the driver? Is that a loop-pause in Ekos, something in the driver, or does Ekos just move as fast as possible? I am finding the motor is turning pretty slowly on a absolute position slew and would like to speed it up.
OK, I found the critical "usleep" command in the driver that controls the slew rate. I tinkered with changing the scaling factor from 1000 to 100 to make the Step Delay motor parameter act like tenths-milliseconds. In principle this worked but it seems that the Ekos bogs down a crashes when the delay is too small.