Jump to content

Using OPI pc + for Open Glider Project - unable to add user


AndrejW

Recommended Posts

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/bootstrap
Resolving ognconfig.onglide.com (ognconfig.onglide.com)... 212.13.204.217
Connecting to ognconfig.onglide.com (ognconfig.onglide.com)|212.13.204.217|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7770 (7.6K) [text/plain]
Saving to: ‘bootstrap’

bootstrap           100%[=====================>]   7.59K  --.-KB/s   in 0.002s

2016-12-10 15:46:40 (2.97 MB/s) - ‘bootstrap’ saved [7770/7770]

root@orangepipcplus:/home/andrej# chmod +x bootstrap
root@orangepipcplus:/home/andrej# ./bootstrap
starting...
/usr/bin/sudo

 * Adding ogn user and installing as that
useradd: existing lock file /etc/passwd.lock without a PID
useradd: 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

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

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

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

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

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

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

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

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

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

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

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

 

 

20170413_112312.jpg

20170412_163545.jpg

Link to comment
Share on other sites

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

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

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines