Welcome, Guest
Username: Password: Remember me
25 Jul 2018
Glad to announce of release of INDI Library v1.7.4 on 2018-07-25. A few drivers were added in this release as we continue to improve & stabilize existing drivers.
Read More...

TOPIC: [SOLVED] FIFO start script

[SOLVED] FIFO start script 4 months 5 days ago #27282

I'm having a brain fart and can't find a solution.
Simple script:
#!/bin/bash
indiserver -f /tmp/indiFIFO &
test="echo start indi_roof_odroid > /tmp/indiFIFO"
eval $test
echo "started"

running the above script:

heidenrod@heidenrod-obs:~/obs_control$ ./test.sh
2018-07-08T16:15:22: startup: indiserver -f /tmp/indiFIFO
started
heidenrod@heidenrod-obs:~/obs_control$ 2018-07-08T16:15:23: Driver indi_roof_odroid: Init props


I never get the
echo "started"

Also running
echo "start indi_roof_odroid" > /tmp/indiFIFO
does work, but you have to press enter at the end to get back to the prompt

Question: how can I avoid this please? As in not having to press enter, my script stops because of this.
As I said, brain fart, it's probably dead obvious but I can't see it.

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

Kstars Mac osx
Odroid C1 running indiserver (kept up-to-date with apt-get update/upgrade)
HEQ5 pro / QHY5 / Atik 314L+
Last Edit: by Gonzothegreat.

FIFO start script 4 months 5 days ago #27286

  • maxer
  • maxer's Avatar
  • Offline
  • Gold Boarder
  • Gold Boarder
  • Posts: 203
  • Karma: 1
  • Thank you received: 28
Hi,
You can try something like this.. it works for me in Ubuntu.

indiserver -f INDIFIFO > $HOME/indilog.txt &
disown indiserver
echo "indiserver running.."
echo "Starting up devices.."
sleep 1
echo start /usr/bin/indi_moonlite_focus -n \"MoonLite\" >INDIFIFO
echo
sleep 1
echo start indi_duino -n \"Focuser\" -s \"/usr/share/indi/spaceslab_focuser_sk.xml\" >INDIFIFO
echo

Br
/Markku

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

EQ8, Small scope SW200, Big scope SW300, Xagyl FW, Guidescope Celestron 80mm, SX LodestarX2, SXVR-H9.
RPi3, Ubuntu Mate, and many Arduinos..

FIFO start script 4 months 5 days ago #27288

Thanks, but it does not work as intended.
$ more test.sh 
#!/bin/bash

indiserver -f /tmp/indiFIFO > $HOME/indilog.txt &
disown indiserver
echo "indiserver running.."
echo "Starting up devices.."
sleep 1
echo start /usr/bin/indi_roof_odroid -n \"Ordoid Roof\" >/tmp/indiFIFO
echo "test"
$

I run it and get
heidenrod@heidenrod-obs:~/obs_control$ ./test.sh 
indiserver running..
Starting up devices..
2018-07-08T17:58:30: startup: indiserver -f /tmp/indiFIFO 

heidenrod@heidenrod-obs:~/obs_control$ 2018-07-08T17:58:31: Driver /usr/bin/indi_roof_odroid: Init props

heidenrod@heidenrod-obs:~/obs_control$

I still have to press enter, script does not run
echo "test"

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

Kstars Mac osx
Odroid C1 running indiserver (kept up-to-date with apt-get update/upgrade)
HEQ5 pro / QHY5 / Atik 314L+

FIFO start script 4 months 5 days ago #27291

  • maxer
  • maxer's Avatar
  • Offline
  • Gold Boarder
  • Gold Boarder
  • Posts: 203
  • Karma: 1
  • Thank you received: 28
Hmm, that's strange, I use it all the time in my observatory and it works every time..
Is the last line an empty "echo" and the last line a CR ?? maybe that's the difference ??

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

EQ8, Small scope SW200, Big scope SW300, Xagyl FW, Guidescope Celestron 80mm, SX LodestarX2, SXVR-H9.
RPi3, Ubuntu Mate, and many Arduinos..

FIFO start script 4 months 5 days ago #27292

Would you mind please posting your entire script please?

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

Kstars Mac osx
Odroid C1 running indiserver (kept up-to-date with apt-get update/upgrade)
HEQ5 pro / QHY5 / Atik 314L+

FIFO start script 4 months 5 days ago #27294

  • maxer
  • maxer's Avatar
  • Offline
  • Gold Boarder
  • Gold Boarder
  • Posts: 203
  • Karma: 1
  • Thank you received: 28
#!/bin/bash

if [ -p "$HOME/INDIFIFO" ]; then
  rm -Rf $HOME/INDIFIFO
  sleep 1
  mkfifo $HOME/INDIFIFO
else
  mkfifo $HOME/INDIFIFO
  sleep 1
fi

