{"id":72,"date":"2016-07-07T15:26:32","date_gmt":"2016-07-07T13:26:32","guid":{"rendered":"http:\/\/www.sensimedia.org\/?p=72"},"modified":"2025-03-07T08:44:21","modified_gmt":"2025-03-07T07:44:21","slug":"raspberry-pi-et-celestron-phase-2","status":"publish","type":"post","link":"https:\/\/sensimedia.org\/?p=72","title":{"rendered":"Raspberry PI et Celestron (Phase 2)"},"content":{"rendered":"\n<p>Objectif:<\/p>\n\n\n\n<p><a href=\"http:\/\/www.sensimedia.org\/2018\/11\/17\/raspberry-pi-et-celestron-phase-1\/\">\u2013 Configurer le Raspberry en mode AP + Nat.<\/a> OK<br>\u2013<a href=\"http:\/\/www.sensimedia.org\/2018\/11\/17\/raspberry-pi-et-celestron-phase-2\/\"> Installer le service Telescope Server Stellarium pour piloter le Telescope (Nexstar\/LX2000).<\/a> OK<br>\u2013 Permettre de visualiser via une webcam l\u2019image du chercheur<br>\u2013 Permettre d\u2019Astrophotographie depuis de le Raspberry (avec PI CAM NoIR)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Etape 1: Installer un demon qui permet de presenter un port serie via une \u201cIP\u201d<\/h3>\n\n\n\n<p>Il existe pour cela ser2net.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install ser2net<\/code><\/pre>\n\n\n\n<p><strong>Modifie<\/strong> le fichier de conf&nbsp; <strong>\/etc\/ser2net.conf<\/strong> en commentant les lignes de d\u00e9port en place (2000\/2001\/3000\/3001) et on ajoute<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>2002:raw:0:\/dev\/ttyUSB0:9600 NONE 1STOPBIT 8DATABITS<\/code><\/pre>\n\n\n\n<p><em>Attention l\u2019utilisation du port \nserie est exclusif, donc non compatible avec l\u2019utilisation du daemon \nStellarium Telescop Server, ou tout autre solution utilisant le port \ns\u00e9rie<\/em><\/p>\n\n\n\n<p><em>Ser2Net peut etre utilis\u00e9 dans le cas d\u2019utilisation de SkySafari par exemple.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Etape 2: Installer Telescope Server (Stellarium)<\/h3>\n\n\n\n<p>Bon pour commencer, obligation d\u2019installer subversion Grrrrr !!!!<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt-get install subversion<\/pre>\n\n\n\n<p>puis si pas d\u00e9j\u00e0 fait<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd ~\/ &amp;&amp; mkdir src &amp;&amp; cd src<\/pre>\n\n\n\n<p>puis<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo svn co https:\/\/svn.code.sf.net\/p\/stellarium\/code\/trunk\/telescope_server<\/pre>\n\n\n\n<p>On enfin les sources et un packge de M\u2026e sur le PI !!. Bref maintenant on compile<\/p>\n\n\n\n<p><strong>cd telescope_server\/src<\/strong><br>\n<strong> sudo make<br>\nsudo cp -p TelescopeServer* \/usr\/local\/bin\/<\/strong><\/p>\n\n\n\n<p>On configure maintenant le TelescopeServer (Nexstar dans notre cas). \nPour \u00eatre honn\u00eate, il y a pas de daemon, de fichier de conf, c\u2019est juste\n un truc en ligne de commande TRES basique.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Etape 3 : Executer le Telescope Server<\/h3>\n\n\n\n<p>Donc deux possibilit\u00e9s, soit on fait \u00e0 la main<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo TelescopeServerNexStar 10001 \/dev\/ttyUSB0 &amp;<\/pre>\n\n\n\n<p>Soit on fait un service qui d\u00e9marre automatiquement au reboot du PI.<\/p>\n\n\n\n<p>Pour creer un service sous Jessie, c\u2019est facile, enfin presque.<\/p>\n\n\n\n<p>Editions du fichier \/etc\/init.d\/TelescopeServer. Il faut savoir que \nle TelescopeServer n\u2019est pas pens\u00e9 pour fonctionner en mode Daemon, il \ncrache des logs sur le TTY. Il est possible de les r\u00e9cup\u00e9rer en \nredirigeant la sortie vers un fichier. Je n\u2019ai pas choisi cette \noption\u2026.SDCARD oblige.<\/p>\n\n\n\n<p>Si on veut garder l\u2019historique et les traces des echanges il suffit \nde rajouter a la lignes options&nbsp; \u201c&gt; \/var\/log\/TelescopeServer.log\u201d, si\n c\u2019ets sur une cle USB, ou autre media \u2026GO<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#! \/bin\/bash\n#\n# TelescopeServer&nbsp;&nbsp; &nbsp;init script for TelescopeServer\n#\n#&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Written by Loops &lt;&gt;\n\n### BEGIN INIT INFO\n# Provides:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TelescopeServer\n# Required-Start:&nbsp;&nbsp;&nbsp; $network $remote_fs\n# Required-Stop:&nbsp;&nbsp;&nbsp;&nbsp; $network $remote_fs\n# Should-Start:\n# Should-Stop:\n# Default-Start:&nbsp;&nbsp;&nbsp;&nbsp; 2 3 4 5\n# Default-Stop:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 1 6\n# Short-Description: Run TelescopeServer for Stellarium \n# Description:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This daemon allows communication between Stellarium Client and Telescope Server to pilot Nextar\/Lx200\n### END INIT INFO\n\n&nbsp; . \/lib\/lsb\/init-functions\n\nPATH=\/sbin:\/bin:\/usr\/sbin:\/usr\/bin\n\nDAEMON=\"\/usr\/local\/bin\/TelescopeServerDummy\"\nPORT=10001\nSERIAL=\"\/dev\/ttyUSB0\"\nDAEMON_OPTION=\"$PORT $SERIAL\"\nNAME=TelescopeServer\nDESC=\"TelescopeServer For Stellarium\"\nPIDFILE=\/run\/$NAME.pid\n\ntest -f $DAEMON || exit 0\n\n\ncase \"$1\" in\n&nbsp; start)\n&nbsp;&nbsp;&nbsp; log_daemon_msg \"Starting system $NAME Daemon\"\n&nbsp;&nbsp; &nbsp;start-stop-daemon --background --name $NAME --start --quiet --exec $DAEMON $DAEMON_OPTION\n&nbsp;&nbsp;&nbsp; log_end_msg $?\n&nbsp;&nbsp; &nbsp;;;\n&nbsp; stop)\n&nbsp;&nbsp; &nbsp;log_daemon_msg \"Stopping system $NAME Daemon\"\n&nbsp;&nbsp;&nbsp; start-stop-daemon --name $NAME --stop --retry 5 --quiet --name $NAME\n&nbsp;&nbsp; &nbsp;log_end_msg $?\n&nbsp;&nbsp; &nbsp;;;\n&nbsp; force-stop)\n&nbsp;&nbsp; &nbsp;stop\n&nbsp;&nbsp; &nbsp;killall -q $NAME || true\n&nbsp;&nbsp;&nbsp; sleep 2\n&nbsp;&nbsp;&nbsp; killall -q -9 $NAME || true\n&nbsp;&nbsp; &nbsp;;;\n&nbsp; restart|reload|force-reload)\n&nbsp;&nbsp; &nbsp;stop\n&nbsp;&nbsp; &nbsp;sleep 1\n&nbsp;&nbsp; &nbsp;start\n&nbsp;&nbsp; &nbsp;;;\n&nbsp; status)\n&nbsp; &nbsp;&nbsp; &nbsp;status_of_proc \"$NAME\" \"$DAEMON\" \"system-wide $NAME\" &amp;&amp; exit 0 || exit $?\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;&nbsp;&nbsp; &nbsp;\n&nbsp; *)\n&nbsp;&nbsp; &nbsp;N=\/etc\/init.d\/$NAME\n&nbsp;&nbsp; &nbsp;echo \"Usage: $N {start|stop|restart|reload|force-reload|status}\" &gt;&amp;2\n&nbsp;&nbsp; &nbsp;exit 1\n&nbsp;&nbsp; &nbsp;;;\nesac\n\nexit 0<\/pre>\n\n\n\n<p>On remplacera, dans le script le bon TelescopeServer a charger, le port si il faut et enfin, le ttyUSB\u2026<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Objectif: \u2013 Configurer le Raspberry en mode AP + Nat. OK\u2013 Installer le service Telescope Server Stellarium pour piloter le Telescope (Nexstar\/LX2000). OK\u2013 Permettre de visualiser via une webcam l\u2019image du chercheur\u2013 Permettre d\u2019Astrophotographie depuis de le Raspberry (avec PI CAM NoIR) Etape 1: Installer un demon qui permet de presenter un port serie via &hellip; <a href=\"https:\/\/sensimedia.org\/?p=72\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Raspberry PI et Celestron (Phase 2)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,3,5,10],"tags":[],"class_list":["post-72","post","type-post","status-publish","format-standard","hentry","category-astro","category-automation","category-linux","category-raspberry"],"_links":{"self":[{"href":"https:\/\/sensimedia.org\/index.php?rest_route=\/wp\/v2\/posts\/72","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sensimedia.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sensimedia.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sensimedia.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sensimedia.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=72"}],"version-history":[{"count":1,"href":"https:\/\/sensimedia.org\/index.php?rest_route=\/wp\/v2\/posts\/72\/revisions"}],"predecessor-version":[{"id":528,"href":"https:\/\/sensimedia.org\/index.php?rest_route=\/wp\/v2\/posts\/72\/revisions\/528"}],"wp:attachment":[{"href":"https:\/\/sensimedia.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sensimedia.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sensimedia.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}