Menu

AutoStart semi-working

Help
2022-10-19
2022-10-23
  • Barry Martin

    Barry Martin - 2022-10-19

    Hi Folks!!
    Having problems with getting NCID to display its GUI (the chart with the calls, time, etc.) automatically on boot. Fresh installation using NCID 1.13-2 under Raspberry Pi (3) Bullseye 64-bit.

    /etc/rc.local:
    sudo systemctl start ncidd
    /usr/bin/ncid &
    

    This works fine in the old system (NCID 1.12, Bullseye 32-bit). Also works fine with the new system when I manually load “/usr/bin/ncid &” via Terminal. Even tried a sleep 10 command in rc.local. Nope (obviously otherwise I wouldn’t be posting!). Logs don’t seem to be complaining.

    TIA!
    Barry

     
  • John L. Chmielewski

    I am surprised starting from rc.local ever worked. The rc.local file is executed before any users log in, therefore $HOME is undefined, causing ncid to abort. The only way to start ncid in rc.local is to use the --no-gui option, usually with a module.

    The proper way to autostart ncid is to configure autostart in the File menu:
    File-->Auto Start->On

    There are three types of on that you can select. It works with Gnome and should work with other desktops that support ~/config/.autostart. I think that the Raspberry Pi OS supports Gnome.

     
  • Barry Martin

    Barry Martin - 2022-10-21

    Hi John!
    Oh-oh! I did the impossible again! One thing I have learned is not to use short-cut variables like $HOME – use the full path. (If defined within a script it’s OK.)
    As for your autostart suggestion, not quite sure where it is but I did play with some stuff on and off today and found something that works here. (Might be my ‘magic’ again, like that rc.local thing!)

    sudo nano /home/barry/.config/lxsession/LXDE-pi/autostart (change user ‘barry’)

    @lxpanel --profile LXDE-pi
    @pcmanfm --desktop --profile LXDE-pi
    @xscreensaver -no-splash
    #   @galculator     <== test line: opened calculator on boot
    @/usr/bin/ncid
    

    “galculator” is the RPi’s calculator utility – used this as test to verify this file would work. Autostart does not need the ‘&’ at the end so why not up there. The ‘@’ runs the command a few times should it error the first time. Source site is: https://forums.raspberrypi.com/viewtopic.php?t=294014
    Thanks for the lead! LIS, I had played with some stuff and was about ready to post when saw your reply. Concept looks similar. just different method to get the same result.
    Barry
    (About to copy in my reply – just realized where “File” meant! – no wonder I didn’t find it originally!)

     
  • John L. Chmielewski

    Thanks for the link to "How to use Autostart - Raspberry Pi OS (Desktop)".
    It is not something NCID would normally use, but it does seem like it could be useful.

    Buster has ~/.config/autostart for GUI based applications.
    Just copy the /usr/share/applications/<app name>.desktop
    file there and the app will autostart.

    The ncid client does this for you, plus it can also enable ncid-alert for notifications. As an example, the ncid client copies /usr/share/applications/ncid.desktop to ~/.config/autostart/
    and will modify the exec line if the ncid-alert module is wanted.

    Autostart seems like it should be included in the ncid Help Menu. The help menu has small files for different topics concerning the ncid client.

     
  • Barry Martin

    Barry Martin - 2022-10-21

    Hi John!
    Using Bullseye 64-bit on a Raspberry Pi 3B here and looks like stuff has been moved around/not included. (Semi-disclaimer: ‘latest and greatest’ only because may as well use what’s current and so will probably be supported for a few years. Using the 3B as had “in stock” here and save the 4’s for where needed.)

    For whatever reason not finding Bullseye’s autostart at the same place as you stated for Buster:
    barry@raspberrypi:~ $ ls .config
    chromium geany libfm lxterminal pulse
    dconf gpicview lxpanel pcmanfm user-dirs.dirs
    galculator gtk-3.0 lxsession pipewire-media-session user-dirs.locale

    barry@raspberrypi:~ $ find / -type f -iname autostart 2>/dev/null
    /etc/xdg/openbox/autostart
    /etc/xdg/lxsession/LXDE/autostart
    /etc/xdg/lxsession/LXDE-pi/autostart
    /home/barry/.config/lxsession/LXDE-pi/autostart <== this is the one I created

    I did try inserting /usr/bin/ncid & in the three /etc/xdg autostarts, one at a time and rebooting. Here did not load ncid’s GUI. No idea if I did something wrong, like needing to prepend the ‘@’ – didn’t learn about that until later when those three options didn’t work.

    Hopefully my little experimentations will help you if there is something different between Buster and Bullseye. AFAIK I have the complete versions installed but I could have screwed something up.

    Barry

     
  • Barry Martin

    Barry Martin - 2022-10-23

    Hi John!
    Looks like we’re both learning new stuff! At this point I think I’m going to leave things alone: it’s running. I’ll try during the next upgrade and/or project. Perhaps put both new autostart options in your manual so if one doesn’t work there is another one to try. (And sometimes one option makes more sense than another.)
    Thanks for the feedback and willingness to help us amateurs!
    Barry

     

Log in to post a comment.