echo "Loading INDI to FIFO.."
cd $HOME
indiserver -f INDIFIFO > $HOME/indilog.txt &
disown indiserver
echo "indiserver running.."
echo "Starting up devices.."
sleep 1
echo start /usr/bin/indi_moonlite_focus -n \"MoonLite\" >INDIFIFO
echo
sleep 1
echo start /usr/bin/indi_eqmod_telescope -n \"EQMod Mount\" >INDIFIFO
echo
sleep 1
echo start /usr/bin/indi_sx_ccd -n \"SX_CCD\" -s \"/usr/share/indi/indi_sx.xml\" >INDIFIFO
echo
#sleep 1
#echo start indi_sx_ccd -n \"SX_Lodestar\" >INDIFIFO
#echo
sleep 1
echo start /usr/bin/indi_xagyl_wheel -n \"XAGYL Wheel\" >INDIFIFO
echo
#sleep 1
#echo start indi_watchdog -n \"Watchdog\" >INDIFIFO
#echo
echo "Devices are up and running.."
echo
#echo **** Devices and ports ****
#indi_getprop | grep DEVICE_PORT
The following user(s) said Thank You: Gonzothegreat

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

EQ8, Small scope SW200, Big scope SW300, Xagyl FW, Guidescope Celestron 80mm, SX LodestarX2, SXVR-H9.
RPi3, Ubuntu Mate, and many Arduinos..

FIFO start script 4 months 5 days ago #27295

  • maxer
  • maxer's Avatar
  • Offline
  • Gold Boarder
  • Gold Boarder
  • Posts: 203
  • Karma: 1
  • Thank you received: 28
I see that the last CR doesen't show, but it is there..

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

EQ8, Small scope SW200, Big scope SW300, Xagyl FW, Guidescope Celestron 80mm, SX LodestarX2, SXVR-H9.
RPi3, Ubuntu Mate, and many Arduinos..

FIFO start script 4 months 5 days ago #27296

I get the same behaviour with your script
heidenrod@heidenrod-obs:~/obs_control$ ./test.sh 
Loading INDI to FIFO..
indiserver running..
Starting up devices..
2018-07-08T18:30:47: startup: indiserver -f INDIFIFO 

Devices are up and running..

heidenrod@heidenrod-obs:~/obs_control$ 2018-07-08T18:30:49: Driver /usr/bin/indi_roof_odroid: Init props

heidenrod@heidenrod-obs:~/obs_control$

I still have to press enter, it just seats at
heidenrod@heidenrod-obs:~/obs_control$ 2018-07-08T18:30:49: Driver /usr/bin/indi_roof_odroid: Init props


It's bugging me, I'm sure it's something stupid but I can't see it.

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

Kstars Mac osx
Odroid C1 running indiserver (kept up-to-date with apt-get update/upgrade)
HEQ5 pro / QHY5 / Atik 314L+

FIFO start script 4 months 5 days ago #27297

  • maxer
  • maxer's Avatar
  • Offline
  • Gold Boarder
  • Gold Boarder
  • Posts: 203
  • Karma: 1
  • Thank you received: 28
Strange, it should be working but obviously not, hmm.. no errors at all it just stops there ? I don't get it..

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

EQ8, Small scope SW200, Big scope SW300, Xagyl FW, Guidescope Celestron 80mm, SX LodestarX2, SXVR-H9.
RPi3, Ubuntu Mate, and many Arduinos..

FIFO start script 4 months 5 days ago #27298

bash -x
heidenrod@heidenrod-obs:~/obs_control$ bash -x test.sh 
+ '[' -p /home/heidenrod/INDIFIFO ']'
+ rm -Rf /home/heidenrod/INDIFIFO
+ sleep 1
+ mkfifo /home/heidenrod/INDIFIFO
+ echo 'Loading INDI to FIFO..'
Loading INDI to FIFO..
+ cd /home/heidenrod
+ disown indiserver
+ echo 'indiserver running..'
indiserver running..
+ echo 'Starting up devices..'
Starting up devices..
+ sleep 1
+ indiserver -f INDIFIFO
2018-07-08T18:42:07: startup: indiserver -f INDIFIFO 
+ echo start /usr/bin/indi_roof_odroid -n '"Ordoid' 'Roof"'
+ echo

+ echo 'Devices are up and running..'
Devices are up and running..
+ echo

heidenrod@heidenrod-obs:~/obs_control$ 2018-07-08T18:42:08: Driver /usr/bin/indi_roof_odroid: Init props

heidenrod@heidenrod-obs:~/obs_control$

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

Kstars Mac osx
Odroid C1 running indiserver (kept up-to-date with apt-get update/upgrade)
HEQ5 pro / QHY5 / Atik 314L+

FIFO start script 4 months 5 days ago #27299

  • maxer
  • maxer's Avatar
  • Offline
  • Gold Boarder
  • Gold Boarder
  • Posts: 203
  • Karma: 1
  • Thank you received: 28
That's a neat solution :) I was thinking of "xdotool" or maybe "expect" but it's solved now, I've never used -x but it's good to know.

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

EQ8, Small scope SW200, Big scope SW300, Xagyl FW, Guidescope Celestron 80mm, SX LodestarX2, SXVR-H9.
RPi3, Ubuntu Mate, and many Arduinos..

FIFO start script 4 months 5 days ago #27300

'bash -x' is to debug your script (sort of), the script still doesn't work as intended I'm afraid and I can't see what's wrong.

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

Kstars Mac osx
Odroid C1 running indiserver (kept up-to-date with apt-get update/upgrade)
HEQ5 pro / QHY5 / Atik 314L+
Time to create page: 0.195 seconds

Login



3rd Party

Choose from the numerous 3rd party INDI drivers to suit your needs!

Got Problem?

Check out the FAQ, the forum, and the bug tracking system to resolve any issues you might have!
You can also subscribe to INDI newsletter and development mailing lists to get the latest updates on INDI!


Gallery

Replica

Why INDI

Replica