×

INDI Library v1.8.0 is Released (27 Jul 2019)

INDI Library v1.8.0 is mostly a maintenance release to fix a few bugs in several drivers.

mcp23s17_open failing, where is stderr

  • Posts: 18
  • Thank you received: 2

mcp23s17_open failing, where is stderr was created by eplumer

I am still trying to debug why I cannot connect piface_focusers. I added some extra tracing into piface_focuser.cpp:

bool IndiPiFaceFocuser1::Connect()
{
// open device
mcp23s17_fd = mcp23s17_open(0,0);

if(mcp23s17_fd == -1)
{
DEBUG(INDI::Logger::DBG_SESSION, "Focuser1 :: Open :: FAILED");
IDMessage(getDeviceName(), "PiFace Focuser 1 device is not available.");
return false;
}
else
{
DEBUG(INDI::Logger::DBG_SESSION, "Focuser1 :: Open :: OK");
}



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.
6 months 2 weeks ago #34794

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

  • Posts: 18
  • Thank you received: 2

Replied by eplumer on topic mcp23s17_open failing, where is stderr

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.

[2019-02-09T14:09:27.137 CST DEBG ][ org.kde.kstars.indi] - PiFace Focuser : "PiFace Focuser 1 device is not available. "
[2019-02-09T14:09:27.138 CST DEBG ][ org.kde.kstars.ekos] - PiFace Focuser is disconnected.
[2019-02-09T14:09:27.147 CST DEBG ][ org.kde.kstars.indi] - < PiFace Focuser 2 >: < DEBUG_LEVEL >
[2019-02-09T14:09:27.168 CST DEBG ][ org.kde.kstars.indi] - < PiFace Focuser 2 >: < LOGGING_LEVEL >
[2019-02-09T14:09:27.171 CST DEBG ][ org.kde.kstars.indi] - < PiFace Focuser 2 >: < LOG_OUTPUT >
[2019-02-09T14:09:27.186 CST DEBG ][ org.kde.kstars.indi] - PiFace Focuser 2 : "PiFace Focuser 2 device is not available. "
[2019-02-09T14:09:27.187 CST DEBG ][ org.kde.kstars.ekos] - PiFace Focuser 2 is disconnected.

So, here is the original error message I was asking about. However, non of the critical mcp23s17_open STDERR messages are going here.
6 months 2 weeks ago #34796

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

  • Posts: 18
  • Thank you received: 2

Replied by eplumer on topic mcp23s17_open failing, where is stderr

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.
6 months 2 weeks ago #34810

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

  • Posts: 632
  • Karma: 6
  • Thank you received: 244

Replied by Kaczorek on topic mcp23s17_open failing, where is stderr

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.
--
Radek Kaczorek
Astroberry Server | NEQ6 | Atik 460EX | Atik EFW2 | ASI 120MM
6 months 2 weeks ago #34813

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

  • Posts: 18
  • Thank you received: 2

Replied by eplumer on topic mcp23s17_open failing, where is stderr

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.
6 months 2 weeks ago #34814

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

  • Posts: 632
  • Karma: 6
  • Thank you received: 244

Replied by Kaczorek on topic mcp23s17_open failing, where is stderr

Then it is not a driver's issue. Make sure you add dtparam=spi=on in your /boot/config.txt to enable SPI bus.
--
Radek Kaczorek
Astroberry Server | NEQ6 | Atik 460EX | Atik EFW2 | ASI 120MM
6 months 2 weeks ago #34817

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

  • Posts: 18
  • Thank you received: 2

Replied by eplumer on topic mcp23s17_open failing, where is stderr

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.
6 months 2 weeks ago #34818

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

  • Posts: 18
  • Thank you received: 2

Replied by eplumer on topic mcp23s17_open failing, where is stderr

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.
6 months 1 week ago #34821

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

Moderators: Kaczorek
Time to create page: 0.425 seconds