AndrejW Posted December 10, 2016 Share Posted December 10, 2016 Hello everyone, I have purchased an OPI PC + with intent to use it as a reciever for OGN, a network of recievers used for monitoring FLARM position info of equiped aircraft. http://wiki.glidernet.org/ I have flashed the Legacy 3.4.112 Jessie Desktop image first to the sd card and then installed it to the internal memory of the device. All went smoothly thus far. Then I ran into the problem that is the reason I am posting this thread. When I ran the bootscript for the installation of the OGN software, I got the following error message in the console: Bootscript source: http://ognconfig.onglide.com/ root@orangepipcplus:/home/andrej# wget http://ognconfig.onglide.com/files/v2.0/bootstrap-O bootstrap --2016-12-10 15:46:39-- http://ognconfig.onglide.com/files/v2.0/bootstrapResolving ognconfig.onglide.com (ognconfig.onglide.com)... 212.13.204.217Connecting to ognconfig.onglide.com (ognconfig.onglide.com)|212.13.204.217|:80... connected.HTTP request sent, awaiting response... 200 OKLength: 7770 (7.6K) [text/plain]Saving to: ‘bootstrap’bootstrap 100%[=====================>] 7.59K --.-KB/s in 0.002s2016-12-10 15:46:40 (2.97 MB/s) - ‘bootstrap’ saved [7770/7770]root@orangepipcplus:/home/andrej# chmod +x bootstraproot@orangepipcplus:/home/andrej# ./bootstrapstarting.../usr/bin/sudo * Adding ogn user and installing as thatuseradd: existing lock file /etc/passwd.lock without a PIDuseradd: cannot lock /etc/passwd; try again later. * unable to add ogn user?!root@orangepipcplus:/home/andrej# I tried adding an user manually using useradd and adduser, no success. Adding a new user is not strictly necessary for the reciever to work, but it seems like the bootscript requires it. I also dont know if there are any potential problems down the line. The software was working with OPI lite, as it is listed as tested on the OGN site. This bootscript is the easiest way for me to get the reciever working, it is supposed to be universal and when I tested it on a desktop with Ubuntu it worked like a charm. Any help is much appreciated, Andrej Link to comment Share on other sites More sharing options...
AndrejW Posted January 18, 2017 Author Share Posted January 18, 2017 Hello again, After several tries and ample support from the OGN irc I was able do get the OGN reciever working on the OPI PC + using the manual installation method. The only thing that failed was getting the program working at start automatically. Is there a way for me to automate these two commands at start: ./ogn-rf LJNMT.conf ./ogn-decode LJNMT.conf These two start the reciever. Any help would be appreciated. The board is running Debian GNU/Linux 8 4.6.7-sun8i Thank you for your help, LP Andrej Link to comment Share on other sites More sharing options...
martinayotte Posted January 18, 2017 Share Posted January 18, 2017 The simplest way is to call those commands from inside /etc/rc.local (before the exit 0) Link to comment Share on other sites More sharing options...
AndrejW Posted January 18, 2017 Author Share Posted January 18, 2017 Could you elaborate on how is this done? Link to comment Share on other sites More sharing options...
AndrejW Posted January 18, 2017 Author Share Posted January 18, 2017 Also, if someone would be interested in helping developing the bootstrap, the OGN guys asked me to link this: Krilo[m]1: You could add a post, that the automatic installation script is devolped here: https://github.com/glidernet/ogn-bootstrap Link to comment Share on other sites More sharing options...
martinayotte Posted January 18, 2017 Share Posted January 18, 2017 edit /etc/rc.local with your favorite editor and add your required commands the before the line showing "exit 0". Maybe your commands will need to be inserted with full path of the application location, such as "/home/andrej/openglider/ogn-rf /home/andrej/openglider/LJNMT.conf" and "/home/andrej/openglider/ogn-decode /home/andrej/openglider/LJNMT.conf". And if one of those commands are not starting in background process, add an ampersand "&" symbol at the end of the line. Link to comment Share on other sites More sharing options...
AndrejW Posted January 18, 2017 Author Share Posted January 18, 2017 Thank you, will be trying this. Link to comment Share on other sites More sharing options...
AndrejW Posted January 21, 2017 Author Share Posted January 21, 2017 Like so? #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. /home/ogn/rtlsdr-ogn# ./ogn-rf LJNMT.conf & /home/ogn/rtlsdr-ogn# ./ogn-decode LJNMT.conf & exit 0 Link to comment Share on other sites More sharing options...
martinayotte Posted January 21, 2017 Share Posted January 21, 2017 Not exactly ... dashes need to be removed ... /home/ogn/rtlsdr-ogn/ogn-rf LJNMT.conf & /home/ogn/rtlsdr-ogn/ogn-decode LJNMT.conf & Also, maybe not the case, some programs don't wish to be executed from any arbitrary paths, but only from their own location. If it is the case, maybe wrap it differently using it own bash script, such as /home/ogn/rtlsdr-ogn/start.sh : #!/bin/bash cd /home/ogn/rtlsdr-ogn/ ./ogn-rf LJNMT.conf & ./ogn-decode LJNMT.conf & And call that script in /etc/rc.local that way : /home/ogn/rtlsdr-ogn/start.sh & Link to comment Share on other sites More sharing options...
AndrejW Posted January 21, 2017 Author Share Posted January 21, 2017 Thank you, but unfortunately, neither of those options worked. I think I followed your instructions correctly, but keep in mind that I am new to linux(not to mention any kind of programming) and it is possible that I screwed something up that you experienced people take for granted =). Under this line is the whole path the command is normally manually executed from, if it makes any difference(root privilege maybe?) root@orangepipcplus:/home/ogn/rtlsdr-ogn# Link to comment Share on other sites More sharing options...
martinayotte Posted January 21, 2017 Share Posted January 21, 2017 Earlier in the thread, you've mentioned that it was starting properly with the above commands. So, it should work the same way ! Did you wrote that start.sh script ? Did you have made a "chmod a+rx ./start.h" ? What is happening when trying to execute it ? Any error messages ? Link to comment Share on other sites More sharing options...
AndrejW Posted January 21, 2017 Author Share Posted January 21, 2017 I wrote the start script with nano as such: root@orangepipcplus:/home/ogn/rtlsdr-ogn# nano start.sh #!/bin/bash cd /home/ogn/rtlsdr-ogn/ ./ogn-rf LJNMT.conf & ./ogn-decode LJNMT.conf & Then I placed it into ininto /etc/rc.local this way: #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. /home/ogn/rtlsdr-ogn/start.sh & exit 0 I did not use the "chmod a+rx ./start.h" No error messages were given. Link to comment Share on other sites More sharing options...
AndrejW Posted January 21, 2017 Author Share Posted January 21, 2017 When I run the two commands manually I do it by running each of them separately in their own screen sessions which I then detach so they do not die when i close the putty terminal(i know its not meant for that but it works). Link to comment Share on other sites More sharing options...
martinayotte Posted January 21, 2017 Share Posted January 21, 2017 You need to do the "chmod a+rx /home/ogn/rtlsdr-ogn/start.sh" Then, try to start it manually using "/home/ogn/rtlsdr-ogn/start.sh" Link to comment Share on other sites More sharing options...
AndrejW Posted January 21, 2017 Author Share Posted January 21, 2017 After following your instructions and manually starting: https://paste.ubuntu.com/23841258/ There is, however, no acess to ports 8080 and 8081 which, when acessed, offer insight into the operation of the receiver and demodulator modules, which indicates that they are not running. Link to comment Share on other sites More sharing options...
AndrejW Posted January 21, 2017 Author Share Posted January 21, 2017 Dropping both & symbols initiates the first command successfully, but not the second. Link to comment Share on other sites More sharing options...
AndrejW Posted January 21, 2017 Author Share Posted January 21, 2017 Ok, this is spaghetti code but it somehow works so I am not complaining.If you want some sauce you will need to find it somewhere else, I cook even worse than I write code =). Since it didn't work by running the program directly (one process was killing the other and they didn't want to start at power on) I tried doing it using screen(it started at reboot when instructed) I created two entries into /etc/rc.local, start.sh and start1.sh like so: #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. /home/ogn/rtlsdr-ogn/start.sh & /home/ogn/rtlsdr-ogn/start1.sh & exit 0 Then I created start.sh #!/bin/bash cd /home/ogn/rtlsdr-ogn/ screen -d -m ./ogn-rf LJNMT.conf and start1.sh #!/bin/bash cd /home/ogn/rtlsdr-ogn/ screen -d -m ./ogn-decode LJNMT.conf Then: chmod a+rx /home/ogn/rtlsdr-ogn/start.sh and chmod a+rx /home/ogn/rtlsdr-ogn/start1.sh Reciever starts automatically at boot =) I know U martinayotte most probably doesn't want to do anything with this abomination, but without his help, it would be impossible for me to make this work. Thank you! Link to comment Share on other sites More sharing options...
martinayotte Posted January 21, 2017 Share Posted January 21, 2017 Glad that you've finally got it working. I don't know anything about rtlsdr-ogn, so maybe there are better ways, but at least, you're up and running. Ciao ! Link to comment Share on other sites More sharing options...
AndrejW Posted January 21, 2017 Author Share Posted January 21, 2017 Thank you again for your help. I am certain there are better ways, however since this will be pretty much an install and forget type of arrangement, this should do. The only thing missing for the board to be perfect for my use is working onboard wifi, but since I need to run a power cable to it anyway ill most probably just connect it to lan as well. Maybe the awesome team behind armbian will port the nmtui interface to the server images in time and then ill reinstall it with that functionality as well. Lep pozdrav, Andrej =) Link to comment Share on other sites More sharing options...
AndrejW Posted January 23, 2017 Author Share Posted January 23, 2017 For remote access I added https://docs.dataplicity.com/. The installation is literally copying one line of code and it seems to work. Link to comment Share on other sites More sharing options...
AndrejW Posted April 17, 2017 Author Share Posted April 17, 2017 Hello again, the project is complete and the receiver has been installed on the top of our hangar. For Slovenian folks that are interested in checking how many gliders fly during nice spring and summer days you can check here: http://ktrax.kisstech.ch/ktrax/?c=46.1595,14.7574&z=9&airspace=openflightmaps&units=metric&thermals=on&traffic=on Have a nice day, Andrej Link to comment Share on other sites More sharing options...
AndrejW Posted April 24, 2017 Author Share Posted April 24, 2017 Tutorial for the installation of the OGN receiver on orange pi zero, as well as ADS-B by Łukasz Jokiel. https://blog.jokielowie.com/en/2017/04/sledzimy-szybowce-samoloty-helikoptery-i-balony-cz-3-flarm/ Link to comment Share on other sites More sharing options...
AndrejW Posted August 12, 2017 Author Share Posted August 12, 2017 Hello, since the rc.local method was quite unreliable I now invoke the auto startup script using cron with @reboot. Does anyone know if the @reboot means only manual reboot(ie typing reboot into the console) or also any other startup ie after power loss. Thank you Link to comment Share on other sites More sharing options...
AndrejW Posted August 17, 2017 Author Share Posted August 17, 2017 It seems to mean at every boot. @reboot Run once, at startup. @yearly Run once a year, "0 0 1 1 *". @annually (same as @yearly) @monthly Run once a month, "0 0 1 * *". @weekly Run once a week, "0 0 * * 0". @daily Run once a day, "0 0 * * *". @midnight (same as @daily) @hourly Run once an hour, "0 * * * *". https://www.pantz.org/software/cron/croninfo.html Link to comment Share on other sites More sharing options...
Recommended Posts