The previous tutorial showed how to create a wifi access point but the ESP8266 didn't do anything once a station was connected. In this tutorial, we build upon the previous access point to serve a simple HTML web page in response to a request from a connected station.
The ESP8266 Webserver library implements a basic web server that allows the ESP to respond to incoming HTTP requests without needing to worry about the low level details of the response. Include the library at the top of the sketch with the line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Next we need to declare a new Web Server object using the HTTP port number, 80. This is the default port that a browser will use.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The ESP web server needs to be continually polled to see if anything is trying to connect to the device. This is done with a single call, placed inside the main loop code for the device
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Now we have set up a web server to respond to HTTP requests we need to tell it what to respond with. These last few lines create a function that replies to a root ("/") request with a simple text response "Hello World!". It is possible to add other URI responses to the webserver, to serve different pages depending on what is requested.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Putting it all together gives us this sample code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Compile the sample code and upload it to the device, you should be able to connect to the wifi network created by the ESP chip. The default IP address for the device is 192.168.4.1 so open a browser and navigate to "http://192.168.4.1/", a page should load showing this response
This is my laser cut cryptex. It features 28 different characters and 9 rings, giving a total possible 10.5 Trillion different combinations. I took a bit of time developing the design so that I could add some nice features. This cryptex file is laid out so that you can have any number of rings in your own design. The best feature is that the codeword is changeable, each locking ring has an outer letter ring that can be placed in any one of the 28 different positions. Once the rings are back in place the ring locking bars can added and they prevent the rings from being modified until the box is open again. It's a bit hard to explain so I made a video showing how it all work ( svg here ) It took a long time to assemble this so I lived with my initial design choices but if I were to remake it I would adjust the file to make the ring locking bars out of 6mm ply and maybe put some blind holes onto the code rings to prevent the code being brute forced.
The RDC6442G controller from Ruida This is going to be quite an image heavy post describing the rewiring needed to convert between the Leetro controller and the Ruida controller. It is also pretty straight forward on the old Just Add Sharks laser cutters because all of the wires are clearly labelled. The controller was prepared in the previous step in order to make this conversion process as smooth as possible. The Leetro (Pad03) panel on the left and the Ruida panel on the right The view from inside the laser looking up at the control panel The control panel is an easy place to start, both panels have just a single cable that runs down to the controller, both panels are a very similar size, with the Ruida panel being slightly smaller underneath so it will fit in the hole left behind easily. The Pad03 panel clips into place so you'll need to reach up inside the machine to work the clips loose. The cable runs down the inside of the laser and is cable tied onto mounti...
This is a binary sequence puzzle box built from 3mm birch plywood, it uses a Gray code pattern to ultimately align all the dials into a rainbow pattern before the lid can be removed. It's actually a redesign of a puzzle inside Loki's box of Tricks because I thought it would make a cool stand alone puzzle box. The files are available for sale in my Etsy store . ( svg here ) The puzzle consists of five interlocking disks that can only rotate when the disks either side of it are in the correct position to allow it. The large wheel in the middle and the disks on the underside of the lid further restrict the rotation of the disks. The large wheel must be pointed to the disk that is being rotated and the large wheel is in turn restricted from pointing to the smaller disks depending on alignment. Once all the disks are aligned into the full rainbow the large wheel is completely free to rotate and can be turned to the edge of the box and allows the lid to be removed. There is a very ...