With all home automation systems and personal project websites that build electronics and software hobbyists in their free time, they really add up. Before you know it, you may have a closet full of single-board computers that serve old web applications that have not been touched since the IPOD click wheel was introduced. After all this time, this hardware could lose its steam.
The upgrade to new single board computer may be the most sensible option, but Bogdan Ionescu has an interesting way to help this hardware to get his steam (or rather aerosol) back. Ionescu has proven that the ridiculously overwhelmed disposable vapes that are all over the parking lots can be done completely well Web server – as long as you don't have to push them too much.
Ionescu collected disposable vapes for years to save the batteries. But when the devices became more demanding, he began to think about what other hardware repeated. In newer vapes he discovered instead of the expected epoxy -bloted ASICS microcontrollers from Puya. These special chips have a 24 MHz arm Cortex-M0+ CPU, 24 kb flash memory and 3 kb RAM in the PY32 series. That may not be much power, but it is hardly worth describing as a “available”.
There are resources to save (📷: Bogdan Ionescu)
The idea of ​​using one of these vapes as a web server came after experimenting with semi hosting, which is a debugging function with which a embedded microcontroller can hand over to a host device. With the chain of semi-hosting with old school slip (series line internet protocol), Ionescu Linux was able to obtain the vape like a dial-up modem. From there, he was able to transmit real IP packages by running UIP and received a light TCP/IP stack that was developed for memory operating systems.
At first the results were quite terrible, with pings of 1.5 seconds, 50% package loss and websites that lasted more than 20 seconds to load them. But the bottleneck was the byte-by-byte handling of slip packages. By adding a ring buffer to Cache -Leads and Batching writing processes, Ionescu triggered the full potential of the vape. The pings fell to 20 ms, the loss of package disappeared and complete websites in about 160 ms.
With almost 1.4 KB RAM, room was still done for other small tasks, and only about 20% of the flash storage was used. This left enough space to host his entire blog post and even add a simple JSON -API reporting request and the unique ID of the device.
Of course, this will not replace the data centers so soon. Twenty kilobytes of memory do not leave much space for web frameworks, and the setup depends on a connected debugger. Nevertheless, the experiment shows how much hidden computing power is available in everyday devices that are designed for the away distance.