Arch Linux, Serial Console; Garbled messages
A couple of years ago now I scored a serial console, specifically a Link MC-3 which is a rebadged Wyse 60 (or thereabouts) which is itself a knock-off VT-220. I love it to death, and relish any opportunity to drag it out and do something with it.
So the other day I was going to use it to reinstall FreeBSD on my time server, but couldn’t find a cable for it, so I built a new one… and in the process of testing that, I found that when I enabled getty (well, the systemd equivalent of it anyway, and in case future me is looking at this post going “what did you know?!”, the command to do this is systemctl start serial-getty@ttyUSB0.service if the serial device is /dev/ttyUSB0) on my Linux machine, I get some weird messages that look somewhat reminiscent of auditd style messages:
3008;start=<some uuid>;user=root;hostname=fwaggle-laptop;machineid=<some uuid>;bootid=<some uuid>;pid=1234;type=command;cwd=/home/fwaggle
There’s a bunch of these, before and after every command, before and during a login, everywhere. I put up with them and ended up doing something else, and today during lunch I happened to take another look, and managed to turn up a handful of GitHub issues about it, leading to the culprit: systemd itself!
They’re OSC “context” messages, with the idea being your shell will quietly eat them and be able to do all sorts of things at the presentation level, like showing which commands ran as root, and one of the more interesting example uses is being able to right click on a command’s output and kill the process that generated it. As it’s in-band signalling, it does bring up interesting ideas about how one could spoof it for interesting tricks, but I am not aware of anything just yet that uses it.
I find it pretty obvious that the argument that any VT-100 or ANSI-capable terminal will ignore these messages doesn’t hold water, but it was comforting to see that I wasn’t alone, why someone else had the same issue just three weeks ago!
The solution is pretty easy to do, though not exactly elegant. First, run systemctl edit serial-getty\@.service, which will spawn your editor (hope your $EDITOR or $VISUAL is set correctly). I add this to the file:
[Service]
Environment=TERM=dumb
This tells systemd your terminal is “dumb”, and does not support all the OSC messages. Upon running systemctl restart serial-getty@ttyUSB0.service the problem has gone away! Unfortunately so has a bunch of other shit, like the ability for the shell to clear the screen, move the cursor, and so on. Baby, bathwater, bye. Purists may argue this relegates you back to the proper early terminal days, but I have VT-220 capability I would like to use it, thank you very much.
I haven’t found an acceptable solution to this. You can run export TERM=vt220 in your shell after login, but I would like a way to automate it.
Apparently a more permanent fix is to remove /etc/profile.d/80-systemd-osc-context.sh and create an empty /etc/tmpfiles.d/20-systemd-osc-context.conf file to stop the former being recreated, but I’m not sure what else that will break in the future and this is rather rare an occurrence for me.
Happy New Year! Smoke Alarms again…
I don’t appear to have written about it, but at some point early in 2025 we replaced our smoke alarms, so I didn’t replace the batteries during the 2025 New Year. Looking at previous years, even when I did write an entry for the new year, I don’t appear to have written about it since 2022… which is not great. I pinky promise I did actually replace the batteries (you’re actually supposed to do them during daylight savings time, but whatever).
The new ones are Red Smoke Alarms, recommended by our electrician who has installed heaps of them. I specifically wanted a few things out of them, which they fulfill: I wanted mains-wired, interconnected alarms, in all the locations that would be required if I rented the house out (not because we have any intention of being landlords, but I figure it would be the bare minimum that made sense, and also if we went to sell the house while they were still not-EOL I figured it would not lower the value of the house if it did not need retrofitting to be a rental), and I wanted an alarm suitable for the garage.
The last point was the sticking point, our sparky spent a night or two researching it and speaking with Red about it. It’s a finished garage, but not super well insulated, so it gets rather toasty in there, and of course the car starting and the dust probably aren’t great for them either. In fact, it killed the spare cheap-ass smoke alarm I put out there, which started chirping at about 11pm at night after only about a year, and it was not the battery that died.
So we ended up with three photoelectric smoke alarms - the back two bedrooms formerly shared one, but apparently it’s more effective for them to be within x mm of a bedroom door, and one between them would not suffice. Now I must stress, my compliance with these rules is possibly optional, as this house was built prior to 1997, but I think these rules are fairly good sense anyway, and a third smoke alarm isn’t that expensive. I think they’re all the R240RCs.
The garage has a RHA240SL heat alarm. This is less great than a smoke alarm, but between the dust and the heat, a smoke alarm just won’t really work in a garage for very long. It’s mains wired too, and interconnected with the others, so we’ll actually hear it instead of the faint chirp the other one did through the fire door that goes to the garage. It’ll take longer to raise the alarm than a smoke alarm would, because by the time a fire makes the room reach 55C it’ll already be quite a problem, but it’s better than no alarm at all.
So far we’re pretty happy with them - it remains to be seen whether we get the quoted ten years out of them, but our sparky has been pretty happy with them apparently.
Time server goofing
It’s been some time since I built a stratum-1 NTP server, and it’s mostly been chugging away. Not included in that entry is that I went back to Linux + Chrony due to NanoBSD support going away. I replaced the SD card with a mini-PCIe SSD, but never got around to putting FreeBSD back on it.
Yesterday, I elected to build another serial cable (as I’m unable to find mine) and have another go at it. But try as I might, I simply could not get FreeBSD’s install media (14.3 or 15) to show anything other than the bootloader and kernel log on the serial port, leaving me unable to proceed. I’m not sure what I’m doing wrong there, but anyway.
I figured as I had it all apart any way, I might as well try fix the location stuff (it was set to position hold mode on the other side of the garage, so my error rates would in theory be higher than they should be), and that made me realize that I hadn’t written down how to connect u-blox’s u-center to the card without removing it from the APU.
It’s actually really easy, all you need is socat on the machine with the GPS card in it. Stop gpsd or ntpd or whatever might be hogging the serial port, and then redirect it to a TCP port using socat:
socat FILE:/dev/ttyACM0,b115200,raw TCP-LISTEN:9600,fork,reuseaddr
On u-center, create a new connection using TCP to the IP of your timeserver and your chosen port (not sure why I’m using 9600 here). You may also need to pay attention to the baud rate, mine is set to 115200 but yours may be 9600 instead.
It should light right up and let you alter all the configuration and whatnot, so while I’m in there what the fuck else can I break?
A while back a friend mentioned that Australia’s (well, and New Zealand) SouthPAN came online a few years back and that it’s possible to tell some older u-blox stuff to use it. Apparently (I do not know near enough about any of this) the process is:
- You need to enable SBAS if it’s not already (there’s a section in the configuration view).
- You need to tell SBAS module that it can use message 0 (test mode), because SouthPAN is not properly online yet so they send test mode messages instead so that nothing important actually uses it without opting in.
- The PRN for SouthPAN is 122. You may have other PRNs set (I sure did, mine defaulted to
120, 122, 124, 126-127, 129, 131, 134-135, 137-138), but apparently this might cause the receiver to lock onto the wrong PRN so I just removed all those and left 122 and 124 in (124 is apparently reserved for future use). - Apparently the spheroid datum is wrong, the default is WGS84 which will be slightly incorrect and Australia has their own standard, GDA2020 which has slightly different measurements. My receiver does not include GDA2020, so I set it to
USERand plugged the numbers I could find in myself, but I’m not entirely convinced I’ve done it correctly because again I have to stress I have no fucken clue what I’m doing here.
Anyway, I did all this and… nothing. It doesn’t appear to have done anything. Looking at the constellation view, I see SB122 listed but 0 signal. I then looked up where it is in the sky, and apparently from my point of view it’s to the east and rather low in the sky - that would make sense as my antenna basically only has a view of the western sky.
Also in talking to Avi, my receiver probably wouldn’t know what to do with an SBAS that was made in 2020 when it was EOL in about 2013 anyway…
While in the process of trying to get the antenna to see it, I managed to break the SMA connector. A bit of solder and some heat shrink appears to have gotten me out of the woods, but it’s become clear I really need an external antenna at some point (which means an active antenna - not cheap - and a lightning arrester with someone competent to install it, which is probably also not cheap).
But it’s working, and even after I set much more pessimistic survey-in parameters (1 hour at 25M, instead of 30 minutes at 50M) this morning it was happily back in position hold mode and the error margin is comfortably in the nanoseconds range, more than precise enough for my needs.
I’m fairly sure that basically all my error margin comes from a combination of the chipset of the aging APU1D4, and the fact that I only have a view of the western sky, but the satellites in the east are probably still being seen, weakly, by reflections off the colourbond fence on the western side of our yard.
That’s my guess anyway.
Update: 2026-01-01: Unable to leave well enough alone, I moved the APU as close to the window as I could, which let me put the antenna puck almost at the top of the ladder, stuck to a piece of metal on an alloy ladder. The result? It picked up the SouthPAN satellite, and claimed a DGNSS fix. Accuracy doesn’t appear to be any better, but apparently that’s because I did not wait long enough. I am thinking that I’ll buy an exterior antenna at some point in the near future though.
Merry Xmas!
We had our big family get together lunch earlier in the month, so this Christmas was another in a long line of “let’s not make a big deal out of this”. We all agreed that we would try and buy things that were useful this year, as the previous years we bought a lot of “quantity over quality” crap that was good for a chuckle and then never touched.
I got a few neat things, including a Hutton Mug which was apparently bought back during the period earlier this year where I made that game (Elite: Dangerous) my entire personality for the second or third time (currently taking a break from it to play Arc Raiders instead). I decided not to drink from it, I will instead put it on the shelf in my office because it’s neat (so much for things I’ll use!).
They also got me the Lego Game Boy #72046, which I put together this morning. That set rules, 10/10, no notes.
For Christmas Eve dinner we once again had “Feliz Navidadas” (Enchiladas), and then today we just made up the usual grazing platter of oven-baked foods like Sausage Rolls, Spring Rolls, and we steamed some Bao buns. I ate entirely too much, and way too much garbage like cookies and such as well. Leftover enchiladas for dinner.
I took the entire week off work, but I have ducked in to chase up a few things here and there, but it’s been pretty great. This is the first time I’ve taken an extended time off around the new year and haven’t started some massive home improvement project, so I’m feeling rather rested!
Pet Vet Woes
Earlier this month, right before our Christmas dinner with my family, we had to take Tiabeanie in to the vets because she had a spot of diarrhea that was persistent for a couple of days. I was expecting a partial blockage, but the vet after examining her concluded the most likely culprit was - and I keep telling everyone who will listen how much I love this term - “dietary indiscretion”.
That is, she probably ate something she shouldn’t have on a walk, and it upset her stomach. Knowing Beanie, that’s really quite likely. Anyway, they sent her home with some probiotic paste and some instructions, it cleared up, and she went back in for a check-up and they were pretty happy. Thus far, she’s not had any recurrences. That’s the third time this year she’s been into the vet!
But then immediately after the lunch, we noticed that Jemima was not herself. Because of the noise (my folks are loud, and there was a lot of them) it’s to be expected that the animals would be tired the next day, but Jemima was both very tired and not eating, nor pooping, all of which was concerning.
So we made an appointment for her, which involved actually setting her up at the vet, as she’s not been since we adopted her, and Horsham PAWS had her at a different vet. Whoops.
They checked her out and found a small lump that felt like an abscess on a tooth (a molar on the right lower jaw I think?), and she had a mild temperature. They sent her home with some antibiotics and meloxicam (which is terrifying stuff if you read the potential side-effects, I think it’s basically similar to Ibuprofen but animals handle it differently). Both of these can lead to soft stools, which they sure as fuck did, but at least she’s eating.
The course of these made her perk right up, and she was better on the follow-up (including temperature back to normal), but now we’re waiting for her stools to firm up…
She’ll likely go back in in January for a teeth clean and they can inspect things while they’re in there. I absolutely hate having one of our pets knocked out, but she’s done fairly well that she’s about 8 years old and hasn’t been to the vets since spaying.
