Posts

Showing posts from January 28, 2018

ESP8266 File System

Image
While I still try to get my head around the two different DNS servers I thought it was about time to write another tutorial. In this tutorial I'm going to discuss the use of the Serial Peripheral Interface Flash File System (SPIFFS). This handy library lets you store files on the flash memory of the device. So instead of having to construct a HTML string as a response to a request we can serve up a standard web page. To use SPIFFS you need to include the file "fs.h" at the top of the program and in the setup function you need to start the SPIFFS library using the 'begin' function. This initialises the library and allows you to access any files that are contained within the flash memory. For the purpose of debugging I tend to loop through the file system to list all the files contained on the device. The following lines of code retrieve a reference to the directory structure and then outputs all the files names to the serial port. Finally we need to put

Working in a vacuum

Image
I put the vacuum former  to some serious work this week. I had a good run of making car body shells and owl heads, a little bit of practice and I could turn round each new sheet pretty quickly. Obviously making the owl heads and cars themselves has taken up a little bit longer and it has delayed the next ESP8266 tutorial while I try to figure out DNS. In other news I managed to turn my kitchen into a parking lot.

Stone Age Hut

Image
Eli had to make a stone age scene for his homework, he opted to make a model A frame hut similar to the one recently built on Primitive Technology . We laser cut a base to hold it all together and make it easy to line the sticks up and we laser cut all the palm fronds from crepe paper to go over the top of it. It took all day but he really enjoyed it.

Update from a web page

Image
The next incredibly useful feature for the ESP8266 is the ability to program it directly over the Wifi. This would allow you to build devices that didn't even need a usb serial connection and you can easily update any devices that have been sent out to people already (would have been very handy for me this week). The HTTP web updater is actually part of the standard arduino core and it's incredibly simple to set up. We're going to build upon the web server tutorial  but this functionality can be included in all future programs. Include the ESP8266HTTPUpdateServer.h and declare a new instance of the class for use in the program. The only other thing required to make this work is to tell the update server which web server it should be working with. This is done just before you start the local web server. The arduino environment is able to prepare a new image to upload to the device. In the menu system you can go to "Sketch->Export Compiled Binary&quo