adam.weber.1981
Posts: 2
Joined: Thu Feb 26, 2015 4:06 pm

An idea for Headless Operation.

Thu Feb 26, 2015 4:20 pm

So I've had this idea in my head, and I've been trying to get it all figured out:
Basically, I want to be able to access the RPi on my network through a browser and the IP address that will bring up a web based/browser page that includes links and commands for ease of use.

Overall, for instance, someone could bring up a fresh Raspbian install, and when they remote into the RPi through a browser over wired ethernet, the page would display a link to configure WPA1/2, download an install script for a project, such as RetroPie, PiPlay, Kodi, or anything, really, that installs through a script or an apt-get.

Obviously, as I went along, it would become more in depth, but the purpose of this project would be to get users going as quickly as possible on their projects. Even if the links didn't directly start the scripts, maybe they could just display the specific commands necessary in a terminal to download. When someone clicks the RetroPie link, it could either immediately start

Code: Select all

cd
git clone git://github.com/petrockblog/RetroPie-Setup.git

cd RetroPie-Setup
chmod +x retropie_setup.sh
sudo ./retropie_setup.sh
in the terminal or it could possibly just tell the user exactly how to do it.

The point is that I'm asking for help in getting oriented exactly on how this could be worked the most efficiently. Thanks.

W. H. Heydt
Posts: 11064
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: An idea for Headless Operation.

Thu Feb 26, 2015 5:23 pm

While I can see some merit, in the idea of making Pi set up easier, at the same time I have to question if this is truly a good idea. The primary purpose behind the Pi is get away from "computer as a black box" mentality, exposing kids to the real guts and giving them a chance to learn how computers actually work.

I see such a project as antithetical to the goals behind the Pi. However, don't let that stop you from proceeding if only because it will be a learning experience to pursue the project.

adam.weber.1981
Posts: 2
Joined: Thu Feb 26, 2015 4:06 pm

Re: An idea for Headless Operation.

Thu Feb 26, 2015 5:26 pm

Well, that's why I also included the idea of merely showing the commands to use, instead of actually running them through the page.

But, and let's be a little honest, it's not like RetroPie is designed completely for education. :)

User avatar
experix
Posts: 204
Joined: Mon Nov 10, 2014 7:39 pm
Location: Coquille OR
Contact: Website

Re: An idea for Headless Operation.

Fri Feb 27, 2015 3:35 pm

maybe this is a bit off-topic, but--
I have a program with its idiosyncratic display language that I want to run headless. The program needs to get a command line via readline() and turn the echos from readline (going over stdout) into display commands that go over the network to the remote 'head'. The trouble is, when I dup2 the socket fd onto stdin so readline can get its input, apparently readline decides it is not connected to a terminal and so does not echo, although it does correctly gather the input. Does anybody know how to make readline echo under these conditions? Or maybe I can set up a thread that reads the socket and stuffs the data into stdin by using ungetc()?

User avatar
mrpi64
Posts: 931
Joined: Sat Feb 16, 2013 5:13 pm

Re: An idea for Headless Operation.

Fri Feb 27, 2015 6:52 pm

With Python.

You could have a simple web server (which is actually easier than you think - Python has a web server module built-in), and have it serve "non-existing" pages, i.e: whatever you see in your web browser would be determined by the server. It could display a lit of commands, and maybe use JavaScript to request the server for a cmd command. JavaScript could auto-refresh the page, or you could have a terminal-style box that doesn't refresh the page all the time, as that would be quite slow and put some pressure on the Pi.
I'm happy to help.
https://www.raspberrypi.org/forums/viewtopic.php?f=78&t=51794 - List of games that work on the Pi.

Return to “General discussion”