One is a Java Script file that displays the clock on the web page. One is the php file that contains the web page code. So, I have attached the actual files to this project. I had planned on posting the code in this log file but I discovered that when I do that all the formatting is lost. And two, it works for now and gets the Magic Mirror project up and running in a day instead of weeks because it's simple. One, that is how it was coded in a class I took (that is where the code comes from). I just put the weather and news feed in there for two reasons. In the long run I will probably change all of it myself, once I get my head around how to code the AI and voice recognition stuff. You may also want to replace the news feed with something else, and that's OK, right now it is showing national news in the USA. Unless you live in Denison, Iowa you would want to replace the weather RSS feed anyway so that not working is not really an issue. So you can just cut and paste it into your editor and be done. The code below works except for the weather RSS feed as I said before. So, whatever you want to do man, just get er done. I just used nano, and it worked just fine. If you have a favorite HTLM or PHP editor installed on your RPI (I don't know of one), then you could us it to code this next step. Good luck!Īssuming everything went well, we are ready to write some HTML / PHP! If you don't get that something went wrong! Go back and try to delete and recreate the index.php file, then test again. You should get several pages of nicely formatted information about the PHP5 environment. Test the web server with the new index.php file by opening the Chromium browser and entering "localhost" for the URL. Create a new file called index.php using the following command sudo echo "" | sudo tee index.php (make sure you include the quotes).Ĥ. sudo apt-get install libapache2-mod-php5 php5 php-pear php5-xcache.ģ. Install PHP5 using the following command. Now do another "ls -l to ensure it is gone.Ģ. Navigate to /var/Delete that file with the following command "sudo rm index.html". Next lets do a couple of things needed to start writing some code.ġ. Under Localisation, select and change your language preferences and change your date and time to match your local area. This will cause the RPI to boot into the desktop GUI as user pi automatically.ģ. Under Boot Options, select "Desktop Autologin". This will ensure you are using all available space on the SD card.Ģ. Under advanced options find and select "Expand Filesystem". However, the code does work, so if you want to copy my code and stick your own weather feed link in there it should work just fine 4 U.įrom the command line, type raspi-config to pull up the configuration GUI and make the following changes.ġ. The problem is, I can't find an RSS / XML weather link for my area just yet. I am still working on getting the weather RSS feed to work. OK, today we are going over all remaining steps needed to get the Raspberry Pi set up to display a simple web page that shows the date and time in the top left corner, and three news feeds right justified in the middle section.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |