×

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

Bi-monthly release with minor bug fixes and improvements

mcp23s17_open failing, where is stderr

  • Posts: 18
  • Thank you received: 2
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.
5 years 1 month ago #34794

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

  • Posts: 18
  • Thank you received: 2
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.
5 years 1 month ago #34796

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

  • Posts: 18
  • Thank you received: 2
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.
5 years 1 month ago #34810

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

  • Posts: 983
  • Thank you received: 375
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.
5 years 1 month ago #34813

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

  • Posts: 18
  • Thank you received: 2
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.
5 years 1 month ago #34814

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

  • Posts: 983
  • Thank you received: 375
Then it is not a driver's issue. Make sure you add dtparam=spi=on in your /boot/config.txt to enable SPI bus.
5 years 1 month ago #34817

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

  • Posts: 18
  • Thank you received: 2
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.
5 years 1 month ago #34818

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

  • Posts: 18
  • Thank you received: 2
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.
5 years 1 month ago #34821

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

Moderators: Radek Kaczorek
Time to create page: 0.243 seconds