I was checking an old hard drive backup when I came across a webpage I posted in 1998 of benchmark results, for various Smalltalk implementations run on a 166MMX Pentium desktop computer (typical for the time). The benchmark was published by the Smalltalk Industry Council (no longer in existence) and all I did was tweak the source to compare available Smalltalk implementations and Java. The page is reproduced here. Out of curiosity, I tweaked the code to run in Toit on an ESP32-WROOM-32E, which yielded the following numbers:...
Using TFTP
Recently I posted on using MQTT to collect air quality data from an IKEA VINDRIKTNING air quality sensor. The WiFi around my house appears to be subject to numerous, brief interruptions, causing problems for the TCP connection MQTT maintains between client and gateway. For the devices that need to deep-sleep, MQTT-SN is used, but it would preferable to use a single protocol for both wall and battery powered devices. Trivial File Transfer Protocol (TFTP) offers a connectionless transport for file transfer, with a single outstanding response/request handshake over UDP....
Interfacing to an IKEA VINDRIKTNING air sensor
Posted as a ‘Show and tell’ on Toit Discussions, Interfacing to an IKEA VINDRIKTNING air sensor, including source and a video demonstration.
Power consumption, revisited
About a year and a half ago I posted about the power consumption observed running Toit on the ESP32 Huzzah. Since then, there have been a couple of developments that significantly reduce power consumption. Deep sleep The first, was support for deep sleeping the ESP32 while not being used. In a lot of typical programs, the code starts, runs some initialization, then enters a potentially indefinite while true: loop where you do some task, then long sleep....
Using websockets to update a browser page
Posted as a ‘Show and tell’ on Toit Discussions, Using websockets to update a browser page, including source. A counter is updated on button clicks, without refreshing the page: This technique was used in the Fuzzy Logic project to directly manipulate the fuzzy model inputs on the ESP32, via an onboard webserver:
A tank level simulation and control
I posted a ‘Show and tell’ on Toit Discussions, A tank level simulation and control, including source and a demonstration video.
Creating a library, using Jaguar
The original post on creating a Toit Library was written a year ago, when Toit was only offered as closed source. Since then, the Toit language has been open sourced and Jaguar tooling added. An update of the original article, using Jaguar v1.7.1 to revise and run the project FW_Keyboard was posted as a Show and tell on Toit Discussions.
Reporting data from a sleepy device
I posted a ‘Show and tell’ on Toit Discussions, Reporting data from a ‘sleepy’ device, including source and demonstration video.
Porting a Fuzzy Logic library to Toit
A while ago I used to design utility boiler control systems. Before machine learning (ML), there was a lot written in the control journals about fuzzy systems, but for me most of the articles were deeply theoretical and unapproachable. Recently there has been some comment that although the ML models are highly effective, they are largely opaque to inspection. That sparked my interest in fuzzy logic again, as fuzzy logic (FL) enables observed knowledge of system behaviour to be captured in rules and linguistic terms … “if it is hot, then run the fan fast” … and thus why the controller was running the fan fast could be deduced....
An example of creating a Toit library
(updated Oct 29, to reflect CLI v1.14.0) (updated Dec 22, to reflect CLI v1.17.0) I have written a couple of toy applications in Toit and wanted to create a library for the Solder Party Keyboard FeatherWing. Following the Package quick start guidance I could not get the source to compile. The Toit team responded on Slack and got me going, so although the Toit documentation should be considered definitive, the following notes may be useful to some....