TechnicalBooting lonely Linux

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  Manthorp  
 To:  ALL
41672.1 
Eyup all.  With no knowledge of Linux to speak of, I've managed to bodge together a Raspberry Pi with a 3.2" screen running Raspbian to stream all the uses of the work 'lonely' in a terminal window using THIS tutorial.

HERE it is, working.

What I would like is for the Pi to boot straight into a full-screen terminal window running the programme.  

What I currently have to do is:

open a fullscreen terminal window (ctrl+alt+f1)
login: pi
password:raspberry
navigate to the project folder: cd twitter_stream
run the programme: node index.js

Is it possible to write something that will automate all this?

Please excuse my ignorance, I genuinely don't have a clue, i'm just making all of this up as I go along...

"We all have flaws, and mine is being wicked."
James Thurber, The Thirteen Clocks 1951
 
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Manthorp     
41672.2 In reply to 41672.1 
I'll try and fashion something later if someone else hasn't helped.

I'd go down the line of an @reboot crontab line with a simple bash script being executed to run node
0/0
 Reply   Quote More 

 From:  Manthorp  
 To:  ANT_THOMAS     
41672.3 In reply to 41672.2 
You are a sweetie, Mr Ant.  Thank you.

I may have another request to tack on, I'm afraid.  I believed that I could prevent the screen from timing out and blanking  by editing two values at /edit/kbd/config, BLANK_TIME and POWERDOWN_TIME to 0,  so I did so last thing last night (well, 4am this morning, actually); but stumbling downstairs this morning, that doesn't seem to have worked: the window was blank (though on the positive side, index.js was still working when I hit a key and got rid of the blank screen).  If you or anyone else has any inspired ideas for what else I could try, please let me know.  Surely there's an absolute fix for this?
 

"We all have flaws, and mine is being wicked."
James Thurber, The Thirteen Clocks 1951
 
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Manthorp     
41672.4 In reply to 41672.3 
There will definitely be a fix for that. When I played with a similar LCD I had a motion sensor determining when the backlight/screen was on.
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  Manthorp     
41672.5 In reply to 41672.3 
Easiest way to do this would be to install a tiling window manager (since they open things fullscreen by default) like i3 and use a stripped down config which launches a terminal and runs your thing.

If you want to do it (as now) without a window manager then you'll first have to get it to autologin. If the version of Raspian you're using is based on Debian 8+ (and thus uses Systemd) you'll be able to do it this way. If it's based on an older Debian and still uses inittab then you'll be able to do it like this (replacing 'root' with your username).

Then you just need to get it to run the app. I think the easiest way to do that would just be to add it to /etc/profile.

You should be able to prevent blanking on the virtual terminal by running:
Code: 
setterm -blank 0 -powersave off
Which also has to be run on a virtual terminal (i.e. not one inside a graphical desktop).

It doesn't stick though. You can add it as a kernel parameter but it'd be easier to just add that to /etc/profile too, then it'll run every boot.

 
0/0
 Reply   Quote More 

 From:  Manthorp  
 To:  Drew (X3N0PH0N)     
41672.6 In reply to 41672.5 
Thanks Xen.  got to file a tax return now, but I'll be back & try all this out when I'm done.

"We all have flaws, and mine is being wicked."
James Thurber, The Thirteen Clocks 1951
 
0/0
 Reply   Quote More 

 From:  koswix  
 To:  ALL
41672.7 
Hijack: What's the best flavour of linux for Pi these days, the official raspbian or soething else?

I've got a Pi 2 coming today which is going to be used with a touch screen to run the software for my laser cutter (there's one that needs a window manager & one that runs as a node.js thing so need the server components to run, and this then accessed through a browser).

 ▪                    
             ┌────┐    ┌────┐                      
          │    │    │    │ ▪                    
          │    └────┘    │                      
          │   ──┐  ┌──   │ ▪                    
   ┌──────┤    ▪    ▪    │                      
  ┌┘      │              │ ▪                    
┌─┤       └──┐  │  │  ┌──┘                      
│ │          │ ││  ││ │   ┌─┐                   
│ │          └─┼┤  └┴─┴───┘ │                   
│ │           ─┘│           │                   
│ │   ┌──────┐  └┬──────────┘                   
  │   │      │   │                              
  │   │      │   │                              
  └───┘      └───┘                              
If Feds call you and say something bad on me, it may prove what I said are truth, they are afraid of it.
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Manthorp     
41672.8 In reply to 41672.3 
Give drew's suggestion a go first.

I typed all this out then pressed the back button on my mouse :@

sudo raspi-config 

Set it to not go to desktop on boot
http://elinux.org/RPi_raspi-config#boot_behaviour_-_Start_desktop_on_boot.3F

I can't remember if Raspbian does an auto-login, if it doesn't use one of drew's suggestions for that.

sudo nano /usr/local/bin/lonely

Paste in
 
Code: 
#!/bin/sh
#

while true; do
node /home/pi/twitter_stream/index.js
sleep 5
done


sudo chmod +x /usr/local/bin/lonely
to makes it executable

sudo crontab -e
add the line
@reboot /usr/local/bin/lonely
save and exit

reboot

This may work, or may need tweaking slightly.
 
0/0
 Reply   Quote More 

 From:  CHYRON (DSMITHHFX)  
 To:  Manthorp     
41672.9 In reply to 41672.1 
How should we interpret that video? Linux is a pain in the neck?

----
"I could stand in the middle of Fifth Avenue and shoot somebody and I wouldn’t lose any voters"
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  koswix     
41672.10 In reply to 41672.7 
I like Arch. So I like Arch on the RPi too. The benefit of Arch is that it's really simple where simple means no layers of abstraction added on top of things, no configuration tools, everything is as vanilla as possible. Which makes configuring it a breeze once you know what you're doing. The Wiki is great.

