iwrite two articles about cost of hardware for Gopher - tgtimes - The Gopher Times Err bitreich.org 70
hgit clone git://bitreich.org/tgtimes git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/tgtimes URL:git://bitreich.org/tgtimes git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/tgtimes bitreich.org 70
1Log /scm/tgtimes/log.gph bitreich.org 70
1Files /scm/tgtimes/files.gph bitreich.org 70
1Refs /scm/tgtimes/refs.gph bitreich.org 70
1Tags /scm/tgtimes/tag bitreich.org 70
1README /scm/tgtimes/file/README.md.gph bitreich.org 70
i--- Err bitreich.org 70
1commit 812f6bfe1baa59beec1220bf4e8a4e4db3385c61 /scm/tgtimes/commit/812f6bfe1baa59beec1220bf4e8a4e4db3385c61.gph bitreich.org 70
1parent d9486721b97cbded94d8f48e118f9fce9493f77b /scm/tgtimes/commit/d9486721b97cbded94d8f48e118f9fce9493f77b.gph bitreich.org 70
hAuthor: Josuah Demangeon <me@josuah.net> URL:mailto:me@josuah.net bitreich.org 70
iDate: Sun, 29 Jan 2023 01:52:48 +0100 Err bitreich.org 70
i Err bitreich.org 70
iwrite two articles about cost of hardware for Gopher Err bitreich.org 70
i Err bitreich.org 70
iDiffstat: Err bitreich.org 70
i M opus | 2 +- Err bitreich.org 70
i M opus7/article-athas-shell-redirect… | 2 +- Err bitreich.org 70
i D opus7/article-tgtimes-most-minimal… | 1 - Err bitreich.org 70
i A opus7/article-tgtimes-most-minimal… | 88 +++++++++++++++++++++++++++++++ Err bitreich.org 70
i A opus7/article-tgtimes-most-minimal… | 62 +++++++++++++++++++++++++++++++ Err bitreich.org 70
i A opus7/article-tgtimes-panopticon-e… | 0 Err bitreich.org 70
i A opus7/article-tgtimes-peering-cake… | 0 Err bitreich.org 70
i A opus7/footer.mw | 24 ++++++++++++++++++++++++ Err bitreich.org 70
i A opus7/tgtimes7.mw | 14 ++++++++++++++ Err bitreich.org 70
i A opus7/tgtimes7.pdf | 0 Err bitreich.org 70
i A opus7/tgtimes7.txt | 100 +++++++++++++++++++++++++++++++ Err bitreich.org 70
i Err bitreich.org 70
i11 files changed, 290 insertions(+), 3 deletions(-) Err bitreich.org 70
i--- Err bitreich.org 70
1diff --git a/opus b/opus /scm/tgtimes/file/opus.gph bitreich.org 70
i@@ -1 +1 @@ Err bitreich.org 70
i-v=6 Err bitreich.org 70
i+v=7 Err bitreich.org 70
1diff --git a/opus7/article-athas-shell-redirections.mw b/opus7/article-athas-shell-redirections.mw /scm/tgtimes/file/opus7/article-athas-shell-redirections.mw.gph bitreich.org 70
i@@ -1,6 +1,6 @@ Err bitreich.org 70
i .SH athas Err bitreich.org 70
i Shell Redirections Err bitreich.org 70
i-.2C 60 Err bitreich.org 70
i+.2C 30 Err bitreich.org 70
i . Err bitreich.org 70
i .PP Err bitreich.org 70
i Newcomers to the Unix shell quickly encounter handy tools such as Err bitreich.org 70
1diff --git a/opus7/article-tgtimes-most-minimal-gopher-client-hardware.mw b/opus7/article-tgtimes-most-minimal-gopher-client-hardware.mw /scm/tgtimes/file/opus7/article-tgtimes-most-minimal-gopher-client-hardware.mw.gph bitreich.org 70
i@@ -1 +0,0 @@ Err bitreich.org 70
i-https://github.com/ptrks/AVR-ENC28J60-Examples Err bitreich.org 70
1diff --git a/opus7/article-tgtimes-most-minimal-gopher-client.mw b/opus7/article-tgtimes-most-minimal-gopher-client.mw /scm/tgtimes/file/opus7/article-tgtimes-most-minimal-gopher-client.mw.gph bitreich.org 70
i@@ -0,0 +1,88 @@ Err bitreich.org 70
i+.SH athas Err bitreich.org 70
i+Most minimal gopher client Err bitreich.org 70
i+.2C 30 Err bitreich.org 70
i+. Err bitreich.org 70
i+.PP Err bitreich.org 70
i+Gopher is a protocol allowing browsing text, images interactively, Err bitreich.org 70
i+reach telnet interfaces, and download any file, or open any URL, Err bitreich.org 70
i+for custom action to be chosen by the user. Err bitreich.org 70
i+. Err bitreich.org 70
i+.IP "Network" Err bitreich.org 70
i+One reliable way to fetch the content from internet would be Ethernet, Err bitreich.org 70
i+but convenience and price would push toward using radio transmission Err bitreich.org 70
i+such as WiFi. Err bitreich.org 70
i+.FS Err bitreich.org 70
i+Ethernet would require an extra transceiver chip, while wifi takes mostly Err bitreich.org 70
i+just a wire acting as antenna, which partly explains its low cost. Err bitreich.org 70
i+.FE Err bitreich.org 70
i+. Err bitreich.org 70
i+.IP "Processing" Err bitreich.org 70
i+One inexpensive family of processors featuring a high cost-to-performance Err bitreich.org 70
i+ratio, which also features WiFi, is the ESP32. The C3 iteration even uses Err bitreich.org 70
i+the open-source architecture RISC-V. The speed is decent enough for Err bitreich.org 70
i+decoding JPEG an PNG, or support TLS as used in gophers://. Err bitreich.org 70
i+. Err bitreich.org 70
i+.IP "Display" Err bitreich.org 70
i+The cost of displays have dropped considerably as they invaded the market. Err bitreich.org 70
i+Economy of scale made small color displays even cheaper than Err bitreich.org 70
i+character-based displays. Err bitreich.org 70
i+. Err bitreich.org 70
i+.IP "Input" Err bitreich.org 70
i+Browsing content is a lot about scrolling. Since we do custom hardware, Err bitreich.org 70
i+capacitive touch buttons can be used for little to no extra cost. Err bitreich.org 70
i+This could permit a smooth scrolling through the content. Err bitreich.org 70
i+.FS Err bitreich.org 70
i+Once again, mostly requiring wires, this cuts the price and explain Err bitreich.org 70
i+their popularity. Err bitreich.org 70
i+.FE Err bitreich.org 70
i+. Err bitreich.org 70
i+.IP "Text" Err bitreich.org 70
i+Text is compact and efficient, and bitmap font requires a bit of storage Err bitreich.org 70
i+for all the common non-ASCII characters, but ESP32 have 16MB of flash Err bitreich.org 70
i+storage enough for the entire uncompressed Unifont: Err bitreich.org 70
i+.LK http://unifoundry.com/unifont/ Err bitreich.org 70
i+. Err bitreich.org 70
i+.IP "Audio" Err bitreich.org 70
i+Producing sound does not cost much more than a small audio amplifier, Err bitreich.org 70
i+software for decoding MP3, and a 3.5mm Jack connector. Err bitreich.org 70
i+Very small cost added. Err bitreich.org 70
i+. Err bitreich.org 70
i+.IP "Extension" Err bitreich.org 70
i+an USB interface would allow plugging the device to a computer for Err bitreich.org 70
i+either automation or using a full keybaord. Err bitreich.org 70
i+. Err bitreich.org 70
i+.IP "Power" Err bitreich.org 70
i+A small dedicated battery could be included increasing the cost, Err bitreich.org 70
i+but getting all power from USB would also preserve the choice to Err bitreich.org 70
i+the user, free to chose a wall charger or portable power bank. Err bitreich.org 70
i+. Err bitreich.org 70
i+.IP "Enclosure" Err bitreich.org 70
i+A custom 3D printed case would allow keeping the cost very low Err bitreich.org 70
i+even at small volume production. Err bitreich.org 70
i+. Err bitreich.org 70
i+.PP Err bitreich.org 70
i+There exist boards around 5 USD which would provide all of the above Err bitreich.org 70
i+except audio and a few wires, typically the size of an MP3 player. Err bitreich.org 70
i+The grand total bill of material could realistically approach 10 USD. Err bitreich.org 70
i+An actual product could eventually reach as low as 15 USD if keeping Err bitreich.org 70
i+only a small margin for the seller, and eventually lower if produced Err bitreich.org 70
i+on a larger scale. Err bitreich.org 70
i+. Err bitreich.org 70
i+.PP Err bitreich.org 70
i+Writing the software for such a product from the ground up could take Err bitreich.org 70
i+typically an entire week, including JPEG and PNG decoding libraries, Err bitreich.org 70
i+image and font rendering, writing driver for all the parts involved, Err bitreich.org 70
i+integrating the TCP/IP stack and TLS stack. Err bitreich.org 70
i+. Err bitreich.org 70
i+.PP Err bitreich.org 70
i+While an XML parser able to fetch content over HTTP would be relatively Err bitreich.org 70
i+as difficult to build, this would not permit the same level of user Err bitreich.org 70
i+experience as the Gopher-based project: CSS and JavaScript are becoming Err bitreich.org 70
i+an increasingly frequent requirement to access the Web, and reimplementing Err bitreich.org 70
i+a new compatible rendering engine is not feasible to a single person. Err bitreich.org 70
i+. Err bitreich.org 70
i+.PP Err bitreich.org 70
i+This requirement would in turn affect the minimal performance of the Err bitreich.org 70
i+processing unit used: a processor in the GHz range with RAM in the Err bitreich.org 70
i+GB range, in particular if anticipating future needs of the Web Err bitreich.org 70
i+software system. Err bitreich.org 70
1diff --git a/opus7/article-tgtimes-most-minimal-gopher-server.mw b/opus7/article-tgtimes-most-minimal-gopher-server.mw /scm/tgtimes/file/opus7/article-tgtimes-most-minimal-gopher-server.mw.gph bitreich.org 70
i@@ -0,0 +1,62 @@ Err bitreich.org 70
i+.SH tgtimes Err bitreich.org 70
i+Most minimal Gopher server Err bitreich.org 70
i+. Err bitreich.org 70
i+.PP Err bitreich.org 70
i+Gopher is a protocol providing a gateway to a document system, allowing Err bitreich.org 70
i+to serve an organized hierarchy of files over the network. Dynamically Err bitreich.org 70
i+generating the content as per user requests is also possible. The client Err bitreich.org 70
i+side is in charge of rendering the content as it sees fit. Err bitreich.org 70
i+. Err bitreich.org 70
i+.PP Err bitreich.org 70
i+Generating Gopher indexes and transmitting file contents or generated Err bitreich.org 70
i+contents is low in software compmlexity, and in turn allows less expensive Err bitreich.org 70
i+hardware to be run than complex web stacks. Err bitreich.org 70
i+. Err bitreich.org 70
i+.PP Err bitreich.org 70
i+Which cost would we end-up for building a minimal piece of hardware able Err bitreich.org 70
i+to host the Gopher protocol acheiving all of the above? Err bitreich.org 70
i+The Gopher Times investigates. Err bitreich.org 70
i+. Err bitreich.org 70
i+.IP "Communication" Err bitreich.org 70
i+While WiFi is inexpensive and fits moving device gracefully, the Err bitreich.org 70
i+reliability of Ethernet is indicated for a server. Ethernet adds Err bitreich.org 70
i+1 USD of cost for the transceiver handling the electricial characteristics Err bitreich.org 70
i+of Ethernet. These typically expose an RGMII interface. Err bitreich.org 70
i+. Err bitreich.org 70
i+.IP "Processing" Err bitreich.org 70
i+A microcontroller featuring an Ethernet peripheral (with an RGMII Err bitreich.org 70
i+interface) could be the popular STM32F103, or an alternative Err bitreich.org 70
i+compatible part. Enough processing power would be present for an Err bitreich.org 70
i+embedded TCP/IP and a TLS stack. Err bitreich.org 70
i+. Err bitreich.org 70
i+.IP "Automation" Err bitreich.org 70
i+In addition, most microcontrollers feature a large range of Err bitreich.org 70
i+built-in peripheral such as timers and communication or analog Err bitreich.org 70
i+interfaces, enabling automation of devices such as lighting, Err bitreich.org 70
i+heating, laundry, motors, or an entire car, through external Err bitreich.org 70
i+modules. This would come for no extra cost. Err bitreich.org 70
i+. Err bitreich.org 70
i+.IP "Storage" Err bitreich.org 70
i+A slot for a MicroSD card would allow storing and updating Err bitreich.org 70
i+the static content to serve, and storing network configuration. Err bitreich.org 70
i+. Err bitreich.org 70
i+.IP "Scripting" Err bitreich.org 70
i+There exist project to fit programming languages onto microcontrollers. Err bitreich.org 70
i+Separate projects for supporting a subset of each of Python, Ruby, Err bitreich.org 70
i+Javscript, Go, Rust, Lua, Forth and more. Err bitreich.org 70
i+. Err bitreich.org 70
i+.IP "Power" Err bitreich.org 70
i+By letting power supply happen through the USB port, a large range Err bitreich.org 70
i+of power source can be used, such as battery, solar panels, wind Err bitreich.org 70
i+turbine, hydropower, or power outlet. Err bitreich.org 70
i+. Err bitreich.org 70
i+.PP Err bitreich.org 70
i+The bill of materials for such a design would approximate 5 USD. Err bitreich.org 70
i+A marketed device with a small margin for the seller could reach Err bitreich.org 70
i+as low as 10 USD. Err bitreich.org 70
i+. Err bitreich.org 70
i+.PP Err bitreich.org 70
i+Interestingly, such a device would also be able to provide an Err bitreich.org 70
i+equivalent Web service able to work with all Web client, but Err bitreich.org 70
i+not running the existing popular Web server software stacks Err bitreich.org 70
i+known as "Web Frameworks". Err bitreich.org 70
1diff --git a/opus7/article-tgtimes-panopticon-effect.mw b/opus7/article-tgtimes-panopticon-effect.mw /scm/tgtimes/file/opus7/article-tgtimes-panopticon-effect.mw.gph bitreich.org 70
1diff --git a/opus7/article-tgtimes-peering-cake.mw b/opus7/article-tgtimes-peering-cake.mw /scm/tgtimes/file/opus7/article-tgtimes-peering-cake.mw.gph bitreich.org 70
1diff --git a/opus7/footer.mw b/opus7/footer.mw /scm/tgtimes/file/opus7/footer.mw.gph bitreich.org 70
i@@ -0,0 +1,24 @@ Err bitreich.org 70
i+.SH you Err bitreich.org 70
i+Publishing in The Gopher Times Err bitreich.org 70
i+.2C 10v Err bitreich.org 70
i+. Err bitreich.org 70
i+.PP Err bitreich.org 70
i+Want your article published? Err bitreich.org 70
i+Want to announce something to the Gopher world? Err bitreich.org 70
i+. Err bitreich.org 70
i+.PP Err bitreich.org 70
i+Directly related to Gopher or not, Err bitreich.org 70
i+reach us on IRC with an article in any format, Err bitreich.org 70
i+we will handle the rest. Err bitreich.org 70
i+. Err bitreich.org 70
i+.DS Err bitreich.org 70
i+ircs://irc.bitreich.org/#bitreich-en Err bitreich.org 70
i+gopher://bitreich.org/1/tgtimes/ Err bitreich.org 70
i+git://bitreich.org/tgtimes/ Err bitreich.org 70
i+.DE Err bitreich.org 70
i+. Err bitreich.org 70
i+.PP Err bitreich.org 70
i+Did you notice the new layout? Err bitreich.org 70
i+We now can jump between single and double column as it is more fit: Err bitreich.org 70
i+Some large code chunks will not fit in a two-column layout, Err bitreich.org 70
i+but text is more pleasant to read on two columns. Err bitreich.org 70
1diff --git a/opus7/tgtimes7.mw b/opus7/tgtimes7.mw /scm/tgtimes/file/opus7/tgtimes7.mw.gph bitreich.org 70
i@@ -0,0 +1,14 @@ Err bitreich.org 70
i+.TL Err bitreich.org 70
i+The Gopher Times Err bitreich.org 70
i+.AB Err bitreich.org 70
i+Opus 7 - Gopher news and more - Jan. 2023 Err bitreich.org 70
i+.AE Err bitreich.org 70
i+. Err bitreich.org 70
i+.so opus7/article-athas-shell-redirections.mw Err bitreich.org 70
i+.so opus7/article-tgtimes-10-cent-risc-v-mcu.mw Err bitreich.org 70
i+.so opus7/article-tgtimes-a-billion-gopher.mw Err bitreich.org 70
i+.so opus7/article-tgtimes-most-minimal-gopher-client-hardware.mw Err bitreich.org 70
i+.so opus7/article-tgtimes-panopticon-effect.mw Err bitreich.org 70
i+.so opus7/article-tgtimes-peering-cake.mw Err bitreich.org 70
i+. Err bitreich.org 70
i+.so opus6/footer.mw Err bitreich.org 70
1diff --git a/opus7/tgtimes7.pdf b/opus7/tgtimes7.pdf /scm/tgtimes/file/opus7/tgtimes7.pdf.gph bitreich.org 70
iBinary files differ. Err bitreich.org 70
1diff --git a/opus7/tgtimes7.txt b/opus7/tgtimes7.txt /scm/tgtimes/file/opus7/tgtimes7.txt.gph bitreich.org 70
i@@ -0,0 +1,100 @@ Err bitreich.org 70
i+ Err bitreich.org 70
i+ Err bitreich.org 70
i+ Err bitreich.org 70
i+ The Gopher Times Err bitreich.org 70
i+ Err bitreich.org 70
i+____________________________________________________________ Err bitreich.org 70
i+ Err bitreich.org 70
i+ Opus 7 - Gopher news and more - Jan. 2023 Err bitreich.org 70
i+____________________________________________________________ Err bitreich.org 70
i+ Err bitreich.org 70
i+ Err bitreich.org 70
i+ Err bitreich.org 70
i+ Err bitreich.org 70
i+ Shell Redirections athas Err bitreich.org 70
i+____________________________________________________________ Err bitreich.org 70
i+ Err bitreich.org 70
i+ Newcomers to the Unix shell quickly encounter handy Err bitreich.org 70
i+ tools such as sed(1) and sort(1). This command prints Err bitreich.org 70
i+ the lines of the given file to stdout, in sorted or- Err bitreich.org 70
i+ der: Err bitreich.org 70
i+ Err bitreich.org 70
i+ $ sort numbers Err bitreich.org 70
i+ Err bitreich.org 70
i+ Soon after, newcomers will also encounter shell redi- Err bitreich.org 70
i+ rection, by which the output of these tools can conve- Err bitreich.org 70
i+ niently be read from or stored in files: Err bitreich.org 70
i+ Err bitreich.org 70
i+ $ sort < numbers > numbers_sorted Err bitreich.org 70
i+ Err bitreich.org 70
i+ Our new user, fascinated by the modularity of the Unix Err bitreich.org 70
i+ shell, may then try the rather obvious possibility of Err bitreich.org 70
i+ having the input and output file be the same: Err bitreich.org 70
i+ Err bitreich.org 70
i+ $ sort < numbers > numbers Err bitreich.org 70
i+ Err bitreich.org 70
i+ But disaster strikes: the file is empty! The user has Err bitreich.org 70
i+ lost their precious collection of numbers - let's hope Err bitreich.org 70
i+ they had a backup. Losing data this way is almost a Err bitreich.org 70
i+ rite of passage for Unix users, but let us spell out Err bitreich.org 70
i+ the reason for those who have yet to hurt themselves Err bitreich.org 70
i+ this way. Err bitreich.org 70
i+ Err bitreich.org 70
i+ When the Unix shell evaluates a command, it starts by Err bitreich.org 70
i+ processing the redirection operators - that's the '>' Err bitreich.org 70
i+ and '<' above. While '<' just opens the file, '>' Err bitreich.org 70
i+ *truncates* the file in-place as it is opened for Err bitreich.org 70
i+ reading! This means that the 'sort' process will du- Err bitreich.org 70
i+ tifully read an empty file, sort its non-existent Err bitreich.org 70
i+ lines, and correctly produce empty output. Err bitreich.org 70
i+ Err bitreich.org 70
i+ Some programs can be asked to write their output di- Err bitreich.org 70
i+ rectly to files instead of using shell redirection Err bitreich.org 70
i+ (sed(1) has '-i', and for sort(1) we can use '-o'), Err bitreich.org 70
i+ but this is not a general solution, and does not work Err bitreich.org 70
i+ for pipelines. Another solution is to use the Err bitreich.org 70
i+ sponge(1) tool from the "moreutils" project, which Err bitreich.org 70
i+ stores its standard input in memory before finally Err bitreich.org 70
i+ writing it to a file: Err bitreich.org 70
i+ Err bitreich.org 70
i+ $ sort < numbers | sponge numbers Err bitreich.org 70
i+ Err bitreich.org 70
i+ The most interesting solution is to take advantage of Err bitreich.org 70
i+ subshells, the shell evaluation order, and Unix file Err bitreich.org 70
i+ systems semantics. When we delete a file in Unix, it Err bitreich.org 70
i+ is removed from the file system, but any file descrip- Err bitreich.org 70
i+ tors referencing the file remain valid. We can ex- Err bitreich.org 70
i+ ploit this behaviour to delete the input file *after* Err bitreich.org 70
i+ directing the input, but *before* redirecting the out- Err bitreich.org 70
i+ put: Err bitreich.org 70
i+ Err bitreich.org 70
i+ $ (rm numbers && sort > numbers) < numbers Err bitreich.org 70
i+ Err bitreich.org 70
i+ This approach requires no dependencies and will work Err bitreich.org 70
i+ in any Unix shell. https://github.com/ptrks/AVR- Err bitreich.org 70
i+ ENC28J60-Examples Err bitreich.org 70
i+ Err bitreich.org 70
i+ Err bitreich.org 70
i+ Err bitreich.org 70
i+ Publishing in The Gopher Times you Err bitreich.org 70
i+____________________________________________________________ Err bitreich.org 70
i+ Err bitreich.org 70
i+ Want your article published? Want to announce some- Err bitreich.org 70
i+ thing to the Gopher world? Err bitreich.org 70
i+ Err bitreich.org 70
i+ Directly related to Gopher or not, reach us on IRC Err bitreich.org 70
i+ with an article in any format, we will handle the Err bitreich.org 70
i+ rest. Err bitreich.org 70
i+ Err bitreich.org 70
i+ ircs://irc.bitreich.org/#bitreich-en Err bitreich.org 70
i+ gopher://bitreich.org/1/tgtimes/ Err bitreich.org 70
i+ git://bitreich.org/tgtimes/ Err bitreich.org 70
i+ Err bitreich.org 70
i+ Did you notice the new layout? We now can jump be- Err bitreich.org 70
i+ tween single and double column as it is more fit: Some Err bitreich.org 70
i+ large code chunks will not fit in a two-column layout, Err bitreich.org 70
i+ but text is more pleasant to read on two columns. Err bitreich.org 70
i+ Err bitreich.org 70
i+ Err bitreich.org 70
i+ Err bitreich.org 70
i+ Err bitreich.org 70
.
Response:
text/plain