tag:blogger.com,1999:blog-39934988472031833982024-03-18T12:28:29.932+00:00RevK®'s ramblingsRevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.comBlogger2916125tag:blogger.com,1999:blog-3993498847203183398.post-60399439861838259802024-03-16T16:31:00.013+00:002024-03-17T18:14:50.493+00:00Missing unix/linux/posix file open option<p style="text-align: left;">What I would like is a file open option for "create replacement file".</p><p style="text-align: left;">The idea is that this makes a new inode in the same mount point as the target filename, which has no actual directory entry, but <i>on close </i>it replaces the directory entry of the specified path with the new file.</p><h3 style="text-align: left;">Why?</h3><p style="text-align: left;">There are many situations where you want to make a new file to replace an existing file, but want the change from old to new file to be atomic at the file system level.</p><p style="text-align: left;">Something reading the half written new file is bad.</p><p style="text-align: left;">So you make a new temporary file, and then finally use <span style="font-family: Source Code Pro;">rename()</span> to replace the original, but that is only atomic if you are on the same mount point. You cannot simply use a <span style="font-family: Source Code Pro;">mktemp()</span> in <span style="font-family: Source Code Pro;">/tmp</span> for that as the target file may not be on the same mount point as <span style="font-family: Source Code Pro;">/tmp</span>. So you make a file with a dot prefix and some suffix or something. Messy. And needs cleaning up if you crash.</p><h3 style="text-align: left;">Easy?</h3><p style="text-align: left;">It really would not be hard, I am sure, for the underlying filing system to support this as a file open mode. The atomic replacement of the directory entry is already a thing in <span style="font-family: Source Code Pro;">rename()</span>, and the idea of a file not in a directory but using space while open is easy - make a file and unlink it before closing. So the underlying mechanisms for this exist.</p><p style="text-align: left;">The only caveat, as a really useful extra feature, would be if not a "clean" <span style="font-family: Source Code Pro;">close()</span> call, i.e. a close because code aborted or exited without calling <span style="font-family: Source Code Pro;">close()</span>, it would *not* replace the original, just lose the new file as not in a directory. This helps cover the crash case, and always cleans up inherently.</p><p style="text-align: left;">This would be so useful.</p><p style="text-align: left;">And, of course, make gcc use this for making binaries!!!</p><p style="text-align: left;">Just to be clear, I am not suggesting "buffering" the whole file. The system to have an open file not in a directory already exists. One can create a file and open it and unlink it and still write to it, on to "disk". That is the "buffering" here. Just atomically either lose the new file (if crash, as would happen if you did that) or replace the directory entry with it and lose the old file, on clean <span style="font-family: Source Code Pro;">close()</span> call.</p><h1 style="text-align: left;">You can nearly do it!</h1><p style="text-align: left;">Thanks for all the feedback, it is close... <span style="font-family: Source Code Pro;">open()</span> explains a <span style="font-family: Source Code Pro;">_GNU_SOURCE</span> specific option <span style="font-family: Source Code Pro;">O_TMPFILE</span>. This allows you to create an unnamed file which will vanish when you close, even if you crash. It then explains you can use a slightly convoluted call to <span style="font-family: Source Code Pro;">linkat()</span> to name the file before you close it. This nearly does the job, but not quite.</p><p style="text-align: left;"></p><ol style="text-align: left;"><li>The <span style="font-family: Source Code Pro;">open()</span> call needs a directory so it knows file system. Annoyingly you cannot pass the filename you want and have it work out the directory. It has to be the directory, meaning you have to faff about getting the directory from the file name. Not a big faff, obviously.</li><li>The <span style="font-family: Source Code Pro;">linkat()</span> call needs <span style="font-family: Source Code Pro;">CAP_DAC_READ_SEARCH</span> set. There is a convoluted way to using <span style="font-family: Source Code Pro;">/proc/</span> otherwise. More faff. Also, given that there is a <b>documented</b> way around the limitation, why is it dependant on a capability in the first place?!</li><li>The <span style="font-family: Source Code Pro;">linkat()</span> call expects the new filename not to exist.</li></ol><p style="text-align: left;">This does allow a file to be atomically created as a complete file, with no temp files if you crash. But this last point is the show stopper as it means you have to <span style="font-family: Source Code Pro;">unlink()</span> first, leaving a small window where the file does not exist. That or you link to a temporary file name and use <span style="font-family: Source Code Pro;">rename()</span> which puts us almost back where we started, albeit with a smaller window for leaving a temp file behind.</p><p>The obvious fix would be a new flag to <span style="font-family: Source Code Pro;">linkat()</span> to allow replacing the new file. That or allow <span style="font-family: Source Code Pro;">AT_EMPTY_PATH</span> in <span style="font-family: Source Code Pro;">renameat2()</span>.</p><p></p>RevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.com6tag:blogger.com,1999:blog-3993498847203183398.post-26505933873757596252024-03-12T16:44:00.013+00:002024-03-15T16:17:30.310+00:00Separating waste<p style="text-align: left;"></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGqnErGs_dvBfIIj0XImEJcC1_Y4XxOJSMwTy6_2R_DvyfXDd0t9U3996f_849MVXjosBc4WT5vX8yTwOL-c8vRZx_YNdxxWlrSEUs8AVBE8uOShuh_epOBrUVzZr2IoQ8gQ3hHLwL8Qt05DaX9T8pFk0uVfooPC4pbitTXHAwjqsVOtvhg2qJw2wo3fa1/s800/240_litre_colour_comparison.jpg" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="800" data-original-width="800" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGqnErGs_dvBfIIj0XImEJcC1_Y4XxOJSMwTy6_2R_DvyfXDd0t9U3996f_849MVXjosBc4WT5vX8yTwOL-c8vRZx_YNdxxWlrSEUs8AVBE8uOShuh_epOBrUVzZr2IoQ8gQ3hHLwL8Qt05DaX9T8pFk0uVfooPC4pbitTXHAwjqsVOtvhg2qJw2wo3fa1/s320/240_litre_colour_comparison.jpg" width="320" /></a></div>I was not sure of posting this as it makes us look bad, so sorry about this.<p></p><p style="text-align: left;">Over the last few, what, decades, domestic waste collection has changed. And mostly without us noticing!</p><p style="text-align: left;">It all started a long time ago, we used to have a "dustbin" and any number of black bags taken away by the council. They had a legal obligation to remove <b>all</b> domestic waste.</p><p style="text-align: left;">Then one day it was "green wheelie bin", and they provided one. There were sizes for different houses. At this time we had five kids, and, I think, a lodger. We made plenty of domestic waste. We got a big bin.</p><p style="text-align: left;">So it was wheelie bin and extra bags.</p><p style="text-align: left;">Then the council said they would not take extra bags - it was because the vehicles were all set up for wheelie bins now. It made it much more efficient. So I asked.. "If it is more efficient, how much can I expect to see a reduction on my council tax bill?", and I did not get a sensible answer. I asked how they know it is more efficient, with no helpful answer!</p><p style="text-align: left;">Anyway, they said they <i>were not restricting the amount of waste we produce,</i> but it was a limitation of the vehicles, so I suggested "fine, empty the wheelie bin, then put the extra bags in the empty bin, and empty that". It was a simple and practical solution, but for some reason they were not happy to do that, suggesting their "reason" for not doing it was not as they said.</p><h3 style="text-align: left;">The answer was simple.</h3><p style="text-align: left;">We purchased another wheelie bin!</p><p style="text-align: left;">For some time, many years, this worked, even when we moved house. And many locals had an extra wheelie bin.</p><p style="text-align: left;">Then, one day, with a note saying the would now only collect one wheelie bin, they stole our extra wheelie bin! I meant to sue them for the cost.</p><h3 style="text-align: left;">I gave up!</h3><p style="text-align: left;">This is very unlike me, but I decided to give up!</p><p style="text-align: left;">Just to be clear, I was not giving up on recycling or trying to avoid it. At the time the council only did the one type of collection - the general waste green wheelie bin. My issue is they stole one of our bins and refused to actually collect all the waste we produced.</p><p style="text-align: left;">So I simply engaged a commercial bin collection at the house.</p><p style="text-align: left;">I kept meaning to bill the council for this on the basis they had a legal obligation to collect all domestic waste, and were failing. I never got around to it.</p><p style="text-align: left;">When we moved, 3 years ago, we kept the commercial collection, simples. Why not?</p><h3 style="text-align: left;">Left out of the loop here</h3><p style="text-align: left;">The problem is we have been left out of the loop here. For decades now we have simply put all rubbish in one bin, with black bags, and that was it, as we have for decades before.</p><p style="text-align: left;">Whilst others have gone through many changes of many coloured bins and bags and so on, we have not.</p><h3 style="text-align: left;">Turning over a new leaf...</h3><p style="text-align: left;">As Wales have now made even commercial properties do waste separation, we have to get in to this, all of a sudden. This is a bit of a shock.</p><p style="text-align: left;">It does not look too hard, honest. Cans, bottles, card and paper, etc.</p><p style="text-align: left;">It seems laws have changed over the many years. We have not had to notice.</p><p style="text-align: left;">So yes, we are finally doing the domestic waste separation - thrown in the deep end. I am almost shocked you cannot just pay someone to do that for you - seems an obvious commercial opportunity.</p><p style="text-align: left;">It means a place in the house for the various bags, and bins, and containers. Finding what day they collect each. But I am sure we will manage.</p><p style="text-align: left;">Thanks to one of my daughter's for help with this.</p><h3 style="text-align: left;">Doing things right.</h3><p style="text-align: left;">As someone says, I like to do things right, and we do have solar power generation we feed in to the grid and a green energy tariff and so on. I don't drive, and have not for decades. We had not actively tried to avoid waste separation, but to be honest I have not looked in to it either. It all kicked off with the council being arseholes and stealing our bin, and then it was a non issue as we got a commercial bin.</p><p style="text-align: left;">I am not entirely convinced the pushing responsibility on to individuals just going about their lives is the answer to climate issues, when so many big industries dwarf anything we can do, to be honest, but I do understand we do all need to take things seriously, and I already do quite a bit - just not this specific bit until now. Sorry. And I chose to post this to say sorry to some extent.</p><h3 style="text-align: left;">Update:</h3><p style="text-align: left;">Wow, it is crazy, there seem to be no standards. I decided it would be a good idea to get some partitioned and/or stacked bins for the house. Make sense.</p><p style="text-align: left;">But the labelling and colours do not match what the council have. And the categories do not match. E.g. we have a green plastic tub for glass, but tins go in with plastic. Yet almost all bins you can by combined glass and tins in one bin, so would have misleading labelling, and nothing matches the colours.</p>RevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.com10tag:blogger.com,1999:blog-3993498847203183398.post-62542763480320950522024-03-11T15:44:00.005+00:002024-03-11T15:59:41.841+00:00How not to QR (again)<p style="text-align: left;">I have mentioned a bit about QR codes before (<a href="https://www.revk.uk/2024/02/qr-marketing.html">here</a>).</p><p style="text-align: left;">But today I saw an example of a QR done badly!</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9izpolwqNzQJKHXiq5oQpzLLc2zPl2_cOESLnKqlV2qzyivuoPu1nPWecHDwB-PP8grWm9oGlBW1huRp3gXk1ANRAF5PjKFYn9B385qOV9VtFd1KMhqBnWEqWpK8cSRHebKUvftwCQMJnfM0nt1iGR7h14epj9XctkNabWk0U3CLhR1IMqkSQ7RruIoYN/s5712/IMG_1784.heic" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="5712" data-original-width="4284" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9izpolwqNzQJKHXiq5oQpzLLc2zPl2_cOESLnKqlV2qzyivuoPu1nPWecHDwB-PP8grWm9oGlBW1huRp3gXk1ANRAF5PjKFYn9B385qOV9VtFd1KMhqBnWEqWpK8cSRHebKUvftwCQMJnfM0nt1iGR7h14epj9XctkNabWk0U3CLhR1IMqkSQ7RruIoYN/w300-h400/IMG_1784.heic" width="300" /></a></div><p style="text-align: left;">The QR code contains a reference, an alphanumeric code and number, and name of student. But the <i>passcode</i> is just the first part (8 character code).</p><p style="text-align: left;">So what is wrong here?</p><p style="text-align: left;"></p><ol style="text-align: left;"><li>The machine readable part, the QR code, has the redundant extra information of student name, why? QR has error check and correction code, so no need.</li><li>People expect a QR code to be <i>scannable</i>, and for that to be anything useful it is best done as a URL. This is just text.</li><li>The instructions ask you to go to a web site, and enter a pass code.</li></ol><p style="text-align: left;">This could be so much better as a URL with a <i>passcode</i> on the end, perhaps as a query.</p><p></p><ol style="text-align: left;"><li>The user could scan it, and even if it only went to the web site, that saves a lot of typing.</li><li>The web site could use the query on the end to actually do the next step and save typing the <i>passcode</i>.</li><li>If they need the QR for face to face stuff, collecting photos, whatever (which does not seem top be the case, so why even have the QR code at all on the paperwork), then scanning can easily skip the URL part and read the <i>passcode</i> part. Though the wording sounds like this may be printed first and scanned as part of taking photos - fine, scan with a URL in it, that does no harm.</li></ol><p style="text-align: left;">And example of a case we have is serial numbers on FireBricks.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhG2RocarGwkLhp8exU1os5t4IanbvgYEsMMFBHpAvywqTNzVuhhXxsKnRL2YtGGyIjvTat7vFWEWlh3m06Ojy00R1onEk5eshB_b1dkfWO_yFiQ9AC23SVntrbxx5foWEwTCb2lfjzur79ScORcgboGLTBl9bk4gZHuK8wqKxwK8MdCIckdq49YeM020jT/s1064/9000-0005-0159.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="330" data-original-width="1064" height="99" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhG2RocarGwkLhp8exU1os5t4IanbvgYEsMMFBHpAvywqTNzVuhhXxsKnRL2YtGGyIjvTat7vFWEWlh3m06Ojy00R1onEk5eshB_b1dkfWO_yFiQ9AC23SVntrbxx5foWEwTCb2lfjzur79ScORcgboGLTBl9bk4gZHuK8wqKxwK8MdCIckdq49YeM020jT/s320/9000-0005-0159.png" width="320" /></a></div><p style="text-align: left;">The QR code contains <span style="font-family: Source Code Pro;">HTTPS://FB0.UK/900000050159</span> which serves two purposes. When scanned by a user it goes to the product page, but when scanned by my staff for a serial number on a delivery note or invoice, the <span style="font-family: "Source Code Pro";">HTTPS://FB0.UK/</span><span style="font-family: inherit;"> is skipped by the </span>system<span style="font-family: inherit;"> and the serial </span>number<span style="font-family: inherit;"> correctly recorded.</span></p><p></p><p></p>RevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.com1tag:blogger.com,1999:blog-3993498847203183398.post-20043681657881026882024-03-09T18:02:00.008+00:002024-03-11T16:11:18.444+00:00Except for access<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhegIcLtQ4EOTHMhM4V8yoWyizRrkqLwLxTob7zhsM1arIURyv4F3qXuztK2MFjLqe8LIf1ZTJInhZL7TyfZTLlw5Efm0F80uGtCG47j31_CQLzpBeS_0LtjvrnOd47RXbdxRIZ2MmOzlPaXPcZtg5_TPS1LPMnkDTaU3nd4N4UTZePAkmQ9gS0WwVrrOJD/s998/i.php.jpeg" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="998" data-original-width="804" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhegIcLtQ4EOTHMhM4V8yoWyizRrkqLwLxTob7zhsM1arIURyv4F3qXuztK2MFjLqe8LIf1ZTJInhZL7TyfZTLlw5Efm0F80uGtCG47j31_CQLzpBeS_0LtjvrnOd47RXbdxRIZ2MmOzlPaXPcZtg5_TPS1LPMnkDTaU3nd4N4UTZePAkmQ9gS0WwVrrOJD/s320/i.php.jpeg" width="258" /></a></div><p style="text-align: left;">Drivers should be aware what road signs mean. And so they need to be clear and unambiguous.</p><p style="text-align: left;">But some are a tad more challenging than others, and this is one example.</p><p>The "no motor vehicles" part, is easy. The issue is the "except for access". The signage site from which I nicked this image says "<i>this sign grants permission for vehicles to pass but only for reasons of accessing premises or land adjacent to the road.</i>" Our version has Welsh as well :-)</p><p>That is not a bad description.</p><p>But it seems not quite 100% clear in some cases. It seems (and if someone can confirm this is correct, or not, do comment), that these signs relate to an <i>order</i> that the council may have made. That order may have subtly different wording. The problem is that the motorists seeing the sign is in no position to find the order (which may be on display in the bottom of a locked filing cabinet stuck in a disused lavatory with a sign on the door saying "Beware of the Leopard" in the basement of the council offices). So hopefully motorists can rely on something simple like "<i>for reasons of accessing premises or land adjacent to the road.</i>"</p><p>The only reason this came up is because I live on a corner of two roads, a main road, and a side road. The side road (well, three connected roads/closes from it) are subject to such an order. And it seems, before we purchased the property, this all kicked off with local residents of these side roads, understandably, pissed off over people parking in their (!) road just to visit the station - because the station car park is too small and costs money. I do understand, really. What we need is better station parking at a reasonable price, or free. That would solve it.</p><p>But, for some reason that I do not know (I was not here), even though including the next three properties with an address on the main road, like mine, they did not include what is now my property in any of the discussions, or "mailing list". And being not on the mailing list means now I am "talking out of my arse", oddly enough. I have met some of these people, and face to face they seem nice enough, and I have done my bit for the local area and the road (repointing a wall, and refurbishing a sign). I want to be a part of the community. But those that know me know that I try to do thins "right".</p><h2 style="text-align: left;">So what is the issue?</h2><p>Well, I investigated this some years ago, largely because the side road has a load of "resident permit parking only" signs (cheap plastic, stuck to lamp posts, in English only, big clue). They seemed <i>suspect</i> at least. I found there is no way to apply for a permit! Indeed, when some of my visitors parked on the side road they got harassed and stickers on their cars, which itself may be an offence.</p><p>The person from the council, discussing (what was then a temporary order) was quite confrontational. He was adamant that "access" to my property (on the corner) somehow did not count, as I needed a <i>drive</i> on the side road(s) covered by the order. Well, some of the properties "on the road" don't have driveways, so clearly that makes no sense and even the legislation revers to pedestrian access. The fact we also have access from another road also makes no sense, but he tried that (several other properties have various levels of access from other roads as well). But he was pretty adamant, and I go nowhere (apart from them moving the signs maybe 30cm or so, in order not to actually be on my property).</p><p>To be clear, we have a nice drive space (three cars), and rarely will a visitor not be able avail themselves of that, but if not, then parking in the side road makes sense, just like anyone else in the area - these are not people parking to use the station, after all. Parking on the main road, a major A road, is not a good idea.</p><p>It came up again recently following a facebook post, which wound me up enough to email the council at 2am, but I got someone way more sane, well, mostly.</p><p>The "order" is not too bad now. It has been finally made a <i>permanent</i> order. "<i>No person shall cause any motor vehicle to proceed in any of the lengths of road shown coloured blue on Drawing Number 1823 attached to this order except for access to properties situated along those lengths of road.</i>", which leads to the question of "<i>situated along</i>" - a wording that is not quite the same as "<i>adjacent</i>". Adjacent definitely covers my property, as I have a long wall on a border on the side road, but what is "<i>situated along</i>"?</p><p>The council stated it is a contravention if "<i>a motorist accesses these roads with the intention of accessing a property or business without a direct vehicular or pedestrian access point from..</i>" so that sort of means they consider "<i>situated along</i>" as "<i>having a direct vehicular or pedestrian access point from</i>". Is that the actual legal meaning? I have no clue.</p><p>Actually, that is really odd, they have to have the intention to access a property or business at all, and one <b>not</b> on the road. Surely they can have intention to access a property <b>on</b> the road <i>and</i> one not on the road? That wording is way more restrictive than the actual wording of the order. I think it is therefore wrong.</p><h1 style="text-align: left;">Should it be this hard?</h1><p>My concern here is that it should not be so complicated! How the hell is a driver meant to know the exact wording of the order, know it says "situated along", know that accessing a property not on the road (as well as on the road) is prohibited, and what "situated along" means exactly. No, clearly that is insane!</p><h1 style="text-align: left;">Do I qualify?</h1><p>Well, thankfully, even though my property is absolutely "<i>adjacent</i>" to the road, and has a nice long wall on the road in question, it has maybe 1.5m of non-wall which is clearly pedestrian access from the road in question, with a pedestrian dropped kerb even. So I am pretty sure that is the case.</p><p>This is a slight problem as I am not "in the club", and have no "permits" (more below). So my visitors may quite legally enter the side road, and park, to visit me, without showing a permit. Why they chose to exclude my property from the discussions is unknown to me.</p><h3 style="text-align: left;">Crossing the line.</h3><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPkA_gbbOeJM23F3wqhgLjbUIK-01626cNGT7o3gHX3R0ck4L5g-KL3x3w9MeFLuCAorjELF68VXbGwZeLwE-FIJ_fKigTEb9-M0L_06oJf1O-zh1eMehet_maO1vDAN4cJqmn0Ei3u8m_0j3XbOcSqFjNHNP2h5yRsH_DRygsXA-PDO8NDykVoeT9x8_E/s202/Screenshot%202024-03-09%20at%2017.04.51.png" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="162" data-original-width="202" height="162" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPkA_gbbOeJM23F3wqhgLjbUIK-01626cNGT7o3gHX3R0ck4L5g-KL3x3w9MeFLuCAorjELF68VXbGwZeLwE-FIJ_fKigTEb9-M0L_06oJf1O-zh1eMehet_maO1vDAN4cJqmn0Ei3u8m_0j3XbOcSqFjNHNP2h5yRsH_DRygsXA-PDO8NDykVoeT9x8_E/s1600/Screenshot%202024-03-09%20at%2017.04.51.png" width="202" /></a></div>One slight caveat on the email from the council was "<i>The point at which the order begins is where the signs are installed</i>". Well, this is 100% incorrect, but I wonder if he said this to try and exclude me. The signs are the end of my wall, and my "pedestrian access" is before the signs. To park and access my property on foot means walking back passed the signs.<p></p><p>I say it is 100% wrong, with confidence, as the order states the names of the roads, and even has a plan with "blue" marking the roads. It shows the order starts at the main road. It even shows the signs position. So my property absolutely has pedestrian access from the area covered by the order, if that is what "<i>situated along</i>" actually means, and not just "<i>adjacent</i>" to. Even if the order started <i>at the sign</i>, I would be properly "situated along" the named road by the definition given, but clearly the order "starts" several metres before at the edge of the main road.</p><h1 style="text-align: left;">Why is this all stupid?</h1><p>This is all silly, and the reason is that the clear stated intention is to <i>restrict parking</i>. The order says that is why it is made. It is what the locals want. It make sense. But this is <b>not</b> a parking restriction!</p><p>One issue is that the legislation allowing the council to even make a "no motor vehicles" order lists why they can do that, and <i>parking restriction</i> is not one. I raised this with the previous (unhelpful) contact and the best he could do was "maintain the character of the area". I pointed out the character of the area was "lots of cars parked with people using the station" and he was "improving" (i.e. not "maintaining") the character. The response seems to be the order saying: "<i>If any person wishes to question the validity of the Order or any of its provisions on the ground that it or they are not within the powers conferred by the Act, or that any requirement of the Act or of any instrument made under the Act has not been complied with, that person may, within six weeks from the effect of the order 2a June 2023, apply for that purpose to the High Court.</i>" which seems odd, as I would expect if the order is invalid, it is invalid without time limit, and someone could challenge it as invalid in defence of a penalty charge / conviction for the driving offence. I may be wrong.</p><p>Surely the answer would be to actually make a proper parking restriction?!</p><h1 style="text-align: left;">Even if the order is valid, then what?</h1><p>If the order is valid, then what? Well, it seems to be a <i>moving traffic offence</i> enforced by the police, so that seems to me to mean the police have to see (or maybe CCTV) a vehicle crossing the signs, and then what? Follow the driver and all passengers to see if any of them access a property? The rules allow for "intend" to access a property so someone could aim to visit someone, park, call, and find the are out, and leave, and be legal. Someone could visit and park on the basis that it is close to a property they will visit when the return from going to Newport on the train - again <i>intention to access a property</i> "situated along" the road even if police officer follows them to the station. And then what is <i>access</i>, well, anyone actually intending to circumvent these rules just needs a few Chinese menus, and record themselves dropping one in a letter box on each visit as they walk to the station. They have "<i>accessed</i>" a property in the area covered by the order in doing so, and having done so there is no parking restriction to stop them parking for as long as they like.</p><p>So, in essence, enforcing this is almost impossible. My understanding is that these orders are usually for "rat runs" when someone drives in one end of a road and out of the other end - which is easy to enforce. Trying to enforce this use "as a parking restriction" has to be almost impossible.</p><p>So the best they can do is infer someone parked may have not planned to visit someone, because they have no permit. If <b>all</b> of the residents ensure all visitors show a permit, then maybe that can be inferred (apart from the Chinese menu trick). Apparently the whole permit scheme has been agreed with residents (not me) and council and mayor and police, so facebook says. But we have not been included, so our visitors will have no permit, so just as well no permit scheme exists legally.</p><p>But it gets worse, there is a small single track road leading in to the same area that has no signs, so even if someone was parked, and did not show a permit, and just parked to go to the station, they just have to say they came in that way, no passing signs and so no <i>moving traffic offence</i>.</p><h1 style="text-align: left;">The fix?</h1><p>Scrap this stupidity, which is questionably legal anyway, and leaves so many loopholes, and actually do a proper parking restriction, or better still have free and available parking for the station so nobody needs to park in these side roads!</p><p>If it was actually permit parking, we would apply for a couple of permits just in case.</p><p>I want to be part of the community here, and any help I can offer in making this right and workable, I am happy to offer. I do have a property "on" the road in question. But telling me I am "talking out of my arse" on facebook is not the way to progress matters, is it?</p><p>We'll see how it goes.</p><p>Or this :-)</p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_3vX6b_3uEYYjkgK2gEJThS1kl1jvfunbkpTZVZkEKufF_efZdGDjMjEO2_cLRtVP9i66L9-jbW-_mxIsXhhy8zAZ2UFUVQgqhGMuyjpmlZwNN_k9Ap0lajo49a-NxOYXiDdBeuqvPH8m1PMecWyKG7zxm9ciQH8prgFTtFCuzxPDam6lXJVBcfaq-5dA/s442/JPEG%20image.jpeg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="333" data-original-width="442" height="301" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_3vX6b_3uEYYjkgK2gEJThS1kl1jvfunbkpTZVZkEKufF_efZdGDjMjEO2_cLRtVP9i66L9-jbW-_mxIsXhhy8zAZ2UFUVQgqhGMuyjpmlZwNN_k9Ap0lajo49a-NxOYXiDdBeuqvPH8m1PMecWyKG7zxm9ciQH8prgFTtFCuzxPDam6lXJVBcfaq-5dA/w400-h301/JPEG%20image.jpeg" width="400" /></a></div>RevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.com4tag:blogger.com,1999:blog-3993498847203183398.post-69461907178635806252024-03-09T15:32:00.006+00:002024-03-09T16:36:13.477+00:00THINK!<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiK0Q2TmHm54xJasUvFxGIb0-4u8YaoUAPpsRjFBDi4esh9a3nW6tqmz0CmThLMAICZxEz_sJg4J3_sidMtMqv_8wo-AhyC4mHeidojarJ9ud2leytp3xICFrKougXa0IysEaozBLmiw0ceBM5nb7_Eeol83LgmndWwXf6Pn-v4qqB8etDMu-L960g77HQo/s3325/d5dc6821259530ff.jpeg" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="3325" data-original-width="2494" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiK0Q2TmHm54xJasUvFxGIb0-4u8YaoUAPpsRjFBDi4esh9a3nW6tqmz0CmThLMAICZxEz_sJg4J3_sidMtMqv_8wo-AhyC4mHeidojarJ9ud2leytp3xICFrKougXa0IysEaozBLmiw0ceBM5nb7_Eeol83LgmndWwXf6Pn-v4qqB8etDMu-L960g77HQo/s320/d5dc6821259530ff.jpeg" width="240" /></a></div><p style="text-align: left;">This was the scene I saw, walking from my house last night.</p><p style="text-align: left;">The reason is that there are some over night closure of one side of the road (behind me in that view), so one way and traffic lights, for resurfacing (something we all want done).</p><p>So what's the problem? Interestingly, posting this on mastodon, there was almost entirely very understanding response (contrary to the arguments that would have instantly ensued on 𝕏, and why I avoid it). Indeed, some pointed out they would ask the council to move the obstruction to the footpath, or take in to their own hands (not ideal). But is there a <i>problem</i> and what is the <i>solution</i>.</p><p style="text-align: left;">My main issue here is that those placing the signs probably did not think for one second about what they were doing. They presume that (a) they cannot possibly inconvenience drivers by putting the signs on the road itself, and (b) that this would be no inconvenience to pedestrians or that pedestrians simply don't matter somehow. It is also very common when there is a cycle lane for signs to appear in the cycle lane, totally blocking its normal use.</p><p style="text-align: left;">What is weird here is that these signs are to announce a serious inconvenience to motorists - a blocked lane and traffic lights, so considering <i>not inconveniencing them</i> with signs in the road seems a tad odd even. It's a 20mph road, with good street lighting, so not like they need lots of advance warning.</p><p style="text-align: left;">For pedestrians, many of us can walk around them, but a lot harder for wheelchair users, or blind, and so on. Not a single thought given to them.</p><p style="text-align: left;">Is there a solution? Well the main thing is consider <i>all</i> road users. It may be that the signs could have been placed in the gutter and partly on the pavement leaving space for both cars, and pedestrians (even in a wheelchair) to pass with minimal inconvenience. It would depend on the road/pavement in question, but this pavement may be wide enough. When not the case, well, these signs are not related to pedestrian use, so simply put them in the road, surely?</p><p style="text-align: left;">But whatever, someone putting up signs needs to actually think - simple as that!</p>RevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.com1tag:blogger.com,1999:blog-3993498847203183398.post-53490176458726405982024-03-05T14:43:00.002+00:002024-03-05T14:46:11.015+00:00One can dream<p style="text-align: left;">It is nice to dream, and daydream even. Is it a "daydream" when lying in bed, not actually asleep, but just coming up with daft ideas to ponder while you fall asleep? You all do that right? Anyway, I am sure many have done exactly the same in thinking of crazy things for the hell of it, like "what if I could fly?", "what if I could teleport?", and perhaps even "what if I was a god?".</p><p style="text-align: left;">The "what if I was a god?" one is entertaining to ponder, like, I suddenly find I can do anything, (maybe I crack the back door in the simulation) - do I keep quiet and do things in small ways for fun, or what. Of course the obvious thing to do, (well, apart from just fix the climate, just fix poverty, etc), but especially with the state of world, is to <i>smite the hell</i> out of of some of the political figures and world leaders that are being dicks in my humble opinion. Zap them with lightning, Thor style, or make them disappear, or if you want to be subtle, just make them ill. One idea in such a daydream, was send them to <i>hell</i> for 1000 years and then bring them back with no time passed. Proper smiting stuff. One can dream!</p><p style="text-align: left;">But when exploring the idea you quickly realise smiting, and punishment don't make sense. If they are being dicks, just change them, use your omnipotence to just make them "nice". Problem solved.</p><p style="text-align: left;">Indeed, the whole concept of punishment, and hence also reward, and even rules, and tests, all make no sense for an omnipotent god. Would such ideas even occur to a god? They sort of make sense to a parent trying to adjust the behaviour of a child, but only because parent can't simple change the behaviour of the child directly. A god has no reason to consider the concept of punishment or reward.</p><p style="text-align: left;">If a god wants to make its beings, for whatever game it is playing, it can make them "play nice" in the first place. Or the second place, if first time it realises its beings turn out to be dicks, but obviously a god would have known that was going to happen, so let's stick to "in the first place".</p><p style="text-align: left;">This is not really a "free will" thing, either. Maybe a god wants its beings to have <i>free well</i> to see how things go, fair enough, it is adding a roll of the dice to the game. But free will is always limited. I have free will - I can do any spontaneous shit I like, even if silly or stupid, but my free will can never make me poke a red hot poker in my eye. My free will has limits. So if a god wants some simple "play nice" rules, like the whole "not killing other people" one, which seems sane, then just make its beings have a natural aversion to the whole idea of killing people, just like the "poker in the eye" thing. Then they can still have lots of free will but within some sensible constraints. No need to even tell them the rules, or write them down, and certainly no need to punish them or reward them in any way.</p><p style="text-align: left;">It makes you wonder why gods in many religious texts include concepts of punishment, reward, tests, and rules, when an omnipotent deity would not even have to consider such concepts in the first place.</p><p style="text-align: left;">I'm not the first to ponder this by any means, I am sure. This will have some famous person's name on it, from 1000 years ago, won't it?</p>RevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.com2tag:blogger.com,1999:blog-3993498847203183398.post-63404207461881490212024-03-04T15:40:00.012+00:002024-03-04T16:24:45.716+00:002038<p>This may be slightly topical now as we have seen a seriously surprising number of <i>leap year issues</i> this year, or so it seems. See <a href="https://codeofmatt.com/list-of-2024-leap-day-bugs/">https://codeofmatt.com/list-of-2024-leap-day-bugs/</a></p><p>It is quite amazing how any programmer gets something as simple as leap years wrong. There was some excuse in 2000 maybe as people had the vague idea that every 100 years there is no leap year, but 2000 was an exception to that (every 400 years), so for the last 123 or so years we have had a leap year every 4 years. It is pretty damn simple. Personally, a much bigger issue is coding for clock changes twice a year, but leap years are simple, and there are a lot of libraries for it, so what the heck?!</p><h1 style="text-align: left;">Y2K was a joke?!</h1><p>One of the other things I hear is people saying all the concern over <i>Y2K bugs</i> was just a waste of time as basically <i>nothing happened</i>, which is true for most people for most things. To be honest I think I heard of fewer Y2K issues than I did for this leap year, but memory can be like that.</p><p>In fact Y2K was only a <i>non event</i> simply because a <b>lot of people</b> (I was one of them) did a <b>lot of work</b> (OK I did not do a lot) to make sure it was a <i>non event</i>. There were a <b>lot</b> of things that would have gone wrong, honest.</p><p>Y2K was a huge success for proactive work to avoid a problem.</p><h1 style="text-align: left;">Y2K was easy?</h1><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjS_oq22tItY_5ApWvzIaxskxhQDzWaGNUNxhFvhUxpH-9pbf1P0aXk0O-HCP1clNNY6CmSKAPqTIoh54uMEf2ViWuyQkVrlaMzcsiOFaLcmXEcX4tfBDmPLi-9qyIu6YmLwpMJ1MnBPI8PIfA0mIr88Z7Ta1E21SRH2Xujq3XhPftFaWartY-0nquOgqDl/s4032/IMG_4716.HEIC" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="2183" data-original-width="4032" height="216" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjS_oq22tItY_5ApWvzIaxskxhQDzWaGNUNxhFvhUxpH-9pbf1P0aXk0O-HCP1clNNY6CmSKAPqTIoh54uMEf2ViWuyQkVrlaMzcsiOFaLcmXEcX4tfBDmPLi-9qyIu6YmLwpMJ1MnBPI8PIfA0mIr88Z7Ta1E21SRH2Xujq3XhPftFaWartY-0nquOgqDl/w400-h216/IMG_4716.HEIC" width="400" /></a></div>One view is Y2K was not that hard to sort, the hard work was the sheer scale of it. It was almost entirely down to the way a year was recording as text or presented or input.<p></p><p>The classic example is your bank card that has the year as two digits. This is basically how many Y2K issues manifested.</p><p>Decades ago, checking an expiry year was easy, is current year (two digits) smaller/equal to year on card (two digits) - if so, OK.</p><p>The problem is when the current year is <span style="font-family: Source Code Pro;">97</span> and the year on the card is <span style="font-family: Source Code Pro;">02</span> as <span style="font-family: Source Code Pro;">02</span> is less than <span style="font-family: Source Code Pro;">97</span>.</p><p></p><ul style="text-align: left;"><li>The <i>real</i> fix is to make years 4 digits (leaving us with a Y10K bug), but even with sticking to 2 digits, which was simpler for many things, there are issues to address...</li><li>One trick is if current year is >=50 and card expiry is <=50, add 100 to card expiry and compare. Simples! and <i>solves Y2K</i>. This is simple but broken, as what happens when it is 2051 and a card has an expiry of 49? That assumes 2149 expiry and so allowed. There are a few variations on this, and not always <span style="font-family: Source Code Pro;">50</span> as the reference.</li><li>A better way is if it seems expired by more than 50 years then assume not expired, that is a <i>sliding</i> comparison (several ways to do it), and for cards that only last a few years it is by far the best as you expect a card number to be replaced (or the whole concept of cards to have gone) long before a 50 year old card pops up.</li></ul><p></p><p>The fact there is more than one way to do this is an issue, and a time bomb waiting to happen. I bet some people did the simple way and will find issues around 2050 ±5 years for all sorts of things, oops.</p><h1 style="text-align: left;">2038 is hard</h1><p>This is where I have to explain <span style="font-family: Source Code Pro;">time_t</span> to you, sorry.</p><p>Unix, and many other systems from that, use a type for <i>time</i> that is seconds since the start of 1970. It is a simple system. Those seconds were stored in a <i>signed 32 bit number</i>, which allows -2147483648 to +2147483647 and hence dates from Fri 13 Dec 19:45:52 GMT 1901 to Tue 19 Jan 02:14:07 GMT 2038. This seemed a pretty good range. especially for adult engineers living in the early 70s. But 2038 is getting closer and closer. I may (hopefully) live to see it.<br /></p><p>One of the Y2K issues is that the conversion of <span style="font-family: Source Code Pro;">time_t</span> to <span style="font-family: Source Code Pro;">struct tm</span> creates a <span style="font-family: Source Code Pro;">tm_year</span> that starts 1900, so would often be printed as <span style="font-family: Source Code Pro;">19%02d</span> and so you would see <span style="font-family: courier;">19100</span> for <span style="font-family: courier;">2000</span><span style="font-family: inherit;">. The fix is to change it to print </span><span style="font-family: Source Code Pro;">%d</span><span style="font-family: inherit;"> and </span><span style="font-family: Source Code Pro;">tm_year+1900</span><span style="font-family: inherit;">. The whole</span><span style="font-family: Source Code Pro;"> struct tm</span><span style="font-family: inherit;"> thing is messy as hell and should have set </span><span style="font-family: Source Code Pro;">tm_year</span><span style="font-family: inherit;"> to be the year, but even </span><span style="font-family: Source Code Pro;">tm_mon</span><span style="font-family: inherit;"> is one out, so al</span>ways<span style="font-family: inherit;"> fun!</span></p><p><span style="font-family: inherit;">So </span>what's<span style="font-family: inherit;"> the fix?</span></p><p></p><ul style="text-align: left;"><li>A bodge, used on some systems, is to make <span style="font-family: courier;">time_t</span> an unsigned 32 bit number. This allows time from 1970 to Sun 7 Feb 05:28:15 GMT 2106 but not dates before 1970, which is <i>good enough</i>™.</li><li>The proper way is to change <span style="font-family: courier;">time_t</span> to a signed 64 bit type. This is what unix/posix has done. This allows times from <i>invalid date</i> to <i>out of range</i> date... OK roughly ±292 billion years from now, which is pretty good given the universe started only around 13.7 billion years ago. But it may well continue more than 292 billion years, so we may have a Y292B bug coming up. Be ready!</li></ul><p style="text-align: left;">So it should be simple, change <span style="font-family: Source Code Pro;">time_t</span>, right?</p><h3 style="text-align: left;">What's the problem?</h3><p style="text-align: left;">The problem here is not that the fix is <i>harder</i>, it is indeed <i>simple</i>, change <span style="font-family: Source Code Pro;">time_t</span> to 64 bit, but that it is harder to find the problems. Y2K was a lot about input/output a year as 2 digits. It was way more <i>visible</i>. 2038 is harder as it is hidden. It also happens in a lot of <i>embedded systems</i> - the code that runs your fridge or your toaster, and much more.</p><p style="text-align: left;">For a start, any code properly using <span style="font-family: Source Code Pro;">time_t</span> will simply work if the underlying build environment and include files and libraries are all up to date to have a 64 bit <span style="font-family: Source Code Pro;">time_t</span><span style="font-family: inherit;">,</span> and <i>crucially</i> the code uses all the time/date libraries. This is <i>good</i>, but also <i>bad</i>, as the code you are looking at is unchanged, working and not working code <b>looks exactly the same</b>!</p><p style="text-align: left;">The problem is that you need to know that the built binary image in some system was built in an environment that used 64 bit <span style="font-family: Source Code Pro;">time_t</span>. Do you know that for sure? How do your tell? How do you test?</p><p style="text-align: left;">There are also cases where code may happen to misuse an <span style="font-family: Source Code Pro;">int</span> or <span style="font-family: Source Code Pro;">int32_t</span> for something. You may have a proper 64 bit <span style="font-family: Source Code Pro;">time_t</span> passed to something that does maths using <span style="font-family: Source Code Pro;">int</span>, and then passes to something using a <span style="font-family: Source Code Pro;">time_t</span> as an answer. This will work for now, but not after 2038. This is hard to spot, and worse because <span style="font-family: Source Code Pro;">int</span> is a nightmare type it could be 16, 32, or 64 bits anyway, so may or may not work. It may work in some tests and not others!</p><p style="text-align: left;">And mostly I am talking of C code or things based on it, but many languages have time logic, and many are based on the <span style="font-family: Source Code Pro;">time_t</span> 32 bit time. Some will be easier and some harder to find the problem.</p><p style="text-align: left;">A fix to make something 64 bit <span style="font-family: Source Code Pro;">time_t</span> may also break things if that is communicated in binary in a protocol of a file. Is the other side expecting 4 or 8 bytes? So fixing this can break things in itself. This will be bugs long before 2038 in attempts to get ready for 2038.</p><p style="text-align: left;">For these reason 2038 may be way worse and way harder to track down and fix.</p><h1 style="text-align: left;">2036</h1><p style="text-align: left;">There is actually another problem with NTP protocol which used 64 bit time, 32 bits for seconds from 1900, which expires in 2036. NTP changed to 128 bits some time ago, but some may get it wrong. It will be a bit of a dry run for 2038 issues. I hope I live to see this too, at the very least.</p><h1 style="text-align: left;">Anecdotes</h1><p style="text-align: left;">As so many people now have no clue what Y2K was like, and may not have even been born, I say <i>as an old fogy</i>, one of the fun things coming up to Y2K was the bullshit.</p><p style="text-align: left;">We had customers and suppliers wanting us to make formal legal statements on "Y2K compliance".</p><p style="text-align: left;">We never signed any formal statement of "Y2K compliance", ever. We said we expect anything we controlled to work with any date, and if it failed we would work to fix it, like any other fault, and we expect the same of suppliers of things we sell.</p><p style="text-align: left;">One special case was Barclays card services, as they wanted us to confirm we were "Y2K compliant". I replied asking "compliant with what?".</p><p style="text-align: left;">I found that British Standards had created a standard for what Y2K compliance meant, and it covered working correctly with <b>all</b> dates <b>before, on, and after 2000</b>, which is way more than most people were doing. It meant that "Y2K compliance" to the BS meant 2036 and 2038 compliant!</p><p style="text-align: left;">We stated we were not as we were sure we had some systems that would fail in 2036, 2038, or 2106, or 10000. We also did not work with dates before 1582. So we could not say we complied with the British Standard on Y2K, and seriously, <b>no company could</b>! But we asked what standard they wanted us to comply with? Is it the BS standard or something else?</p><p style="text-align: left;">Importantly we asked if <b>THEY</b> were compliant with the same standard! We knew they were not.</p><p style="text-align: left;">They did not reply but later came back with new questions clearly to all customers, referencing the BS standard, and some clues on what they would do and comply with (even if not the BS standard). We did not claim to comply, as we could not, obviously, and there was no come back.</p><p style="text-align: left;">Nobody really pushed back on us saying we could, of course, not comply with Y2K compliance, and neither could anyone else, but we would try our best. Asking what the person asking the question was doing to comply was always telling. It was layers of bullshit on bullshit, and in some ways "fun". I wonder how may companies spent a lot of time on the "paperwork" and not just on actually fixing things.</p><p style="text-align: left;">Thankfully all the bullshit had a deadline.</p><h1 style="text-align: left;">Deadline</h1><p style="text-align: left;">At the end of the day, for a lot of things, and I say this an an <i>old fogy</i>, it is "<i>will I be dead before this is an issue"</i>. This is, perhaps, the problem with any such code, ever. I'd love to be around for the Y292B bug.</p><p></p>RevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.com6tag:blogger.com,1999:blog-3993498847203183398.post-40734144661010809852024-02-27T15:53:00.010+00:002024-02-28T08:59:52.030+00:00CCTV<h2 style="text-align: left;"><table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjUa1uLIgaSEbZcDJGYW82GeXAqWlJf56LtEBf0wr03kU2ZPZm65sj1R-Q2J1-viRs3vKEj8YKJeBuPJxcNTboRCa_SRn-TUp2vckRPSW6isIUANIUK46hRSg3fHbSL4NHcoLQIc55EwUy5BbGZs6qnxMT_R3GTy15sKKNqajTIeXEyJSzgM5zIWQ8m9i0/s2560/Bat_Cave_2024_02_27_15_52_26.png" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" data-original-height="1920" data-original-width="2560" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjUa1uLIgaSEbZcDJGYW82GeXAqWlJf56LtEBf0wr03kU2ZPZm65sj1R-Q2J1-viRs3vKEj8YKJeBuPJxcNTboRCa_SRn-TUp2vckRPSW6isIUANIUK46hRSg3fHbSL4NHcoLQIc55EwUy5BbGZs6qnxMT_R3GTy15sKKNqajTIeXEyJSzgM5zIWQ8m9i0/s320/Bat_Cave_2024_02_27_15_52_26.png" width="320" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Warehouse 22?</td></tr></tbody></table>Picking a CCTV management system</h2><p style="text-align: left;">CCTV has moved on a lot these days, and there are a lot of cameras now. Some use proprietary systems, and some have clever custom detection and face recognition and ANPR and hardware inputs and outputs. Some have low light colour. Some have infrared. The options are endless.</p><p style="text-align: left;">But ultimately, whatever they are, you want a management system to record and allow local and remote viewing, alerts and events, basically providing a way to see what is going on and what happened later.</p><h3 style="text-align: left;">At home</h3><p style="text-align: left;">At home, a CCTV system is largely engineered to be a deterrent for theft. A house with a load of cameras should be less likely to be burgled than the next house with none.</p><p style="text-align: left;">But it has a load of other uses, and ironically the main one is deliveries.</p><p style="text-align: left;"></p><ul style="text-align: left;"><li>Seeing a delivery in real time remotely, even "talking through the camera" to the delivery person when not there.</li><li>Proving they did not delivery when they said they did, or that they "chucked it over the fence and that is why it broke".</li></ul><p style="text-align: left;">But also, police, and neighbours, may ask if your camera caught something. Yes, this surprising (police asking) as it is an issue with ICO guidance, which is very confusing. They work on the basis of a case law that somehow, even though the collection and processing of potentially personal information is for personal domestic use (so outside scope of GDPR), that somehow it matters <i>what</i> you are seeing with the camera - i.e. seeing a road or path that is off your land. The GDPR does not have that as a criteria, and the second you try to apply that logic it to dash cams and cycle helmet cams and the like it all falls apart. I.e. my cycle helmet cam is "OK" somehow (personal use) but park my bike by the wall of may house and put the helmet on it, viewing the road, is that OK? Then run a power lead to the helmet cam so it runs 24/7, is that OK? As what point does it become not OK as it is a CCTV on my house viewing the road, not a camera on my cycle helmet viewing the road. No logic to it at all.</p><p style="text-align: left;">Of course, even if camera covers public spaces, you can "mask" them on many cameras now, to meet ICO rules.</p><p style="text-align: left;">I also wonder about CCTV, especially the CC part. What if I made cameras open to the world on the internet, it is then OCTV not CCTV, so do <i>any</i> of the ICO rules on CCTV now apply?</p><p></p><h3 style="text-align: left;">At work</h3><p style="text-align: left;">At work is different, not personal/domestic use, so needs proper ICO registration, privacy policies, and notices, but once sorted you can run CCTV. There are a lot of legitimate interests for any business running CCTV, for crime detection prevention, both external (break in) and staff fraud (eeeew, don't trust your staff?). As long as you are totally clear about the CCTV, and how and what is processed for what purpose you are probably OK, but don't take my word for it - get legal advice.</p><h2 style="text-align: left;">Back to the point - recording and management</h2><p style="text-align: left;">Whatever cameras you use, and as I say - there are a lot, you need a way to view live, and record, and view and save recordings.</p><p style="text-align: left;">There are many systems, and I have used several. However, the latest I am using has impressed me, so much I feel I should share my fortune and tell you all about it.</p><p style="text-align: left;">The system is "NX Witness", and Simon (of <a href="https://dp.co.uk/">Dedicated Programmes</a>) is an expert at settings these up (and supplying a range of cameras). I am lucky to have got a system from him as a birthday present, thank you.</p><p style="text-align: left;"></p><ul style="text-align: left;"><li>It is easy to use</li><li>It is slick</li><li>It is fast</li><li>It is so very responsive</li></ul><p style="text-align: left;">I have used Synology previously, and once wanted to check a delivery (that did throw a parcel over the fence) remotely from mobile, and it took me like half an hour. It was so slow and unresponsive and hard to use.</p><p style="text-align: left;">NX Witness, just works. An app on my phone and on my Mac, but I understand Android and Windows are just as easy.</p><p style="text-align: left;">I had to ask Simon how I save a video clip, as on Synology it was a nightmare, and he was "Duh! draw on timeline, right lick, export video", and it was, and it worked, and that was it!</p><p style="text-align: left;">When I click a time in the past the videos all show it, instantly, no delay. When I click a motion event, the same.</p><p style="text-align: left;">And I have custom icons on my videos now that allow me to turn on lights, open gate, and so on, simply, from my phone.</p><p style="text-align: left;">I really an impressed, simple as that!</p><h2 style="text-align: left;">Record all</h2><p style="text-align: left;">You could record only on motion or events, but hard disks are cheap enough, and recording all has advantages.</p><p style="text-align: left;">The NX Witness makes it easy to see the motion events, and the like.</p><p style="text-align: left;">But recording all allows you to also see when something <i>didn't happen</i>! When a delivery claimed to happen and you can send video covering 10 minutes either side of the time with no delivery happening.</p><p style="text-align: left;">So that is what I do, only for maybe a month's worth, but that allows me to find something if I need.</p><p style="text-align: left;">One edge case was damage to some rendering on a wall, on Synology it was hard to track down, and I imagine on NX witness it would be so much quicker. It was focusing on events for a small part of the image, and the NX witness lets me highlight an area and pick only motion events covering that area.</p><h2 style="text-align: left;">Don't use WiFi</h2><p style="text-align: left;">This should not need saying, but so many cameras these days are WiFi, and even "only 2.4GHz". Just say no. Sorry. Apart from the ease of jamming the WiFi if you want to not be seen, WiFi is very much a shared medium, and a couple of cameras constantly streaming over WiFi can make it shit very quickly.</p><p style="text-align: left;">You need wires anyway for power to the camera, so use PoE, one wire, not that hard even if it means a few holes and cable clips.</p><h2 style="text-align: left;">Public space</h2><p style="text-align: left;"></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcBvSc8RdxIYgx2MlFRqgApdiW4HnhD7RMNv1eZ5WSbUFRqdL0_uUWhOYztIxcTDvemIXXi2EChBRwwWddzwvU2g3MUr58h9ySedQWVvSuR_uLIvIHURQfDexQR3g6oeLYzQ1Huebj4gOdDCo0nwG1TLdvbrs7JcTnr74WNbF_7HKoubjlg1Pee-tEUN1T/s1539/Drive_2024_02_27_17_09_12.png" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="1539" data-original-width="1496" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcBvSc8RdxIYgx2MlFRqgApdiW4HnhD7RMNv1eZ5WSbUFRqdL0_uUWhOYztIxcTDvemIXXi2EChBRwwWddzwvU2g3MUr58h9ySedQWVvSuR_uLIvIHURQfDexQR3g6oeLYzQ1Huebj4gOdDCo0nwG1TLdvbrs7JcTnr74WNbF_7HKoubjlg1Pee-tEUN1T/s320/Drive_2024_02_27_17_09_12.png" width="311" /></a></div>A small follow up because of a comment.<p></p><p style="text-align: left;">The issue with GDPR is that it covers the <i>purpose</i> of the processing, being domestic/personal, not what you are processing, which is why the case law on CCTV covering a public space makes no sense. And so why trying to <i>draw a line</i> makes no sense. The fact that helmet cams and dash cams are OK, even recording public space, but not fixed CCTV, is a totally mental and wrong interpretation of the law.</p><p style="text-align: left;">I have a couple of good examples. One relative has a doorbell camera, but the house is directly on the public pavement. So to record <i>anything</i> they are recording public space, even when it is a delivery person ringing their door bell. That clearly should be allowed as personal/domestic purpose. (I am lucky to have a small (maybe 1m) space from public pavement).</p><p style="text-align: left;">On the other hand I have a corner that is tarmac'd along with the pavement. I was careful to ensure the tarmac has a clear line for the border of my properly, but lots of people, almost everyone, cuts the corner, walking over my properly when simply walking along the public road. So, in my case, I <i>can</i> record them, under ICO rules, as they are on my property. I have no real reason to, other than <i>I am allowed to</i> as they have not jumped over my gate, etc.</p><p></p>RevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.com11tag:blogger.com,1999:blog-3993498847203183398.post-39147708792865024552024-02-26T18:32:00.003+00:002024-02-27T06:33:33.847+00:00Not Noodle<p style="text-align: left;">I was "donated" a bag of nice Pot Noodles for when Sandra was away on holiday. Thank you.</p><p style="text-align: left;">I have always liked pot noodles (sorry), but they are one of a few foods that cause problems for blood sugar, even though not too bad in carbohydrates. Another is some maize snacks like Monster Munch. They send my blood sugar super high for a short period. I have to avoid them.</p><p style="text-align: left;">Thankfully I have mastered pot noodles now, waiting for my blood sugar to be low, drinking some whisky (yes, that has a massive impact on slowing the whole process!), and taking some tablets to help with the blood sugar on top of the daily insulin, and I can eat a pot noodle safely.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiMOMqn00SrjcvrvUCp5kA1NwNotgCI6dSHnO3TpKYFZTRIpvi8530G05HNoUlA8UAq6trw06XoT5TIz1Va1l-4r6SEQ4eUuHLP7mAfc3K9jtTOEGkG2R8Kx2782PX1oQ8MFii48sjI-6a41n20tJw7lKhUXRyROXn7dYvX9WCPEfLNgkHrxCi8L4J1_XH/s553/IMG_4678.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="553" data-original-width="460" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiMOMqn00SrjcvrvUCp5kA1NwNotgCI6dSHnO3TpKYFZTRIpvi8530G05HNoUlA8UAq6trw06XoT5TIz1Va1l-4r6SEQ4eUuHLP7mAfc3K9jtTOEGkG2R8Kx2782PX1oQ8MFii48sjI-6a41n20tJw7lKhUXRyROXn7dYvX9WCPEfLNgkHrxCi8L4J1_XH/w333-h400/IMG_4678.jpg" width="333" /></a></div><p style="text-align: left;">But today I was fooled, I found a "not noodle". One with no noodles!</p><p>I did what anyone would have done, and combined the spicy sauce packet and the not noodles with the next pot noodle to make a pot₂ noodle. And wow, it was spicy and intense - amazing. They should do pot₂ noodles as a thing. It was amazing.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgj3GIe7eYwhMSznBZhrkzaAAgHvX6JoirtGEL2fZa6yZVgQkIWoxmkfyip0blG-uHk7vlzSqCEsc7wR2osKtcpa8bhjIAa1unujLkqvIM_X05dNx-dTy8JBQzJEQPTtbJiXDl0vBTLGk98X-m48pUo4oOHgIsPaJR7JDpxsbuRtM0V_EziMGJlYrrpm_A_/s4032/IMG_4676.HEIC" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="4032" data-original-width="3024" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgj3GIe7eYwhMSznBZhrkzaAAgHvX6JoirtGEL2fZa6yZVgQkIWoxmkfyip0blG-uHk7vlzSqCEsc7wR2osKtcpa8bhjIAa1unujLkqvIM_X05dNx-dTy8JBQzJEQPTtbJiXDl0vBTLGk98X-m48pUo4oOHgIsPaJR7JDpxsbuRtM0V_EziMGJlYrrpm_A_/w300-h400/IMG_4676.HEIC" width="300" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVqH86jSl4CkzplXElCIIqDXTIRpZzii5EMtYubQf-zJFkIbIc7MqAhru_03vELq09jXTOW4Fyz2U87vgLUZvK0OF1xhCRTnXCCkHs2lUm5xE8e34F-txGaqUShRANjpJ86N0VxNCthRRLCjltApOcV982uuHBGBLwFEM1jSDZX_iSipkem-JuT2qWbzbZ/s4032/IMG_4677.HEIC" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="4032" data-original-width="3024" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVqH86jSl4CkzplXElCIIqDXTIRpZzii5EMtYubQf-zJFkIbIc7MqAhru_03vELq09jXTOW4Fyz2U87vgLUZvK0OF1xhCRTnXCCkHs2lUm5xE8e34F-txGaqUShRANjpJ86N0VxNCthRRLCjltApOcV982uuHBGBLwFEM1jSDZX_iSipkem-JuT2qWbzbZ/w300-h400/IMG_4677.HEIC" width="300" /></a></div>RevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.com1tag:blogger.com,1999:blog-3993498847203183398.post-76214132264079421092024-02-25T19:05:00.012+00:002024-03-11T15:33:38.116+00:00QR marketing<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8c0qnNebdeKMtBT5I1nquswNXdzitGQdktco6ex2aRZPDOdgVFdzcW2gXwwp3VGZ7_VvMyZ-2z3OzBG_C3-yBMML8_jHmBDNdcsQRkfMtT0b4OTZFogt5C5lqUemN4zhvEGGTnM8zNmYwndH6tApQ_aXfB2bEP08vYijp3AJwmDTxAMC2bIQ7V_ef3piI/s116/qr.png" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="116" data-original-width="116" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8c0qnNebdeKMtBT5I1nquswNXdzitGQdktco6ex2aRZPDOdgVFdzcW2gXwwp3VGZ7_VvMyZ-2z3OzBG_C3-yBMML8_jHmBDNdcsQRkfMtT0b4OTZFogt5C5lqUemN4zhvEGGTnM8zNmYwndH6tApQ_aXfB2bEP08vYijp3AJwmDTxAMC2bIQ7V_ef3piI/w400-h400/qr.png" width="400" /></a></div><p style="text-align: left;">QR codes are great, aren't they?</p><p style="text-align: left;">I'm not going to go in the the technical aspects here, I have done that before, but more about actually using them.</p><p style="text-align: left;">We see them on everything, from shop windows to packets of crisps.</p><p style="text-align: left;">But there are some guidelines that are worth considering if you are planning on playing with QR codes. This is very much a top level explanation, and as I say not very technically.,</p><h2 style="text-align: left;">Starting with what is a QR code?</h2><p style="text-align: left;">It is simply a standard way to represent data in a machine readable format that can be printed or displayed on a screen, and these days almost any phone with a camera can "read" them.</p><h3 style="text-align: left;">Why use them?</h3><p style="text-align: left;">Well, the main reason is to allow people to get to a web site, that is pretty much the main "marketing" use of QR codes.</p><p style="text-align: left;">There are a load of more technical reasons to use them, tracking products and deliveries and all sorts, even COVID related stuff, but from a marketing point of view it is pretty much "a web site" without the typing, and more importantly the "mistyping" of some URL.</p><p style="text-align: left;">Of course someone could put a sticker over your QR with another one, how would people know until they try it?</p><h3 style="text-align: left;">Silly graphics in them?</h3><p style="text-align: left;">One of the annoying things from a technical point of view is people putting silly images and graphics in the middle, or changing them to be round dots or some such. They are designed to tolerate a lot of errors, so these generally work, but they are not close to being standard. Also they are meant to have a 4 unit white border which is often reduced to 1 unit or not at all. Again, people "get away with it", but it is not right. Properly they are a grid of black or white squares with a 4 unit white border.</p><h3 style="text-align: left;">But what to put in them?</h3><p style="text-align: left;">This is where it gets fun - you typically put a web site, a URL, and that is it.</p><p style="text-align: left;">Start it properly <span style="font-family: courier;">HTTP://</span> or better <span style="font-family: courier;">HTTPS://</span> though again you "get away" with just <span style="font-family: courier;">WWW.</span></p><p style="text-align: left;">But there is more to it!</p><p style="text-align: left;"></p><ol style="text-align: left;"><li>There is no point putting a silly long URL with loads of extra query fields, really, that makes for a dense QR code which may be harder to read. Don't do<span style="font-family: courier;"> https://www.amazon.co.uk/Faikin-Alternative-Daikin-WiFi-controller/dp/B0C2ZYXNYQ/ref=sr_1_1?crid=216EE7WGMZ221&dib=eyJ2IjoiMSJ9.XweYjNYnMX2FDmEgANqtjLiG7EHQIhpAHquJL8qCQ74Nr4YyT0zmkbk9467lCnQEb862FHm0WxqOGwExyaAH8JP42vCPVbInuwGvXc5MduR3JtainfYF4sz3oXKDZrVvA81M5J9-Ro5CIDRtqDictRG7E_GGusC-wTDynho5VPmjb4R-00iqmk26qH04W9nRkcYdt7pvh2HMGyh53iA4pPdQcVPNx2Q6B2_T2DDDULQ.qMn3ZtO7J7xmPu_bSUUilYAZ64X_8IK_MAJgIaqpQM0&dib_tag=se&keywords=faikin&qid=1708887615&sprefix=faikin%2Caps%2C81&sr=8-1</span></li><li>You can use some sort of URL shortening thing, but that means on phones the preview shows some URL shortening domain and so no way to know it is "genuine". Don't do <span style="font-family: courier;">http://tinyurl.com/yrescvrw</span></li></ol><p></p><p style="text-align: left;"></p><p style="text-align: left;">I have seen both extremes!</p><p style="text-align: left;">The middle ground is using your proper domain name, and then a short additional path. This can make a compact URL, and show your domain as the preview for the link on phones, but still get to where you want. You can also make it all upper case which actually makes the QR code less dense. E.g. <span style="font-family: courier;">HTTPS://FAIKIN.REVK.UK</span></p><p style="text-align: left;">Using your actual domain means you control it and are not subject to some third party, and also the preview on a QR code on the phone shows your domain, not <span style="font-family: courier;">tinyurl.com</span><span style="font-family: inherit;">.</span></p><p style="text-align: left;"><span style="font-family: inherit;">I have actually seen this for some locals shops, with QR codes, that are via some site, and worked when printed, but when I scanned came up with "your free trial is over, choose a package for your QR link" or some such. Totally useless for the shops in question, when just a QR to their own website (which they have) would have worked fine.</span></p><p style="text-align: left;"><span style="font-family: inherit;">For comparison, the above URL examples as QR codes.</span></p><p style="text-align: left;"><span style="font-family: inherit;">1. Long URL (harder to scan)</span></p><p style="text-align: left;"></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_Mq9QnVu6f9fCnFtdTFMh9XKXVUw4l6pMomeA_ofBDTHf-oFFFIKAxifvsI0mDjZ64wIKIf443nAj74EtMc0v4DAy9HBVitC07eLCWIBDGr9tSJSKDtviUS8BjyWr7l8qsnpSZU7b3Y-oOBYAL7MxShxwYFSrqUUkrdjGEWDLMnVFtezYEvxKOPgX9MXa/s340/qr-1.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="340" data-original-width="340" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_Mq9QnVu6f9fCnFtdTFMh9XKXVUw4l6pMomeA_ofBDTHf-oFFFIKAxifvsI0mDjZ64wIKIf443nAj74EtMc0v4DAy9HBVitC07eLCWIBDGr9tSJSKDtviUS8BjyWr7l8qsnpSZU7b3Y-oOBYAL7MxShxwYFSrqUUkrdjGEWDLMnVFtezYEvxKOPgX9MXa/s320/qr-1.png" width="320" /></a></div><p></p><p style="text-align: left;"><span style="font-family: inherit;">2. Short URL (no obvious preview before following link)</span></p><p style="text-align: left;"></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh86S33OnqdRYoAy752J_1NNFpfQqtOBg_CsxDMXnWVSdZ5QK_1aT0Hb0xyuKj1VuIR_xVTxM6FMGwvOO2gGKymtnVjZ0bQRnKei80CpjboSYss7jaOyyIvWuImqGXBJxHMOXjT1Ht-oxJhF4dgarhu_M-5ySXuqN3csla20SOQmqYQvnvuqhWMxikkAETC/s132/qr-2.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="132" data-original-width="132" height="132" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh86S33OnqdRYoAy752J_1NNFpfQqtOBg_CsxDMXnWVSdZ5QK_1aT0Hb0xyuKj1VuIR_xVTxM6FMGwvOO2gGKymtnVjZ0bQRnKei80CpjboSYss7jaOyyIvWuImqGXBJxHMOXjT1Ht-oxJhF4dgarhu_M-5ySXuqN3csla20SOQmqYQvnvuqhWMxikkAETC/s1600/qr-2.png" width="132" /></a></div><p></p><p style="text-align: left;">3. Proper URL (clear preview and easy to scan)</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwt_2p_QoKj8AviQzTJsz8Iif7f1ZDwG-pNJ_grAjd4Pisz2EKPLiIUJJjoWtfXoEpdELNED5l8WiNibuPo6h0o3DT7m8lEveLv7j4P6ny10sdtGmEs0irg2iVsPYQ2mw1LUV4O_PDSJfGXU9eyrLDlWYGn9JbArAq5zLU9Wfcpr7VbdOfxKmwRF8ILs9l/s116/qr.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="116" data-original-width="116" height="116" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwt_2p_QoKj8AviQzTJsz8Iif7f1ZDwG-pNJ_grAjd4Pisz2EKPLiIUJJjoWtfXoEpdELNED5l8WiNibuPo6h0o3DT7m8lEveLv7j4P6ny10sdtGmEs0irg2iVsPYQ2mw1LUV4O_PDSJfGXU9eyrLDlWYGn9JbArAq5zLU9Wfcpr7VbdOfxKmwRF8ILs9l/s1600/qr.png" width="116" /></a></div><p style="text-align: left;">4. Make it a URL!</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYQ0KgvyljTmcrr25JmdECs9cCZkCiW9sAQnBHjKtS1W1Ci_rV0UsQ_tpzkhyphenhyphenP6oeWTy1mP8kocO48b5PZKtvjSlDkEF5Cc6L13DFcSQTU5OI0jwk7dH0aUzh5uOzYGd2_t61Nmu1af_eW44DZOnkJ4z8fSUfQXE9JdlxgzL2EWRjq34fUGp944n_j3_Ku/s116/qr.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="116" data-original-width="116" height="116" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYQ0KgvyljTmcrr25JmdECs9cCZkCiW9sAQnBHjKtS1W1Ci_rV0UsQ_tpzkhyphenhyphenP6oeWTy1mP8kocO48b5PZKtvjSlDkEF5Cc6L13DFcSQTU5OI0jwk7dH0aUzh5uOzYGd2_t61Nmu1af_eW44DZOnkJ4z8fSUfQXE9JdlxgzL2EWRjq34fUGp944n_j3_Ku/s1600/qr.png" width="116" /></a></div><br /><p style="text-align: left;">The above is an example of a dual purpose QR. Scanned, it goes to the product site, but it includes a serial number, so when <i>we</i> scan it on a delivery note, etc, the URL part is ignored and the serial number is read in to to document. Customers expect a QR to be a URL, so why not use that fact.</p><p style="text-align: left;">And don't forget - check it works!</p><p>Having made the QR code, check it, pretend to be a customer/user.</p><p></p><ul style="text-align: left;"><li>Check what the preview shows on your phone</li><li>Check the link goes where you expect</li></ul><div>(Yes, I ballsed that step up making this page the first time, thanks for letting me know)</div><p></p>RevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.com2tag:blogger.com,1999:blog-3993498847203183398.post-59016099039641372672024-02-19T15:32:00.004+00:002024-02-25T13:56:18.514+00:00JLPCB<p style="text-align: left;">As some of you know I use JLCPCB a lot for my PCBs.</p><h2 style="text-align: left;">Why not UK?</h2><p style="text-align: left;">We do use UK manufacturers for our FireBrick products, but for the small cheap PCBs I make, it is simply not viable. I have tried to get competitive quotes but people in the UK cannot match the prices, or even close, or the time scales. It is a real shame, and would be great if the UK could find any way to compete.</p><h2 style="text-align: left;">Problems?</h2><p style="text-align: left;">I posted about a weird tracking issue a while back. Thankfully it was a one off.</p><p style="text-align: left;">But things have gone down hill.</p><h3>Stupid rules</h3><p style="text-align: left;">One issue (I don't think I posted) was that they charge a surcharge for "multiple designs" on a PCB, i.e. where cuts or v-cuts allow parts of the board to be broken off, and those have <i>different</i> designs on them. I don't follow the logic at all. But what is even more weird is the logic for this - any tracks or silk screen on break of parts makes it a different part. If just blank, it not and so no surcharge. They can silk screen on it at no extra (e,g. their job number). I even tried to "follow the rules" and had text done in the solder resist (they say explicitly tracks and silkscreen as separate parts, not solder resist), but they would not play. It is a shame, I just wanted a bar code (for the board) on the break of parts of a panel. Pain, but their stupid rules.</p><h3>Broken search</h3><p style="text-align: left;">More recently I found, when uploading, a part was not in stock, a 124k 0402 resistor. For a start, how is that not in stock, but I did the search option and it showed many 0402 parts and I picked one in stock.</p><p>What fooled me is the search did not list resistors matching the value I was searching, and I managed to pick a 0.124Ω resistor. My mistake, after a broken search, and I got a UK company to rework for me ("hot tweezers").</p><h3>Broken component selection</h3><p style="text-align: left;">Anyway, my mistake. This time I ordered more boards, same bill of materials I have used dozens of times before, and for this one component, the same as dozens of designs of boards over the last 6 months.</p><p style="text-align: left;">The BOM has an "R" (i.e. resistor) in an "0402" package, with a value of "124k", simple. I don't care the other aspects, it is a potential divide as a reference for the regulator, so really does not matter what 0402 124k resistor it is, hence I have not picked a specific LCSC part number for a specific manufacturer, as that could be out of stock more easily. Like simple resistors and capacitors I simply list the value I want, obviously.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4K6wonLQsGAqhh8UCzQgCBRd9T2y7QwZF9C83f3TRTExJDA5tAkVNCI7g4uBzUofUDzf1upmPwBtE6h06q88xsqWk1MhxOtY7PjkN1d-BKivJZejWFH1Bs5HF54ry_mYqkq-vYJo2UxE_BLWNK6f4XymMwg25ohVj_Rd5DGtoyc0dkhNW9r1vOGOCfFXl/s1708/Screenshot%202024-02-19%20at%2010.21.42.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="472" data-original-width="1708" height="110" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4K6wonLQsGAqhh8UCzQgCBRd9T2y7QwZF9C83f3TRTExJDA5tAkVNCI7g4uBzUofUDzf1upmPwBtE6h06q88xsqWk1MhxOtY7PjkN1d-BKivJZejWFH1Bs5HF54ry_mYqkq-vYJo2UxE_BLWNK6f4XymMwg25ohVj_Rd5DGtoyc0dkhNW9r1vOGOCfFXl/w400-h110/Screenshot%202024-02-19%20at%2010.21.42.png" width="400" /></a></div><p style="text-align: left;">As usual, it picked the parts, and showed them, not actually showing the value, as truncated. But I gate it a value, as I have done so many times before, and obviously expect it to pick a resistor of that value.</p><p style="text-align: left;">Suddenly, this time, it picked a 1.24Ω resistor. So ignored the value I specified! This happened on two orders. One I will have to pay someone to rework, again!</p><p style="text-align: left;">This is bad, I should be able to just say I want an 0402 resistor of a specific value and it pick one. That really is one of the most basic things they can handle in the BOM upload. They used to handle it.</p><p>Update: Just to be clear, I have used JLC for years and never had an issue until now, but now it is seriously broken. I re-tested, and even adding Ω to the value does not help. Magically today the 124k is working, but the 1M is suddenly 51kΩ - which makes no sense at all. Previously perfectly fine BOM files now fail randomly. I tried setting specific LCSC parts, which works, except that they are then out of stock of the specific parts and you have to search parts instead of just using a known working BOM.</p><h3>Baking</h3><p style="text-align: left;">And now the latest fiasco, and this really is now taking the piss,.</p><p style="text-align: left;">A part I have used on dozens of designs over at least 6 months, and hundreds of boards. A simple LED. Indeed, my Stargate designs actually have over 500 of them on each board!</p><p style="text-align: left;">The design I am ordering is one I have ordered many times, indeed, I just received some I ordered over a week ago, same BOM, same LED (wrong resistor, as above).</p><p style="text-align: left;">But now, for some reason this "<i>is highly sensitive to humidity, and needs baking before soldering, or it will easily got moisture damaged</i>". They suggest checking the datasheet. There is a surcharge!</p><p style="text-align: left;">The datasheet says: "<i>If the moisture absorbent material has fade away or the LEDs have exceeded the storage time, baking treatment should be performed based on the following condition: (60±5)°C for 24 hours.</i>"</p><p style="text-align: left;">This suggests they have stored it incorrectly maybe? and want me to pay a surcharge for their bad handling of a component.</p><p style="text-align: left;">Awaiting reply, but they have gone from "quick, easy, cheap", to "pain in the arse, costly rework, and stupid rules and extra cost."</p><p style="text-align: left;">I may have to find someone else!</p>RevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.com6tag:blogger.com,1999:blog-3993498847203183398.post-91375634540069557762024-02-02T17:46:00.004+00:002024-02-02T17:50:02.086+00:00Hiding passwords<p style="text-align: left;">A minor niggle, but some times you want a web form that has passwords.</p><p style="text-align: left;">The <i>classic</i> solution is <span style="font-family: courier;">type=password</span> and send the password as the value. This works, and if the page is all https, then why not, it is secure. It also offers to save the password (something that is really hard to disable these days, and there are reasons to want to do that!).</p><h3 style="text-align: left;">But what if not https, for, <i>reasons*</i>? </h3><p style="text-align: left;">Sending a password is not ideal - but if not https, sending one back is also in the clear, but if the threat is purely <i>snooping</i> then it is not too daft to minimised sending it when not needing changing. You minimised the window of capturing it. You also stop someone simply requesting the page to see it, even if they are able to change it.</p><p style="text-align: left;">So a simple fix is to have a <i>rouge value</i> password you use to mean <i>no change</i> such as <span style="font-family: courier;">********</span>. You can send this and if a returned value is not that then it means a new password has been set.</p><p style="text-align: left;">It bugs me slightly, as it means you cannot have a password of <span style="font-family: courier;">********</span>.</p><p style="text-align: left;">Well, maybe.</p><p style="text-align: left;"></p><ol style="text-align: left;"><li>Only send when password set, as always useful to be clear if a password is set or not.</li><li>Why not use something more esoteric, such as <span style="font-family: courier;">✶✶✶✶✶✶✶✶</span> (unicode 6 pointed stars). Passwords should allow unicode stuff, obviously.</li><li>Allow setting the password to the rogue value if not currently set, meaning you sent blank and not the rouge value, so the rouge value coming back means someone set it. This means the only limitation is changing from one password to the rouge value without unsetting it first - not a biggie (if documented).</li></ol><p></p><p style="text-align: left;">* such as local control to a microcontroller that has limited capability to do https and limited capability to handle certificates. A problem we would all like to solve <i>cleanly</i>.</p><p style="text-align: left;">** And yes, I mean for those occasions where one cannot store a hash! They exist! WiFi passwords for one. But even when a hash, you need a way to know someone is trying to <i>change</i> the password, and this works for that too.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUC4zZiEALGkv_dJVge6LyS7XQxfLav4TisbITZL3-c1xsbAyzyguCm03pA9D4_D0DVmiyhy9EucWK2asiswps6CZ6IxGiV56qmqobgFitOCDUhPs0OF3zUlPu8MvQqQTWzBOgkvyQaGyREVNLnfgx8iHcMbHkGIbTV0ccd_-e_RyeANpZnQfz1J-EeLKB/s90/Screenshot%202024-02-02%20at%2017.46.31.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="38" data-original-width="90" height="38" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUC4zZiEALGkv_dJVge6LyS7XQxfLav4TisbITZL3-c1xsbAyzyguCm03pA9D4_D0DVmiyhy9EucWK2asiswps6CZ6IxGiV56qmqobgFitOCDUhPs0OF3zUlPu8MvQqQTWzBOgkvyQaGyREVNLnfgx8iHcMbHkGIbTV0ccd_-e_RyeANpZnQfz1J-EeLKB/s1600/Screenshot%202024-02-02%20at%2017.46.31.png" width="90" /></a></div>RevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.com6tag:blogger.com,1999:blog-3993498847203183398.post-84860107829478531772024-01-25T16:31:00.002+00:002024-01-26T10:25:12.156+00:00GPS Logger project<p>My GPS logger project is pretty much over at last. All working so well, and several customers happy!</p><p>Do buy them (<a href="https://www.aa.net.uk/etc/circuit-boards/gps/">here</a>) but they are not live trackers - they are loggers.</p><p>I have had an annoying set of issues.</p><p></p><ul style="text-align: left;"><li>power control FET for GPS/SD picked wrong, way too low power.</li><li>not spotting I had inputs on non RTC GPIOs on the ESP32S3.</li><li>not realising the STAT signal from the charger is only charging so stops when charged.</li><li>having a cap on GPS so it could brownout the power when connected.</li></ul><p style="text-align: left;">Even so, all sorted, and quickly, and the whole project sorted from start to finish in a couple of weeks.</p><p>I'd like to thank Neil for inspiring the whole project - his blog: <a href="https://neilzone.co.uk/2024/01/revks-privacy-friendly-gps-logger/">RevK's privacy-friendly GPS logger</a>.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgXlo-fECtLuGXQS2n5L2H0qhx54XeGCVV1XuXhuZl-tJRHKQDFoipKbvCLLqTWf96sfHfY-Oc_OWA7jovgjWvPRfZtrsybNdSjVGKwju-8jn5Ow9Rn1-HQXV9etztymqqXvcP_zNKe-QrfbnPRnqn8n1jL5IaInQlZqg3uHJeney4Ac84Kdjt9-53G3jBl" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="543" data-original-width="800" height="271" src="https://blogger.googleusercontent.com/img/a/AVvXsEgXlo-fECtLuGXQS2n5L2H0qhx54XeGCVV1XuXhuZl-tJRHKQDFoipKbvCLLqTWf96sfHfY-Oc_OWA7jovgjWvPRfZtrsybNdSjVGKwju-8jn5Ow9Rn1-HQXV9etztymqqXvcP_zNKe-QrfbnPRnqn8n1jL5IaInQlZqg3uHJeney4Ac84Kdjt9-53G3jBl=w400-h271" width="400" /></a></div><p></p>RevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.com0tag:blogger.com,1999:blog-3993498847203183398.post-5317367910500222302024-01-22T17:28:00.005+00:002024-01-22T17:34:02.044+00:00Finding a postcode<p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNEnRsu6q5i5U2saNykT2bBhG8fumqxhuLJmDWsmNJNIs7yGCWFQObThEfkgLBUAvT1g6Gv-Kz7ybgLXSsayNA9RzkymFJG0q0uUw3fTQAebaH2ptlGH3KgQBQvWW4BRQ9U_cspK8zfFj6xJPQuzrduyJAqx7Cm7MCsr5stCQgA6GNtDV6J9gx97vn2i2t/s650/0000000.png" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="650" data-original-width="350" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNEnRsu6q5i5U2saNykT2bBhG8fumqxhuLJmDWsmNJNIs7yGCWFQObThEfkgLBUAvT1g6Gv-Kz7ybgLXSsayNA9RzkymFJG0q0uUw3fTQAebaH2ptlGH3KgQBQvWW4BRQ9U_cspK8zfFj6xJPQuzrduyJAqx7Cm7MCsr5stCQgA6GNtDV6J9gx97vn2i2t/w215-h400/0000000.png" width="215" /></a></div>My GPS logger is going well (available <a href="https://www.aa.net.uk/etc/circuit-boards/gps/">here</a>) and it logs journeys when back on home WiFi.<p></p><p>One of the requirements that someone requested was to list postcodes visited. I think it was a district nurse, and they need this for expense claims.</p><p>So, not a hard task, surely, making it find postcode where you are...</p><h2 style="text-align: left;">Postcodes are odd shapes</h2><p>Sadly postcodes are not simple, and odd shapes, but the best I could easily do is find nearest postcode based on the centre for each postcode, which is published free by Ordnance Survey.</p><p>Notably the Dutch government does the same but with a bounding box which may help identify when there is ambiguity.</p><h2 style="text-align: left;">Microcontroller</h2><p>The challenge is that this is a small micro controller. I cannot just "install mysql". I need a way to look up postcodes and finding the nearest. I cannot sensibly scan 1.7 million UK postcodes each time I want to log a postcode.</p><p>The "trick" is simple, make a grid. I picked 1km squares on the OSGB E/N grid. So not quite 1km but close enough. More on that later. That meant I could make a grid for the whole UK, and for each grid square I can make a list of possible postcodes with there centre.</p><p>That was simple enough, well, except...</p><h2 style="text-align: left;">Converting lat/lon to OSGB</h2><p>First issue is, on device, converting GPS lat/lon to E/N OSGB. There are simple algorithms for this, I have seen them, but some are way off, and ultimately the "official" way to do it is make a guess and check a huge look up table of surveyed points (I think each 10km).</p><p>I did not want to do this on device, so my solution is convert the postcode list to lat/lon. This runs on linux and can use the official look up table, but gives me a postcode database which uses lat/lon.</p><h2 style="text-align: left;">Searching one cell</h2><p>The next step was a simplification for search. I make each grid square (now based on lat/lon) have a list of postcodes with centre location to find the closest.</p><p>The problem is that, at the edge of a square, the closest may be in the next square. So I scan the edges of the squares, binary dividing to find all "near" postcodes for all points along it, whether in the target square or not. I then have all that are in the target square.</p><p>This means for each square I have a list of all postcodes that could be the closest postcode for any point in the square. This means some duplication from square to square but makes the lookup simple.</p><p>The whole lots ends up in one file. Look up the grid to find the list of postcodes, and scan the list for the closest. Simple.</p>RevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.com8tag:blogger.com,1999:blog-3993498847203183398.post-15035639480602046602024-01-13T10:36:00.012+00:002024-01-13T20:16:22.409+00:00Distance of point to line in four dimensions (or more)<h2 style="text-align: left;">Why?</h2><p>I'm writing the blog because searching has not helped me on this. Why do I need to know? well the answer is I am applying a <a href="https://en.wikipedia.org/wiki/Ramer–Douglas–Peucker_algorithm">Ramer–Douglas–Peucker algorithm</a> to GPS tracking data.</p><p>You can look it up, but it is pretty simple to explain. Imagine you have a set of points starting from A and going to B - in my case it is GPS log data, so points on a map, every second, so lots of points. You want to reduce how many points you have without losing significant information.</p><p>Ideally all the intermediate points are on a straight line A to B, and can all be removed leaving just A and B. I practice you allow a tolerance, an allowable <i>deviation</i> from the line. If all of the intermediate points are within that tolerance you can delete them all. If not, you find the most deviant point, call it C. C is effectively a <i>corner</i> point. You apply the algorithm on A to C and C to B recursively.</p><p>In the end you have a set of points, which could just be A and B, or A, C, and B, or more. If you join the dots with straight lines you can be sure all of the removed points lay within your tolerance of that line, and so be sure any <i>detail</i>, that is more than the tolerance allowed, has not been missed.</p><p>I use this years ago on GPS data.</p><p></p><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEjNFgz0iydJKHvlQZifJyqbY6qglCQknhmWvaJYosHUR1-EG9lpLJGSdGq9HTfPRyBQIDso-LsoqCSDuYYmoluF8DIRum2E-IIH9DHT_d95iwf8Lou4z6x588CsY3RGFOfTh8oQdsT1IVaYH9JFaZnpQCOG161BnZJb314wpF3fHcrHc0zAzZxnf_45O1FX" style="margin-left: auto; margin-right: auto;"><img alt="" data-original-height="828" data-original-width="1600" height="208" src="https://blogger.googleusercontent.com/img/a/AVvXsEjNFgz0iydJKHvlQZifJyqbY6qglCQknhmWvaJYosHUR1-EG9lpLJGSdGq9HTfPRyBQIDso-LsoqCSDuYYmoluF8DIRum2E-IIH9DHT_d95iwf8Lou4z6x588CsY3RGFOfTh8oQdsT1IVaYH9JFaZnpQCOG161BnZJb314wpF3fHcrHc0zAzZxnf_45O1FX=w400-h208" width="400" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Before</td></tr></tbody></table><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgDzCKfP4pt9s8xvhowGxN_msnhyl2YUqhWEr8KZhC3fBeaSklFNAj2ENZw1c81B2MAxJ5Sz6JbSvYP54jvb6Y6DXW9BiidicN6YJugobmRcQJLD274ghjVm5qrGEYhOF8O1Szh9DwWyTVefbHPFNAtn8KlS9-aL2YPd5ff5XLJ_hbVpU01xU09TdKvtg99" style="margin-left: auto; margin-right: auto;"><img alt="" data-original-height="818" data-original-width="1600" height="205" src="https://blogger.googleusercontent.com/img/a/AVvXsEgDzCKfP4pt9s8xvhowGxN_msnhyl2YUqhWEr8KZhC3fBeaSklFNAj2ENZw1c81B2MAxJ5Sz6JbSvYP54jvb6Y6DXW9BiidicN6YJugobmRcQJLD274ghjVm5qrGEYhOF8O1Szh9DwWyTVefbHPFNAtn8KlS9-aL2YPd5ff5XLJ_hbVpU01xU09TdKvtg99=w400-h205" width="400" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">After</td></tr></tbody></table><p></p><h2 style="text-align: left;">Point to line</h2><p style="text-align: left;">The crux of the algorithm is working our the deviation from the line, what wikipedia helpfully just refers to as perpendicularDistance().</p><h2 style="text-align: left;">Two dimensions</h2><p style="text-align: left;">In two dimensions this is simple, and searching finds an algorithm. I used this on latitude and longitude. But this causes problems.</p><p style="text-align: left;"></p><ul style="text-align: left;"><li>Latitude and longitude are not a flat plane. This is not likely to be a real issue unless tracking a plane (pun intended) or a ship over a long distance.</li><li>Latitude and longitude are in degrees not metres, so working out your distance is not easy. A degree North is not the same distance as a degree West and changes depending one where you are. You need trigonometry to compensate and convert to distance units.</li></ul><p></p><h2 style="text-align: left;">Three dimensions</h2><p>Of course, we also have altitude, and so seems sensible to include that - why not. Algorithms for a point to a line in 3D are also easy to find, but there seem to be several different approaches. At least altitude is already in metres.</p><p>However, the GPS can provide not just lat/lon/alt, but also <a href="https://en.wikipedia.org/wiki/Earth-centered,_Earth-fixed_coordinate_system">ECEF</a> data. This is simple Cartesian X/Y/Z co-ordinates from centre of the Earth. This avoids any need to adjust from degrees, and makes it simple.</p><h2 style="text-align: left;">Four dimensions</h2><p>I have to push it one step further, don't I? If you travel in a straight line, but stop for a while, you would remove all points. By including time as a 4th dimension we create a <i>corner</i> when speed changes notably or you stop for a while.</p><p>It does mean you have to <i>scale</i> time to a distance, but that can be a simple parameter in the algorithm.</p><p>However, there is a snag - finding an algorithm for point to line in four dimensions is not simple. The only ones I could find explain it in vector maths - and even with an A in A-level maths, it was a long time ago and I really did not get on with vector maths. Nobody seems to give me a simple algebraic answer which is driving me mad.</p><h2 style="text-align: left;">Making it simple</h2><p style="text-align: left;">So, back to basics, I am interested in three points, and regardless of how many dimensions that is, they can be said to lie on a flat two dimensional plane. This means working out the deviation is a simple matter of considering a triangle.</p><p style="text-align: left;"></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEj15ZlIQymNsGatxglrjlrmSLgQEseiFLm9Yc-w6AcLSBqSTZQBoFicXs3McmfzYIgLTrJUsE3WOa2AT_MoO2wkhogGc9dgqa87Qt0gQjTzhdU0MCpfCjQyQbr3YWLz_8wXrvb0E9ttNtZjUetVDcC9EyfRVUgnm0xd_sOl_m1g9WUeIGqU5ynBPSJUtQyL" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="774" data-original-width="1350" height="229" src="https://blogger.googleusercontent.com/img/a/AVvXsEj15ZlIQymNsGatxglrjlrmSLgQEseiFLm9Yc-w6AcLSBqSTZQBoFicXs3McmfzYIgLTrJUsE3WOa2AT_MoO2wkhogGc9dgqa87Qt0gQjTzhdU0MCpfCjQyQbr3YWLz_8wXrvb0E9ttNtZjUetVDcC9EyfRVUgnm0xd_sOl_m1g9WUeIGqU5ynBPSJUtQyL=w400-h229" width="400" /></a></div><p></p><p></p><p>So I want to find <i>h</i>. To do this I need distances <i>a</i>, <i>b</i>, and <i>c</i>. But that is easy to find as it is simple Pythagoras, regardless of how many dimensions. For two dimensions it is √((Ax-Bx)²+(Ay-By)²). For three dimensions it is √((Ax-Bx)²+(Ay-By)²+(Az-Bz)²), and so on.</p><p>Knowing <i>a</i>, <i>b</i>, and c I can use <a href="https://en.wikipedia.org/wiki/Heron%27s_formula">Heron's formula</a> to find area...</p><p></p><ul style="text-align: left;"><li><i>s</i> = ½(<i>a</i>+<i>b</i>+<i>c</i>)</li><li><span face="sans-serif" style="background-color: #f8f9fa; caret-color: rgb(32, 33, 34); color: #202122; font-size: 22.4px; text-align: center;">𝔸</span> = √(<i>s</i>(<i>s</i>-<i>a</i>)(<i>s</i>-<i>b</i>)(<i>s</i>-<i>c</i>))</li></ul><p></p><p>Then use the formula for area from base and height</p><p></p><ul style="text-align: left;"><li><span face="sans-serif" style="background-color: #f8f9fa; caret-color: rgb(32, 33, 34); color: #202122; font-size: 22.4px; text-align: center;">𝔸</span> = ½<i>hb</i></li><li><i>h</i> = 2<span face="sans-serif" style="background-color: #f8f9fa; caret-color: rgb(32, 33, 34); color: #202122; font-size: 22.4px; text-align: center;">𝔸</span>/<i>b</i></li><li><i>h = 2</i>√(<i>s</i>(<i>s</i>-<i>a</i>)(<i>s</i>-<i>b</i>)(<i>s</i>-<i>c</i>))/b</li></ul><p style="text-align: left;">So it can be done with any number of dimensions.</p><h2 style="text-align: left;">Faster</h2><p style="text-align: left;">One of the considerations is performance when coding for a microcontroller. They can do integer add/subtract very fast, multiply reasonably fast, division slower, and floating point even slower. As it happens the ESP32 has hardware single precision floating point, which helps.</p><p style="text-align: left;">So can I simplify this?</p><p style="text-align: left;">Thankfully wikipedia helpfully expands Heron's formula to:</p><p style="text-align: left;"></p><ul style="text-align: left;"><li><span face="sans-serif" style="background-color: #f8f9fa; caret-color: rgb(32, 33, 34); color: #202122; font-size: 22.4px; text-align: center;">𝔸 </span>= ¼√(4<i>a</i>²<i>b</i>²-(<i>a</i>²+<i>b</i>²-<i>c</i>²)²)</li></ul><p></p><p style="text-align: left;">Which gives us:</p><p style="text-align: left;"></p><ul style="text-align: left;"><li><i>h</i> = 2(¼√(4<i>a</i>²<i>b</i>²-(<i>a</i>²+<i>b</i>²-<i>c</i>²)²)/b)</li><li><i>h</i> = ½√(4<i>a</i>²<i>b</i>²-(<i>a</i>²+<i>b</i>²-<i>c</i>²)²)/b</li><li><i>h</i>² = (4<i>a</i>²<i>b</i>²-(<i>a</i>²+<i>b</i>²-<i>c</i>²)²)/4<i>b</i>²</li></ul><p style="text-align: left;">Working our <i>h</i>² is useful as ultimately I am just comparing this distance so no need to apply a square root. I can square my reference threshold.</p>Why is this helpful? Well, all of the parameters are <i>a</i>², <i>b</i>², and <i>c</i>². This means that I don't need to use a square root to work out <i>a</i>, <i>b</i>, and <i>c</i> in the first place. The whole lot is simple addition, subtraction, multiplication, and just one division.<p></p><h2 style="text-align: left;">Turning back</h2><p style="text-align: left;">There is another problem with all of the perpendicular distance algorithms, including this one. The all work out a distance of a point to an <i>infinite</i> line which is defined as going through two points.</p><p style="text-align: left;"></p><div style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEj5OvGmqYoPt4qZTKU7B0OsKAN4DeN9L8mepEq8r3BDoN6QFnntNNzop1D0A2_J6isbnZIjmkpN60c2vJVjlhTPhMyrfWf8UKqKR6yXi-PHcmrHMynF6Ha5T1z2hvEqy1TsH54FmPmu5x28PKvHOL6Bf2rkj8z3Iz2MP5IbxBiaoP24ZtooiK0b2pMTO3td"><img alt="" data-original-height="504" data-original-width="1728" height="116" src="https://blogger.googleusercontent.com/img/a/AVvXsEj5OvGmqYoPt4qZTKU7B0OsKAN4DeN9L8mepEq8r3BDoN6QFnntNNzop1D0A2_J6isbnZIjmkpN60c2vJVjlhTPhMyrfWf8UKqKR6yXi-PHcmrHMynF6Ha5T1z2hvEqy1TsH54FmPmu5x28PKvHOL6Bf2rkj8z3Iz2MP5IbxBiaoP24ZtooiK0b2pMTO3td=w400-h116" width="400" /></a></div><br />In this case point C is way off the line A-B, in fact it is <i>c</i> off it, but <i>h</i> is small. If <i>h</i> is within the tolerance then it would be removed leaving only A-B.<p></p><p style="text-align: left;">To solve this I can use the fact that if <i>c</i>²-<i>b</i>² is > <i>a</i>² the C must be <i>beyond</i> A and I should use <i>a</i>² as the distance².</p><p style="text-align: left;"></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEhXM2nj4Pf8DACKbsR_mdl2yUIYPZO9qUm04sFqRrFHPWFtaHF01eORXcwXglYOcfGVpK7T7nVBkFl8pElRjeqLZ46Qn6I55p4sBouA2SFMSt9i4NyCOEhUEuza99oTZfCRt-TdBYIXKVffdQE7jkv7FE633x_hz0iKaDXSGwXbZ6OxqNMVoPkaHJHT9o8q" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="788" data-original-width="1368" height="230" src="https://blogger.googleusercontent.com/img/a/AVvXsEhXM2nj4Pf8DACKbsR_mdl2yUIYPZO9qUm04sFqRrFHPWFtaHF01eORXcwXglYOcfGVpK7T7nVBkFl8pElRjeqLZ46Qn6I55p4sBouA2SFMSt9i4NyCOEhUEuza99oTZfCRt-TdBYIXKVffdQE7jkv7FE633x_hz0iKaDXSGwXbZ6OxqNMVoPkaHJHT9o8q=w400-h230" width="400" /></a></div><br />Similarly if <i>a</i>²-<i>b</i>² > <i>c</i>² then C is <i>beyond</i> B, meaning I should use <i>c</i>² as the distance².<p></p><p style="text-align: left;">Fortunately I have <i>a</i>², <i>b</i>², and <i>c</i>² already, so is a simple test.</p><p style="text-align: left;">Of course, what if you have a straight line A-B-C-D and travel A-B-C-B-C-D? No points will be "outside" the A-D range... Well the use of time as a 4th dimension catches that - which means the first case would also have been caught... Even so, this simple test on end points is worth doing I think.</p><h2 style="text-align: left;">C what I mean...</h2><div><br /></div><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #7effa5; font-variant-ligatures: no-common-ligatures;">inline</span><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #7effa5; font-variant-ligatures: no-common-ligatures;">float</span><span style="font-variant-ligatures: no-common-ligatures;"> dist2 (fix_t * A, fix_t * B)</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> {</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #7effa5; font-variant-ligatures: no-common-ligatures;">float</span><span style="font-variant-ligatures: no-common-ligatures;"> X = x (A) - x (B);</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #7effa5; font-variant-ligatures: no-common-ligatures;">float</span><span style="font-variant-ligatures: no-common-ligatures;"> Y = y (A) - y (B);</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #7effa5; font-variant-ligatures: no-common-ligatures;">float</span><span style="font-variant-ligatures: no-common-ligatures;"> Z = z (A) - z (B);</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #7effa5; font-variant-ligatures: no-common-ligatures;">float</span><span style="font-variant-ligatures: no-common-ligatures;"> T = t (A) - t (B);</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #e8eb14; font-variant-ligatures: no-common-ligatures;">return</span><span style="font-variant-ligatures: no-common-ligatures;"> X * X + Y * Y + Z * Z + T * T;</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> }</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #7effa5; font-variant-ligatures: no-common-ligatures;">float</span><span style="font-variant-ligatures: no-common-ligatures;"> b2 = dist2 (A, B);</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> fix_t *m = </span><span style="color: #fb00ff; font-variant-ligatures: no-common-ligatures;">NULL</span><span style="font-variant-ligatures: no-common-ligatures;">;</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #7effa5; font-variant-ligatures: no-common-ligatures;">float</span><span style="font-variant-ligatures: no-common-ligatures;"> best = </span><span style="color: #fb00ff; font-variant-ligatures: no-common-ligatures;">0</span><span style="font-variant-ligatures: no-common-ligatures;">;</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #e8eb14; font-variant-ligatures: no-common-ligatures;">for</span><span style="font-variant-ligatures: no-common-ligatures;"> (fix_t * C = A->next; C && C != B; C = C->next)</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> {</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #7effa5; font-variant-ligatures: no-common-ligatures;">float</span><span style="font-variant-ligatures: no-common-ligatures;"> h2 = </span><span style="color: #fb00ff; font-variant-ligatures: no-common-ligatures;">0</span><span style="font-variant-ligatures: no-common-ligatures;">;</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #7effa5; font-variant-ligatures: no-common-ligatures;">float</span><span style="font-variant-ligatures: no-common-ligatures;"> a2 = dist2 (A, C);</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #e8eb14; font-variant-ligatures: no-common-ligatures;">if</span><span style="font-variant-ligatures: no-common-ligatures;"> (b2 == </span><span style="color: #fb00ff; font-variant-ligatures: no-common-ligatures;">0</span><span style="font-variant-ligatures: no-common-ligatures;">)</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> h2 = a2; </span><span style="color: #2ceeeb; font-variant-ligatures: no-common-ligatures;">// A/B same, so distance from A</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #e8eb14; font-variant-ligatures: no-common-ligatures;">else</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> {</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #7effa5; font-variant-ligatures: no-common-ligatures;">float</span><span style="font-variant-ligatures: no-common-ligatures;"> c2 = dist2 (B, C);</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #e8eb14; font-variant-ligatures: no-common-ligatures;">if</span><span style="font-variant-ligatures: no-common-ligatures;"> (c2 - b2 >= a2)</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> h2 = a2; </span><span style="color: #2ceeeb; font-variant-ligatures: no-common-ligatures;">// Off end of A</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #e8eb14; font-variant-ligatures: no-common-ligatures;">else</span><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #e8eb14; font-variant-ligatures: no-common-ligatures;">if</span><span style="font-variant-ligatures: no-common-ligatures;"> (a2 - b2 >= c2)</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> h2 = c2; </span><span style="color: #2ceeeb; font-variant-ligatures: no-common-ligatures;">// Off end of B</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #e8eb14; font-variant-ligatures: no-common-ligatures;">else</span></p><p style="background-color: rgba(0, 0, 0, 0.9); font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"><span style="color: #2fff12;"> h2 = (</span><span style="color: #fb00ff;"><span style="caret-color: rgb(251, 0, 255);">4</span></span></span><span style="color: #2fff12; font-variant-ligatures: no-common-ligatures;"> * a2 * b2 - (a2 + b2 - c2) * (a2 + b2 - c2)) / (b2 * </span><span style="color: #fb00ff; font-variant-ligatures: no-common-ligatures;">4</span><span style="caret-color: rgb(47, 255, 18); color: #2fff12;">)</span><span style="color: #2fff12;">;</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> }</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #5edcff; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="color: #2fff12; font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #e8eb14; font-variant-ligatures: no-common-ligatures;">if</span><span style="color: #2fff12; font-variant-ligatures: no-common-ligatures;"> (m && h2 <= best)</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #e8eb14; font-variant-ligatures: no-common-ligatures;">continue</span><span style="font-variant-ligatures: no-common-ligatures;">;</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> best = h2;</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> m = C;</span></p><p style="background-color: rgba(0, 0, 0, 0.9); color: #2fff12; font-family: "Courier New"; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size-adjust: none; font-size: 13px; font-stretch: normal; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-emoji: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-variant-ligatures: no-common-ligatures;"> }</span></p><p></p>RevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.com3tag:blogger.com,1999:blog-3993498847203183398.post-80105882559484846162024-01-12T18:37:00.009+00:002024-01-15T17:29:15.006+00:00IBM Model M keyboard<p>For a very long time my preferred keyboard has been an IBM Model M keyboard. It uses "buckling spring" keys which have good tactile feedback and are clicky and loud...</p><p>This has been my preferred keyboard since they really were actual IBM Model M keyboards. These days it is UNICOMP that make them, and as I have moved to Mac as my main machine, and UK Mac keyboard layout.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiENjXjqcyiE-cTfczyR5v3hjCFGLZOX7gfGtuN9WiFyCyUr4-0BAh7NZ5xei2ZsRxGovYkc6jB9YZXM71sogZ8-HITlCHPJNhQyN29rexaVLL4UFGICpWm7jjWhuEksLWIBS04GB9sjJDdp-byCS1UU56Hs_zwRJMf1LB7dlX3AWN_QuLrnxc7phOI9kZU/s5712/IMG_4473.HEIC" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="4284" data-original-width="5712" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiENjXjqcyiE-cTfczyR5v3hjCFGLZOX7gfGtuN9WiFyCyUr4-0BAh7NZ5xei2ZsRxGovYkc6jB9YZXM71sogZ8-HITlCHPJNhQyN29rexaVLL4UFGICpWm7jjWhuEksLWIBS04GB9sjJDdp-byCS1UU56Hs_zwRJMf1LB7dlX3AWN_QuLrnxc7phOI9kZU/w400-h300/IMG_4473.HEIC" width="400" /></a></div><p>It works well, I love it.</p><p>But it has broken. Some keys get iffy, and this has happened now. It had happened once before, years ago. I assume somehow muck gets in there - but the whole thing is all sealed to a metal plate inside, so not easy to debug or fix. Last time I got a new one.</p><p>So, this time, as they have no Mac layout ones, I ordered a PC layout, and sorry, no, I just cannot get used to it. I'd rather have no Z and an iffy S than use a PC layout. Yes, I had to *hit* the Z hard to type that.</p><p>As UNICOMP have none of the Mac layout - I am a bit stuck, and, for the first time, in literally decades, looking at another keyboard.</p><p>I'll update this post when it arrives. Worrying times when a mad has to change his keyboard. But it may save muting Jitsi when I type.</p><p>Updates:</p><p></p><ol style="text-align: left;"><li>The keys do not map correctly by default on a Mac, notably ±/§ and ~/` reversed. Annoying, but solvable...</li><li>The tools to allow remapping using "VIA" app website did not work! It got stuck after connecting to the keyboard, so I fixed the remapping in the OS.</li><li>The keys are too sensitive, so being slightly different spacing I keep hitting adjacent keys just enough to register - but I will get used to the spacing. It is quieter.</li></ol><p></p>
<iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/NVNf-ULvnKQ?si=DlqC8tpzylkBzySW" title="YouTube video player" width="560"></iframe>RevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.com5tag:blogger.com,1999:blog-3993498847203183398.post-51830842145579018882023-12-28T16:38:00.013+00:002024-01-11T14:31:39.422+00:00Ordering PCBs<p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9z5fiMIx7UL7F07eaEWSk5kGSfHCDwGJf8oielL8iXYuKPY2T8RUiEDdWYmAK89tbjJsVTiifffMuxZnem-CgveZc39QMUFNqaw3NeZezYzE8_91cd2IyYZLxw7YWsaVn32-P7RC4WDs8d29Hn9f7aLfvuBxq8EloGg9z835n3yHPdZBVgvfsmhEimPZ3/s118/circuit_diagram-039-423-118-082-meca.png" style="clear: right; display: inline; float: right; margin-bottom: 1em; margin-left: 1em; text-align: center;"><img border="0" data-original-height="82" data-original-width="118" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9z5fiMIx7UL7F07eaEWSk5kGSfHCDwGJf8oielL8iXYuKPY2T8RUiEDdWYmAK89tbjJsVTiifffMuxZnem-CgveZc39QMUFNqaw3NeZezYzE8_91cd2IyYZLxw7YWsaVn32-P7RC4WDs8d29Hn9f7aLfvuBxq8EloGg9z835n3yHPdZBVgvfsmhEimPZ3/s16000/circuit_diagram-039-423-118-082-meca.png" /></a>Ordering PCBs and assembly is fun :-)<br /></p><p>Well, not fun, and to be honest, one of the biggest challenges is the parts selection, what they have in stock or something equivalent, but designing the PCB is definitely fun (well, for me).</p><p>I export a gerber files that are the instructions to make the PCB tracking images, and also a BOM (bill of materials) and position file, for placing the parts.</p><p>I have done this many many times with several PCB manufacturers, and lately with JLCPCB, which seem to be surprisingly quick and sensibly priced (apart from the odd quirk). I'd love to find a UK company as cheap and easy to use, I'd use them.</p><p>The PCB printing has a few design constraints, the gaps between tracks, minimum track width, and so on, which relate to the optics of the process for printing and drilling the board itself. But apart from that the PCB is printed exactly as expected.</p><p>Well, until now.</p><p>This is what I ordered... (this is an image from their order history page)</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikTAQc6V8yd-TfX0SJ7gjWXcQhQDjB9BylkUbPlJGHLNDpn_avcxUzXp4oU2uC7l7Q1-3IMRPFLhdfYmkyp0p24dg18cU-PSOXLpIW9NA9UasK5SxxRrG7WLXlMhJsCZoLA_Jn3FwOAoi4WGjzaYY5_6kLu7ebrq3K-GcT42zBfNLxaUhL8NdUJ4wk3G9B/s800/Screenshot%202023-12-27%20at%2017.42.43.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="716" data-original-width="800" height="358" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikTAQc6V8yd-TfX0SJ7gjWXcQhQDjB9BylkUbPlJGHLNDpn_avcxUzXp4oU2uC7l7Q1-3IMRPFLhdfYmkyp0p24dg18cU-PSOXLpIW9NA9UasK5SxxRrG7WLXlMhJsCZoLA_Jn3FwOAoi4WGjzaYY5_6kLu7ebrq3K-GcT42zBfNLxaUhL8NdUJ4wk3G9B/w400-h358/Screenshot%202023-12-27%20at%2017.42.43.png" width="400" /></a></div><p>And this is what arrived...</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicpFS-KscV7xOdA2fGNose-HG4nZ0gVKGSB2NfR2HhCo8KBXxAOipvMAdUH8dIOhAWX2wuEf3hiFWq36vwzIhM-YSyY6PYvWTJ3XM0tUE3JCc9iG5m74R-thYgIDFwhG7lZeJkASoNXLboLpMFRwNDRxUVOSFso2YQ1fiGSMGwlBuSQZ6QH3iIkSxNdD3F/s1032/PICT0010.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="867" data-original-width="1032" height="336" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicpFS-KscV7xOdA2fGNose-HG4nZ0gVKGSB2NfR2HhCo8KBXxAOipvMAdUH8dIOhAWX2wuEf3hiFWq36vwzIhM-YSyY6PYvWTJ3XM0tUE3JCc9iG5m74R-thYgIDFwhG7lZeJkASoNXLboLpMFRwNDRxUVOSFso2YQ1fiGSMGwlBuSQZ6QH3iIkSxNdD3F/w400-h336/PICT0010.jpg" width="400" /></a></div><p>It took me ages to debug it - tracking down that the CPU was running way too hot (burned my finger) and not quite right. It turned out it was running on 4.5V not 3.3V. The shorts there short input to output on a regulator circuit and I was testing from 5V USB via a diode. If I had tested 12V it would have made smoke, I expect.</p><p>The thing is the order process involves a lot of steps, and each step show the PCB you are making.</p><p></p><ul style="text-align: left;"><li>When uploading the gerber files</li><li>When selecting assembly and it shows the bare PCB</li><li>When showing PCB with parts</li><li>When order complete and preview of PCB</li><li>When order complete and preview of assembly</li><li>On gerber viewer on the site from their order confirmation</li></ul><p style="text-align: left;">At every stage they show the circuit correctly, but the final PCB was faulty.</p>I complained, and they advised: "<i>We have reflected this issue to our engineering team and JLCCAM software team and they have found and fixed the issue just now, and there will be no the same issue next time, so don't worry about it.</i>"<p></p><p>They even provided an image of the error:</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUFz7Sx18Ki9xJkPSdCX2ZQYNJm7jsYE4524qsbOIusqMpa69tBM5oTDVSOhyZrpK9air8TK_9bsmMl1XV284BBCjJEbBejYckWlhsLn5GO8PSXvZojQnjS-N9yBd5QJPtTsIKb94CRDGrpb_w9StkSZJKByVfZrpjAy-SlhKNjhTZaHDu7Cf_8k0bwm3Z/s1905/001.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="874" data-original-width="1905" height="184" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUFz7Sx18Ki9xJkPSdCX2ZQYNJm7jsYE4524qsbOIusqMpa69tBM5oTDVSOhyZrpK9air8TK_9bsmMl1XV284BBCjJEbBejYckWlhsLn5GO8PSXvZojQnjS-N9yBd5QJPtTsIKb94CRDGrpb_w9StkSZJKByVfZrpjAy-SlhKNjhTZaHDu7Cf_8k0bwm3Z/w400-h184/001.png" width="400" /></a></div><p>Next step - refund!</p><p>My view is simple.</p><p></p><ul style="text-align: left;"><li>They made an error in printing the PCB.</li><li>Arguably they made an error with the flying lead test of the PCB not spotting the printing error.</li><li>They then made the PCB with parts that cost money - either of the above errors not made would have avoided that.</li><li>It was not, in any way, my fault.</li><li>I did not get what I paid for.</li></ul><p style="text-align: left;">It is simple. I should not only have a full refund, including shipping cost, but ideally I should be compensated for the hours of debug, the delay in getting working boards, and the cost of disposing of the WEEE (defunct PCBs and part).</p><p style="text-align: left;">I'll be happy for <i>just</i> a full refund, and either they pay for courier to return boards, or I dispose of them (at my cost). As I buy loads from them, I'd even allow for it to be a credit on my account rather than an actual refund.</p><p style="text-align: left;">I have a funny feeling they will try and weasel out of this - and then I may have to ask Amex to intervene. It is for two separate batches of boards (from 4 I ordered, 2 of which were fine) totalling over $470.</p><p style="text-align: left;">Watch this space - I'll update with news.</p><p style="text-align: left;">Update: They do seem to be trying to weasel out of out - that PCB manufacturer is separate from supplying parts and assembly - but the parts they supplied are useless to me as supplied, so not reasonable that I pay for them, surely? Indeed, I have offered to send the parts back to them (at their cost). We'll see how that goes.</p><p style="text-align: left;">They suggested I try and isolate the track, but this is cutting through soldered pads, so when I put the components back it will short again!</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiKMXGKt9wRcriX3cAiH9Yee73YzimkrWIpHm6fZmaQEDhEWO0bOqoGno_63JNrDo-M7HUZw0I7Y3ftMsfmkmBAIik0R2vHZUEBLmkBwqyXb7m9EWEA2LcGdLhXGhEKPP4UzOUFljV_Rj40umAgyZ_T4tgeQg5r7KrA8QSv4_jsaQhzc62kF4CAkOvlNZO/s1654/001.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="873" data-original-width="1654" height="211" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiKMXGKt9wRcriX3cAiH9Yee73YzimkrWIpHm6fZmaQEDhEWO0bOqoGno_63JNrDo-M7HUZw0I7Y3ftMsfmkmBAIik0R2vHZUEBLmkBwqyXb7m9EWEA2LcGdLhXGhEKPP4UzOUFljV_Rj40umAgyZ_T4tgeQg5r7KrA8QSv4_jsaQhzc62kF4CAkOvlNZO/w400-h211/001.png" width="400" /></a></div><p>Update: They are being counter reasonable. I suggested I could maybe find someone to rework - they suggested I try, and get a quote. I may try and get a quote.</p><p>They also think just cleaning solder would be enough to avoid shorting with the component leads when cut like this...</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsNgP1BeGvA1tSKbCrvQyFM8Yp5nXlIn3FzQn4fKSiN4h-ws_nswEcq2DPMHUpRPFdXsj9R-BHUquyIi3mxPGgDKAm-WMfnKQAj-Z9aBRzpp7izncdhv0ZYr-UcT2IpYcHiyoX8zCiDDiWsi9QKHDyGbO1_eTfnh7vVA14J_DsA1RmrGCO5WIF66rJ24s0/s1327/001.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="879" data-original-width="1327" height="265" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsNgP1BeGvA1tSKbCrvQyFM8Yp5nXlIn3FzQn4fKSiN4h-ws_nswEcq2DPMHUpRPFdXsj9R-BHUquyIi3mxPGgDKAm-WMfnKQAj-Z9aBRzpp7izncdhv0ZYr-UcT2IpYcHiyoX8zCiDDiWsi9QKHDyGbO1_eTfnh7vVA14J_DsA1RmrGCO5WIF66rJ24s0/w400-h265/001.png" width="400" /></a></div><p>Update: I have decided instead to offer a compromise on basis that on one board I can re-use the SCD41 sensors they have supplied. Pushing their offer $50 more on each set of boards. We'll see.</p><p>Update: We have credits now.</p>RevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.com8tag:blogger.com,1999:blog-3993498847203183398.post-84245432389143103842023-12-17T12:08:00.004+00:002023-12-18T13:22:09.032+00:00Rule 170<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPy7xdKMrX_g83uSAP_tNoHNTYa2wvYFdkbLOP1Qn9NpC8d330URKYpRfDl1nce_bNxv6Sni5tQW4EsguFvS6od7sd_v8XfmLCX8G1pV146-xzkS-A2LwfqLfEgeAx6ApispNzh4rl3ZeL9kHljtVO2I5BbzVdSLwZ2vwm2er3T5NvrJ5sjMOA8aDwRbZ_/s960/rule-170-give-way-to-pedestrians-who-have-started-to-cross_orig.jpg" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="600" data-original-width="960" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPy7xdKMrX_g83uSAP_tNoHNTYa2wvYFdkbLOP1Qn9NpC8d330URKYpRfDl1nce_bNxv6Sni5tQW4EsguFvS6od7sd_v8XfmLCX8G1pV146-xzkS-A2LwfqLfEgeAx6ApispNzh4rl3ZeL9kHljtVO2I5BbzVdSLwZ2vwm2er3T5NvrJ5sjMOA8aDwRbZ_/s320/rule-170-give-way-to-pedestrians-who-have-started-to-cross_orig.jpg" width="320" /></a></div><p style="text-align: left;">The Highway code <a href="https://www.highwaycodeuk.co.uk/road-junctions.html">Rule 170</a> was updated a while ago. Last time I posted about it was before the update, and was surprisingly controversial for some reason. This time I hope less so.</p><h2 style="text-align: left;">The changes</h2><p style="text-align: left;">The changes were actually quite subtle, in my view.</p><p style="text-align: left;">1. It used to say that pedestrians <i>crossing</i> a side road had priority over vehicles entering the side road. It now says that drivers should give way to pedestrians <i>waiting</i> as well as <i>crossing</i>. I say this is subtle, as, before, a driver had to allow for the fact that a pedestrian <i>waiting</i> could become a pedestrian <i>crossing</i> in an instant by putting their foot on the road.</p><p style="text-align: left;">2. Pedestrians used to only have priority half way, i.e. over vehicles entering the side road. Now the rule covers cars leaving as well, which was a silly omission before.</p><h2 style="text-align: left;">The main rule</h2><p>The key rule here is "<i><b>give way</b> to pedestrians crossing or waiting to cross a road into which or from which you are turning. If they have started to cross they have priority, so give way</i>", but it is worth noting the first part "<i><b>watch out</b> for cyclists, motorcyclists and pedestrians including powered wheelchairs/mobility scooter users as they are not always easy to see. Be aware that they may not have seen or heard you if you are approaching from behind</i>"</p><h2 style="text-align: left;">Going well</h2><p style="text-align: left;">I think the change is working!</p><p style="text-align: left;">I suspect the publicity over the change has had most impact rather than the change itself, as drivers used to ignore the old rules, in my experience.</p><p style="text-align: left;">I used to see a lot of cases where a car turning right in to a side road would wait for traffic and then turn, even though I was crossing said side road. They then slam on their brakes and get cross with me. It seems they thought I should see them signalling and wait. Obviously I could see them, but as (a) they are stationary, and (b) I had priority, then of course it should be safe for me to cross.</p><p style="text-align: left;">I am seeing this less, and I am even seeing cars coming to a main road stop with a gap to allow me to cross in front of them. Obviously if they stop on the line I just cross in front of them walking on the dotted line. This brings the other concern I have over the number of drivers that will pull away without looking to see if someone is right on their bumper in front of them!</p><h2 style="text-align: left;">Clarification</h2><p style="text-align: left;">I like clear wording if possible, and I feel the new wording has a couple of possible issues where it could be improved.</p><p style="text-align: left;">I would hope these are silly niggles and any driver would be clear on what they should do, but given the lack of understanding so many drivers have, and the controversial comments on my last post which revolved around very specific wording, I can't help feeling the wording could be improved.</p><h3 style="text-align: left;">Crossing or waiting?</h3><p style="text-align: left;">The rule covers pedestrian <i>crossing</i> or <i>waiting</i> to cross, but seems to be to have a glaring omission. A pedestrian assertively walking towards the edge of the road with the clear intention of crossing, i.e. no indication of stopping. In that case they are neither <i>crossing</i>, nor <i>waiting</i> to cross.</p><p style="text-align: left;">I feel a simple change from <i>waiting</i> to "<i>intending</i> to cross" would cover this loophole.</p><h3 style="text-align: left;">Turning</h3><p style="text-align: left;">Another oddity is the use of <i>turning</i>. If you have a cross roads, two side roads on a main road opposite each other. Cars may be leaving or entering a side road from the other side road with no <i>turning</i> involved. Using words <i>entering</i> or <i>leaving</i> would clarify that stupid loophole.</p><h3 style="text-align: left;">Driveways</h3><p style="text-align: left;">I don't think it is controversial to say that cars entering or leaving a driveway should give way to pedestrians, and I suspect it is covered elsewhere by the fact the car is crossing the footpath itself. So probably does not need clarifying in rule 170 itself.</p><h3>Private Roads</h3><p style="text-align: left;">I would hope rule 170 applies to private roads, e.g. entrance/exit of supermarket car parks, etc. These do not always have the usual dotted road markings. It would be nice if rule 170 actually made this clear. I have seen plenty of drivers seem confused that I am crossing in front of them whilst they are waiting to leave a car park.</p><p style="text-align: left;">However, apparently any private road to which the public have access is a "road" under law, so it would apply.</p><h3>Roundabouts</h3><p style="text-align: left;">This is one I have no clue on - does rule 170 apply to the exits of a roundabout.</p><p style="text-align: left;">As a pedestrian this would be very useful. As worded, surely leaving or entering a roundabout is <i>turning</i> in to a or from a <i>road</i>. So rule 170 should apply. Or is a roundabout not a <i>junction</i>, so rule 170 does not apply at all?</p><p style="text-align: left;">So does it? It would help if rule 170 was clear on this either way.</p><h3>Turning in to a road</h3><p style="text-align: left;">Another odd one is when are your entering or leaving a road. E.g. in the middle of Abergavenny there is a sharp turn between Cross Street and Monk Street. So vehicles are clearing turning in to a new road. But both are the A40, so are they? And is it a <i>junction</i>? The particular turning is marked as a <i>box junction</i> so surely it is a <i>junction</i>, so the only question is whether going from Cross St to Monk St is turning in to a road? It would be great if pedestrians did have priority there, and if they do, it may be possible to get the road authority to put of a sign of some sort - they refuse to put in a zebra crossing for some reason.</p><h2 style="text-align: left;">More law</h2><p>This blog is excellent! <a href="https://pedestrianliberation.org/the-law-2/">https://pedestrianliberation.org/the-law-2/</a></p>RevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.com4tag:blogger.com,1999:blog-3993498847203183398.post-38861071994611549652023-12-17T11:35:00.002+00:002023-12-17T11:35:19.863+00:00BACS and Direct Debit<p style="text-align: left;"></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQQ262EwYRWfL_JKZKhNXhQ7nimfr7EkNaLu2X7UKGjyCRXNUiWmBcvNRrmMPagjiOeoYGWUfcGhI7N1jP005Hv4AhyphenhyphenCV6KmOMy0x-_jpFQLZD6MqKs_61bfsNscMDOyUMxdZbbjMEmZjvZHxOCVzjr1f2RkuD3wm-3cyzvtwSLQfMr6Z20GcBvmelvMY_/s1200/4080.jpg.webp" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="900" data-original-width="1200" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQQ262EwYRWfL_JKZKhNXhQ7nimfr7EkNaLu2X7UKGjyCRXNUiWmBcvNRrmMPagjiOeoYGWUfcGhI7N1jP005Hv4AhyphenhyphenCV6KmOMy0x-_jpFQLZD6MqKs_61bfsNscMDOyUMxdZbbjMEmZjvZHxOCVzjr1f2RkuD3wm-3cyzvtwSLQfMr6Z20GcBvmelvMY_/s320/4080.jpg.webp" width="320" /></a></div>10 years ago I posted about us having to re-do our payments system with only 2 months notice. That time was because of HMRC making changes that caused Lloyds to very suddenly close their BACS bureau. Scary times.<p></p><p style="text-align: left;">Last month we got two months notice that the BACS submission system we use (Experian) was end of life. Do these people have no clue how slow banking stuff moves?</p><p style="text-align: left;">So, the good news, my management team (Alex/Andrew) investigated a number of solutions. Most would stand no chance of being up and running in the time frame. But of a couple of options could be: one was by the company doing the Experian s/w (they took them over!) which could magically "support" the Experian system after "end of life" if we are onboarding (horrid word) their new system.</p><p style="text-align: left;">However we picked someone else - InterBACS, who are clearly technically clued up and have allowed us to get working very quickly.</p><h2 style="text-align: left;">What are BACS submissions?</h2><p style="text-align: left;">There are two main reasons you want to send files to BACS, one if Direct Debits (getting money from people), and one is Direct Credits (paying people). Direct Debits actually have special messages for setting up and cancelling Direct Debits as well as the actual payment connection messages. These type of direct credits are usually for payroll and is the older system, not to be confused with Fast Payments. Either way the process takes two banking days, and then the money moves. A reliable system. There are also a load of BACS reports we have to get, which include reports on the submission, and on changes to Direct Debits by banks, people moving to new banks and accounts, errors, bounced Direct Debit collections, and clawed back Direct Debit payments. These can actually be downloaded from the BACS web site.</p><h2 style="text-align: left;">Three ways to make BACS submissions.</h2><p style="text-align: left;">It looks like there are three ways to do BACS submissions (and get reports). I thought there were only the first two, but we discovered InterBACS do a third way.</p><h3 style="text-align: left;">1. Bureau</h3><p style="text-align: left;">One of the simplest ways is dealing with a BACS bureau - they accept a file from you, and authenticate you by whatever means they agree, and they send the file to BACS for you.</p><p style="text-align: left;">In most cases they don't actually take a "file", but "manage" Direct Debits for you, so you tell them a new customer, and how much they are paying every month - they then send the notice to the customer, and do the payments, and so on. This is ideal for a gym or the like, and can mean a simple web interface to manage regular customer payments.</p><h3 style="text-align: left;">2. Direct submission</h3><p style="text-align: left;">For direct submission you have software to send files to BACS directly. This is what we had with the Experian system. It means we have a BACS user and smart card from the bank. This is used to sign the submission file, and to log in to BACS (to send the file and get reports). The signing code only works on windows, which is a tad annoying - the only windows machine we have. This is usually cheaper than a bureau.</p><h3 style="text-align: left;">3. Web based direct submission</h3><p style="text-align: left;">This was new to us, and what InterBACS do. They have a web based system, allowing us to upload a submission file to them. Then, via the web page, log in to BACS - they log in, but they have the web browser (or a separate app depending on the browser) do the signing for the login using the card signing and card on our windows machine. So it is logged in, remotely. Similar they do signing the submission file remotely using the card on our windows machine. They get BACS reports and allow us to download them. It means we don't have to install BACS software, just the card signing stuff from the bank, and use a browser.</p><p style="text-align: left;">The also have a bureau service, and also have a whole management package for people just wanting to set up monthly payments, etc.</p><h2 style="text-align: left;">HSM</h2><p style="text-align: left;">There is another option, but very expensive. The bank could provide a hardware security module certificate, which we either have an (expensive) HSM, or have the certificate loaded on InterBACS's HSM. This allows the whole logging in to BACS and signing the submission without a manual use of a card and PIN. I.e. it can be fully automated. Sadly it is way too expensive to be remotely viable.</p><h2 style="text-align: left;">Experience with InterBACS</h2><p style="text-align: left;">We picked them as they seemed clued up and very responsive. They were very quick to sort things out and the whole thing just works. So quite impressed.</p><p style="text-align: left;">Also, they were responsive when we needed minor changes - a bulk save of all reports rather than selecting each one, etc.</p><p style="text-align: left;">We are now up and running with them in only a few weeks. Indeed, in hindsight, it could have been under a week, had the deadline been even closer, but we were a little cautious with lots of testing first.</p>RevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.com4tag:blogger.com,1999:blog-3993498847203183398.post-34029301594383202682023-11-28T16:25:00.016+00:002023-12-06T17:21:10.054+00:00No No-bell prize<p>I wanted to improve our doorbell... Yes, that is dull.</p><p>But the main change is not the bell (a nice, old style bell in the kitchen, which is driven by a Shelly, and the sitting room, and flashing lights in bedrooms and hot tub), or the bell push itself as such, but a sign on the door by the bell.</p><p>We used to have a simple brass "please ring the bell" sign, pointing to the bell push. Still, too many people knock instead.</p><h2 style="text-align: left;">Push the button</h2><p>So the idea is a sign, and additional bell push right by it, on the actual door. The sign has the house name and number and road name - that itself may help as we get parcels for the same number in the next road often, and they get ours. But a sign saying ring the bell with a hand pointing to the bell push right by the sign.</p><p>The magic happens when they push the bell (either the new or old bell push) - the sign lights LEDs on the back and changes. The basic option is like this...</p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgM3zmoWGfvBYvFPgCDV8TpZvhWvimqbFc8IiJVpqCeA1idhSqjHxQCoOO-tHkm-pwCtXwJl2T5i1b0oe8RMGUDAwZSbInjHej3ljPy3iYH9in6hde5sm2QlRiGy9B6Yb6_DnQxEeV8BWeA8QlBt-3f_c5CjIvBwjrx7OjaITpGvfebt2LFuPchwGmEUFh5" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="5712" data-original-width="4284" height="400" src="https://blogger.googleusercontent.com/img/a/AVvXsEgM3zmoWGfvBYvFPgCDV8TpZvhWvimqbFc8IiJVpqCeA1idhSqjHxQCoOO-tHkm-pwCtXwJl2T5i1b0oe8RMGUDAwZSbInjHej3ljPy3iYH9in6hde5sm2QlRiGy9B6Yb6_DnQxEeV8BWeA8QlBt-3f_c5CjIvBwjrx7OjaITpGvfebt2LFuPchwGmEUFh5=w300-h400" width="300" /></a></div><p>I included a barcode with date time and postcode for photos when leaving a parcel.</p><h2 style="text-align: left;">Seasons greetings</h2><p style="text-align: left;">I also decided it may be a fun idea to change the message, add Christmas tree for now, and so on, but even regionalise the message...</p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEh_TSdrwnkFtHYK-pD3-yqVakah6ldAHWALgXcLAA9FVLaKkOViyJnJbQpTZgSeS_VtyTtupulEo3LZHkzNkFKHQe6Kb3ZAJq7-58pvnGffM3MKuMfR3HG45D54nj4KeG_FBt7yGUjTWFtUoOpRqZ10gzWjOGpGYKNosSNT3O2YQB7blyAxe1xLsEst8f62" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="3024" data-original-width="4032" height="300" src="https://blogger.googleusercontent.com/img/a/AVvXsEh_TSdrwnkFtHYK-pD3-yqVakah6ldAHWALgXcLAA9FVLaKkOViyJnJbQpTZgSeS_VtyTtupulEo3LZHkzNkFKHQe6Kb3ZAJq7-58pvnGffM3MKuMfR3HG45D54nj4KeG_FBt7yGUjTWFtUoOpRqZ10gzWjOGpGYKNosSNT3O2YQB7blyAxe1xLsEst8f62=w400-h300" width="400" /></a></div><br />The idle message can be updated and made seasonal, I may even automate based on date, but also the message shown when you press the button can vary depending on circumstances. This saves me putting a sign on the door when we are out - which is a notice to everyone that we are, well, out. The message for when we are out ("leave parcels behind the double gates") is only shown when someone pushes the bell. Indeed other messages can be set if needed.<p></p><h2 style="text-align: left;">Let there be light</h2><p style="text-align: left;">The main way it decides what to show is based on lights. Yes, that seems crazy, but is incredibly simple when almost all lights are Shelly running tasmota and reporting to MQTT. I can track light states. I have a stairs light which only gets turned off when the alarm is set (we are out). I also track the hall light, which is an easy way I can indicate "we are busy, leave by the door" for when I am in the hot tub, etc. Indeed, if I change a light when the message shown updates in real time, so if in the hot tub I can remote turn off the hall light from my phone when the bell rings.</p><p style="text-align: left;">I also have Mastodon DMs for the bell, with exact time stamps to make easy to find in CCTV.</p><p style="text-align: left;">It also means control of the status display is something my wife can also easily understand and change if she wants, just using light switches.</p><h2 style="text-align: left;">Making a board</h2><p style="text-align: left;">Obviously I designed my own circuit board for this. It works with a waveshare 7.5" e-paper display.</p><p style="text-align: left;"></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEjYtiX6cQIjel9DoWPqA0Gf8ptkhqcGakhILITOx5AYxnGl7X_1391Ovxullvt9z8-3HGzMk-jFxk2BAIBgVROqEvI9MLFFYjMMJoCiX0_vN0jyG4Tr8U-Chi9c7izRFCtTZCDTQwPlkqN3_GHzI4uThMyjfJZyZkW12hHQ_gPYW1b3vGOuegExnpd2zmgY" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="2904" data-original-width="4714" height="246" src="https://blogger.googleusercontent.com/img/a/AVvXsEjYtiX6cQIjel9DoWPqA0Gf8ptkhqcGakhILITOx5AYxnGl7X_1391Ovxullvt9z8-3HGzMk-jFxk2BAIBgVROqEvI9MLFFYjMMJoCiX0_vN0jyG4Tr8U-Chi9c7izRFCtTZCDTQwPlkqN3_GHzI4uThMyjfJZyZkW12hHQ_gPYW1b3vGOuegExnpd2zmgY=w400-h246" width="400" /></a></div><br />It sticks to the back of the board, has an ESP32-S3 with wifi, USB connectors, and big solder tabs for wires for power and the bell itself. It was designed so it could be set in resin even (though that seems to break the e-paper, possibly by getting in the FPC connector). So a bare board with acrylic spray for now.<p></p><h2 style="text-align: left;">No-bell prize</h2><p style="text-align: left;">It did not work. The screen did not update properly. I was disappointed to say the least.</p><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEg7OWjLS33w8x4V0OcV5CN9NYMu1cNKHPBI4tEJGejKvAtngXhycVW523vEypiB4jOz_SSTEogHMB467jclqQUQG_XlziaopAqE3j0iZHD4WmX38OsfB6Cf889R3q4jfYbvfHPzqMEsYrU8ROxNz9w8cM-8T4q8kpp_3ZIRNUE8P-ftsw20qq1KGV3QL6u9" style="margin-left: auto; margin-right: auto;"><img alt="" data-original-height="1644" data-original-width="2252" height="293" src="https://blogger.googleusercontent.com/img/a/AVvXsEg7OWjLS33w8x4V0OcV5CN9NYMu1cNKHPBI4tEJGejKvAtngXhycVW523vEypiB4jOz_SSTEogHMB467jclqQUQG_XlziaopAqE3j0iZHD4WmX38OsfB6Cf889R3q4jfYbvfHPzqMEsYrU8ROxNz9w8cM-8T4q8kpp_3ZIRNUE8P-ftsw20qq1KGV3QL6u9=w400-h293" width="400" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Old</td></tr></tbody></table><div class="separator" style="clear: both; text-align: center;"><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgl_dIA9r7GUiE_ngB9jrwazu51wwhQWB2QdL4IuOtPoxqwaTnN8QZbaUpREgxCnx4ZKioS6UGpVP4Sk1eIkb68DVpDCSERUzEDkDfqWWh1n57_PiQBtzpEDjzjCsnEJvBKbcigU5VTphNpZxkb5BCNgY0LOXTZoMRXpZjW1Wq3Q1IqwK3HSYIRLEEHwhXz" style="margin-left: auto; margin-right: auto;"><img alt="" data-original-height="1468" data-original-width="2102" height="279" src="https://blogger.googleusercontent.com/img/a/AVvXsEgl_dIA9r7GUiE_ngB9jrwazu51wwhQWB2QdL4IuOtPoxqwaTnN8QZbaUpREgxCnx4ZKioS6UGpVP4Sk1eIkb68DVpDCSERUzEDkDfqWWh1n57_PiQBtzpEDjzjCsnEJvBKbcigU5VTphNpZxkb5BCNgY0LOXTZoMRXpZjW1Wq3Q1IqwK3HSYIRLEEHwhXz=w400-h279" width="400" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">New</td></tr></tbody></table></div><p style="text-align: left;">The fix was to change the inductor and make it work, yay, no no-bell prize for me now.</p><p></p><p style="text-align: left;">So, finally, it works!</p><p style="text-align: left;">Update: The only reason this board is this size is because it has LEDs (one in each corner) do fits the 7.5" e-paper. If not then it could use a much smaller board, which I have also designed. But the new version of this larger board now has 24 LEDs, given that the LEDs are the only reason for the larger board this makes sense, but it may be a slight power issue as they are 10mA when white, so some testing may be necessary.</p><p style="text-align: left;">Update: I love the fact I have been accused of "nerd sniping" Bloor. He got one of these 7.5" panels with the waveshare HAT, and somehow he totally messed up the simple task of the FPC connectors, so much he broke several of them, and then managed to crack the display trying to get one working, and threw it all away. I come in and not only have no problem with the connectors, but then I don't just use the 7.5" panel and HAT with no problem, but make my own better PCB, and a new smaller PCB, and a version 2 of both boards, and a working door sign, and now even listing on <a href="https://www.amazon.co.uk/dp/B0CPFM1ZJJ">Amazon</a>! Is that "nerd sniping", or am I bad?</p><p></p>RevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.com2tag:blogger.com,1999:blog-3993498847203183398.post-50609377470849700882023-11-06T10:11:00.003+00:002023-11-06T10:11:55.998+00:00USB-C Plugs, Sockets, and 5V supply<p>Assuming you want to use a USB Type-C connector, but just want USB2 (D-/D+) and 5V power.</p><p>So many get this wrong, however, it seems the answer is quite simple.</p><p>It would seem there are a number of connectors you can get, with just the main USB2 pins, or with all USB-C pins.</p><p>For a USB-C Socket, you need to connect CC1, and CC2, <b>separately</b>, via 5k1 resistors to GND. Like so.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-CWN-rOX0yU4YANN69FFmL3QR8dFJb5jMpu1u9Po1_1zPAm50nydm_quAcOyxt1_mWr7E9jUWnagfUCss6B5iUmjNUpW8AfWasxdn7yFYajVgvOWe8tImd7s6t7L8jbiY8KCJ7g3amhySjKafCS6CWMwPVEUMMOEa6KaWaJtqD_48fbf1FftrI21S1H9r/s648/Screenshot%202023-11-06%20at%2010.07.20.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="648" data-original-width="570" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-CWN-rOX0yU4YANN69FFmL3QR8dFJb5jMpu1u9Po1_1zPAm50nydm_quAcOyxt1_mWr7E9jUWnagfUCss6B5iUmjNUpW8AfWasxdn7yFYajVgvOWe8tImd7s6t7L8jbiY8KCJ7g3amhySjKafCS6CWMwPVEUMMOEa6KaWaJtqD_48fbf1FftrI21S1H9r/w351-h400/Screenshot%202023-11-06%20at%2010.07.20.png" width="351" /></a></div><p>However, for a USB-C plug, the CC1/CC2 pins are actually CC and VCONN. You connect CC via 5k1 to GND, and leave VCONN unconnected. If you connect both then it won't work! Like so.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMHdEghlPG_Um3EXCjn1FobmIU9WsTaa2LElvIDbdWbKARvIG0MKKH_ncnt9WqjdOamemBTeqJwSUiGNZIenszUJ4C9muIKFoRq2vQsB32UZHDy2QkOWr-KLI759EBzlNVy5esTI53UM2ayZ2fHULWMKwxJKbT_BlVYKIcW6INJDcbiEo0NraQLaHOsK8_/s642/Screenshot%202023-11-06%20at%2010.09.17.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="642" data-original-width="612" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMHdEghlPG_Um3EXCjn1FobmIU9WsTaa2LElvIDbdWbKARvIG0MKKH_ncnt9WqjdOamemBTeqJwSUiGNZIenszUJ4C9muIKFoRq2vQsB32UZHDy2QkOWr-KLI759EBzlNVy5esTI53UM2ayZ2fHULWMKwxJKbT_BlVYKIcW6INJDcbiEo0NraQLaHOsK8_/w381-h400/Screenshot%202023-11-06%20at%2010.09.17.png" width="381" /></a></div>
<p>Yes, the connector is reversible, so actually it does not matter if A5 or B5 are connected to the 5k1 resistor, just as long as only one of them is.</p>RevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.com0tag:blogger.com,1999:blog-3993498847203183398.post-27965780379175856892023-11-01T12:07:00.004+00:002023-11-01T12:07:55.294+00:00LiPo batteries<p>I have done a lot of small circuit boards, but one of the challenges with any board is battery working.</p><p>I used the Watchy as a good example of this, understanding how to put the ESP32 in to deep sleep and so on. This worked very well. What I had not done until now was actually make a battery based board myself.</p><p>The first attempt, which was a massive long shot, was to test if I could run an ESP32 (ESP32-S3-MINI-1) off a <i>button cell</i>. The answer is no. This was not a big surprise.</p><p>So the next attempt was this :-</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWfQTOV1fGrvxU-gciAVH-FEXl49wLiiTjcXKYArybYIbJC_jdEGBEF69hgujuGnEgPTOOc8b1jie2X1pZLwnLAoYhF7IbVDhdHUmx4HCFEJPggi6W4s2iECoXquqhXll0uSfeIDWfenoX-whEPsBCKFs6QZL7xx75CTjycQFnUYelDniy55RERiMKS85x/s5472/318154.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="3648" data-original-width="5472" height="266" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWfQTOV1fGrvxU-gciAVH-FEXl49wLiiTjcXKYArybYIbJC_jdEGBEF69hgujuGnEgPTOOc8b1jie2X1pZLwnLAoYhF7IbVDhdHUmx4HCFEJPggi6W4s2iECoXquqhXll0uSfeIDWfenoX-whEPsBCKFs6QZL7xx75CTjycQFnUYelDniy55RERiMKS85x/w400-h266/318154.jpg" width="400" /></a></div><p>This has a small LiPo battery, an LDO regulator, and a charger circuit. This is basically copied the choice of components for these from the Watchy design.</p><p>There are a few things you need for battery working though - for a start, I have a FET to control power to the LED chain. The LEDs, when idle, do use very little power, but for battery working I want it to be zero power. So I have a GPIO that actually switches the power for the LED chain on and off (this is the small WS2812B compatible 3.3V RGB LEDs I have been using lately).</p><p>Another small trick is to also use a FET to switch the battery voltage to an ADC. The ADC on the ESP32 needs a lower voltage, so has a potential divider. The problem is a potential divider uses a small amount of current all the time - so again, this is switched on using a FET. I don't know if that is really necessary, but every uA helps. This should, hopefully, allow me to confirm battery levels whenever I need.</p><p>One small issue, which I have yet to quite get to the bottom of, is waking from deep sleep. The ESP32 IDF seems to suggest it is possible to make any RTC GPIO cause a wake on a state change. This is ideal for any buttons (I have two on that board design). However, that did not seem to work. I'll experiment more. There is, however, a separate way to do this, which is you can have a set of RTC GPIOs and wake on "any high" or "all low". For more than one button (I added two for the hell of it), this only really works if you have the idle state of the button low, not high. I had, as is common, had these buttons switched to GND with a pull up. I had to change the design not be reversed to allow wake on either button being pressed (at least until I get the "change of state" logic working).</p><p>I had fun finding a suitable upright USB-C connector, and I have juggled the various connector positions a bit since this original design.</p><p>Now to find what the battery life is when idle, and how many times you can use it before it goes flat. But it does work - yay!</p>RevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.com2tag:blogger.com,1999:blog-3993498847203183398.post-29053527716223357782023-10-14T11:45:00.018+01:002023-10-17T17:31:11.064+01:00Playing with a serious number of WS2812B RGB LEDs<p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5E6GPZzfrfanMExCQoaOh53GOhyphenhyphenzNCEPV7JtHtdZoJndJUd9QYaHwf851_S8d1UssGR56jsX4gSXmwxkhzhMAOIuWK3_NQ4f3LUj5zfH4qvgc6LbNZh0PAnVJrwVdI8B-AzkRiJ1j_zscmSvpd9vEkz55TkvTL5p4CrRxdN-nXQWMce77vYcoCYI4VM_V/s2760/316211.jpg" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="2760" data-original-width="2378" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5E6GPZzfrfanMExCQoaOh53GOhyphenhyphenzNCEPV7JtHtdZoJndJUd9QYaHwf851_S8d1UssGR56jsX4gSXmwxkhzhMAOIuWK3_NQ4f3LUj5zfH4qvgc6LbNZh0PAnVJrwVdI8B-AzkRiJ1j_zscmSvpd9vEkz55TkvTL5p4CrRxdN-nXQWMce77vYcoCYI4VM_V/w345-h400/316211.jpg" width="345" /></a></div>I have done some fun stuff with LEDs, but now I have found some very small 1mmx1mm WS2812B LEDs, I decided to make a Stargate.<p></p><p>Well, the doctor said to rest, so this is my resting! I have spent a week on this - much of that waiting for slightly wrong 3D prints to print. 3D printing is always a massive time hog.</p><p>My first ideas was 210 LED, but then I went for a better design with 372 LEDs.</p><p>I have since revised the design to 507 LEDs!</p><p>The image shown here is the 372 LED design.</p><p>Needless to say, some C code was used to place the LEDs and caps and vias and tracks for this.</p><p>To my surprise the power usage is not that bad, all 372 LEDs on full white is 3.6A, including the ESP32. So can run off a suitable USB charger.</p><p>In practice, the Stargate dialling sequence does not go over 0.8A, so no problem.</p><p>As usual, all open source on my <a href="https://github.com/revk/ESP32-LED/tree/main/PCB/Gate">GitHub</a>.</p><p>However, I did find that JLCPCB cannot cope with more than 400 designators on one line in a BOM file :-)</p><p>As for spinning, I could make a spinning effect using 117 LED rings, but I could not spin the actual glyphs - so as a compromise I illuminate the glyphs that are dialled in situ. I think it works quite well.</p><p>Of course, the challenge then was a 3D case for it. This was tricky - there are a lot of 3D models of stargates, some more easily printed than others, but I wanted one I could nicely slice in two and allow the PCB to be inserted. That proved more complex, so I designed one from scratch in OpenSCAD. It is simplified to be easy to 3D print, even though the whole thing is nearly 7 hours print time.</p><p>I also needed a reasonably neutral colour to allow the LEDs to show. I ended up using the ColorFabb Glowfill, which has the side effect that it glows in the dark.</p><p>Here is it dialling...</p>
<iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/xCBAoHpSLCk?si=VYLdpTR4SqFMDFRv" title="YouTube video player" width="560"></iframe>
<p>This is the latest 507 LED PCB design, the main change is an extra kawoosh ring that will be inside the 100mm gate ring. The idea is that this could then work with a mirror and half mirror perhaps to make a gate tunnel effect. I'll see when I make some more. It works out around £30 per board, shipped.</p><p>The extra tabs are not a space gate effect, honest, they are tooling holes and fiducials for production, and get snapped off.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOfMxZg0Voi9DH_Ilm5brzRKBuGkTv7DO7FqYuR-Fh25tulZbtZ_6utkdh8Uat6i4dtk6J4fKW5IgYqLBsYWVUzIGBuzsf0Ya5svZgu08MMyyi0G1W3A9nscEvCHL7gsDSZ4dVpSV7XktzuQli9-mAGqD06FAe_CqTZ6r9vKlUrnDhPpO_M_hK31TbB4Wk/s2508/Gate.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="2508" data-original-width="2392" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOfMxZg0Voi9DH_Ilm5brzRKBuGkTv7DO7FqYuR-Fh25tulZbtZ_6utkdh8Uat6i4dtk6J4fKW5IgYqLBsYWVUzIGBuzsf0Ya5svZgu08MMyyi0G1W3A9nscEvCHL7gsDSZ4dVpSV7XktzuQli9-mAGqD06FAe_CqTZ6r9vKlUrnDhPpO_M_hK31TbB4Wk/w381-h400/Gate.png" width="381" /></a></div>
<div style="text-align: left;"><br /></div><h2 style="text-align: left;">That's a lot of LEDs</h2><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiITf1UNQT3Sq4hJPJIcxnkbEKfukJ3lRcxK0jUb5ENf_sdNPev5yEBNV5pMlP_UcVIDpJQyJ1761soOL-QJEhHynumOa1vTOL7BVY0d4IeRuL8brW6N9wPqPyXjoG8odFi014818ci4pNKY2XS2nPJPQUJWNsICHzVt8-D7d2XAAkHNNBcM_yvehuZGAA/s1243/316368.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1243" data-original-width="1125" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiITf1UNQT3Sq4hJPJIcxnkbEKfukJ3lRcxK0jUb5ENf_sdNPev5yEBNV5pMlP_UcVIDpJQyJ1761soOL-QJEhHynumOa1vTOL7BVY0d4IeRuL8brW6N9wPqPyXjoG8odFi014818ci4pNKY2XS2nPJPQUJWNsICHzVt8-D7d2XAAkHNNBcM_yvehuZGAA/w363-h400/316368.jpg" width="363" /></a></div>RevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.com2tag:blogger.com,1999:blog-3993498847203183398.post-91995119384880820642023-10-07T08:30:00.007+01:002023-10-09T09:21:11.810+01:00Shelly Plus PM Mini<p>Another in the Mini series from Shelly, the PM (Power monitor).</p><p>Update: explanation from Shelly: <i>Easy, N is almost double the heat inside of the device. Sorry but in such small size we didn't want it. Double out allow to use single device in double socket which is most useful than second N.</i></p><p>Obviously this wants to be <i>in-line</i> with the device you are monitoring.</p><p>What struck me as odd from the pictures, and did confuse others as well, is that it has L/N (in) and O/O (out).</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkVDus8kTwoQ1yPpNOogmJJ5KrsymHrS_ZEvWiHclnbdlUJV9dZnPc78IYvHXjDCsg6LUUTWfXWxucLH6DZKZDKTT8_pn8ixtsz_ZQXg7P7uQhkbLU4I4tU6DFqvWhZxt5mPJ6WtlQpE7xcmKf4Sc0fHTAuFCLT0LNd985F2EPpcizMehZcwtJmeLTUp4F/s3282/315765.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="3132" data-original-width="3282" height="381" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkVDus8kTwoQ1yPpNOogmJJ5KrsymHrS_ZEvWiHclnbdlUJV9dZnPc78IYvHXjDCsg6LUUTWfXWxucLH6DZKZDKTT8_pn8ixtsz_ZQXg7P7uQhkbLU4I4tU6DFqvWhZxt5mPJ6WtlQpE7xcmKf4Sc0fHTAuFCLT0LNd985F2EPpcizMehZcwtJmeLTUp4F/w400-h381/315765.jpg" width="400" /></a></div><p>Is that L/N in and L/N out? That would make sense if it is to go <i>in-line</i> to a device being monitored.</p><h2 style="text-align: left;">No it is not!</h2><p>As you can see, the O/O are both wired together and are the Live out after the monitor.</p><p>There is no second N, so wiring in this <i>in-line</i> either means two neutral in one screw terminal (not ideal) or a wago to join the neutral wires.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdEwR1pV24RXpMc3Si1TS2vbrCypqmY2mxMKAGZQzLUEUm9GVGyqJlbTmvVgctThpVA2B9iT6XzFItmJ5oeOvZqwZvqXS85hi-iBLpZe6dTv9uRjzr_xGrhh9u1mGe3SyVCf9nee01e-1oBsQNOhNomx_dol7Pr8Tu0NgLOmcBmoVL9oXTYm45f8mGWve2/s2481/315876.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="2405" data-original-width="2481" height="388" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdEwR1pV24RXpMc3Si1TS2vbrCypqmY2mxMKAGZQzLUEUm9GVGyqJlbTmvVgctThpVA2B9iT6XzFItmJ5oeOvZqwZvqXS85hi-iBLpZe6dTv9uRjzr_xGrhh9u1mGe3SyVCf9nee01e-1oBsQNOhNomx_dol7Pr8Tu0NgLOmcBmoVL9oXTYm45f8mGWve2/w400-h388/315876.jpg" width="400" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><h2 style="text-align: left;">Why Shelly? Why?</h2><p>I appreciate an L/N/gap/L/N may have been messy to track the neutrals, but what they could, very easily, have done have N/N/L/gap/O. This would allow live in and out, and neutral in and out and no wagos, and no two wires in one screw terminal. Way better.</p><p>I had to draw diagrams to explain to the people on the Shelly group on facebook!</p><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitP8mAsJTcChkzj_4uJiR_KT9gU8RK0ur1Nx7HpAgCH7G-D2nfGAgIdP15-9Je3BMs2LkMzt2s_WDEy-xdPVKKmZVOgmayBD1FK0eaeYB89BPlo3ysn1Af_ajRnAUhdkMb7Bhqzq2BAMTBWkNeHnA2FHIsWZ1MFliZAkuC59uaSo1X7X57VWlNXi_OK0GQ/s1840/Screenshot%202023-10-07%20at%2010.43.34.png" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="1840" data-original-width="1404" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitP8mAsJTcChkzj_4uJiR_KT9gU8RK0ur1Nx7HpAgCH7G-D2nfGAgIdP15-9Je3BMs2LkMzt2s_WDEy-xdPVKKmZVOgmayBD1FK0eaeYB89BPlo3ysn1Af_ajRnAUhdkMb7Bhqzq2BAMTBWkNeHnA2FHIsWZ1MFliZAkuC59uaSo1X7X57VWlNXi_OK0GQ/w305-h400/Screenshot%202023-10-07%20at%2010.43.34.png" width="305" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">How you have to wire it now</td></tr></tbody></table><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigs5gRCQnEdDtSTqR7z_i6nlZf0c0j5woT8OPvVFS6y98mlAZmqMzgR6aLPCvXapB2RqviF29Bf9oZp4WP_8oMM4RmhHXaFxUaGJRBkampnOjBlLEYi2rHgUIZKbQVUl2QpqYZbGtc1UrrTlZlwM7ej4Q4C8ThYVZ9eRwCuyfctp_e9gh4jYqBy9D85rrw/s1360/Screenshot%202023-10-07%20at%2010.48.38.png" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="1218" data-original-width="1360" height="359" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigs5gRCQnEdDtSTqR7z_i6nlZf0c0j5woT8OPvVFS6y98mlAZmqMzgR6aLPCvXapB2RqviF29Bf9oZp4WP_8oMM4RmhHXaFxUaGJRBkampnOjBlLEYi2rHgUIZKbQVUl2QpqYZbGtc1UrrTlZlwM7ej4Q4C8ThYVZ9eRwCuyfctp_e9gh4jYqBy9D85rrw/w400-h359/Screenshot%202023-10-07%20at%2010.48.38.png" width="400" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">How it could have been</td></tr></tbody></table><br /><p style="text-align: left;">As explained above, the explanation is N through the device is extra heat, but to be honest I do not buy it.</p><p style="text-align: left;">The two O, meant that if one uses the second O only, all the current has to flow an extra few mm via a nice thick track to the second O terminal and that is extra resistance and heat. But surely that is exactly the same as would happen with N flowing to an adjacent N terminal the other side.</p>RevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.com0tag:blogger.com,1999:blog-3993498847203183398.post-27000481086993610192023-10-06T12:11:00.030+01:002023-10-25T15:34:34.176+01:00Shelly Plus 1 Mini<p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8AdFqOXfwf6yGK84PW5Bm8j9oR2CW6ENt2PqIUooxAIU_nEl4l6mghjGaLzH4f71Nkja5-aNt1H93v0ebKq5sNwUXKcHjZzSPYbpjB4O4QjxvLsj8fLJKuAat1iQAX0p9ZuMMEW-pkz8WltKQv4NDdfzlKS8n88oD4TICat_l0IBTMNZRLKXa-4EJ1oeR/s3358/315761.jpg" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="3194" data-original-width="3358" height="304" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8AdFqOXfwf6yGK84PW5Bm8j9oR2CW6ENt2PqIUooxAIU_nEl4l6mghjGaLzH4f71Nkja5-aNt1H93v0ebKq5sNwUXKcHjZzSPYbpjB4O4QjxvLsj8fLJKuAat1iQAX0p9ZuMMEW-pkz8WltKQv4NDdfzlKS8n88oD4TICat_l0IBTMNZRLKXa-4EJ1oeR/s320/315761.jpg" width="320" /></a></div><p style="text-align: left;">The new Shelly Plus 1 Mini is now available, and it is indeed tiny.</p><p style="text-align: left;"><b>Note: Detailed instructions of upgrade from Shelly to Tasmota via web interface at the end of this blog.</b></p><div><p></p><p></p><p>Key differences from the Shelly Plus 1</p><p></p><ul style="text-align: left;"><li>Smaller (33½mm x 28mm x 16mm)</li><li>Cheaper</li><li>No DC power</li><li>No programming connections</li><li>8A not 16A relay</li></ul><p></p><p style="text-align: left;">The lack of programming header was a concern as I have always reflashed these using the programming header - but it can be done via the web control pages.</p><p style="text-align: left;">I did try, and failed, to find an image of the back of a Shelly Plus 1 Mini - so here you are...</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjAtynzNN3uRHWJ3sSEXMPkWCPx0iM69HN8xyD1eCxpxZr3cco_aQny2zmSO-1k1rHKJVtmiBO2ckiF-ryGat4wEJlCQn3-5af0MtNGI-RYfCGIfnwVF0544zcy3lcnT_VoohzFSad31AMFRTmhPZUS22SF6hSIOR6v51vHwfD_T9B-HiuAa8NwYjPaFlG/s3319/315762.jpg" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="3182" data-original-width="3319" height="307" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjAtynzNN3uRHWJ3sSEXMPkWCPx0iM69HN8xyD1eCxpxZr3cco_aQny2zmSO-1k1rHKJVtmiBO2ckiF-ryGat4wEJlCQn3-5af0MtNGI-RYfCGIfnwVF0544zcy3lcnT_VoohzFSad31AMFRTmhPZUS22SF6hSIOR6v51vHwfD_T9B-HiuAa8NwYjPaFlG/s320/315762.jpg" width="320" /></a></div><div style="text-align: left;">It does still have a dry contact relay, making it suitable for working DC contacts (garage door opener, etc).</div><p style="text-align: left;">It still has the button on the back.</p><p style="text-align: left;">It still has an LED in the back.</p><p style="text-align: left;">It does still have the ESP32 processor.</p><p style="text-align: left;">But overall, this is a welcome addition to the Shelly family.</p><h2 style="clear: left; text-align: left;">Inside</h2><p style="text-align: left;">The inside is indeed compact. As you can see, the back does have programming pads. I have not worked out what they are yet, but should not be hard.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEif5fuwv6LKRUviXwAHVSU_n8PkWfOKuWMpzgMyWlMOXuSBP0SUgUURyCcMdvSX7pw80ywLQT_r1Sr4PqI5jZCTBCAnXqAByYLIg-r_D-R80jEH2LTUfYH8AsMeNeYjsewtBY5vBnEiuSSVy7km3gidSQwZl10hRINiniYgGBpzBEESEd7e-d7-HiQ-hbUZ/s3089/315759.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="3019" data-original-width="3089" height="391" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEif5fuwv6LKRUviXwAHVSU_n8PkWfOKuWMpzgMyWlMOXuSBP0SUgUURyCcMdvSX7pw80ywLQT_r1Sr4PqI5jZCTBCAnXqAByYLIg-r_D-R80jEH2LTUfYH8AsMeNeYjsewtBY5vBnEiuSSVy7km3gidSQwZl10hRINiniYgGBpzBEESEd7e-d7-HiQ-hbUZ/w400-h391/315759.jpg" width="400" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbyxC62C43n3N9cO9iosK1748KNBUvyZGQFED_8dzqvjpXQL6AH-i7ULB_pd8Lra-QgHsXRcNQ37LeJHldn3YrsKIPevOu43OtNM2SoC2JShMMjVAiw87WWjvvG4FeZTrCBrGKnepwvApyTvh9Hoe_MMPR2AAn6baLFPPt-lod0ayxaL691wWl1Rqir4F6/s3037/315760.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="2896" data-original-width="3037" height="381" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbyxC62C43n3N9cO9iosK1748KNBUvyZGQFED_8dzqvjpXQL6AH-i7ULB_pd8Lra-QgHsXRcNQ37LeJHldn3YrsKIPevOu43OtNM2SoC2JShMMjVAiw87WWjvvG4FeZTrCBrGKnepwvApyTvh9Hoe_MMPR2AAn6baLFPPt-lod0ayxaL691wWl1Rqir4F6/w400-h381/315760.jpg" width="400" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><h2 style="text-align: left;">Upgrade to Tasmota</h2><p>These are basically the steps from <a href="https://github.com/tasmota/mgos32-to-tasmota32">https://github.com/tasmota/mgos32-to-tasmota32</a> but with some explanation of exactly which menus to pick at each stage.</p><p></p><ol style="text-align: left;"><li>You need to connect to the AP for the Shelly, and it does not pop up so you need to visit 192.168.33.1 to talk to its web interface.</li><li>Select "Configure Wi-Fi Settings", tick "Enable Wi-Fi network", select SSID and enter password, and "Save settings". You then have to work out what IP address it is on as it does not say - you may have to check your DHCP server.</li><li>You will need the right zip file. This lists them <a href="https://github.com/tasmota/mgos32-to-tasmota32/releases">release section</a> but on a mac you end up with an unzipped directory - you want the raw zip. Curl works with the link, but as they have a 302 you need curl with -L to follow the 302 and so make the valid ZIP file. Note they say you cannot load using a URL in the shelly upgrade menu for some reason.</li><li>On the Shelly control page on its new IP, select "Settings", "Firmware". If the Shelly is not itself on latest code, you may need to tell it to upgrade first.</li><li>On the Shelly control page on its new IP, select "Settings", "Firmware", and under "Upload custom firmware" selecting the zip file. Click "Update device". It should say (at top of page) "Your Shelly is updating...". Note, you need the right upgrade file for the model - it will not work if you pick the wrong one, e.g. don't confuse Plus1PMMini and PlusPMMini for example.</li><li>You then have to connect to the tasmota AP. Wait for it to auto load the set up page, select WiFi and enter password. It shows the new IP so you can get to it (probably the same as the Shelly got).</li><li><b>Important, it seems the following steps are necessary else it can be bricked on next update!</b></li><li>Select "Configuration" / "Auto-configuration" and pick the device and "Apply configuration". Again, get the correct device setting.</li><li>The next bit in the instructions was "Open the partition wizard" fooled me. It is "Consoles", "Partition Wizard". If not present then it is possible to upload a Partition_Wizard.tapp file under "Manage file system". Under the "Partition Wizard", select "Start migration". It says "Magic is happening" and there are "multiple restarts". Some intermediate steps will show "SAFEBOOT". It takes a few minutes to be ready.</li><li>Select "Consoles", "Partition Wizard", and click "Resize FS to max". This removes all files (including the Partition Wizard).</li></ol><p style="text-align: left;">You now have an upgraded Tasmota installed Shelly, which is Matter compatible and works with MQTT.</p><h2 style="text-align: left;">And finally, the pin out for serial programming.</h2><div><b><span style="background-color: #fcff01; color: red;">Do not dismantle or connect serial programming whilst connected to mains power!</span></b></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKB_ul35N_x0oPj0j9xSezlPSLzr-Y-l0IwH2_qcBrT9zZYvQqTDB-fffWO8-lgpuPkeBFi2IoVlBxgoMzt1n0JDglkj2-3ZTcHomjG96Oolc0FGyW4LVsri0Eb8_1buZg2gXCn91R5tIGSVnovIWclraKf1WFIVnSPnQ4A6212vfOU2DRGJR2ZxDRtgLm/s3858/315953.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="3169" data-original-width="3858" height="329" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKB_ul35N_x0oPj0j9xSezlPSLzr-Y-l0IwH2_qcBrT9zZYvQqTDB-fffWO8-lgpuPkeBFi2IoVlBxgoMzt1n0JDglkj2-3ZTcHomjG96Oolc0FGyW4LVsri0Eb8_1buZg2gXCn91R5tIGSVnovIWclraKf1WFIVnSPnQ4A6212vfOU2DRGJR2ZxDRtgLm/w400-h329/315953.jpg" width="400" /></a></div></div><p>With pogo pins :-)</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-jdpQXpLPSbRJS3WVBVFlp8mhFMNK0-eLN648Rh5AOXUyz1WCdT8eTC5HrQ9TfZqgkYT5rLHOEQx6AAe8FCrGXvntzvg3RXBWOT0XzvqcK1pc9vuTTAh3t0DIgA4XoMB9H6KMNHWrF8OETqbvgbm1ooo3KnLim_wtBCyp1q_ezvKbXtoWHl0IvUKEa7Pe/s5472/317521.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="3648" data-original-width="5472" height="266" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-jdpQXpLPSbRJS3WVBVFlp8mhFMNK0-eLN648Rh5AOXUyz1WCdT8eTC5HrQ9TfZqgkYT5rLHOEQx6AAe8FCrGXvntzvg3RXBWOT0XzvqcK1pc9vuTTAh3t0DIgA4XoMB9H6KMNHWrF8OETqbvgbm1ooo3KnLim_wtBCyp1q_ezvKbXtoWHl0IvUKEa7Pe/w400-h266/317521.jpg" width="400" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-Uzh2zuqhHC8yUHAfbSDdnLAwJKtkCx4NRIpiGwt-9S7HmeD2jTPvK0kTd3FcngZofSzph375AxvfHid-IbpJE5l_MZht95IizATY0ltQRH_F5fiYor8PBWskb5emd-gkOdvMJxgZ-Lk9NOHedohdJKaGDYIZCPAN4kAQf2HTtTT7AMUFu_kA_0GXwXMl/s5472/317522.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="3648" data-original-width="5472" height="266" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-Uzh2zuqhHC8yUHAfbSDdnLAwJKtkCx4NRIpiGwt-9S7HmeD2jTPvK0kTd3FcngZofSzph375AxvfHid-IbpJE5l_MZht95IizATY0ltQRH_F5fiYor8PBWskb5emd-gkOdvMJxgZ-Lk9NOHedohdJKaGDYIZCPAN4kAQf2HTtTT7AMUFu_kA_0GXwXMl/w400-h266/317522.jpg" width="400" /></a></div>RevKhttp://www.blogger.com/profile/12369263214193333422noreply@blogger.com1