Super Secret Storage in a PICO

I wanted to do some more work on code I wrote in Micro Python. But I couldn’t find it. Turns out that the latest version was in the PICO2 device inside the light I’d made. This can be a problem when writing code on a device. You end up with the source on the device and nowhere else. Of course you could have a rigorous code management regime that ensures that you extract and store all the code you’ve written at the end of a programming session. Yes, I guess you could do that….

Anyhoo, I managed to get my code back off the PICO2 even though I’d subsequently re-flashed the device with a C++ program. It seems that flashing a C++ program into a device doesn’t overwrite the part of the EEPROM where Micro Python stores files. And installing Micro Python doesn’t wipe the EEPROM at all. So, if you want to store super secret data you can do this:

  • Write a little Micro Python that takes your secret data, does a bit of encryption and drops it into a file on the device.

  • Then reflash the device with a C++ program that does something different and put it into something around the house, perhaps a light.

  • Now, if you want your super-secret data back you just have to load the Micro Python program that decrypts the data and run it.

Anyone who finds your device and takes a look at the EEPROM will just see random rubbish. They’d need to have your program (and maybe a key) to get it back. You could even use public/private key encryption so that you can send data to someone else inside a gadget you’ve made for them.

This technique is not restricted to PICO (although I’ve not tested it). It should work on ESP32 too. I’m sure that there are much better ways of hiding data than this, and I personally don’t have any top secret data to store (although this is of course what any superspy would say…)

Electronics and Broken Wi-Fi at the Hardware Meetup

I really thought I’d cracked it. I thought my shiny new Robot Wi-Fi hotspot would give all my robots squeaky clean connections and all would work.

Not so.

The robots persistently fell off the network. Just like last time. Most annoying. And after a lot of testing back home where they worked perfectly. Oh well. If I had a drawing board this might be a good time to go back to it.

The good news was that we had some impressive stuff on show. Ian had brought in a complete DSP rig which lets him “round trip signals” from a signal generator, through a DSP module and then back into the computer so that he can view the effects of his DSP code. Very impressive and super-useful if you want to tune the frequency response of your system to match particular environments. You can find out more about what he has been up to in Practical Electronics magazine. Meantime Ross was working on Hull pixelbot PICO migration and Brian had brought his robot arena system with him which proved extremely good at ball tracking. Soon all the robots will be “ball aware”. Just as long as I can get the network to, er, work.

The next Hardware Meetup will be on the 17th of September. All are welcome to turn up and discover if whatever changes I’m going to make will fix anything….

The Worst Bugs are by Design

The latest version of PythonIsh is coming along a treat. I spent most of today fiddling with working on the code. And I fixed a silly bug. My new command to send MQTT messages from a Pythonsh program wasn’t working when entered into a program. Although the command worked fine when entered from the terminal. What’s going on? Turns out quite a lot. But first, some background:

Pythonish is a thin wrapper on top of a thing I’ve called HullOS which runs programs that are implemented as two character statements. Some HullOS statements have extra data on the end. For example I have the command:

rtHello World

This is in the “remote” family of commands (that’s what the r means) and it transmits an MQTT message (that’s what the t means). The rest of the command is the message to send (Hello World). There are command families for quite a few letters of the alphabet now. Remote commands are special. They control receipt and storage of remote programs. The rm command says “Don’t perform the statements I’m going to send you, instead store them to run later”. Then the rx command says “I’m done with storing code, lets go back to performing statements”.

When I implemented these commands it occurred to me that it would be silly to allow running programs to initiate remote downloads and whatnot as this would get really confusing really quickly. So, I built the code so that r commands are never added to stored programs.

And then I wrote a bunch of extra r command behaviours which do need to be stored in program code. Idiot me. I’ve fixed it now. I’m not sure what the lesson is here, other than “Don’t do stupid things”. And add big comments on code which behaves differently from the norm.

If you want to follow my journey and have a play with the code (we even have some documentation now!) take a look here.

Gone Flying

We’ve done a lot of fake flying. We have regular meetups where we tour the world in Microsoft Flight Simulator 24. It’s very good. But no substitute for the real thing. Today one of us got to fly a real plane and I went along to take pictures using a variety of cameras and lenses. We were at Beverley Airfield. The weather was great, the conditions were clear (if a bit draughty) and everything passed off without a hitch. The only real problem was that they serve bacon butties for breakfast in the café and we’d already eaten. But we’ll know for next time.

