×
INDI Library v1.8.5 Released (19 Apr 2020)

April 2020 release of INDI Library v1.8.5 introduces new drivers while providing fixes and improvements to existing devices and core framework.

mcp23s17_open failing, where is stderr

1 year 5 months ago
eplumer
Fresh Boarder
Fresh Boarder
Posts: 18
More
Topic Author
mcp23s17_open failing, where is stderr #34794
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.

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

1 year 5 months ago
eplumer
Fresh Boarder
Fresh Boarder
Posts: 18
More
Topic Author
mcp23s17_open failing, where is stderr #34796
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.

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

1 year 5 months ago
eplumer
Fresh Boarder
Fresh Boarder
Posts: 18
More
Topic Author
mcp23s17_open failing, where is stderr #34810
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.

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

1 year 5 months ago
Kaczorek
Moderator
Moderator
Posts: 912
Karma: 6
More
mcp23s17_open failing, where is stderr #34813
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

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

1 year 5 months ago
eplumer
Fresh Boarder
Fresh Boarder
Posts: 18
More
Topic Author
mcp23s17_open failing, where is stderr #34814
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.

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

1 year 5 months ago
Kaczorek
Moderator
Moderator
Posts: 912
Karma: 6
More
mcp23s17_open failing, where is stderr #34817
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

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

1 year 5 months ago
eplumer
Fresh Boarder
Fresh Boarder
Posts: 18
More
Topic Author
mcp23s17_open failing, where is stderr #34818
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.

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

1 year 5 months ago
eplumer
Fresh Boarder
Fresh Boarder
Posts: 18
More
Topic Author
mcp23s17_open failing, where is stderr #34821
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.

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

Moderators: Kaczorek
Time to create page: 0.196 seconds