bkm888
Posts: 13
Joined: Fri Jan 13, 2017 8:56 pm

How can I use web page form data to control RPi boot up?

Sun Jan 22, 2017 7:54 pm

This is my second attempt to explain what I am trying to do. After reading my first attempt I deleted it out of frustration. However I think I can at least explain what I am trying to do this time.

I have a RPi 3 operating as apache2/php server that serves up simple web pages to 4 other RPi's as sort of digital signs. In order to make it easier to use (and prevent myself from having to constantly SSH into display units it to make edits) I have loaded apache2 on each of the display pi's as well. It is my idea that the apache server on the display units will allow me to create a default start page that would be a form for a user to populate with boot settings. Most importantly is to allow the pi to be moved from screen to screen and allow user to alter things such as screen resolution and hdmi type in the /boot/config.txt. This was needed because the screens themselves get changed out every few weeks and do not always have the same characteristics as the one before.

By using the web server on the display units, A user can call them up in a browser anywhere on the network and immediately be on the settings page to make the adjustments needed for the new screen. When they are done and click the "Submit" button the settings are stored as variables that /boot/config.txt can use on the next reboot. The submit button can also execute the
"window.close()"; to finish it off.

My problem is the variables used to store the form input values from the web form seems to only be available to the browser. I have no idea how to make them useful to the server scripts. I know how to create the web pages and forms, and even use form input in other pages. Just cannot get that data to the server for use in bash scripts.

Much searching has lead me to ways to populate a form from a bash command, but not the reverse.

What am I missing here? I feel like puppy chasing his own tail. :oops:

Thanks a bunch if you can point me in the right direction.

BKM888

gkreidl
Posts: 6307
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: How can I use web page form data to control RPi boot up?

Mon Jan 23, 2017 5:42 am

You have to write some kind of script which runs as a daemon and is started as root (e.g. using sudo), because it has to modify the /boot/config.txt file. An easy way might be
1) Watch for existence of a certain file every minute.
2) If the file is found, analyze it and modify /boot/config.txt accordingly.
3) delete the file
4) reboot the system.

Then all your web form component (using PHP or whatever) has to do is to create that special file if the user submits the form.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

Return to “Beginners”