If that doesn't appeal then yeah, go with Raspian. It's based on Debian so it's super-solid and very widely used, has tonnes of packages and there's plenty of info out there.

 
0/0
 Reply   Quote More 

 From:  CHYRON (DSMITHHFX)  
 To:  Drew (X3N0PH0N)     
41672.11 In reply to 41672.10 
Stop saying Arch is simple. It's not simple, and that's why nobody else likes it.

----
"I could stand in the middle of Fifth Avenue and shoot somebody and I wouldn’t lose any voters"
0/0
 Reply   Quote More 

 From:  Manthorp  
 To:  koswix     
41672.12 In reply to 41672.7 
Bastard.

"We all have flaws, and mine is being wicked."
James Thurber, The Thirteen Clocks 1951
 
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  CHYRON (DSMITHHFX)     
41672.13 In reply to 41672.11 
simple != easy
0/0
 Reply   Quote More 

 From:  koswix  
 To:  Drew (X3N0PH0N)     
41672.14 In reply to 41672.10 
Some of the laser software can be quite processor intensive (converting an image to a fake raster file, for example), so I think keeping things minimal would be good.

But then I'd also quite like to install XBMC for when I'm not laser cutting :$

 ▪                    
             ┌────┐    ┌────┐                      
          │    │    │    │ ▪                    
          │    └────┘    │                      
          │   ──┐  ┌──   │ ▪                    
   ┌──────┤    ▪    ▪    │                      
  ┌┘      │              │ ▪                    
┌─┤       └──┐  │  │  ┌──┘                      
│ │          │ ││  ││ │   ┌─┐                   
│ │          └─┼┤  └┴─┴───┘ │                   
│ │           ─┘│           │                   
│ │   ┌──────┐  └┬──────────┘                   
  │   │      │   │                              
  │   │      │   │                              
  └───┘      └───┘                              
If Feds call you and say something bad on me, it may prove what I said are truth, they are afraid of it.
0/0
 Reply   Quote More 

 From:  koswix  
 To:  koswix     
41672.15 In reply to 41672.14 
Seems to be a fair bit about setting up Kodi/XBMC in the arch wiki. Wonder if it works the same on the ARM version for Raspberry Pi...

 ▪                    
             ┌────┐    ┌────┐                      
          │    │    │    │ ▪                    
          │    └────┘    │                      
          │   ──┐  ┌──   │ ▪                    
   ┌──────┤    ▪    ▪    │                      
  ┌┘      │              │ ▪                    
┌─┤       └──┐  │  │  ┌──┘                      
│ │          │ ││  ││ │   ┌─┐                   
│ │          └─┼┤  └┴─┴───┘ │                   
│ │           ─┘│           │                   
│ │   ┌──────┐  └┬──────────┘                   
  │   │      │   │                              
  │   │      │   │                              
  └───┘      └───┘                              
If Feds call you and say something bad on me, it may prove what I said are truth, they are afraid of it.
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  koswix     
41672.16 In reply to 41672.14 
Consider dual booting? Maybe from a USB stick running XBMC on Raspbian or OpenElec for super streamline.
0/0
 Reply   Quote More 

 From:  Manthorp  
 To:  Drew (X3N0PH0N)     
41672.17 In reply to 41672.5 
Raspbian autologs in, but when you open a fullscreen terminal it irritatingly asks you to log in again.

"We all have flaws, and mine is being wicked."
James Thurber, The Thirteen Clocks 1951
 
0/0
 Reply   Quote More 

 From:  koswix  
 To:  ANT_THOMAS     
41672.18 In reply to 41672.16 
aye it's a possibility, would like to keep it on one though if possible. If I can keep some (minimal coms) stuff running in the background and watch videos while the laser completes its job that'd be awesome. Amazon man just brought the pi so I'm going to hunt down an SD card and try it out.

 ▪                    
             ┌────┐    ┌────┐                      
          │    │    │    │ ▪                    
          │    └────┘    │                      
          │   ──┐  ┌──   │ ▪                    
   ┌──────┤    ▪    ▪    │                      
  ┌┘      │              │ ▪                    
┌─┤       └──┐  │  │  ┌──┘                      
│ │          │ ││  ││ │   ┌─┐                   
│ │          └─┼┤  └┴─┴───┘ │                   
│ │           ─┘│           │                   
│ │   ┌──────┐  └┬──────────┘                   
  │   │      │   │                              
  │   │      │   │                              
  └───┘      └───┘                              
If Feds call you and say something bad on me, it may prove what I said are truth, they are afraid of it.
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  Manthorp     
41672.19 In reply to 41672.17 
Hmmm. What are you logging in *to*, exactly? I'd assumed from the description that you were just logging in on the virtual console. But 'opening a fullscreen terminal' doesn't make sense in that context (unless you just mean switching TTYs, in which case: don't :D).

Edit: I guess maybe Raspian has some default GUI which starts, which you're logging in to, and then switching to TTY1 with ctrl+alt+f1?

If so, if there's some GUI, find out how to prevent that from starting (since you're not using it).

If not, just use the TTY that it autologs in on. If you want to clear the screen you can just do:
 
Code: 
clear
(You can add that to /etc/profile so that it happens once the login terminal is up)
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  koswix     
41672.20 In reply to 41672.15 
I've only used Kodi on the RPi so I don't know firsthand what it's like elsewhere but I believe it's the same everywhere. It performs really well (especially given how poorly graphical desktops tend to perform on the Pi).
0/0
 Reply   Quote More 

Reply to All  
 

1–20  21–40  …  101

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats