2023-10-14

Playing with a serious number of WS2812B RGB LEDs

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.

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.

My first ideas was 210 LED, but then I went for a better design with 372 LEDs.

I have since revised the design to 507 LEDs!

The image shown here is the 372 LED design.

Needless to say, some C code was used to place the LEDs and caps and vias and tracks for this.

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.

In practice, the Stargate dialling sequence does not go over 0.8A, so no problem.

As usual, all open source on my GitHub.

However, I did find that JLCPCB cannot cope with more than 400 designators on one line in a BOM file :-)

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.

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.

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.

Here is it dialling...

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.

The extra tabs are not a space gate effect, honest, they are tooling holes and fiducials for production, and get snapped off.


That's a lot of LEDs

2023-10-07

Shelly Plus PM Mini

Another in the Mini series from Shelly, the PM (Power monitor).

Update: explanation from Shelly: 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.

Obviously this wants to be in-line with the device you are monitoring.

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).

Is that L/N in and L/N out? That would make sense if it is to go in-line to a device being monitored.

No it is not!

As you can see, the O/O are both wired together and are the Live out after the monitor.

There is no second N, so wiring in this in-line either means two neutral in one screw terminal (not ideal) or a wago to join the neutral wires.


Why Shelly? Why?

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.

I had to draw diagrams to explain to the people on the Shelly group on facebook!

How you have to wire it now

How it could have been

As explained above, the explanation is N through the device is extra heat, but to be honest I do not buy it.

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.

2023-10-06

Shelly Plus 1 Mini

The new Shelly Plus 1 Mini is now available, and it is indeed tiny.

Note: Detailed instructions of upgrade from Shelly to Tasmota via web interface at the end of this blog.

Key differences from the Shelly Plus 1

  • Smaller (33½mm x 28mm x 16mm)
  • Cheaper
  • No DC power
  • No programming connections
  • 8A not 16A relay

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.

I did try, and failed, to find an image of the back of a Shelly Plus 1 Mini - so here you are...

It does still have a dry contact relay, making it suitable for working DC contacts (garage door opener, etc).

It still has the button on the back.

It still has an LED in the back.

It does still have the ESP32 processor.

But overall, this is a welcome addition to the Shelly family.

Inside

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.



Upgrade to Tasmota

These are basically the steps from https://github.com/tasmota/mgos32-to-tasmota32 but with some explanation of exactly which menus to pick at each stage.

  1. 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.
  2. 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.
  3. You will need the right zip file. This lists them release section 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.
  4. 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.
  5. 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.
  6. 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).
  7. Important, it seems the following steps are necessary else it can be bricked on next update!
  8. Select "Configuration" / "Auto-configuration" and pick the device and "Apply configuration". Again, get the correct device setting.
  9. 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.
  10. Select "Consoles", "Partition Wizard", and click "Resize FS to max". This removes all files (including the Partition Wizard).

You now have an upgraded Tasmota installed Shelly, which is Matter compatible and works with MQTT.

And finally, the pin out for serial programming.

Do not dismantle or connect serial programming whilst connected to mains power!

With pogo pins :-)


2023-10-05

Stroke

Old MRI image, not showing my stroke
If you think you are having a stroke, call 999, get help as soon as possible, please.

For more  information see stroke.org.uk

But this is my experience.

Misconceptions

I was surprised how much people don't know about a stroke. I ended up writing a long explanation for my family to cover it. One of my daughter's has worked with stroke patients in a care home and was "D'Uh!", but I think it helped the rest understand.

One of the things I found difficult was people asking "how are you feeling now", and "get well soon". A stroke, like most "long term" illnesses, is very different to the average illness. It is not like a cold, or even like a broken leg.

Basically - I feel fine. I actually "felt fine" the whole time - I just could not speak for about 4 hours. Maybe, and not even that much, a little tired, and that is it. I don't feel ill at all.

But also "get well soon" is not really a thing in the same way. The damage is done. The "getting better", in terms of brain cells that recovered from the lack of oxygen, has happened, within the first few hours. Yes, there is some re-learning stuff my brain could do over a longer term, maybe, if I am lucky. In my case I can tell my speech is not quite back to normal, but just the occasional word tripping me up. That may never go away. For worse strokes there may be possible rehab and physiotherapy that can help some recovery over time. But the whole process is very different to the "get well soon" you would apply to someone with a cold.

The usual platitudes for someone that has been ill or injured are not ideal, and even wind me up slightly as it is hard to give the simple answer. Sorry.

Background

I have been doing well. I have managed to lower my weight steadily over the last six months, doing more exercise. I have managed to keep my blood pressure and blood sugar well under control. Ticking all the boxes. No reason to have a stroke.

COVID

I made the mistake of going on a cruise. I did take quite a few precautions, including avoiding a commercial flight, not having to queue up for anything (yes, it was one of those cabins at the top of the ship that gets you a personal escort to the front of queues) and masking up in crowded spaces. Sadly I did go to the bar, and even with a table at the end out of the way and the small group of the same people, one of them got COVID the day before me. The two people on the cruise with me did not. Very unlucky.

But COVID is just like a nasty cold, and over in a week, right?

Wrong!

Yes, the main symptoms, in this case a severe fever and cough, cleared up a lot in 3 or 4 days. I was left with a nagging cough (which happened last time and lasted a few weeks), and a bit tired.

I'd like to thank Mike and Simon for ensuring a supply of pizza, starbucks, and paracetamol turned up at my cabin door.

But on returning from the cruise I realised my blood pressure was unusually high.

Mistake 1: I should have contacted my GP and got something done about it, even if only temporary while the COVID symptoms clear up finally. That said, blood pressure on its own is not what triggers the stroke - it is likely COVID causing blood clots - but the high blood pressure is a risk factor and an clear indication of COVID messing with me still.

Stroke

As seems to be a common thing now with COVID - I then had a stroke. It was 11 days after first COVID symptoms.

It was fortunate that I had reason to go and talk to someone - I managed to leave my glasses in a shop in town and walked back to find them. If not, I would have been sat at home and not had any cause to talk to anyone. When I got there I realised I could not talk properly! My speech was really slurred. The people in the shop did not know me and so did not know that was not my normal speech.

I went home and double checked. I recorded myself and played back. I could smile. I could raise my arms, and legs. But my speech was slurred. Oddly it seemed worse to me when speaking than it did listening to the playback, but even so, the playback was slurred. I have learned that some people cannot tell their speech is slurred, which is interesting - I definitely could.

Given the horror stories about delays with ambulances of late I decided not to wait, and just walk to the minor injuries unit at Nevill Hall. It is 20 minutes or so, but I am pretty confident it was quicker than an ambulance would have been. Obviously in different circumstances I would have either been driven by my wife (she was out) or called 999 for an ambulance. In hindsight, starting to walk, and calling 999 from my mobile, may have been the best of both worlds - though "calling 999" with dysarthria may well have been a problem.

Yay! I learned a new word, dysarthria.

Nevill Hall

The MIU were good. I had to type on my phone to be understood - I did this whilst walking to the unit anyway, so was ready. Fastest triage ever - I did not have time to sit down. I was on a bed, on a drip, CT scan, and then very quickly in ambulance (blue lights!) to The Grange hospital, 20 minutes away. They got me on aspirin pretty quickly.

The Grange

Being in hospital sucks, I know. First night I was in resus in the emergency department on a monitor and there is no way to get any sleep. Then was transferred in morning via "Majors" and "Assessment" before going on to the actual stroke ward.

I spent three nights in hospital, bored silly. I had a book, and my phone, but still bored. The ward was good though, a shower, reasonable food, comfortable bed. But 3 hourly obs (blood pressure, pulse ox, temp, pupil response) makes a good night's sleep impossible.

The stroke tests get very tedious...

  • Smile
  • Stick tongue out and move left/right
  • Raise arms
  • Raise legs
  • Grip
  • Push (arms and legs)
  • Pull (arms and legs)
  • Where are you?
  • What month is it? (yes, even at 1am on 1st October, I passed)
  • Who's the King?

Now, I know they are important test, and I know the staff are doing their job, honest.

The real problem is a stroke is very different to a lot of other illnesses. At this point, I was not "ill" any more. I felt fine. My speech was 99% back to normal after only a few hours on Friday. Being in hospital when not actually ill is extra frustrating.

But the staff were great, and have my thanks.

Some minor niggles

There is equipment for monitoring patents. It does blood pressure, ECG if needed, pulse ox. On Friday I was plumbed in to it. But after that it was used for regular obs, so blood pressure cuff and pulse ox sensor. The problem is that they left it switched on. This means a beep every 5 seconds to warn that it is not "connected" to the patient any more. It is a matter of a button press to shut it up.

There are two problems with this!

  1. The noise. Four of these on the ward all doing a beep every 5 seconds all the time, all out of phase. This is not conducive to patient care and getting rest.
  2. The more serious issue - these things beep for a reason. They are alerting that something is wrong (in this case, simply that they are disconnected). By ignoring the beeps, becoming deaf to them, they lose any usefulness - the beeps can no longer be effectively used to actually warn that something is wrong any more. It has to be bad practice to ever leave any such equipment generating an ongoing warning beep.

There are some cases where a beep is not a warning as such, such as the heat beat beeps for the ECG when in ED, where the beeps can allow the attending nurse to instantly hear even subtle problems. But on the ward there was nobody on ECG, so not the issue.

I did manage to get them turned off, but had to ask on several occasions, and the stock answer is "we have to monitor some patients", and I have to explain that I understand, but these are from machines that are not monitoring patients!

The other obvious niggle is that I was only really there for three days, not for observation, but because of the time it takes to get an MRI, Doppler scan, and see occupational health and speech therapist. That could have all been done after 24 hours, but a lot of stuff is not done at weekends. At the end of the day, that is just how it is.

Oh, and being supervised taking my regular meds felt like I was some sort of naughty schoolboy! They also struggled with the notion that I set my own insulin dose, and adjusted it because being in hospital was different (led to a hypo in the night, so lowering the dose).

Stroke doctor

The stroke doctor basically explained it was a mini stroke. He did the checks again, and a number of perceptual checks. He explained that I would be on aspirin for 3 weeks, and blood thinners permanently, and some slight changes to other meds.

However there were a couple of oddities. He was a stroke specialist, but still, I was surprised.

  1. He commented how my HbA1c (overall blood sugar measure for diabetics) was really good, and maybe I should not be on meds/insulin for diabetes. This makes no sense to me (or my GP) as the very reason my HbA1c is good is because I am on the meds and they are working!
  2. He asked about migraines, and I explained I get an aura only, one side or the other. He said "so one eye or the other". I corrected him that it was one side of my vision, or the other, and not one eye or the other. He continued with "one eye or the other" so I gave up.

Followup information

This was another surprise. I got following information on (a) not driving for a month, and (b) speech therapy. But I got absolutely nothing on strokes. No "what is a stroke? what causes a stroke? What risk factors can you mitigate in future? Why do you have blood thinners?" etc. I can research these myself, but why no information pack? I bet a lot of patients leave confused about what has happened and what they should do about it.

Work

Obviously I work - I run an ISP. But my management team are very good, so have no problem with my trying to rest for a few weeks, or longer if I was to be seriously ill. I am obviously keeping an eye on things as "taking a rest" is not quite the same as "doing nothing" which would wind me up even more.

COVID recovery

Right now, my main concern is the COVID symptoms - the cough and high blood pressure. Especially the high blood pressure. I have been working with my GP - higher dose of some meds while it is a problem, and that seems to be working now. Oh, and saying "stroke" to a GP receptionist seems to be a magic spell for getting an immediate call back from a doctor.

People need to realise COVID is still very common and still very serious. Whilst my case was "minor", a stroke can be a serious long term impact on someone's life, and the lives of their family, for the rest of their life. In some ways it can be worse than COVID just killing people off (and I say that as someone that watched my father die of COVID just a year ago).

It is not just a cold. Please take it seriously.

ISO8601 is wasted

Why did we even bother? Why create ISO8601? A new API, new this year, as an industry standard, has JSON fields like this "nextAccessTim...