×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

indi_dsi_ccd not working after a while

  • Posts: 153
  • Thank you received: 29
Hi Soren,
I'm assuming this is repeatable, is that right? If so, could you provide instructions to reproduce it?

Thanks,
Ben
7 years 1 month ago #15029

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

  • Posts: 278
  • Thank you received: 17
Yes, it happens every time I run my script for a few hours. The script captures images, wait for it to appear and then captures yet another image repeatetly. Then suddently no images are found after issuing

indi_setprop -p 7626 "DSI.CCD_EXPOSURE.CCD_EXPOSURE_VALUE=1"

Also, no image appear if I ussue the exposure outside the script once the driver have failed. (so it is not because my script crashes). I can also see that the indi_dsi_ccd aquires more and more memory, so it seems to me there is also a memory problem with the driver. With an older version of indi (1.3.1), I had indi_dsi_ccd use almost 50% of the memory of my RPi.

What's the best way to proceed here?
7 years 1 month ago #15031

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

  • Posts: 153
  • Thank you received: 29
I think I see the memory leak in the code (and I definitely see it when running). I'm going to try and get valgrind running to make sure I get them all.

I'm attempting to reproduce the main issue that you posted about. I'll let it run overnight and see what happens.

Thanks,
Ben
The following user(s) said Thank You: S
7 years 1 month ago #15044

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

  • Posts: 153
  • Thank you received: 29
I was actually seeing kstarts ballooning up, not indi_dsi_ccd. The memory leak bug that I thought was there is actually in the code, but it seems g++ handles it just fine. So, I'm unable to reproduce the high memory usage of indi_dsi_ccd on my intel machine. I've also been unable to reproduce the problem of not being able to download an image.

I'll fire up my raspberry pi and see if i can reproduce it there.

It might be helpful if you could share the logs from the shell running indi_dsi_ccd (indiserver).

Thanks,
Ben
7 years 1 month ago #15078

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

  • Posts: 153
  • Thank you received: 29
I'm unable to reproduce either of these problems on my raspberry pi. Could you share your script?
-Ben
7 years 1 month ago #15102

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

  • Posts: 278
  • Thank you received: 17
Hi!

Thank you for the efforts! I am currently running Ubuntu mate 16.04 on my RPi and it also did not work when I used raspbian earlier.

Here is how I start the capture process:
indiserver -p 7626 -v indi_dsi_ccd &>/home/pi/dsiindi.log &
(while true; do /home/pi/captureDSI2.sh >>/home/pi/DSI.log 2>&1; sleep 2s; done) &

Here is the capture script (captureDSI2.sh):
#!/bin/bash
cd /home/pi/DSI
date
 
port=7626
 
DefaultExp=1
Exp=${1:-$DefaultExp}
echo $Exp
 
rm DSI_IMAGE_*.fits
indi_setprop -p $port "DSI.CONNECTION.CONNECT=On"
indi_setprop -p $port "DSI.GAIN.GAIN=10"
indi_setprop -p $port "DSI.OFFSET.OFFSET=0"
indi_setprop -p $port "DSI.UPLOAD_SETTINGS.UPLOAD_DIR=/home/pi/DSI"
indi_setprop -p $port "DSI.UPLOAD_SETTINGS.UPLOAD_PREFIX=DSI_IMAGE_XXX"
indi_setprop -p $port "DSI.UPLOAD_MODE.UPLOAD_LOCAL=On"
indi_setprop -p $port "DSI.UPLOAD_MODE.UPLOAD_CLIENT=Off"
indi_setprop -p $port "DSI.CCD_COMPRESSION.CCD_COMPRESS=Off"
indi_setprop -p $port "DSI.CCD_COMPRESSION.CCD_RAW=On"
indi_setprop -p $port "DSI.CCD_EXPOSURE.CCD_EXPOSURE_VALUE=$Exp"
 
for i in $(seq 1 1000); do
    if [ "$(indi_getprop -p $port DSI.CCD_EXPOSURE.CCD_EXPOSURE_VALUE 2>/dev/null | cut -d '=' -f 2)" == "0" ]; then
        break
    fi
    sleep 0.25s
done
 
sleep 0.5s
 
if ! [ -f DSI_IMAGE_001.fits ]; then
    echo Nothing captured...
    exit
fi
 
title=""
subtitle=$(date)
 
convert  -font /usr/share/fonts/truetype/freefont/FreeMono.ttf -background '#0008' -fill white -gravity center -pointsi\
ze 16 -size 640x22 caption:"$title $subtitle"  -gravity south DSI_IMAGE_001.fits  -normalize -gamma 2 +swap -composite \
-resize 640x480! obsimage.jpg
mv obsimage.jpg ObsImage.jpg

