I am playing the game Path of Exile again and continue to be amazed at the complexity of the third party tools gamers have created for it. The game doesn’t really support addons or anything, it’s all hacked on. A few years ago I looked at how PoB Item Tester worked; this time around it’s Awakened PoE Trade (APoET).
There’s a feature where APoET will take a screenshot of the screen, OCR the text on the caption of an item, then tell you whether it is valuable. It’s a little flaky but when it works it’s a huge convenience over alt-tabbing out and doing a web lookup.
The tech it uses is remarkably complex. APoET itself is an Electron app written in 8500 lines of TypeScript and 6800 lines of Vue. It’s a strange UI, built to run as popups on hotkeys while playing the game; not at all like a typical Electron windowed app.
The OCR code is just 326 lines of TypeScript. To use it you install a binary blob. In that is Tesseract, a nearly 40 year old OCR library that has gotten a bunch of updates over time. The modern version is based on OpenCV (itself 20 years old) and some machine learning model boiled down into 4MB of weights. The code for these libraries are a further 5.5MB of WASM binaries. It’s called “tesseract-core-simd”; news to me that WASM could take advantage of SIMD instructions, I guess that’s a few years old.
Anyway it’s a tower of complex software building what is ultimately a pretty simple and kludgey product. I love that this is all possible and accessible even to folks hacking a tool for a game they play.
(while I’m here, the real standout tool for PoE is Path of Building, a complete theorycrafting game simulator. With 50,000 lines of hand-written Lua and another 2M lines of game data as Lua code.)
I’m on the hunt for a good Chromebook, a real laptop for travel. The cheap Acer 311 C722-K4CN I bought is fine but underpowered and not a great screen (low res, TFT not IPS). I want something with a touchscreen and sturdy hinge but that folds back 360° so it’s like a bulky tablet. Would like a fingerprint reader and decent speakers. And I want an ARM processor, not Intel, on an unsubstantiated theory you get more life on the same battery.
Lenovo is about to come out with a $270 Lenovo IdeaPad Slim 3 Chromebook. It looks good except that the hinge doesn’t do 360°. Also it’s marketed as “budget” but it seems plenty powerful enough to me.
HP has a $370 HP Chromebook x360 13b that also looks promising. This review and this one note “bottom firing speakers” which is not great. Also no fingerprint reader. Still it looks good, particularly at $100 off the original price. If I had to buy one today it might well be this one.
Shopping for Chromebooks is so frustrating. HP makes 17 machines named Chromebook x360 that all look pretty different. The “13b” is the only ARM one. Apple does so much better at marketing their laptops.
Insisting on ARM is really limiting my options. Maybe I should give up on that.
What I really want is an OLED screen. The only option I could find is the Lenovo Chromebook Duet 5. But it’s a detachable keyboard which doesn’t meet my “sturdy” requirement. In particular I need to be able to hold it by the keyboard and have the screen stay put. Could be an interesting alternative to my Samsung Android tablet though.
Update: needed this sooner than I expected so I ordered theHP Chromebook x360 13b-ca0047nrr for $409. Note this is slightly updated from the 13b-ca000 that until recently was the offering. The newer one has a faster MediaTek Kompanio 1380 and 8GB of RAM. Reviews for this machine are mostly positive with the main complaint being the screen is nothing special (1920x1080, 250 nits). I was sorely tempted by the Samsung Galaxy Chromebook 2 360 because it has an amazing screen: 2560 x 1600 and 350 nits. But the $450 model has only 4GB of RAM and a Celeron N4500 and reviews said it felt underpowered, even for a Chromebook. I’m going to keep using my Android tablet for high end video stuff so I’m OK with the better computer with the less exciting screen.
Update 2: ha, cancelled the HP order and am getting a Acer Chromebook Spin 714 instead. They’re on sale right now for $529. Compared to the HP laptop it’s a brighter screen (350 nits vs 250 nits), better speakers, and significantly faster (80,000 octane vs 30,000, according to videos). Downside is it’s not the ARM processor I was hoping for but, eh, that was a bit of a silly thing to stand on. The Acer apparently gets an honest 10 hours of battery life which is plenty (compare “up to 16” with HP).
I’ll add that hp.com is a miserable place to try to buy something direct. The ordering experience is OK but then it takes 2+ weeks to ship? Maybe it’s backordered. But then cancelling is a nightmare. There’s no automated order cancellation, you have to talk to support. Which takes 10+ minutes and involved three separate attempts to retain my order and/or sell me something new. And at the end of that I’m just told “we’ll try to cancel your order let you know in 48 hours”. So dumb.
I bought a little Wi-Fi thermometer, a Shelly H+T. Neat product; eInk display, wifi, runs on 4 AA batteries for a year. I don’t know much about Shelly but it seems fairly hacker friendly. In particular you can run the thing in local network mode and not use their cloud service at all.
Setting up Shelly
First challenge was getting the device up and running. The docs are good and there’s several routes. I went the WiFi only route (no Bluetooth); you plug the device in, get it into AP config mode by holding the reset button in the battery compartment. It creates a WiFi network for itself and runs a web server on 10.33.1.1 which you can then use to configure it. You have to work fast; even plugged in to a USB power source it seems to only want to run for 30 seconds before going in to sleep mode. The main configuration required is to tell it your wifi network details to connect to your LAN.
First step after that was to flash the firmware. Glad I did, they completely changed everything. Next step was to configure it to do something useful. Because it’s low power you can’t really poll the device, most of the time the WiFi is off. So instead it wants to push data.
I’m not a fan of MQTT, it’s too complicated. But it is a standard and there are tools. I found this guide helpful in getting started. It has you installing mosquitto for a MQTT server (“broker”), mosquitto-clients for testing, then setting up telegraf to be an MQTT listener for data logging to influx and thus Grafana.
mosquitto takes some config; by default it will only listen on localhost. You have to configure authentication. I used a simple username/password, probably “no auth” would be fine on my LAN too. Note this configuration has to occur before a line like listener 1883, defining which mqtt instance you’re setting up. (See what I mean about complicated?)
Then I pointed Shelly at the MQTT broker (no SSL, port 1883, username and password) and.. nothing. There’s a log file in /var/log/mosquitto but it didn’t have much useful in it. So I added connection_messages true to the configuration and then I could at least see that Shelly was connecting. No data logged to a file though.
To get the data you have to use mosquitto_sub to subscribe and listen to the data. There’s a concept of “topics”, which kind of events you listen to; # is a wildcard. You can also use mosquitto_pub to send test messages. Honestly to figure all this out I asked ChatGPT how to use it and it told me. Way easier than reading docs and it happened to work this time. (ChatGPT failed later producing telegraf configs.)
With all that set up I got Shelly logging overnight. It seems to log to two topics: shellyplusht-b8d61a8b17cc/events/rpc and shellyplusht-b8d61a8b17cc/online. The useful data is in the RPC.
The important RPC payload is a JSON blobmethod named NotifyFullStatus and a wakeup_reason of status_update. The data itself is in params and the key thing is data blocks for temperature and humidity.
Not clear on update frequency. When it was plugged in I was getting updates every 305 seconds or so. There was some status indication that suggests it wants to update every 600 seconds; I guess 300 is when it starts trying and the extra 5 is getting wifi online? On battery it updates less often, I think only when a measurement changes significantly. There’s a setting in the firmware where you can make it wake up for every change of 0.5°C or 1% humidity.
Anyway, Shelly is working and publishing to MQTT. Now to get the data somewhere useful.
Logging to Influx
Telegraph can take input from MQTT. It took some levering to get this working but I finally got telegraf to just store all the fields that are in the JSON data blog from Shelly. Here’s the config:
This logs all RPC messages from shelly; the useful ones with data but also other RPCs. It also logs all the measurements, many of which are not so useful, but it’s just easier this way and it’s only logging every 5 minutes at most.
Note the commented out date parsing. I’m sure I got that JSON key name right but telegraf couldn’t find it, at least in some of its inputs. I gave up. Instead telegraf will log with its own timestamp rather than the one Shelly reported. That’s OK most of the time but if Shelly buffers any data and uploads it in bulk it will be a problem.
Also the “tag_keys” seems to be useless. I was hoping to use influx tags to filter just on the NotifyFullStatus responses and not the other junk. No idea why but it’s not ending up in the database.
I probably should have tried json_v2 as the telegraf parser.
(An aside on testing telegraf with systemd. systemctl reload telegraf does work but sometimes delays, I think telegraf waits until the agent finished its last run. journalctl -f -u telegraf is a useful way to watch the telegraf log file. Shelly only logs every 5 minutes so it’s a slow process of testing.)
Calibration
A man with two clocks never knows what time it is. None of these devices are precisely calibrated so I don’t know for sure what’s right. Shelly has an option in the firmware to add a static offset for calibration so I can at least get it to line up with the Laseregg.
When I first was using it, my LaserEgg said 70.5°F, Shelly said 72.7°F. A Taylor thermoprobe (for cooking) says 71.5°F (both air and a glass of water). In general the Shelly is reading 2-3°F more than the LaserEgg and 2% less humidity.
But then I put Shelly in the fridge for 10 minutes, and it dutifully read colder. Then I took it out. Now 12 hours later Shelly and the LaserEgg are basically reading the same without me putting in a calibration offset at all.
Graph
Here’s 24 hours of my far-too-complex set of graphs of Shelly data. Top two are calibrating temperatures between Shelly and the Laseregg, bottom two are status just from Shelly. The weird dip in temperature is when I locked Shelly in the fridge
After last week’s article about LED lighting quality I noticed a lot of posts in the Hacker News discussion were praising bulbs from Waveform Lighting. So I ordered some to try. But they look too blue and I will be returning them. I’m flummoxed by LED lights now and am thinking I need some fancy color-tunable bulb.
Waveform Lighting sells high end LED bulbs: $18 for the typical A19, compare $3 for a basic Feit bulb from Home Depot. Waveform bulbs are supposedly better. A higher CRI (95 vs 90), a better spectrum beyond what CRI measures, and no flicker. Their website has a blog with a bunch of excellent semi-technical posts on it explaining what they do and why. I’ve been wanting high quality bulbs for awhile and they have a generous return policy, so I ordered some 3000K BR30 floods for my office / TV room.
They’re too blue.
When I turn them on low at night the room looks very blue. Way bluer than the old incandescents, which I expected. But also bluer than the 3000K Feit PAR30s I use. Nominally the Waveforms and the Feits have the same color temperature design; weird! The Waveforms also look too blue on a cloudy day. On a sunny day I don’t notice as much, presumably because the sunlight washes everything else out.
What’s weird is the measured color temperature of the Feit bulbs and the Waveform bulbs is the same. I measured this with an Android app. I didn’t calibrate the app so I don’t trust the absolute numbers, but the relative comparisons should be meaningful. The Waveform LED bulbs measured 4000K at all dimness levels; so did the Feit LED bulbs. The incandescents measured 3400K-4100K depending on dimmer setting. Those numbers are all about 1000 too high (calibration?) but otherwise plausible.
So why does the Waveform light look bluer to me? My only thought is it’s in some detail of color accuracy, that the Waveforms fill in more bluer spectrum than the Feits. I don’t have a way to measure that. But I know how it looks to me. The good news is I like the cheaper bulbs more! So that’s money saved.
Update: after a day or two with both the Waveforms and Feits in the same room I no longer think one looks bluer than the other. They seem a similar color temperature to me now. However there’s definitely a difference of some kind in color between the two. I can’t describe it and one doesn’t look better to me than the other. The room with both lights feels a bit cold / late night convenience store for me. It’s not objectively true but my subjective vibe is more “fluorescent lighting” than “candles”.
Desired color temperature
I think I’d prefer the Waveform bulbs in an application where they were turned on during the day to, say, light an office. I believe their claims the colors are more accurate.
But this is a room where I either stare at a computer screen during the day (don’t much care about the ceiling lights) or watch TV at night (want cozy dim lights). I think what I really want is a light that turns redder towards 2700K at low dim settings, them up to 3000K or maybe higher at full brightness. Philips sells “warm glow” bulbs that are exactly like that. But it’s not clear that’s a viable product. Now I’m contemplating programmable smart bulbs of some sort.
It’s funny, when I first learned about LED bulbs I was sure I wanted true sunlight 6000K bulbs. It’s natural! Turns out, at least in the west, we’ve all learned that cozy indoor lighting looks red like a fire glow. I put some 4500K bulbs in my shower and they look just terrible to me on cloudy days, like cheap fluorescents.
Other Waveform thoughts
I really wanted to like these Waveform bulbs. I’m happy to pay for higher quality!
They are good heavy bulbs. I take that as a sign they have a serious heat spreader.
I didn’t get any sense for flicker. I’ve never noticed flicker in any LED bulb.
I like the lens on the BR30s. The surface of the bulb is a smooth glow, not like the visible points of light in the cheaper Feits.
The Waveforms take about half a second to turn on after flipping the switch. Not a huge deal but it seems weird.
I’m testing with a 20 year old Leviton incandescent dimmer, which is not correct. The Waveform mostly works with it, but the minimum dimness is too bright. Also there’s a quiet buzz coming from the bulb at low dim levels. Both of those problems would probably be fixed with a proper modern LED dimmer. I’ll note the cheap Feits work fine with the old dimmer; another cost savings.
After collecting a week+ of data I think Starlink’s service has genuinely improved for me in Grass Valley, CA (residential service). The ISP had gotten very congested in the evenings; 5% packet loss, speeds under 10Mbps, games and streaming video not working well. Really frustrating. I first noticed this in February 2022. But sometime in the past few weeks it got better.
Measuring the improvement
Some basic stats comparing the last week (Mar 31 - Apr 7) to a typical week in February (Feb 7 - 14):
Average packet loss around 9pm: 1% vs 4%
Average packet loss for a week: 0.5% vs 1%
Latency around 9pm: 53ms vs 65ms
Average latency for a week: 50ms vs 50ms
Hours of download under 20Mbps: 3 vs 16
Average download: 115Mbps vs 105Mbps
Min download: 7.5Mbps vs 0.9Mbps
They key pattern here is that worst-case performance during the evenings is much, much better. Packet loss is the biggest change: Starlink has gone from 4% (with peaks of 10%) to 1%. But that shows up also as improved latencies. And maybe improved download speeds although that’s harder to measure accurately; the “bad hours” statistic I list first seems real though.
It’s interesting that average performance over a whole week didn’t improve much, just the worst-case performance in the busy evenings.
Thoughts on what it means
I’m thrilled with the improvement; things had gotten so bad in the evenings I couldn’t reliably use the Internet. Great job, Starlink! And well timed; they just opened up the area to more customers, i was afraid it was going to get even worse. It might still get worse again, and I don’t love Starlink’s pattern of degrading service and increasing prices. But this change here is a real improvement.
So what changed? I don’t know. But my guess is they deployed a better traffic shaping system. So that individual users are getting fairer sharing than they used to. That would be nicely in-line with their announced plans to add soft data caps. They’ve supposedly been throttling best effort customers all along but I wonder if the initial implementation wasn’t as good as what I’m seeing this last week.
The other possible explanation is more capacity. But I think that’s unlikely. They’ve launched more satellites in the past two months but not enough to explain this change. I don’t think they increased their satellite link capacity (or did they?). It’s possible they improved the infrastructure on the ground between the station and the rest of the Internet, but I don’t see much evidence of that.
I don’t really know what changed, but as a customer of Starlink I’m very happy to see the improvement.
Some graphs
Here’s a graph of packet loss and latency over the week in February, from before the change. The peaks every evening are evidence of a congestion problem.
And here’s a graph of the same data for the last week. See how much smoother it is? What an improvement!
Notes on measurement
All data comes from my automated test setup. Download speeds come from an hourly Ookla speed test. Latency and packet loss come from IRTT, a ping-like tool. I think they’re both reasonably accurate measures but I’m just doing some simple testing with basic tools. These are all scripts and graphs I’ve set up myself, using Telegraf and Grafana for data collection and a cheap VPN server in LA for the other end of the IRTT testing. I also have a second measure of latency and packet loss from pings to Google DNS; it confirms this pattern.
Not positive about this, but I’m seeing evidence that Starlink has improved performance in the evening congestion. Back in February packet loss would go up to about 5% and latency would jump from 50ms to 70ms during the evening hours, particularly 7pm-9pm. Now it’s only going to 1.5% and latency is staying steady around 50ms. There’s maybe a small increase in packet loss and latency in the evening but nothing nearly as bad as before.
I might also be seeing an improvement in my hourly Ookla speed tests. Feb 17 I got 9.3Mbps and 1.5Mbps at the worst hours (9pm and 10pm). April 3 it was 30Mbps and 27Mbps. Speed tests are so random I’m not confident about this.
I’m in Grass Valley, CA with residential service. It’s a congested area. Testing with IRTT, a ping-like tool. if I had to guess I’d say this improvement is recent, like in the last week or two. I don’t have good data because we’ve had a lot of snow-related outages here.
Here’s snapshots of before and after, from 2pm to 2am on Feb 17 and Apr 3.
February 17April 3
That’s latencies and packet loss. For download speed, here is a 90 day graph of number of hours a day under 20Mbps. (Ignore the big red block of 24 hours; that was my backup ISP). These past few days have been really good; 0! This data is noisy enough I don’t want to read too much trend into it.
Thought I’d give Datasette a quick try. I was curious about which countries were the most and least diverse. Seemed like a good simple use case for the data exploration tool. This is my first time really using it. I am trying to use higher level tools rather than write low level code that works exactly like I want. Here’s what I did. An hour or two of tinkering and learning here, maybe a little more.
Manually edited the CSVs to change the column headings to simpler things without whitespace.
Installed datasette, sqlite-utils, and csvs-to-sqlite via pip.
Ran csvs-to-sqlite *.csv diversity.db to make a database.
Merged the two tables into one by using sqlite to run create table combined as select * from diversity left join population on diversity.Country = population.Country;
Removed an extra copy of the country name with sqlite-utils transform *db combined --drop 'Country:1';
Converted the population column from string to text with this code:
And with that now I have a nice little web GUI. I used it to make a report of the diversity of large European countries. Which immediately yields a lot of questions about exactly how we’re defining diversity, but that’s not Datasette’s fault.
Thoughts
Datasette is cool, a nice generic HTML front end to tabular data.
Preparing data was more fiddly than I liked. I felt like Datasette and related tools wasn’t doing a lot of work for me I couldn’t just do in sqlite. For instance, I was hoping for a GUI in datasette for doing the join between the two sources tables. It will let you do the Datasette slice-and-dice on top of any sql, so you can have an ephemeral table where you write the join yourself, but I wanted a persistent table for convenience.
The management of the population column types seemed awfully awkward. My input CSV had quoted text-looking columns for the numbers like "233,319". The code uses pandas to import CSV files, which I thought was smart enough to parse those as numbers. Maybe there’s a way to get csvs-to-sqlite to import them that way. It’d be nice if sqlite-utils convert inspected the Python type and changed the column automatically. (There’s a -transform option but I think it only works if you create a new column.)
I was hoping for some way to do a chloropleth of the diversity measures, but no one’s written that plugin. Would be easy enough to export a CSV and use some other service to visualize. There are some map visualization plugins for Datasette but they seem oriented to working with lat/lon pairs, not country names.
It’s really cool how easy it’d be to publish this little set of data to some cloud service.
I’m surprised the integer columns don’t have separators in their display! “144713314” is hard to read. This would be an easy plugin I imagine.