Effortless Debugging with Your Pico Probe: No More Sudo!

Hey there, Raspberry Pi enthusiasts! Are you tired of summoning sudo every time you need to commune with your Pico debug probe? Fear not! Today, we're delving into a nifty trick to make your Pico probe obedient without the superuser incantations. And for those of you using Visual Studio Code, this trick is a game-changer.

Why Bid Farewell to sudo?

Summoning sudo for debugging is like wearing a full suit to a casual brunch; it's overkill and can be risky. Moreover, when you're using elegant tools like Visual Studio Code, running the debugger as a superuser inside the tool is a bit tricky. Let's simplify this, shall we?

The Power of udev Rules:

In the Linux realm, udev rules are like spells that control how the system interacts with various devices. By crafting a specific udev rule, we can grant ourselves permission to access the Pico debug probe without escalating our privileges to the superuser level.

Crafting the Universal Pico Probe Rule:

Most Pico debug probes share the same Vendor and Product IDs, so we can usually use a standard rule for all. Here's how to do it:

The Magic Numbers: For the Pico debug probe, the typical IDs are: Vendor ID 2e8a and Product ID 000c. We'll use these in our rule.

Creating Your Rule: Head over to /etc/udev/rules.d/ and conjure a new file called 99-pico-debug-probe.rules Sprinkle the following line into it:

SUBSYSTEM=="usb", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="000c", MODE="0666"

This incantation essentially tells your system, "Hey, let everyone read and write to this device, will you?"

Enforcing the Rule: To make the rule take effect, use this spell:

sudo udevadm control --reload-rules && sudo udevadm trigger


What If My Device Is Different?

Got a different device? No problem! Plug it in, run lsusb, and look for the ID format VendorID:ProductID. Use these values to create a custom rule.

Post-Reboot Harmony:

Your new rule is like a loyal house-elf, diligently working after every reboot, ensuring smooth, sudo-free access to your debug probe.

Conclusion:

And there you have it! A simple yet elegant solution to make your debugging sessions with Raspberry Pi Pico as smooth as butter. No more sudo, no more hassle, especially when you're working in sophisticated environments like Visual Studio Code.

Happy debugging, and may your code be bug-free!

Author’s note: I didn’t write this. ChatGPT did. I worked with ChatGPT to solve my problem and then asked it to write a blog post about the solution “In the style of Rob Miles”. I’m quite proud of this, although I didn’t do much of the work….

Cold Battery Blues

Thanks again Dal-e

On Radio Humberside talking about cold batteries. Apparently Tick Tockers (whatever they are) have been noticing that they can’t make as many videos on their phone in the cold weather. This is what I said:

  • Low temperature increases the “internal resistance” of the battery. This limits the amount of power you can get from it.  It also means that to get a certain level of performance it takes more power out of the battery.

  • Electric cars are affected too. They heat up the battery in cold weather. If you have the car plugged in at home you can “pre-condition” the battery to warm it up. This can improve the range, which is a good idea in winter because cold substantially reduces range (at least by a third).

  • Always Be Charging. There’s no advantage in running your lithium battery right down before charging it (in fact flattening a lithium battery can destroy it). Keep your battery charged every chance you get. The only reason to let the battery run down is so that the phone can work out the battery life.

  • Keep your phone in an inside pocket so that you keep it warm.

  • If you give your phone something hard to do this will warm it up (although of course it will also flatten the battery). There are even “hand-warmer” apps that do this – but they are not a particularly good idea.

  • Charge the battery when it is warmer.

  • Warm your phone up before you do something that consumes a lot of power.

Another year of Cubeness

Nice work Dal-E. Not sure about the number of door handles though….

Our Nissan Cube is getting on a bit. As are we all. He’s not perfect, but he is good enough to pass the MOT test for another year. I’m going to get his underside comprehensively clarted with wax and whatnot to try and stave of the inevitable onset of rust (poetic prose) but it is nice to have him around for at least one more year.

Hardware Meetup Wednesday 17th January

Printer Poop produced when switching colours

We’re having a hardware meetup next Wednesday evening at Hull Makerspace in the Central Library in Hull. We’ll be opening 5:30 pm with a presentation of 3D printing lithophanes and the HueForge program starting around 6:00 pm. We’ll finish around 7:00pm

There’s no need to book, just turn up and look interested. If you’ve got anything to show off we’d love to see it.

Lithophane Colour Chart

I’ve Cropped off the very dark areas

I thought it might be fun to make a lithophane of a colour test chart just to get an idea of how well colours are resolved and what colours you could get. Above you can see the original chart. I ran it through Colour Lithophane Maker and then printed it.

