It is the 2198th of March 2020 (aka the 7th of March 2026)
You are 2600:1f28:365:80b0:411a:328d:9c62:c3fb,
pleased to meet you!
mailto:blog-at-heyrick-dot-eu
Car repair
I drove cross-country to the mechanic at noon on Thursday. No rain this time, but quite a lot of wind. If you remember, there was a storm passing through the last time I went to the mechanic.
When I got there, I spoke to the commercial agent (the guy that does the selling). Yes, I have an appointment. He asked about the problem and then said that it sounds like it might be a problem with the transmission on that side.
"I hope not, it was changed just over three weeks ago."
Uhhh.... the mechanic will be back soon.
I liked the grey haired guy. I just can't seem to warm to a person who wears a synthetic leather jacket with Red Bull insignia all over it. Anyway, he took the car in, lifted it, and took a look.
It was a... bearing? It's called a roulement in French. Basically a steel ring, with a smaller steel ring inside, and a bunch of ball bearings between the two. The outer ring connects to the car, the inner ring to the axle, and that's pretty much how a wheel turns without falling off. Well, the thing was toast. Going by the clunking, I'm wondering if it was missing one of the bearings?
I talked to the agent about the temperature sensor, pointing out that as nice as it would be, it's just not credible that it is twenty seven in February in the north of France. He went and had a few words with the mechanic.
I didn't mention the fog light. They won't have one in stock, so I'll get on to that some other time.
While I was there, I was looking at a replacement car. Because I'm halfway through my ownership of this one. There was a little diesel, not quite as high end as the current model (so no side vents (not that I use them) and no button to pop the boot (really? a fifty centime relay is "exclusive"?)) but otherwise fairly similar. But with one difference. It's diesel.
Now, don't get me wrong, I like the electric car. It's cheaper than dead dino juice, and it's really super-quiet. But, alas, it has a fairly small autonomy when it comes to battery life, and because it's not a "real" car, it doesn't support "real" charging. I can't pop into McDonald's and dump in three phase at ten kilowatts to boost the battery. Useful charge times are measured in hours.
By contrast, a noisy diesel holds about 16 litres. It'll do something like 300km on one fill, and can be replenished in a couple of minutes, without needing an app.
This was highlighted by the fact that while they kindly plugged my car in to charge a little, the work was done pretty quickly so it only had about twenty minutes on charge.
Anyway, the "new" car is quoted as a down payment of €2000 and then €156/month. That's just slightly more than what I'm currently paying. But there's a big "if". What does this actually include? Like, how many kilometres a year? And is this the "what I pay" amount, or is the obligatory insurance on top? Because that would add quite a bit over my current amount.
I would imagine the diesel is cheaper because there is more 'life' in the engine than in a battery. The reliability chart shows the capacity starting to drop after 20,000km and by 50,000km it's about time to recycle it. Hell, my previous car had 42.6K on the clock when I bought her, 66.5K when I had finished, and god knows how much the little white one had actually done in total. Suffice to say, with combustion engines, it's often going to be "other stuff" that wears out first, not the engine, and the cost of maintaining the car depends upon how much needs fixed/replaced. But I rather suspect that with electric cars, as they age and the kilometres add up, the important limitation will be the battery. I haven't been able to find a main traction battery online to see how much they cost. Additionally, this is the first version that uses a 48V system. I think the current models use 72V. So, um, how long will these batteries even be available for? Questions, questions, and honestly I think EVs are far too new for there to be much in the way of answers.
Well, I'll be looking at sorting this out some time in the winter. He said it should all be done about six months ahead so everything can happen smoothly. I drive in with my current car and drive away in the new one.
Anyway, after all of that, he handed me the keys and said that they also washed my car. A bit of a lost cause given the rain, the mud, and the tractors...but okay...
I stood by the counter wondering how much I'll need to pay for all of this. He shooed me away.
I guess that's as close as I'm liable to get to "oh crap, sorry". ☺
And while in town
While in town, I stopped at the commercial zone for a pee and to get some nice cat food for Anna - that stuff with wild boar and reindeer. While I was doing that, my car was on charge.
It was a very basic charging station that read the Izivia card and... blinked a white lamp.
So I drove up, plugged the cable in, and waved the card. Nothing.
I tried the other side.
Still nothing.
But I knew I was doing it correctly as I got a ping on my phone thanking me for my charge which was going to cost me €0,00.
I backed up, tried the next unit. I was kind of running out of patience here, but I was only halfway between the 1/2 and 3/4 markers, I really wanted more to be certain to get back home.
Plug in, swipe card over the front, then "click! fvvvvvvvv...". Yup, my car was now on charge. So I could lock up and go shopping.
I wouldn't normally leave the charging cable unattended, because I can imagine there's a certain sort of person that would swipe it for the lulz, but the dealer was just over there so I could go buy a replacement. I'm surprised that charging stations don't offer a way to clamp the cable to stop it from being stolen - like a loop with an electromagnet that needs to be released by swiping the card that started the charge.
Anyway, I put 15 minutes of charge in, and that took me up to the 3/4 mark. And it cost me €0,38.
Afterwards I went to the Leclerc. I didn't get much, what with having up upset tummy earlier in the week, I had not eaten the ready meals that I had intended to take to work. I felt that their sandwich selection was "gross" so I didn't get anything to eat.
Then I went to Picard, and having not eaten all day - in fact I was existing on one single cuppa, I spent "the usual" (just over €30) filling my cold box, and on the way home wondering where the hell I'd put it all.
Don't shop when hungry.
Still, I got myself a nice looking quiche. Do "real men" eat quiche? I'll tell you what - real men eat whatever the hell they like without worrying if it's "girl food" or from the title of a book from the early '80s where far too many people missed the painfully obvious satire.
My new phone cost me €29!
I have just received my €50 refund. All my paperwork was in order and approved. So with the €20 immediate reduction from Orange and the €50 from Xiaomi, my €99 phone cost less than two McMeals.
The Royal FAMILY
There's a certain amount of epicaricacy that one must surely feel looking at the pictures of The Andrew Formerly Known As Prince (#) sitting in the back of the car looking haunted. Unprecedented things are happening - a semi-royal being arrested? "What? No! Laws don't apply to us!" Even better, this is some deep national security crap, it's not who he may or may not have boinked. It's a whole unexpected side quest.
And given that brother, the King, has also taken the unprecedented act of stripping him of his titles, one cannot help but think that even The Palace thinks he's guilty.
Plus, now the government is talking about the unprecedented act of stripping him of his right of succession. He maintains his innocence, but all of this "we wash our hands of him" paints a rather different picture, doesn't it?
So there he sits in the back of the car looking like Diana's ghost is telling him what a failure he is - because the net is closing in and he's running out of places and favours.
I wonder if he'll suddenly take an unexpected holiday in, say, Belize? Somewhere that doesn't pay much attention to western extradition requests.
Jonathan Dimbleby, the King's biographer, was trying hard to make a clear distinction between the family and the monarchy. He is quoted (by BBC News) as saying of the arrest "I don't think that it damages the monarchy, I think we have to separate the notion of a family from the institution of the monarchy. I think it's very important. It's very easy to align the two.".
While this is generally in line with how The Palace sees things, it's mostly verbal subterfuge. Why? Because it is the Royal Family. Special blood and all that crap. I, for example, cannot go and plunge a dagger into Charles' heart and declare myself King.
And for the avoidance of doubt - that's not a death threat, simply a reference to how disputes would have been settled a thousand years ago - look at the story of William and Harold.
Oh, and if I truly want to be King, I'd need to find and kill loads of royals because if Charles is dead it's not as easy as saying "I'm King", because his demise would make William the new King. So I'd need to bump off William, then his three children, then Harry, then his two children (including a five year old girl), then Andrew... this isn't a simple stab-done-I'm-King, this is mass murder, there's like sixty of them in the known line of succession. Because royal blood.
Aside: The determination of who qualifies is a legitimate Protestant descendant of Sophia of Hanover, who was born in 1630. As you can imagine, in nearly four hundred years, there are loads of blood relatives who could - in the absence of the others - lay a claim on the Throne of Great Britain. Something like four thousand people. Because royal blood.
If I wanted to pursue the non-stabby-murdery way into royaldom, well it's difficult because I'm not related to anybody royal. I'm not even nobility. I'm just some random baby that fell out of some random woman half a century ago and pretty much the only thing I'm notable for is surviving being born. I'd need to find a princess and woo her. Me, with zero social skills, right.
That's not to say it's impossible - look at Meghan, but then look again at Meghan and why she's not princess something-or-other. She's a commoner, she's American, she's not white. That's like a holy trifecta that would cause the darker recesses of The Palace to melt down. Because the fact that this bloke might have fallen for this girl.... nah.... love counts less than duty right? Oh, and if she were a princess, it would be by way of her husband, not herself. She wouldn't be a part of the succession because... here it comes... she doesn't have royal blood. Which means even if I hooked up with some random princess, I'll never be a king for the same reason, so... let me sharpen my sword 'cos it looks like I'm just going to have to do this the hard way... 😂
So, as you can clearly see, family ties underpin the Monarchy, and to try to separate Monarchy from Family is bollocks.
It is a powerful and stupidly wealthy family that is the centrepiece of British culture and it doesn't matter whether they call it The Family, The Monarchy, or The Firm.
And Andrew was a fairly prominent part of that for many decades.
No matter how The Palace tries to spin it, no matter how much Charles is willing to throw his brother under a bus, the simple fact of the matter is that he is family. He is a tangible part of the Monarchy. Less now than last year, but still.
Footnote: Who the hell would want to be King anyway? Especially a glorified bureaucrat that doesn't get to vanquish enemies with an epic sword while riding a dragon. What does the King do, really, other than to lend his face to postage stamps and payment tokens, and every once in a while make out-of-touch speeches where he attempts to understand what it is like living in a country where things cost twice what they did a few years ago and the state is being run by squabbling toddlers in adult suits.
And you would have to maintain an acceptable level of drama in order to remain relevant despite largely being an anachronism in the nineteenth century, never mind the twenty first. Marriages, cute children, that sort of thing. But not too much drama as that would look bad. Were you listening, Andrew?
What a hassle. Who the hell would want to be a King?
# - I started referring to him as that on a forum as soon as his Princehood was stripped, and I've noticed others now calling him that. Warm fuzzy glow time. ☺
QuickScope update
I have made a few changes to the QuickScope firmware.
The small change is that I changed "centered" to "centred". I was tired when I wrote the original code, so "cent-red" just looked wrong. When I came back to it "centered" looked wrong. Sometimes my brain annoys me.
I then changed the fake boundary value (to stop the dumb serial plotter from auto-resizing itself) to "90" instead of "-100", which is two characters less to send (saving 16µS).
The big headline change. On my system Java isn't nippy, like not at all. So it was taking about a second per update, with about 400 samples across the screen each time. When sampling at ~9KSPS, it would be receiving around 9,000 lines of data per second to draw 400ish.
So I have simply changed the code to send only every sixteenth sample.
This means the system isn't being held up by all the serial data, and it also means the Java runtime isn't being clobbered by something like 64K/sec with 18,000 samples/sec to have to figure out what to do with.
This does mean that, currently, 15 samples out of every 16 are simply thrown away. I suppose one could try something smarter like averaging them or whatnot? But, for purposes of analysis, it's good enough for the Arduino Plotter, and it looks like this:
This is "One Night Before The Winter" by Stilverlight.
Now, because of the above, the sampling is locked at 16KSPS, and it typically runs at 16,129 or 16,130; and it sends 1,000 lines to the plotter (or 2,000 samples) every second. The plotter isn't any faster, but at least now Java doesn't freeze and warm a core for no good reason. ☺
Why 16,129 instead of 16,000? Basic maths. 1,000,000 (microseconds in a second) does not evenly divide by 16,000; but 16,129.03 does (1,000,000÷62).
I did briefly have a crack at writing something in Python, but not only do I not know any Python so had to cobble together stuff I found online, but the Matplotlib plotter was even slower. I guess I could have tried doing something in C with SDL, but really... that's a lot of extra work that I don't feel like doing.
You will notice that I'm subtracting 15 after making the centre-zero calculation. This is because the readings were a little high on my device, quite likely because the two resistors aren't exactly equal. And maybe also because max analogue input at 11dB attenuation is 3.2V, not the 3.3V we're dividing. I noticed in the serial monitor that the quiescent results were around 15, so I simply subtract 15 to bring them down to zero.
While this might sound a lot, given that our audio signal is in the region of 60-80ish, but if you do the calculation: 3.2V ÷ 4096 × 15 then it's a hundredth of a volt.
And, finally, I have added some zero-clamping to try to reduce the noise from the reading jitter when there is no input. The previous reading will be remembered, and if the previous reading was zero and the current is between -5 and 5, then it too will be set to zero. The reason for requiring a zero value is to try to reduce the risk of this triggering during, say, quieter parts of the music. It does mean, however, that you can't just copy-paste this code, you'll need to see what counts as the baseline with your particular setup and adjust so zero is zero.
This is what a no-input signal now looks like. There's still a little bit of jitter, but I'm not going to be too gung-ho about removing everything, this is good enough.
Jitter reduction.
Oh, and in case you missed it, we may only be reporting 1000SPS over the serial port, but we're actually now running at 16KSPS. The only reason we're outputting less is because the host can't cope with what we were sending.
Still, it's not bad for a general purpose microcontroller that was actually designed to be a WiFi camera.
I think I can let this project rest now, as I've fully demonstrated using an ADC input to create an oscilloscope.
Now, you're probably thinking "but calibration? but known results?". Well, that's pretty much not going to be possible with an ESP32. You are running some code running on top of an RTOS. There's a lot going on inside.
To put this into context:
Sketch uses 930747 bytes (29%) of program storage space.
Maximum is 3145728 bytes.
Global variables use 43832 bytes (13%) of dynamic memory,
leaving 283848 bytes for local variables.
Maximum is 327680 bytes.
Yes, this tiny little bit of code consumes almost a megabyte of flash (using the 3MB huge app model), and ~42K of RAM.
How? How is this possible?
Well, it's because the prebuilt ESP32 binaries come with the WiFi code, the Bluetooth stack, all the networking stuff... These would need to be recompiled (using the Expressif IDE) in order to do things like "remove the networking code". This isn't something the Arduino IDE can do, and given that the selling point is "a microcontroller with WiFi", it's not something that's likely to be common (though it's a shame there's no pre-build "no networking" option).
In short, getting suitably reliable readings from an ESP32 would be difficult because there's always going to be the OS doing stuff in the background. Not impossible, one could sort out a timed interrupt and do it that way, but even so...
When you are using a simpler microcontroller, there is a lot less going on inside. Because of this, you can put a lot more timing priority into making your samples; again most likely hanging off of an interrupt so that you know they are regular. With our ESP32, we're waiting 62µS from the start of one sample to the start of the next, so it's probably pretty fair to say that the sample rate is, now, fairly reliable. Which means the 500 samples across the screen represent 500 (points) × 16 (samples) × 62 (µS), or 496,000µS (just under half a second). To fit a full second with once-a-second (roughly) updates, I'd probably need to send one in thirty two samples, but that's getting ridiculous.
At any rate, now we're running to a timer instead of "as fast as we can go", it is actually possible to calibrate what's on the screen. But, as a rule of thumb, each of the horizontal marked sections is a tenth of a second.
As for the vertical, well, that's just voltage. We know our range is 0-3.2V and we know that max reading is 4096; so when we see the sound hit "50", that's 3.2 (max volts) ÷ 4096 (sample width) × 50 (our reading) which is 0.039V.
This is, of course, slightly wrong. Looking with a real oscilloscope suggests a peak up to around 100mV(ish), not four times that. However, and this is important, the ADC has not been calibrated. It may return results indicating four thousand nuances between nothing and three(ish) volts, but these results are not necessarily linear.
So an important part is also calibration so we can be sure that what we think we are measuring is really what we're measuring. This is why a lot of oscilloscopes have a test signal output at, for example, 1kHz at 0.3V and 3.3V (or 5V on older devices). This can be used not only for trimming the 10× probe, but also for checking the device is measuring properly. If it's not three and a third squares on the 1V/div setting, and one square per high/low on the 500µS setting, then something is wrong.
As for the ESP32, ADC2 is noted as being non-linear, and somewhat noisy. One would normally use ADC1, but this isn't tracked out on the ESP32-CAM boards so, well, no choice. I don't have a set of known exact voltages to attempt any sort of calibration. But, again, this is something you'd do when designing a real microcontroller oscilloscope.
To demonstrate how we're "close but not quite", here's the same thing as it appears on a real oscilloscope. And do bear in mind that the ESP32 can run faster than how we're doing it here, the Java serial plotter is the issue in this setup.
Looking at the same thing on a real mini-scope.
Once we have reliability in what we are measuring, everything else can be calculated from that.
As for handling different sorts of inputs? Timebase is easy, just change how often the samples are taken. As for different voltages? Select different potential dividers. The 10KΩ-10KΩ is a divide-in-half. You could do 10KΩ-100KΩ for a divide by ten. That sort of thing. As long as the resultant voltage is within range of the ADC, you know the ADC's calibration (or know that it is properly linear), and you know how the input is divided down... you can just mathsify it.
Here's the final version of the code with the above changes incorporated. The code is fifty six lines, not including comments. Or if we omit function and no-executed variable definitions and all the brackets, the actual working code is a mere thirty three lines.
// Quick'n'dirty ESP32-CAM oscilloscope// Uses GPIO13 (ADC2_CH4)//// By Rick Murray, February 2026// "just because" ;)//// https://heyrick.eu/blog/entry/20260221//#include <WiFi.h>#include"Esp.h"#define ADC_PIN 13#define INT_LED 33#define SAMPLE_RATE_HZ 16000// 16kHz ideal sample rate#define SAMPLE_PERIOD_US (1000000 / SAMPLE_RATE_HZ)voidsetup(){
Serial.begin(1000000);// Fast serial is important here!delay(1000);// Wait for everything to get going// Disable WiFi to allow ADC2 to work
WiFi.mode(WIFI_OFF);btStop();analogReadResolution(12);// 0–4095analogSetAttenuation(ADC_11db);// ~0–3.2V range// Print a banner
Serial.println("ESP32-CAM QuickScope 2026/02/21");// Now turn on the LED so we know we've started uppinMode(INT_LED, OUTPUT);digitalWrite(INT_LED, LOW);// remember, it is inverted}voidloop(){static uint32_t next_sample =micros();static uint32_t count =0;static uint32_t last_ms =millis();static int sendwhen =0;static int previous =0;// Perform the samplinguint32_t now =micros();if((int32_t)(now - next_sample) >=0){// Read this sample
next_sample += SAMPLE_PERIOD_US;int sample =analogRead(ADC_PIN);// Convert the result to be centred around zeroint centred = (sample -2048);// Fudge for our specified setup due to resistor inequality
centred -=15;// Try to filter out jitter during silenceif( previous ==0){// Only invoke this if we got an initial zero readingif( ( centred > -6) && ( centred <6) )
centred =0;// then count anything +/- 6 to also be silent}
previous = centred;// Only send every SIXTEENTH sample// We currently discard the rest, but could maybe instead do// something clever like average them?
sendwhen++;if( sendwhen >15){// Output as a plain number for Serial Plotter
Serial.print("90 ");// the fake to defeat autoscaling
Serial.println(centred);// the real
sendwhen =0;}// Count our sampling rate
count++;// And report every seconduint32_t now_ms =millis();if(now_ms - last_ms >=1000){
Serial.print("SPS=");
Serial.println(count);
count =0;
last_ms = now_ms;}}}
If I was going to do any more (I'm not), I would look to writing a custom protocol that just sends a sequence of sixteen bit values with no newlines. Once a second, a sync value of &FFFF would be sent, and the code would filter if the second byte is &FF and subtract one; this would barely change anything but would make any &FF byte be the start of the sync value (simplifying the receiver code). Then this would be dumped to the screen as quickly as possible.
It might also be useful for the ESP32 to receive commands, like to trim the baseline up and down, to turn the jitter masking on and off, to change the sample delay, etc.
There's more that could be done, but that's an exercise for you, the reader. I'm done with this particular experiment now. I hope you enjoyed reading this.
Your comments:
Please note that while I check this page every so often, I am not able to control what users write; therefore I disclaim all liability for unpleasant and/or infringing and/or defamatory material. Undesired content will be removed as soon as it is noticed. By leaving a comment, you agree not to post material that is illegal or in bad taste, and you should be aware that the time and your IP address are both recorded, should it be necessary to find out who you are. Oh, and don't bother trying to inline HTML. I'm not that stupid! ☺ As of February 2025, commenting is no longer available to UK residents, following the implementation of the vague and overly broad Online Safety Act. You must tick the box below to verify that you are not a UK resident, and you expressly agree if you are in fact a UK resident that you will indemnify me (Richard Murray), as well as the person maintaining my site (Rob O'Donnell), the hosting providers, and so on. It's a shitty law, complain to your MP. It's not that I don't want to hear from my British friends, it's because your country makes stupid laws.
You can now follow comment additions with the comment RSS feed. This is distinct from the b.log RSS feed, so you can subscribe to one or both as you wish.
C Ferris, 21st February 2026, 21:16
Henry 7 Part xx
How old was his mum when he turned up??
Rob, 22nd February 2026, 14:58
# - used that line myself, before I saw you use it. And it was used by Jonathan Pie on YouTube yesterday, so it's definitely now in common vernacular. Obvious, but hilarious!
jgh, 22nd February 2026, 17:26
I'm a pretentious prat who knows a little bit of Latin, so I call him Andrew Frater Regis. ;)
They're all scrambling to legislate to remove him from the line of succession, as if eight existing Royals are all going to snuff it in some bizaire shooting accident while combing their hair.
David Pilling, 23rd February 2026, 00:10
I think you should treat yourself to an ESP32 with all (or more) of the pins brought out. As I recall there are some nice ones around.
In reality one would not want to be an old fashioned King either - have to sleep with one eye open.
David Pilling, 23rd February 2026, 01:08
That photo, 'red eye', classic photo, old fashioned bad photography. If he had used modern hardware, not present.
This web page is licenced for your personal, private, non-commercial use only. No automated processing by advertising systems is permitted.
RIPA notice: No consent is given for interception of page transmission.