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.
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
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
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.
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).
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.
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 :$
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.
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)
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).