and here is the first and last part of the log from the run:
2017-03-13T05:47:37: startup: indiserver -p 7626 -v indi_dsi_ccd
2017-03-13T05:47:37: Driver indi_dsi_ccd: pid=25375 rfd=3 wfd=6 efd=7
2017-03-13T05:47:37: listening to port 7626 on fd 4
2017-03-13T05:47:37: Driver indi_dsi_ccd: snooping on Telescope Simulator.EQUATORIAL_EOD_COORD
2017-03-13T05:47:37: Driver indi_dsi_ccd: snooping on Telescope Simulator.TELESCOPE_INFO
2017-03-13T05:47:37: Driver indi_dsi_ccd: snooping on CCD Simulator.FILTER_SLOT
2017-03-13T05:47:37: Driver indi_dsi_ccd: snooping on CCD Simulator.FILTER_NAME
2017-03-13T05:47:37: Driver indi_dsi_ccd: snooping on SQM.SKY_QUALITY
2017-03-13T05:53:57: Client 0: new arrival from 127.0.0.1:58288 - welcome!
2017-03-13T05:53:57: Client 0: read EOF
2017-03-13T05:53:57: Client 0: shut down complete - bye!
2017-03-13T05:53:57: Client 0: new arrival from 127.0.0.1:58290 - welcome!
2017-03-13T05:53:57: Driver indi_dsi_ccd: w 1 3                                   [dt=0]
2017-03-13T05:53:57: Driver indi_dsi_ccd:     00000000: 03 01 00                                      PING
2017-03-13T05:53:57: Driver indi_dsi_ccd: r 81 40                                 [dt=1]
2017-03-13T05:53:57: Driver indi_dsi_ccd:     00000000: 03 01 06                                      ACK
2017-03-13T05:53:57: Driver indi_dsi_ccd: w 1 3                                   [dt=1]
2017-03-13T05:53:57: Driver indi_dsi_ccd:     00000000: 03 02 01                                      RESET
2017-03-13T05:53:57: Driver indi_dsi_ccd: r 81 40                                 [dt=0]
2017-03-13T05:53:57: Driver indi_dsi_ccd:     00000000: 03 02 06                                      ACK
2017-03-13T05:53:57: Driver indi_dsi_ccd: w 1 3                                   [dt=1]
.... A lot of lines....
2017-03-13T08:29:37: Driver indi_dsi_ccd: starting image row 483, write_ptr=490728, line_start=190464, is_odd=0, read_ptr=380974
2017-03-13T08:29:37: Driver indi_dsi_ccd: starting image row 484, write_ptr=491744, line_start=190464, is_odd=1, read_ptr=380974
2017-03-13T08:29:37: Driver indi_dsi_ccd: starting image row 485, write_ptr=492760, line_start=191232, is_odd=0, read_ptr=382510
2017-03-13T08:29:37: Driver indi_dsi_ccd: starting image row 486, write_ptr=493776, line_start=191232, is_odd=1, read_ptr=382510
2017-03-13T08:29:37: Driver indi_dsi_ccd: starting image row 487, write_ptr=494792, line_start=192000, is_odd=0, read_ptr=384046
2017-03-13T08:29:37: Driver indi_dsi_ccd: write_ptr=495808
2017-03-13T08:29:37: Client 0: new arrival from 127.0.0.1:40662 - welcome!
2017-03-13T08:29:37: Client 0: read: Connection reset by peer
2017-03-13T08:29:37: Client 0: shut down complete - bye!
2017-03-13T08:29:40: Client 0: new arrival from 127.0.0.1:40664 - welcome!

The last image I find was at 08:38, after this I see no new fits files and indi is still running:
pi@Observatory:~$ ps xavf | grep dsi
22148 pts/4    S+     0:00      0   128  4115   592  0.0              \_ grep --color=auto dsi
25374 ?        S      5:36      0    28  1647  1368  0.1 indiserver -p 7626 -v indi_dsi_ccd
25375 ?        Rl     3:14      0    99 55120 40196  4.2  \_ indi_dsi_ccd

Could it be a hardware fault if you can not reproduce this at all?
Last edit: 7 years 1 month ago by S.
7 years 1 month ago #15107

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

  • Posts: 278
  • Thank you received: 17
Have anyone been able to reproduce this?
7 years 4 weeks ago #15434

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

  • Posts: 486
  • Thank you received: 87
I remember seeing an exagerated memory increase on my DSI Pro when connected to my PI B+.
Also sometimes it would hang or crash in the middle of exposing session.
I will try you script on mine and see how it works.
7 years 4 weeks ago #15503

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

  • Posts: 153
  • Thank you received: 29
I am able to reproduce the high memory usage of indi_dsi_ccd using the script that was provided. Interestingly, I don't see anything obviously wrong using valgrind. I think I was able to reproduce the same high memory usage when I was using ekos, but the memory usage was attributed to kstars rather than indi_dsi_ccd. I'm going to look at other driver code to see if they do something the indi_dsi_ccd driver does not.

I still haven't been able to reproduce the failed exposure.
7 years 4 weeks ago #15514

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

  • Posts: 486
  • Thank you received: 87
I have put my DSI Pro to the test with your script and also cannot reproduce the failed exposure.
I had it working aprox. one hour nonstop until I stop the server. I noticed however that memory usage almost doubled in this time frame!!!!
No crashes or hanging, worked fine and stable.

Also I built INDI Lib and DSI Driver from today sources.
7 years 3 weeks ago #15531

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

  • Posts: 278
  • Thank you received: 17
Thanks to you all. The exposure start to fail after 2-3 hours of running on my system. With a previous version of indi it worked, untill the driver used up all memory on my rpi, so maybe this have fixed itself in a newer version of indi.
7 years 3 weeks ago #15535

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

I will try to test the script with another driver (QHY) and curios to see if there is a memory leak somewhere.
7 years 3 weeks ago #15537

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

Time to create page: 0.624 seconds