Raspstill2web: control a RasbBerry Pi Camera from a webpage / with own server and WIFI APv1.0 (maj: 05/04/2016)
This little software has been created to control a Raspberry PI camera from a webpage using wifi. The Raspberry PI is hosting its own WIFI AP. This can be used for an example for the Pikon Telescope. The program is provided without any warranty nor support as a GNU GPLv3 source-code : feel free to modify and fork. You basicaly just have to add a cheap wifi dongle to the the Pikon telescope kit to allows it to work autonomously, without keyboard nor screen...
Focus is made on simplicity. The camera can be controled with any computer, tablet or cell phone using WiFi. Some parameters are tunables from the web interface. The main (and unique...) page presents a dynamicaly updating (low-res) camera window which allows you to focus the camera, change settings... Once done, the "Take picture" button allows to take a high resolution picture with said parameters.
It is strongly advised to install the following on a fresh raspian installation, to avoid compatibility problem. Make sure the raspberry pi is connected to internet (via ethernet) and has been udpdated (sudo apt-get update + sudo apt-get upgrade). You would also have already activated and tested the camera (sudo raspi-config). It is also advised to deactivate the x-windows interface, to keep only the command line shell, to make the raspberry faster to boot and use (sudo raspi-config, boot options, console boot).
- Install the webserver Apache with PHP (this is a single command, juste copy and paste the italic text...): sudo apt-get -y install apache2 && sudo apt-get -y install php5 && a2enmod php5
- Configure the webserver (this is a single command, juste copy and paste the italic text...) : sudo rm -f /etc/apache2/sites-enabled/000-default.conf && sudo rm -rf /var/www/* && cd ~ && echo "" > oursite.conf && echo "DocumentRoot /var/www/" >> oursite.conf && echo "" >> oursite.conf && sudo mv oursite.conf /etc/apache2/sites-enabled/ && sudo service apache2 restart
- Install the program (this is a single command, juste copy and paste the italic text...): sudo curl -o /var/www/index.php http://opensource.grisambre.net/raspistill2web/raspistill2web.txt && sudo chown www-data:www-data /var/www/index.php
- Give our program autorisation to work: sudo visudo then add a line at the end containing: www-data ALL=(ALL) NOPASSWD: ALL then save
Now, you can check, using the LAN, that the website is working. You may first wish to identify the raspberry-pi IP address with the command ifconfig eth0 | grep "inet adr". For an example, my own raspberry-pi IP address is 192.168.1.16. Then, on your computer, open a we browser and check "http://192.168.1.16/".
Then, you may with to configure your raspberry-pi as a WIFI Access-point, to be able to work without a LAN, and "in the fields" The best is to follow this other site that explains how to.... Attention, the ip address to lookup the application in Wifi mode will be different from the LAN one, you configure it during the WIFI-AP procedure.
Bug report : opensource (arobase) grisambre (dot) net