Bought another broken camera

Today we had a bunch of folks around for a game night and were playing “Formula D”. Things were going OK and then I got an e-bay alert about a price reduction on a “mostly working” camera. Which I then bought. And then our car fell to pieces at the next corner. I hope this isn’t an omen.

Side note: Formula D with all the damage and wear options enabled is really hard work.

FreeCAD Tips

I’ve been writing Python programs in FreeCAD for ages. So after the success (hah!) of my Python Shorts I thought I’d make a little resource with some tips based on what I’ve learnt working with it. You can find it at here.

If you run Python programs in FreeCAD you should take a look. If you want to learn how to write Python programs in FreeCAD it tells you how to get started. I’ll be adding more items later.

You should be playing Cheese Finder

I’ve just renewed the domain for Cheese Finder. I made it a little while back when I was writing Begin to Code: Building Apps and Games in the Cloud. The board contains hidden cheeses. When you click a square it changes to a colour that represents the distance that square is from the nearest cheese. You have to figure out where the cheese (or cheeses) are with the smallest number of clicks. The puzzle above went well. I only needed four clicks. I clicked in three corners, which all came up the same colour. Which meant that the cheese was somewhere in the middle.

It’s quite fun. You get a different puzzle every hour with a different number of cheeses and different colour mapping.

This one was a bit harder to solve, what with there being four cheeses to find.

Robot Hotspot

Yesterday I ordered a heavily discounted portable Wi-Fi hotspot for the robots. I hope they appreciate it. The device arrived today. I slapped a “Pay as you go” phone sim in it and spent 10 minutes setting it up. It works a treat, and the robots can connect to it quite happily.

It doesn’t support 5G signals, but I’m not really after speed and the service it found seemed snappy enough. So, with a bit of luck the next Hardware Meetup won’t end with a broken network…

Leeds Industrial Museum

Today finds us at Leeds Industrial Museum. We like museums. Especially this one. It used to be a Mill, and not a great place to work.

All around they have put up descriptions of the horrible afflictions inflicted on the workforce. The ear defenders above are for visitors to wear when they fire up the spinning machine. Not something that the employees got. They just had to put up with going deaf after a while. All the machines were powered by a steam engine which turned long shafts that ran along inside the roofline. Canvas belts transferred power to the huge machines that took wool into one end and then produced cloth at the other. There were no covers on the belts or the machine mechanisms. Getting mangled was just something you had to try to avoid doing.

It’s interesting to think that at the time the mill was opened these places would have seemed like the ultimate in technical advancement and heralded as the next great thing. Oh well. It’s not as if our generation would widely adopt new technology without thinking hard about the implications and the effects on people using it..

Robots and Axolotls at the Hardware Meetup

We had a super special Hardware Meetup tonight. With young guests, an axolotl on a throne, 3D headset and self-breaking Wi-Fi (which was not in the plan). It was great fun - even when the network broke. Many thanks to the Hull MakerSpace team for doing such a job of showing our guests around and demonstrating some of the awesome machinery they have.

We all learnt something. In my case it was that trying to hang 8 robots off a single phone hotspot doesn’t always end well. For the next meetup I’m working on something a bit more robust…..

Deep Jellyfish

Pesky weather. We had all kinds of plans for today. We were going to head over to Sewerby Hall and look at the penguins and do all kinds of fun outdoor things which are no fun in the rain. But it was raining. So instead we went to “The Deep” and looked at some different penguins. Pro Tip 1 for visiting The Deep: Get there early. Preferably when it opens. You will have a blissful 45 minutes or so to explore the place before everyone else turns up.

Pro Tip 2: Don’t miss the jellyfish. Around half way round you get to an inviting white tunnel entrance which looks really good (it is). But to the left of the entrance is another one to the Jellyfishes. These are awesome and great fun to photograph.

Pro Tip 3: Go to the café and get a seat at “the pointy end” with views all the way up the estuary to the Humber Bridge one way and across the river the other.

And best of all, the tickets last for a year. Which is how we got to go back for free…

Yellowphant

Shown with the original white one. I need to work on my brush technique

Got my “black burger” back from the pottery. We went there and painted some pots a while back. I think it came out pretty well. They have a really nice elephant model which I was planning paint with a different colour for each facet.

Like many of my plans, this one collapsed completely when presented with reality. So instead I want for a “yellowphant”. I’m looking forward to seeing how that one comes out.