Topic: NeTV internal web server
I assume that NeTVServer is the internal web server. Is it based on Apache. Is there a cgi-bin directory and can I call server scripts.
Any PHP support or only shell scripts supported?
thanks
dan
You are not logged in. Please login or register.
chumbysphere forum → NeTV → NeTV internal web server
I assume that NeTVServer is the internal web server. Is it based on Apache. Is there a cgi-bin directory and can I call server scripts.
Any PHP support or only shell scripts supported?
thanks
dan
Hi dlovy,
The internal web server is available at http://git.chumby.com.sg/git/chumby-sg/chumby-netvserver.git. It's written in Qt. Many of the commands the web browser calls are outright shell scripts located under /usr/share/netvserver/
No PHP support, but it should be easy enough to compile Apache and/or Lighttpd with PHP support.
Thanks,
One more question. Are cookies supported? If so, where are they stored.
d.
I think I found the cookies directory. Will test. (oops, they don't appear to be stored in the cookies directory. cookies seem to work just can't find where they are stored)
Is it easy to add scripts to /usr/share/netvserver/docroot/scripts directory and add the command to bridge that will generate the response?
thanks again.
Cookies is sort-of working, but we have not fully tested it yet.
A simple demo is located at http://xxx.xxx.xxx.xxx/session
Alternatively, you can use GetParam & SetParam commands.
You can add a new script to, for eg. /usr/share/netvserver/docroot/scripts/myscript.sh (remember to chmod +x)
And call http://xxx.xxx.xxx.xxx/bridge?cmd=myscript
It will give you the output from the script.
Note that the returned XML might not be well-formed since the shell's output is neither XML-escaped nor URI-encoded.
Alternatively, if you like it raw, just call http://xxx.xxx.xxx.xxx/scripts/myscript.sh
I'll try that as well. How do I pass parameters to the shell script?
thanks,
dan
You can pass data to the scripts in this manner
http://10.0.88.1/scripts/myscript.sh?pa … ram3=ccccc
---------------------
#!/bin/bash
uname -a
chumby_version -f
echo "\$1 = $1"
echo "\$2 = $2"
echo "\$3 = $3"
echo "num = $#"
# you can really kill yourself too
#killall NeTVServer
#reboot
---------------------
will give you this response:
Linux localhost.localdomain 2.6.28 #1 Mon Oct 10 17:17:41 SGT 2011 armv5tejl GNU/Linux
19
$1 = ccccc
$2 = bbbbbb
$3 = aaaaaa
num = 3
Notice the reversed order of the parameters.
Since shell script parameters doesn't use key=value pair like POST/GET, the name (param1,2,3) doesn't really matter. You can have it anything you like, eg. This has the same meaning: blah1=aaaaaa&blah2=bbbbbb&blah3=ccccc
However, the lexicon order of the names are used when passed to the shell script.
So, the following will give you the opposite order
http://10.0.88.1/scripts/myscript.sh?zz … ;xxx=ccccc
$1 = aaaaaa
$2 = bbbbbb
$3 = ccccc
num = 3
Wiki page has been updated with this
http://wiki.chumby.com/index.php/NeTV_w … om_scripts
This is great!
this should give us everything we need.
Thanks for all your help
dan
You might find the newly documented Key, NeCommand, Uploadfile, UnlinkFile commands very interesting too.
Particularly the almighty powerful NeCommand command.
"With great power, comes great responsibility"
They are already available in your current firmware (fwver=19).
Note that they are still in development, the input & output might be changed slightly in next release.
so I could in fact upload a .swf file and run it all from a web page?
cool. saves a lot of work.
dan
chumbysphere forum → NeTV → NeTV internal web server
Powered by PunBB, supported by Informer Technologies, Inc.