2023-01-19

Assembled PCBs from China

I have been using JLCPCB to make PCBs for a while. This is for some of the smaller PCB projects at A&A (here), rather than the big projects we do for FireBrick. It means I am learning a lot.

This month I decided to try and have some "assembled" PCBs done. They have a quite nice ordering page allowing you to view the assembled board. This is important as it seems components have no standard for the reference point, nor rotation, and it varies from PCB manufacturer to PCB manufacturer. The tool I found for KiCad is excellent (here), but I did have to make from the GitHub page, rather than using the library/plug-in manager, as that was out of date. Importantly it allows me to add "offset" and "rotation" adjustments needed for placement of parts. That way I can make working production files in one click, which is amazing.

The big challenge in updating various designs was finding parts - the parts they have available readily, without ordering in, are all very similar to what I am using, but often I have to hunt down the right part number. In one case I found that an inductor was not available in the same package, only to find it was if I did not add a part number. Somehow their search found it even though I failed to. The bigger annoyance was the RGB LED I am using, which is low enough voltage to work from 3.3V. They had a load that are the same footprint even but not the low power and low voltage. I ended up using a different part, different footprint, and even sideways mounting, meaning changes to layout, albeit minor.

I still have to work out how to handle some missing parts - the SCD41, for example, around £30, but they (a) have no stock, and (b) list as $150. So that would not be fitted, and I would have to fit. I am wondering if I can put on the soldered pads with some flux and run through the oven I have. I'll have to test that.

However, for the first board to test the process I ordered the simple Shelly Tasmotizer (here). It does not have a processor, but does have two hand soldered connectors, which was also a good test. They ended up costing £19+VAT each, for a 10 off run, including shipping and assembly and parts. They get a lot cheaper if you order more, of course.

They arrived, and, well, just work. They look really neat. I am impressed.



2023-01-13

Shelly Wall Socket UK

Shelly sell a lot of really cool IoT stuff, and are particularly nice with a consistent re-flashing port allowing their kit to be used with other software (like tasmota) easily. They also support DC working on several devices. I really like their stuff. I have probably close to 100 of them.

Recently I saw on the shelly EU store a number of Shelly Wall Socket models including Shelly Wall Socket UK. So I ordered one to have a play with. It needs a separate faceplate too, and looks like you can get a double faceplate. The cost is €7.20 for the socket and €3.90 for the frame, so around  £11 total.

DO NOT BE FOOLED!

It is just a dumb unswitched power socket. A boring dumb unswitched power socket. An expensive boring dumb unswitched power socket. Note that an unswitched one gang socket is £1.55 from screwfix and I can get in 10 minutes, not 3 weeks.

Their web site does state: There is no relay device included in the package. But that was really not that obvious.

  • I have no idea why they would even sell a dumb power socket at 7 times the price of one I can get locally, especially as they don't sell anything else dumb that I know of. They sell smart IoT stuff.
  • It does not even state BS1363, but is CE marked (not UKCA, but was sold in EU shop, but presumably for a UK market?)
  • The faceplate does not seem to have any clean way to remove it once installed. There is a slot to get a screwdriver in, but that does not lead to the clips, you would have to force it off. Messy.
  • The screw fixings look the right spacing but slotted not just holes so not how you would normally fit to a UK back box, and unlike the £1.55 faceplate, it does not come with any screws!
  • The faceplate outline is smaller than a UK one gang socket, so even if it fits it will look odd if used with a back box as the back box surround shows and looks messy.
  • As you can see from the picture above, the package has the text "Alterco Robotics EOOD declares that the radio equipment type Wall Socket UK..."

They could have been clever, they could have made a socket that takes (or comes with), say, a Shelly Plus 1PM that clips in the back. The L/N could be tags that go in to the Shelly Plus 1PM even. The Shelly Plus 1 PM has a small mechanical button on it, and they could have made a button on the front press that even so it would work as a switch. So many ways they could have made this consistent with Shelly product line, but no.

Overall I feel selling these at all is actually damaging to their reputation, especially as people will assume it is "smart" and no amount of warning on the order page will be obvious when included with a whole list of other "smart" devices.

PS, I stand corrected, they do sell a Shelly Mug that is clearly not smart. They made a mug out of me.



2023-01-11

Bluetooth Low Energy DEFCON

I have been meaning to get my head around Bluetooth for some time, and I think I have finally come up with a project idea which is a bit whacky, but I think should work.

I have discovered that Bluetooth Low Energy (BLE) is different from full bluetooth, something I had not realised, but that BLE should do what I want. The little ESP32 chips with which I am very familiar can do BLE, so this should be simple (LOL).

So here is the idea - DEFCON box. I have one of these at home :-

The way this works is that it shows a DEFCON level depending on who is in the house, so each of the kids has a level, and the lowest level shows. It beeps and the lights click as the go off and on to change levels. All good fun. We know who is about to open the door just before they do...

However, the way it actually works is quite complex. It works on WiFi and MQTT and is told by an MQTT command what level to show. The command comes from a FireBrick, which uses its profiles to decide what level applies. It does that based on the DHCP leases for people's phones on the WiFi. It is really quick to pick up people arriving, but takes the DHCP lease timeout to realise they have gone. But in spite of this complexity it works.

I did think it would make a fun present for someone, but the complexity of WiFi, MQTT, FireBrick and so on makes it really not simple to set up at all.

So this is where BLE comes in...

The idea is that it would scan for BLE devices and pick up phones being present directly. Of course BLE is designed to not allow you to track people, so needs a bit more, and it needs a simple way to tell it which phones are which DEFCON level.

The idea is a button, you press it, and press it repeatedly to pick a level that will flash. The device would be BLE discoverable so show on a phone, and the phone then connects and bonds with the DEFCON device. It then remembers the phone and the level. Because (I hope) the bonding will have an identity resolution key for the phone, it should be possible to passively scan and work out when each phone is present or not.

This makes for a really simple user interface - one button and bond from a phone.

Of course I may face issues with the libraries. A passive scan to find a device you know may not be possible as normally when found you connect to confirm the device is not a fluke random match (which, for this application I am not really too worried about). I'm also assuming a phone will tell my device a key for this - it may not, or may only if it thinks the device is something it expects to want to request a connection. But even so, I can try, and this should cover quite a lot of BLE learning.

So, watch this space :-)

Update1: Demo code works - but I need to advertise only when adding a phone, and as something an iPhone would want to connect to, this was pair using a BLE app not the main settings menu. And I need to work out scanning. Much to do.



2022-12-21

Beware of the word "hub"

Some time ago I posted about Internet Connection Records, here, and how they could result in records you may find hard to explain, especially as they were host name and not full URL.

By way of an example I included an image link in the post to the orange/black graphic word "hub" on a well known web site, nothing rude, but as 1x1 pixel so not even something you would see. By doing so your browser would access said web site.

Irony of irony, now, 7 years late, blogger have put a content warning on that post!

I have edited to bold/underline that it is nothing rude, to see if they review and remove it. What is even more ironic is the link I used is no longer even valid, so definitely not rude, but I have updated it now.

But it shows the problems with automated checking of such things, something that is likely to be an issue not just for Internet Connection Records, but for the current Online Safety Bill.

P.S. Another post was "unpublished" as it showed the domain (not as a link) to a PayPal phishing attempt, a domain that is no longer valid - it was a post about it, not itself malware, d'uh.

2022-12-18

Legacy

I think I mentioned, having written a bit about my family and growing up, after my dad died, I wondered if I should write an autobiography.

It is not a simple task, and to be frank I am not a writer, so this will be new. But as someone once said: The saying "you only live once" is a lie, you live as many lives as you want and can spend years learning something totally new if you want, over and over again in the years that we all (well, many of us) get.

So I have started, in fact I have a first draft at 100 pages, and over 36,000 words. My approach has not been strictly chronological, as I am crap at dates anyway. Many bits are in order, but some are by topic.

I am not expecting to publish it as such, but you never know. The main audience is my kids. But it needs review and editing - a few close friends to comment on it first and tell me where it is crap (or the few places it is not). It will also need some new bits, I am sure.

Maybe when it is all tidied up I'll release it, I'll see.

For now, here is a snippet.

2022-12-02

Dave

So it seems, from what I can tell, under UK GDPR...

✓ Banning someone from your service called "Dave"

Yep, it seems GDPR does not have any issue with your refusing someone "joining a service" based on some aspect of their personal information as long as it it not some discrimination related protected characteristic. So if you designed your system to not allow anyone called "Dave" you can do that.

✓ Banning someone changing their name to "Dave"

Surprisingly, despite the UK GDPR "right to rectification", a company, it seems, according to the ICO and even the parliamentary ombudsman, a company can refuse your changing personal information in any way they like as long as it is a "technical issue". I.e. if you designed a system that cannot handle some specific personal information for some arbitrary reason (such as a short email address, or a name of "Dave") then that is a valid excuse, even though nothing in UK GDPR seems to say it is a valid excuse, and you can refuse to allow the change.

Yep, it is all messed up. What a surprise!

P.S. changing your name to Dåve would probably be something you can insist on, due to case law: https://gdprhub.eu/index.php?title=Court_of_Appeal_of_Brussels_-_2019/AR/1006

2022-11-29

Shelly Plus i4DC GPIO

As previously posted, I am quite impressed with Shelly stuff anyway, but the new "Plus" range has allowed some interesting developments - as they use ESP32, which is the processor I use for my access and alarm system.

This has meant I am able to add bits to the alarm system much more simply than using my custom boards - anywhere. As I reported before the Shelly Plus 1 is great as it can work on DC or AC, but this modules is specifically for DC usage.

The Shelly Plus i4DC, which is like the Shelly Plus i4 (which is AC), is powered from 5V to 24V DC. This is great news as it can work from 12V and 24V alarm systems, and the typical 13.8V of a battery box quite safely. You could even wire to a USB 5V supply.

It has 4 inputs which connect to GND, and this works well for connecting to fire alarms, door sensors, and so on, and can easily have spares for tamper and dummy wires. I would struggle to make something like this for the same cost, and when I factor in my time this is a total no brainer.

I have also worked out the GPIO:-

  • GPIO0: Output for small LED (hard to see through case).
  • GPIO12: Input for SW1 signal (external switch) but needs configuring as pull down.
  • GPIO14: Input for SW2 signal (external switch) but needs configuring as pull down.
  • GPIO27: Input for SW3 signal (external switch) but needs configuring as pull down.
  • GPIO26: Input for SW4 signal (external switch) but needs configuring as pull down.
  • GPIO25: Input for small yellow button on the case, but needs configuring as pull up.

There are also 6 external connection pins for programming which are common to most Shelly, and not mains live on this model:

  • GND
  • GPIO0
  • EN
  • 3V3
  • GPIO3 RX to shelly
  • GPIO1 TX from shelly
  • GPIO16
These can easily be flashed with tasmota too, use the ESP32 solo build. Note I cover two extra GPIO than the usual tasmota config (GPIO0, GPIO25).

Assembled PCBs from China

I have been using JLCPCB to make PCBs for a while. This is for some of the smaller PCB projects at A&A ( here ), rather than the big pro...