[Cialug] raspbery pi monitor

Patrick Mcgillan patrick.mcgillan at gmail.com
Wed Sep 7 18:10:18 CDT 2016


followup after getting it working the way I envisaged <- I think that is a
word - spell check is not whining

A raspebrrypi and its USB hard drive sitting quietly in the corner with a
wifi dongle plugged in for remote access. Then I decided to add a 10 inch
LCD screen and turn it in to a dual display clock, the second zone is UST
time.

After reboot, XDM put a login prompt on the screen.
Poking around the net, I found the inittab method of autologin;
===========================

Step 2: Disable the getty program.
Navigate to the following line in /etc/inittab
1:2345:respawn:/sbin/getty 115200 tty1

And add a # at the beginning of the line to comment it out
#1:2345:respawn:/sbin/getty 115200 tty1

Step 3: Add login program to inittab.
Add the following line just below the commented line1:2345:respawn:/bin/login
-f pi tty1 </dev/tty1 >/dev/tty1 2>&1
This will run the login program with pi user and without any authentication

================================
OK, but XDM was still in the way.
So 'apt-get remove xdm' got rid of that problem.
On the other hand it also got rid of startx
So 'apt-get install xinit' restored that program
Then add this to end of /etc/rc.local
su -l pi -c startx
Great now I am auto logged in with a desktop showing
Create a .xinitrc file in the user pi home directory
#!/usr/bin/env bash
/home/pi/MyClock.py

reboot and the pi user is logged in and the clock starts.

for those interested in my simple py clock, here it is
------------------------------------------------------
#!/usr/bin/python

import Tkinter as tk
import time

def update_timeText():

 # Get the current time, note you can change the format as you wish
 current1 = time.strftime("%H:%M:%S")
 current2 = time.strftime("%H:%M:%S", time.gmtime())
 # Update the timeText Label box with the current time
 timeText1.configure(text=current1)
 timeText2.configure(text=current2)
 # Call the update_timeText() function after 1 second
 root.after(1000, update_timeText)

root = tk.Tk()
root.wm_title("Station Time")

# Create some Labels
timeText1 = tk.Label(root, text="", font=("Helvetica", 175))
timeText1.pack()
timeText2 = tk.Label(root, text="", font=("Helvetica", 175))
timeText2.pack()
Quit = tk.Button(root, text="QUIT", fg="red", command=root.destroy)
Quit.pack(side="bottom")

update_timeText()
root.mainloop()
-----------------------------------------------------------------------------

Thanks to everyone for all the little pushes, they all added up to success.



--
Patrick

On Wed, Sep 7, 2016 at 11:35 AM, Jeff Chapin <chapinjeff at gmail.com> wrote:

> You can also run: sudo strings -a /proc/*/environ | grep DISPLAY
>
> This will check the env for all running processes, and find any that has
> DISPLAY set -- presumably the login prompt will have that set, even if
> nothing else does. This does *not* have to be run from a working X session.
>
> Jeff
>
> On Wed, Sep 7, 2016 at 11:21 AM, Jeffrey Ollie <jeff at ocjtech.us> wrote:
>
> > The display number isn't always 0, try variations of:
> >
> > DISPLAY=:N xeyes
> >
> > where N >= 0.  0, 1 and 10 are possibilities. If that doesn't work, the
> > next time you're in front of the display, open a command prompt and type
> > "echo $DISPLAY" and use that value.
> >
> >
> >
> > On Wed, Sep 7, 2016 at 10:17 AM, Patrick Mcgillan <
> > patrick.mcgillan at gmail.com> wrote:
> >
> > > I have a monitor screen plugged in to the hdmi port on my raspberry
> pi. I
> > > would like to do a remote login and run a python program whose output
> is
> > to
> > > the hdmi port. I am sure it can be done, just haven't figured out the
> > > syntax quite yet.
> > >
> > > Right now, the screen is sitting at login prompt. No keyboard/mouse
> > > attached to the pi. Even trying to get xeyes to come up with xeyes
> > -display
> > > localhost:0.0 only gets me a Error: Can't open display: localhost:0.0
> > >
> > > Something simple I am sure, but its been a long time since playing with
> > > remote xserver.
> > >
> > > Patrick
> > > _______________________________________________
> > > Cialug mailing list
> > > Cialug at cialug.org
> > > http://cialug.org/mailman/listinfo/cialug
> > >
> >
> >
> >
> > --
> > Jeff Ollie
> > The majestik møøse is one of the mäni interesting furry animals in
> Sweden.
> > _______________________________________________
> > Cialug mailing list
> > Cialug at cialug.org
> > http://cialug.org/mailman/listinfo/cialug
> >
>
>
>
> --
> Jeff Chapin
> President, CedarLug, retired
> President, UNIPC, "I'll get around to it"
> President, UNI Scuba Club
> Senator, NISG, retired
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug
>


More information about the Cialug mailing list