Fun with Fish Eyes
/So I took the Fish Eye Lens for a walk. The hard bit is making sure that you don’t end up with your feet in the picture….
Rob Miles on the web. Also available in Real Life (tm)
So I took the Fish Eye Lens for a walk. The hard bit is making sure that you don’t end up with your feet in the picture….
Today I saw the ultimate in error messages. I wasn’t doing anything particularly adventurous, just trying to play a video file. However, the error really scared me. I wish I’d taken a picture of it. The error said:
This video cannot be played. Please try again later. Such evil in 9 words. The video file was eminently playable, this device just couldn’t play that particular format. One of the things about computers that I like the most is the way that given the same inputs a computer will produce the same outputs. The error flies in the face of this, raising the possibility that next time you run the program it will work. I’m wondering if this is a reference to the possibility that in the future a later version of the program will be able to do it. Or that the program might learn how to do it? Or that in a parallel universe it actually does work. Who knows?
Most football fans will tell you that for a supporter it’s the hope that kills you. Hoping against all the evidence that this season will be “the one” even though you have a feeling in deep in the pit of your stomach that actually it won’t be. Perhaps this is a new trend by software developers to encourage users to keep coming back and trying again….
Last week I bought a brand new pair of walking boots. They seem to have wandered off.
Don’t try and download the PC migration tool from the Apple site. I got this.
It is always a bit of a worry when a new device becomes available just after I’ve got paid for some writing. That has just happened with the new MacBook Air. I was thinking of getting a new tablet and this would work out at around the same price once I’d bought a keyboard and everything else you seen to need. I also fancy having a go with GarageBand. I’ve only bought the cheapest MacBook because everything seems to be based on the same processor, the Apple M1 device.
I’m intrigued by the possibilities presented by the new processor. Many years ago I had one of the first ever tablet PCs powered by a Tramsneta Crusoe chip. The idea was that clever circuitry would “morph” the intel instructions into Transmeta ones as the program loads so that a simple low-powered RISC chip could be used in a portable computer.
The idea might have been a good one but the reality was horrible. You could actually watch (and wait for) on screen buttons going in and out when you clicked them. Programs took ages to “wind up” when you opened them and the whole thing was very painful to use.
No such problems with the MacBook Air. It fairly whizzes along. I’ve got Microsoft Office running and even though the Mac is using the Rosetta2 application to convert the Word code from Intel to Arm there’s no perceptible lag and the everything so far is very snappy. I’ve installed Visual Studio Code and that works a treat too.
The only problem that I’ve found is that an issue with “Big Sur” - the new Apple operating system - seems to have broken deployment to ESP devices. The espytool.py program that builds images and sends them to devices fails because the Python pyserial library doesn't work properly. There is a sort of fix, you can find it here, but it is a bit of a pain. The good news is that the build process goes quickly up to the point where it explodes.
I’ve moved my Microsoft ecosystem onto the new platform. OneDrive is showing me all my usual files and I’ll put Edge on next so that I’ve got the best browsing experience. It will be interesting to see how the battery life goes. What with this and the lovely Microsoft Surface Pro X which also uses an ARM processor, not to mention the impressive looking desktop cpus from AMD, these must be worrying times for Intel.
We have a new garage door. Hold the front page.
Only minutes after I’d told number one wife that the previous door (which was the same age as the house - i.e. very old indeed) was absolutely fine I went outside to fetch something from the garage and one of the door support wires snapped. The effect was most impressive. The door jumped out of my hands and slammed shut. It was as if the thing was possessed. I’m pleased I wasn’t underneath it when it failed.
The new door can be opened and closed without the aid of a broom handle and lots of swearing. Which is a definite improvement.
This is one of these “Rob writes a blog post about something so that he can find it later when he forgets how to do it” moments. I’m writing some code using the Arduino platform that I’d like to run on both the ESP32 and the ESP8266. They both run C++ and have a lot in common. But some things are just different. For example they have different commands to ask a device for its unique ID is getFuseMac for the ESP32 and getChipId for the ESP8266.
Fortunately we can use the magic of conditional compilation to make our C++ code always do the right thing. The code below shows how it works.
#if defined(ARDUINO_ARCH_ESP32)
#define PROC_ID (unsigned int)ESP.getEfuseMac()
#endif
#if defined(ARDUINO_ARCH_ESP8266)
#define PROC_ID (unsigned int)ESP.getChipId()
#endif
The symbols ARDUINO_ARCH_ESP32 and ARDUINO_ARCHESP8266 are defined if the program is being built for the respective device. The C++ above defines a PROC_ID symbol that can be used in my code to get the right version.
I’ve made this horrible hack to make it easier to debug my Python macros that run inside FreeCad and design little boxes. It means that I can use all the lovely debugging features of Visual Studio Code to find out why my code don’t work. The hack takes the form of a few simple Python objects that fake part of the FreeCad ones and allows your macros to run in any Python environment you fancy.
If you like the idea of writing Python code that produces physical artefacts you might want to take a look at it. You can find it on GitHub here.
The first two seasons of Star Trek: Discovery were pretty good. But the third is just brilliant. It seems to be a return to a lot of the original Star Trek tropes. Rather than convoluted and long winded stories leading up to a grand finale that is a bit hard to get your head around we have a bunch of people dropped into a nasty situation and then going about doing the right thing.
Each episode so far has ended with the amount of good in the universe increasing slightly. There’s still time for a grand story arc to shuffle in and take centre stage, but for now I’m really enjoying well told free standing episodes that leave you smiling at the end. I really hope it continues this way.
This is bad. No matter how well printed the labels are.
Did you know that if you place two Honeywell EvoHome BDR91 remote valve controllers within 300mm of each other they don’t work properly?
Neither did I. Until I woke up in a cold house and had to do some digging. Apparently the radio connections in the two devices interfere with each other. Or so the very helpful tech support person told me. I’ve moved them a nice long way apart and look forwards to continued warm toes.
I’m making a bunch of devices that I’ve decided to call “clever little boxes”. I’ve taken the important first step and bought the domain name. Now I have to make everything else. I’ve decided that the best place to start is with the deployment. You might think that this is crazy, but actually it is the most important phase of your development. If I’m not able to easily update the devices in the field and manage their deployment I won’t have a product, just a demo. Also, modern product development is a continuous process. You don’t make something and ship it. You make version 1.0 and then create version 2.0 based on the feedback you get.
To help me with this I’ve started using otadrive. Once you have created an account you can store firmware images on the site and then your remote devices can download and install new firmware images from them. You’re given an access key and a web based interface for uploading firmware and managing the devices that need to be kept up to date.
You get a tiny bit of Arduino code you can drop into your device to check for new versions. It works a treat. The only snag in my mind is that the site doesn’t seem to have a business model. At no point in the process of configuring and deploying versions have I been asked for any payment. This worries me for two reasons:
I might suddenly be hit with an enormous price list which makes the whole thing unviable.
The site might vanish overnight taking with it my entire network of devices.
I’m not that concerned just at the moment though. And if things get tough I can look at this on GitHub which might be where I end up putting everything.
If you are lucky enough to own and Oculus Quest 2 you will be enjoying the higher quality and lighter weight of the device compared to the first version of this device. However, you might have noticed that the head strap arrangement is a bit more primitive than the earlier version. One way to fix this would be to buy the expensive Elite Strap. Another approach is to print out a support that fits on the back of your head and holds the straps in place. I had a go at printing it and got the above result. I’m quite pleased with how well it came out. I used a very large layer height so that I got the strap quickly, which is why the quality is not the best. I also used “tree” support to hold up the large mid section. That worked really well too.
Now and again I fall over something so useful that I regret not having used it before. Such is the Quick Access feature of Windows 10. I found it by mistake and it is really rather nice. It lists the files that you have just been using. You might not think that is very useful, but if you remember that lots of applications, for example all the Office apps and programs like Cura, will open a file if you drag it onto them and drop it. You can also upload files to the wonderful OctoPi printer controller by just dropping them onto the browser page.
So when I want to take my saved design file from FreeCAD into Cura I just have to drag it out of the Recent files folder and drop it onto Cura. This saves a lot traipsing through file open dialogs. Now I keep the recent files folder open on the desktop just for things like these.
I took one of my old camera lenses for a walk today. It has the useful property of producing rather nice amounts of blur.
In a blog post last month I confidently asserted that the output pins on an ESP8266 didn’t have enough “oomph” to drive the neopixels on an Adafruit 8x8 panel. I’m sure you remember the post.
Anyhoo, it turns out that the post (rather presciently titled “Making Mistakes”) was wrong. What I should have written is that if you use the wrong pin on your device it won’t work. Just because a pin is labelled D1 doesn’t mean that it is connected to GPIO1, as the diagram above makes very clear.
So now I can use an ESP8266 to drive my panel, which is nice.
In case you were wondering, this is not the best way to make sure that elements of your design are the correct size……
The Timelords met, as Timelords do, from time to time for a coffee. And when they met they liked to talk about the old times and universes that have come and gone. “Ah, the earth universe” said one. “Indeed” said another. “I thought it had promise” said a third.
“The humans had discovered software and version control, and all was going reasonably well. And then one human decided to try to find out what happens if you put the name of the gitignore file into the gitignore file. And then their reality collapsed on itself. ”
The first timelord stared into his coffee cup. “If only they had known the true power of Git” he said glumly.
I was quite proud of the height adjuster I made for Una my Ultimaker 3d printer. Although I wasn’t very proud of the way that I’d handled a lack of bolts of the correct length. Anyhoo, it seemed to work and allowed me to adjust the print head height just by turning the screw at the top. There was only one problem with it.
It didn’t work.
I could use it to move the switch up and down but it also moved the switch all by itself. There was too much play in the mechanism. I’d adjust the height carefully and then find that next time I homed the printer the height was all wrong again. Wah.
One of my favourite quotes is from Ralf Waldo Emerson and goes “A foolish consistency is the hobgoblin of little minds”. This is worth remembering when you are trying to make all the wires in your circuit the same length, or arrange your DVDs in alphabetic order and fretting about how the word “the” works in the movie title. However, when we are talking about things that only work if they are within a tenth of a mm of the correct position, I’m a big fan of consistency.
So it has been out with the fancy adjuster and back to the sturdy little bolts that fix the switch in one position. I’ve not got a bit more of a job to adjust the height of the print bed, but at least the adjustment will stick for a while.
It doesn’t happen very often, but every now and then I find myself in the perfect position with just the technology that I need at my fingertips. It happened today. A while back number one wife came into possession of a large number of green tomatoes. Which screamed “chutney” to her and had the pleasing outcome of a number of differently shaped jars being filled with fabulous smelling stuff.
Today she asked me if I had any blank labels that she use for the jars. She was going to fill in each one by hand. “I can do better than that” I said and vanished upstairs for half an hour. A long while back I bought a label printer to liven up the entrant packs for Three Thing Game. So I happened to have a label printer and just enough labels to make the above. I’m rather pleased with the result.
The ESP32 is mostly my weapon of choice when making embedded devices. The only problem that I’ve had with the device is that tends to be supplied as a device with ready soldered pins. This is fine if you want to plug it straight into a socket but I don’t tend to do that. I’m much happier soldering the wires directly onto the unit. This makes for a more reliable device and also allows me to use smaller boxes. T
The good news is that I’ve now found a supplier on AliExpress who is selling versions that don’t have the pins already fitted. They cost slightly more than the “normal” devices (which I find a bit surprising) but they do give a lot more flexibility.
One thing to remember though; it is a pain to build the ESP32 device into your device and then find that you have a faulty one. So make sure you test the ESP32 before you solder it in.
One of the problems that you can have when 3D printing is called the “elephant’s foot” problem. It is caused because the very first layer is usually printed very slowly and is very thick, causing it to spread out slightly. This leads to the side of the object having a profile that looks a bit like an elephants foot. Which I suppose explains the name…
I’ve found that one way to fix (or perhaps hide) this effect is to apply a “chamfer” to the printing face. This makes the first print layer slightly smaller and hides the foot effect. The chamfer is easy to perform in FreeCAD. You select the Part view in the Workbench and then select the chamfer option (it’s blue and looks like a chamfer (a corner with the edge flattened off). You can then select the face that of the object that you want to chamfer and you can get the rounded appearance you can see on the left hand shape in the design above. One day I’ll figure out how to do this from Python inside FreeCAD and then add it to the part design program.
Then I print using a “brim” which is a bit of print around the outline of the object which helps it stick to the print bed. When the print has cooled I cut the brim off with some sharp scissors and this makes the edges look quite neat as you can see above.
Rob Miles is technology author and educator who spent many years as a lecturer in Computer Science at the University of Hull. He is also a Microsoft Developer Technologies MVP. He is into technology, teaching and photography. He is the author of the World Famous C# Yellow Book and almost as handsome as he thinks he is.