Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Solved: autostart oled display failure..
#11
Thanks.../tmp/monitor.log is blank... Sad
"maybe rc.local is too early in the system startup process" ....yes, I tried amending the script for sleep from 10 to 1000 but no help there...Sad although when calling it from ssh login I can see the display restart after the set time... strange how it will work from a login ssh but not from  boot .. Confused
I will retry an install as you suggest... Big Grin 

Thanks so much for persevering !!  I know how difficult it can be walking through us less-than au-fait users... Wink
----------
bob
Reply
#12
well...this baffles me...

I have a command that works to start the oled display and it's function from the command line at an ssh session logged in as user pi 

Code:
~/Adafruit_Python_SSD1306/raspberry-oled-monitor/launcher.sh &

surely there is some way to make that command start at boot..?? 

if it can be started by the user pi why can it not be started at boot....???
/etc/rc/local   crontab... bash rc  nothing works...


bangs head on desk again...
----------
bob
Reply
#13
As before don't be using "~" in this scenario or in your scripts, that path will only qualify when running as the pi user. Use the full paths.
Have you tried running it as root in a shell?
e.g.
Code:
sudo -i
cd /home/pi/Adafruit_Python_SSD1306/raspberry-oled-monitor && ./monitor.py

or...

Code:
sudo -i
cd /home/pi/Adafruit_Python_SSD1306/raspberry-oled-monitor && /usr/bin/python ./monitor.py

The above lines (those beginning with cd ...) are doing exactly the same as what your launcher shell script is doing, you don't need a script for that.

When executing a process in a non-interactive environment such as cron, rc.local, you cannot assume environment variables and paths are exported as in a user's interactive shell as no user profile is being sourced.

Still, did you try running from rc.local as the pi user as shown in my last post?
Reply
#14
so logged in as pi I can run
Code:
cd /home/pi/Adafruit_Python_SSD1306/raspberry-oled-monitor && ./monitor.py

Code:
cd /home/pi/Adafruit_Python_SSD1306/raspberry-oled-monitor && /usr/bin/python ./monitor.py
Code:
sudo -i
cd /home/pi/Adafruit_Python_SSD1306/raspberry-oled-monitor && ./monitor.py
Code:
sudo -i
cd /home/pi/Adafruit_Python_SSD1306/raspberry-oled-monitor && /usr/bin/python ./monitor.py
yes they all work as do all the other commands and scripts I have mentioned...

But adding any of those lines to /etc/rc/local does not cause the display to start or refresh....

What am I missing...?

Quote:When executing a process in a non-interactive environment such as cron, rc.local, you cannot assume environment variables and paths are exported as in a user's interactive shell as no user profile is being sourced.


I'm sorry, this assumes more knowledge of coding than I have Sad   all Greek  to me..Sad

here are all the suggestions  made and tried to no avail

Code:
# moOde startup and job processor daemon
/var/www/command/worker.php > /dev/null 2>&1

/home/pi/Flirc-moode.py
#python /bin/su - pi -c "cd /home/pi/Adafruit_Python_SSD1306/raspberry-oled-monitor && ./monitor.py &"
#python cd /home/pi/Adafruit_Python_SSD1306/raspberry-oled-monitor && ./monitor.py &
#/home/pi/Adafruit_Python_SSD1306/raspberry-oled-monitor/monitor.py &
#/bin/su - pi -c "/home/pi/Adafruit_Python_SSD1306/raspberry-oled-monitor/monitor.py &"
#cd /home/pi/Adafruit_Python_SSD1306/raspberry-oled-monitor && ./monitor.py &
#/Adafruit_Python_SSD1306/raspberry-oled-monitor/launcher.sh &
#cd /home/pi/Adafruit_Python_SSD1306/raspberry-oled-monitor && ./monitor.py &
#sudo -i
#cd /home/pi/Adafruit_Python_SSD1306/raspberry-oled-monitor && ./monitor.py &

exit 0
----------
bob
Reply
#15
Oh my word   Rolleyes  
OK looking at your dump of your /etc/rc.local file you misunderstood my last post.

So assuming your thing worked when running in a shell and as root...

e.g. as pi, switch to the root user...

Code:
sudo -i


... then run your script

Code:
cd /home/pi/Adafruit_Python_SSD1306/raspberry-oled-monitor && /usr/bin/python ./monitor.py

If that works as root then the monitor works as the root user in a shell.


One would do the same in the rc.local file by just adding to the file before the 'exit 0' line...
Code:
cd /home/pi/Adafruit_Python_SSD1306/raspberry-oled-monitor && /usr/bin/python ./monitor.py &

That will be executed at boot time. So do that and get rid of the other commented out ones...


Now above those, what's this line?

Code:
/home/pi/Flirc-moode.py

 ... and why doesn't it have a '&' on the end? Is that a persistent process? If so nothing after it will run.


FYI you can see what processes are still running from rc.local by running..

Code:
sudo systemctl status rc-local
Reply
#16
Quote: and why doesn't it have a '&' on the end? Is that a persistent process? If so nothing after it will run.

BINGO !!!

Lifts head from desk and smiles.....Thank you so much vinnn for helping my woeful soul.... Smile 

Yes, adding just about anything....but I used your suggested line... above 
Code:
/home/pi/Flirc-moode.py

fixes it.....

Well spotted and so grateful for you sticking with me... Cool
----------
bob
Reply
#17
No worries, you can also add a ' &' to the end of that Flirc line so the rc.local completes in stead of hanging on that line.

OK just to recap, your initial method wouldn't have worked anyway because you weren't using the correct paths in the rc.local file or in your launcher.sh script.
Once we addressed that we discovered your second issue that whatever you were adding to rc.local was not being run due to no '&' at the end of a preceding line.
Reply
#18
@DRONE7

So now that the displays are working, I want to see how you package your system. My significant other is politely pretending she can live with my open boards.  Rolleyes

Regards,
Kent
Reply
#19
(12-30-2019, 03:10 PM)TheOldPresbyope Wrote: @DRONE7

So now that the displays are working, I want to see how you package your system. My significant other is politely pretending she can live with my open boards.  Rolleyes

Regards,
Kent

Ah, I keep an eye out for suitable 'moddable' (MoOde-able ?) quirky enclosures at what we call here Op-Shops.
Your 'Goodwill' equivalent...I think...

A couple of previous builds...
http://moodeaudio.org/forum/showthread.p...0#pid11170
http://moodeaudio.org/forum/showthread.p...5#pid11195

Currently working on a Pi4/Salas L-Adapter/Large Fan enclosure...this one is scratch built...photos pending.

For the Pi3/Kali/Piano dac and displays I have a wooden 'Library Archive' box and some thick resin plates that are suggesting themselves... Undecided

Cheers, Bob
----------
bob
Reply
#20
@DRONE7

Ah, yes, I remember your clock-radio conversion now. Looks great.

Maybe I'll get lucky at a local thrift store, but we're downsizing and I'm supposed to be taking items to it, not bringing items from it Tongue

I can put off the decision for now; still haven't settled on front panel display(s).

Regards,
Kent
Reply


Forum Jump: