Reflashing Xiaomi Mijia LYWSD03MMC allows you to read the environment data easily via BLE. Here is are 2 small Nodejs programs to simplify this a lot.
Comparing some tools to make it less dangerous to run code you did not write. Sandboxing seems to be the best way to go like Deno and wasmtime do. But what about Python, Node.js, etc.?
firejail seems to be have hit the sweet spot between “secure” and “convenient”.
Sometimes advertising is fun. I turned off my ad-blocker for certain web pages, and while I usually get boring advertising, once in a while you get a good and interesting looking one. In this case: https://hunt.reaktor.com/ : it’s a programming quest similar to Google Foobar Challenge, but much shorter and simpler, yet with a veryContinue reading “Humanoid Hunt!”
A quick and non-micro benchmark to figure out how the ARM and AMD CPUs I have and what AWS has relate to each other in terms of single-thread performance. Comparison is between AWS t4g-micro (1 CPU) IBM M75q (Ryzen 5 3400GE @ 3.3 GHz) NanoPi R2S (RK3328, 4xCortex A53 @ 1.3GHz, 64 bit) CubieTruck (AllWinnerContinue reading “Benchmarks!”
Since I use Line, using Line Notify is an easy solution to send myself messages. Here’s how it works: Go to https://notify-bot.line.me/my/ and generate a token. Use cURL to send a message: See the API for Line Notify for more details incl. the list of stickers. Here an example using Node.js:
Firebase Cloud Firestore has the nice feature of being able to tell you about changes to its data. Here’s how this looks like using Node.js: Requirement A Firebase Cloud Firestore DB, named ‘messages’. Has 2 entries per document: sender and text, both being strings. Service Account Key Get your service account secret from Get yourContinue reading “Firebase Real Time Updates”
I got some more sensors, like an Bosch BME280 which uses I²C bus. Neat as it can measure temperature, air pressure and humidity. Using it on an OrangePi Zero is simple: Enable the I2C-0 module: in /boot/armbianEnv.txt add “i2c0” (or use i2c1 or i2c2) to the overlay. Create /etc/udev/rules.d/60-i2c-tools.rules with the following content: KERNEL==”i2c-0″ ,Continue reading “BME280 and Node.js on OrangePi”
The easiest way: harald@opz2:~$ cat /sys/bus/w1/devices/28-*/hwmon/hwmon/temp1_input 21812 22375 23375 The problem is that each sensor takes about 800ms (750ms according to data sheet) conversion time. Making this better and reading them concurrently via Node.js: That’s reading all in parallel (plus about 600ms startup time): harald@opz2:~$ node read-temp.js hwmon0 (28-80000004215e): 23.312 hwmon2 (28-0316884578ff): 21.812 hwmon1 (28-0316884fabff):Continue reading “Reading Temperatures from many DS18B20 via Node.js”
The Elastic Stack is a simple way to log “things” into ElasticSearch and make them nicely visible via Kibana. Since ELK can handle logs as well as time series data, I’ll use it for my own logging incl. performance logging. For pure time series data I’d use the TIG stack: Telegraf, InfluxDB and Grafana. InstallingContinue reading “Logging via ElasticSearch”