This is 0.1mm layers with a 0.4mm nozzle

This is the lithophane that I got. Quite interesting. I think it might be worth running your images through a “posterise” filter of some kind before making the lithophane.

PICO Powered Pixelbot now with Wi-Fi programming

Just plug your Pixelbot into your computer to set up the network

The latest version of the Raspberry Pi PICO Powered Pixelbot (I love a bit of alliteration) now supports Wi-Fi programming. You can connect your robot to your local network and then use a web interface to create and deploy programs into the robot. You can find all the details, plus the images you need to put into your PICO-W here.

Future Meetups

The MakerSpace is a good looking place..

I’ve put together a schedule for hardware meetups for the first part of this year:

Wednesday 17th of January Colour 3D printing

I'll bring in some examples of colour printing and show how to use Bambu Studio to colourise prints and create lithopanes. I'll also show off some work made with HueForge (https://thehueforge.com/)

Wednesday 7th of February Robot Rugby

We'll set up a Hull Pixelbot rugby match and get a game going.

Wednesday 21st February Music and MIDI

I'll bring in a bunch of MIDI music devices (some Pico and Pi powered) and we'll have a go at making some tunes

Wednesday 6th March Analogue photography

I'll show you how to get started taking analogue photographs on instant and black and white home-processed film. If we can have access to running water in the Hackspace we can take a bunch of pictures and process them on the night.

All the meetups are in the Makerspace in the Central Library in Hull. Doors open at 5:30 pm and we start the presentations and whatnot at 6:00pm after some chat. We finish around 7:15pm or so. Anyone can turn up and you don’t need to book. If you have a topic that you’d like us to cover (or better yet you fancy running a session yourself) get in touch. If you want find out more you can find it all on our Mattermost page here.

Late Chair

Every time they failed to deliver the chair they added a new one to the order…

We needed a chair bed to put up a family member at Christmas. So we ordered one. The delivery came and went, and came and went again. Chairs were not delivered owing to “un-foreseen circumstances”.

There are worse things in life than missing out on chair deliveries. Although after four attempts where we had changed our arrangements to fit around their schedule we were getting a bit fed up.

The chair arrived today. Just three weeks or so late. It is very nice. They’ve sent me an email asking for my opinion of the service they provided. Every single person I dealt with, from the folks on the first call to the delivery team, has been lovely to deal with. But I’m forced to conclude that they are trapped in a system which is not working very well.

3D Printing Minox Cassettes: Fail

A few attempts and the camera I’m trying to use

I’ve been trying to print Minox film cassettes for a while now with no success. I love the Minox system for its tinyness and amazing design, not to mention the nice pictures you can get with it. But I’ve only got a few film cassettes and I’m too mean to buy any more. So I thought I’d print some with my lovely new printer. It kind of works. The finished articles are almost useable. But not quite. Even if I use the high resolution 0.2mm nozzle. The problem is that some of the sides of the cassette lids are just one strand of filament wide. The printer can print these just fine, but they haven’t got enough strength to stay attached to the lid for very long, as you can see above.

I’d be happy to trace printability for film length: in other words a 24 shot exposure film held in a cassette that has double thick walls would be just fine with me. Unfortunately I’ve not found a way to tweak the design just yet. If anyone reading this can point me at designs I can work with I’d love to have another go.

HueForge

This is fresh from the printer plate, complete with purge tower

HueForge is amazing. It lets you care 3D printable pictures from images.

I’ve mapped different colurs in the image to different filaments

The original image is on the right. The predicted print is on the left. On the bottom left you can see the four colours I’m using (black, blue, grey and white) and you adjust the sliders to determine the image colours they match. It works wonderfully well and drops out an STL file. You just have to tell your printer the layer numbers where the colour changes and away you go.

If you have a 3D printer that can print different colours you should get HueForge. It’s as simple as that.

Kinect Carbonizer still works

Carbonized Duck ready for printing

Around ten years ago I created one of my first ever GitHub repositories when I uploaded the code for my Kinect Carbonizer. You can find it here. Now that I have a 3D printer that can print things in colour (and at speed) I thought I’d revisit the project with a view to making some multi-coloured carbonized images. I installed the Kinect toolkit, plugged in my Kinect sensor, downloaded the repository, pointed Visual Studio 22 at it and it just compiled and ran.

Amazing.

I had one issue, where the USB on my Windows 10 machine refused to properly recognise the Kinect sensor. I’ve updated the GitHub page with the fix for this.

You can pick up Kinect 2 (not the the original Kinect 360) sensors really cheaply nowadays. You can’t plug them into your computer directly - you need an adapter and power supply - but you can pick them up on ebay at a good price too.

Bambu Studio lets you set the colour of each layer in a print so I should be able to make multi-coloured carbonized prints quite easily. Such fun.

New Years Higher Resolution

I thought you might like to see the original picture. I took it in Melbourne a few years ago

Most 3D printers use a print nozzle which is 0.4mm in diameter. This is a good compromise between speed and quality. But you can get 0.2mm diameter ones too. So I’ve tried printing the same lithophane as you saw yesterday, but with a 0.2 nozzle. There is a definite improvement, but I don’t think it is worth the extra six hours of printing.

This is using a 0.2mm nozzle for best results

The detail is improved, but I would have to add more layers to get rid of the sky banding. Which would make the print time even larger. I reckon a good compromise is 0.1mm layer height with a 0.4mm nozzle. And perhaps not an image with lots of gradual colour changes.

Lithophane Fun

This is about half way through

What better way to start the year than by printing some lithophanes.

This is Melbourne

I’m quite pleased with the results. I got a Cyan, Magenta, Yellow, White kit from Bambu. They have a little wiki which tells you how to do it. This image took around 2 and a half hours to print, which is not bad. Next step is to try a 0.2mm nozzle and see how that turns out.

Bambu Printers: A1 versus P1S

One of the standout things about technology is that as soon as you have bought something a newer and possibly better one is released. A month or so ago I summoned up the courage to invest in a new 3D printer - the P1S made by Bambu which was acclaimed as the best one you could get. Then, last week Bambu released the A1 printer which seems to do everything that my printer does, but for a bit less money. Should I be upset? Read on to find out.

When number one sun arrived here for Christmas the first thing he did was order up a Bambu Lab A1 printer (the new one) to be delivered to our address. This means that for a while we’ve had both 3D printers working in the same room. Let’s take a look at them. The pictures here are from the Bambu website. I hope they don’t mind. I totally forgot to take any shots of my own.

This is the A1. The thing on the right is the Automatic Media selector (AMS)

This is the P1S. The AMS is on the top.

The A1 is what is known as a “bed slinger”. The print head moves left and right over the bed, which moves forward and back. The print head gantry is lifted up as the object is being printed. The P1S puts the print head on a carriage above the print plate. The build plate moves down as the object is printed. But which is best? And should I have waited for the A1 (assuming that I knew it was coming)? Some points to ponder:

  • First things first. Both printers produce excellent prints at very high speed. There is little if anything to choose between them on print quality. At one point we were printing different parts for a gadget (the amazing Toriodal Launcher) When we finished we just put the parts together and they fitted perfectly. So I can’t say one printer is better than the other at printing.

  • The A1 really does sling its bed around at speed while it is printing. It made the desk underneath really bounce. This would worry me if I was printing something tall and thin, but we didn’t have any problems during printing.

  • The P1S is completely enclosed, which means you can print materials which need to be kept warm. The AMS system on the P1S is also enclosed, which means that reels of filament won’t get damp or dusty while they are waiting to be used. Everything is open on the A1.

  • The A1 has a lovely little colour display which shows you what is being printed and provides a nice touch interface. The P1S has a four line text display which does the business but is nowhere near as fun to use. Having said that, you can control both printers from you phone, so the amount of button pushing you do on the device can be zero.

  • Both devices (as purchased) have automatic media selection. They can change filament during a print. This lets you do multi-colour printing and would also allow the printer to switch to a different filament roll if one runs out. I think the AMS solution of the A1 is much more elegant than that on my P1S which seems to involve lots of toing and froing as the filament is wound all the way back onto the roll when it is changed out. The A1 just retracts the filament from the print head itself (although it does have to have four filament feeds to the head). The A1 can only support 4 different filaments; the P1S can be expanded to use 16 by using 4 AMS units.

  • It is much easier to get at and change the print nozzle on the A1 series. The print head itself is more accessible and the nozzle is clipped in rather than screwed in, as it is on the P1S. If you want to regularly switch nozzle sizes this might be a thing to consider.

So, am I regretting my purchase? Is the A1 better than the P1S? I reckon they are pretty much the same. The decision goes down to form factor. I started 2D printing 12 years ago with Una the Ultimaker who was very similar in design to the P1S. I prefer this “enclosed” design, although this is very subjective, so I’m happy with my P1S. Number one son started with a Crealty Ender 3 which is a bed slinger, so he went for the A1. The P1S also takes up less desk space as you can put the AMS on top of it (although you can print a bracket to mount the AMS on top of the A1 as well).

If you are looking to buy one of these formidable devices my advice would be to go for the A1 unless, like me, you prefer the look of the P1S. Both work well and should be equally reliable.