-
Logging RTT data directly to Google Sheets
Raise your hand if you have ever used this flow: output some data from an embedded system to a terminal or a CSV file to analyze it later in a spreadsheet. Whether logging traffic latency over a bus, measuring system performance in a climate chamber, logging memory usage over a weekend, to checking GNSS time to first fix across several days. I did this flow sooo many times. I wondered if there is a better way to handle data from these one-off experiments. Building a dedicated database would be overkill as "you only have to plot one variable across 24 hours" but what about... Google Docs?!
Read more... -
Practical test of TP-Link TL-PA7027P AV1000 Powerline adapters
I had trouble getting reliable WiFi from my router to my main workstation. All 2.4 GHz channels are totally full in my location. The 5 Ghz connection seemed pretty okay but suffered from random dropouts lasting around 20 seconds. Most of the time I can tolerate low speed but it has to be reliable. I just can not tolerate total dropouts. I could not run new wires so I decided to try powerline adapters as a last resort.
Read more... -
Simple hard drive SMART monitoring with collectd
Even though I don't consider myself a datahoarder and follow the 3-2-1 backup strategy I like to know that I can rely on my hard drives and replace them at the first hint of problems. Of course I learned this the hard way. 😁
All modern drives provide basic health data through SMART but you need to put some effort to read the attributes and figure out yourself if the drive is healthy or not. You can view SMART data with
Read more...smartctlmanually, you can set up e-mail notifications for self-tests withsmartd, but what really matters to me are the trends. Are there more bad sectors? Some bad sectors can be expected even on brand new drives. When did they start appearing? Are there any more reallocations? Is the drive running hotter? Is there more read/write load on the drive? To gather this information in a longer period (months or years) an automated approach is needed. -
Detecting file system changes on Linux & BSD
Watching the file system for changes comes useful from time to time. For example: checking an FTP/SFTP/rsync directory for newly uploaded files from some external system, looking for new core dumps, and detecting new lines in an error log file. Other use cases might include waiting for a process (or pipeline) to complete its job and save the results to a file, or very crude web server hacking detection.
Both Linux and FreeBSD provide this feature through the
Read more...inotifywaitcommand. -
Tunneling Zigbee with ser2net and SSH
I wanted to deploy a network of Zigbee sensors in a remote location. The location had no "IT infrastructure" at all. The only connectivity available was LTE so I picked a modern router supported by OpenWRT - the Zyxel LTE3301-PLUS. My favorite Zigbee setup is Zigbee2MQTT and the Sonoff ZBDongle-P as it never caused me any trouble. There are various other Zigbee coordinators with Ethernet connectivity but I prefer to stick to setup I know (and is also the cheapest because the router already provides one USB port 😁). Zigbee2MQTT is a node.js app and it is too large to run on a router. What could I do to avoid installing another box?
Read more... -
Nordic SoftDevice unofficial survival guide
This is a gathering of "basic" things I wish I knew when starting development with Nordic's SoftDevice. Things I wish the first page of documentation would scream at me before I even had the time to write the first line of code.
Read more... -
Keeping LTE connections alive in OpenWRT
Networking equipment installed in places with difficult accessibility need some care to keep it operating reliably without human intervention. A router running OpenWRT and connected by LTE has many potential points of failure. These include issues with the cellular network, the modem (running its separate OS), connection between the main SoC and the modem, and the router itself. If anything goes wrong, and the hardware does not suffer any obvious damage, a simple interface restart or whole router restart can bring connectivity back.
There are countless approaches to keeping connections alive. I based my script on this project and made it slightly simpler.
Read more... -
Setting up an LTE link in difficult terrain
I had to set up connectivity to a remote location to run some basic telemetry and automation. The location is very rural so mobile coverage has always been a challenge. I did not need much, maybe around 1 Mbps. This was enough to run basic ssh and Zigbee but I wanted the link to be as reliable as possible. Starlink would be overkill in terms of cost, bandwidth, and power consumption so I tried good old, terrestrial LTE.
This post could as well be titled "practical 900 MHz propagation in 2024 using modern equipment". 🙂
Read more... -
X-macros: Not all C macros are evil
Macros in C have a bad reputation because the preprocessor does not have any notion of types and operates only on raw text. A disaster is just one missing
do { ... } while (0)away. The standard recommendation is to always favor inline functions over function-like macros andstatic constover#defineto give the compiler better chance of enforcing the already weak type system.Nevertheless, they are part of the C ecosystem and are used to get things done that can't be done in pure C, and without having to pull in external code generation tools.
Read more... -
Lab life hack - displaying messages with SCPI
Most modern lab instruments can be controlled remotely via SCPI commands. This allows building various automated setups where many instruments can work together under a command of a single script. SCPI works over USB, Ethernet, RS-232, IEEE-488, and other interfaces depending on the age of the instrument.
Different instruments have different command sets, a power supply does different things than an oscilloscope. This article is about a command I "discovered" quite recently that is supported by instruments with "large displays" (for example oscilloscopes), and how it can be used to improve the quality of life in the lab.
Read more...