Yet More Hull Pixelbot Fun at our Hardware Meetup

Sorry about the blur. It’s what I get when I try to be artistic

We had our hardware meetup tonight at Hull MakerSpace. Plenty of folks turning up and building/programming robots. We are still working on the rules for Robot Rugby, but in the meantime folks spent today attaching battery packs so their robots could wander around with no wires. I’ve started writing a book which describes the process we are going through. You can find the first part here. I’m going to be adding sections as we build each part of the robot.

This online Arduino Programming Tool is great

Now you can program your Arduino Uno straight from the hullpixelbot.com site

This is an awesome and very useful tool:

https://github.com/dbuezas/arduino-web-uploader

it allows you to deploy Arduino Uno applications directly into a device from a web browser. Just what you want to do if you happen to have an Arduino Uno controlled robot that needs software. Like I do.

It means that you can now create and program your Hull Pixelbot without needing to download any code. You can load the HullOS operating system into your robot and then use the Hull Pixelbot Python-ish editor to deploy the code.

Free Hull Pixelbots at March 20th Hardware Meetup

If too many folks turn up will run a draw for these

Thanks to the generosity of “Player Piano Ross” we have some Hull Pixelbots to give away at the next Hardware Meetup at the Hull Makerspace at Central Library Hull. The meetup is on Wednesday 20th March and will start at 5:30 pm and continue until around 7:00pm. We are going to spend some time doing “Robot Training” with a little obstacle course we’ll try to program our way around.

The long term aim is to swap out the existing Arduino Uno controllers on the robots and replace them with Raspberry Pi Picos. This will let us run Python on the devices and program them over Wi-Fi. For the session on the 20th we’ll be using Python-ish and connecting our robots over RS232. I’m going to bring a few original pixelbots including Crystal Masie and Captain Black. It would be lovely to see you there. Bring your laptop, some AA batteries and a winning smile.

And you might get a free robot of your own.

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.

Robot Rugby fun and games

Ready to rumble

I took the robots into the university to take part in the Computer Science Christmas Bash. There was quite a bit of interest, in spite of competing attractions in the form of lots of video games and a hard fought game of Risk going on at the same time. I think I need to make the gameplay a bit more compelling and come up with a better way of letting players test and deploy their code before the game starts. Great fun though.

Using the second serial port connection on the ESP8266

Perhaps not many of you have had problems with the serial port connections on your ESP8266 devices. But I’m going to write this down anyway. Here’s the problem:

The ESP8266 has one and a half serial ports. But I want my ESP8266 to use serial connections to two different devices:

  • I want to be able to connect my computer to the ESP8266 so that I can load programs into the device and set configuration options.

  • I want the ESP8266 to be able to talk to a Pixelbot robot and tell it what to do.

Connecting the ESP8266 serial signals to the robot processor breaks the serial connection to the computer. So if I want to connect my robot to the my PC I have to unplug connections on the robot itself. Which is tiresome. So instead I’m using a little know feature of the ESP8266. It can swap the serial connections to different processor pins. So I can connect the robot serial signals to GPIO 13 (TX) and GPIO 15 (RX) and, once my program has started running I can call a function to swap the serial signals over to these pins.

Serial.swap();

After swap has been called code in the robot using the serial port will send messages out of the alternate pins. When the robot starts up it looks for messages on the original connection and if it doesn’t see anything it swaps the connection. This makes it much easier to use. This is the kind of kludge I’m proud of.

Robot Rugby is coming

Do you want to be able to play rugby with robots? I do. To that end I’ve spent the day building a web backend for a system that will host a rugby game and allow players to drop program code into their robotic rugby players and tell them what to do.

I’m not sure how much fun it would be to play rugby with robots. But I’ve had great fun which I think is perhaps the most important thing here…

Too much voltage is bad for you

the first PICO powered Pixelbot

I’ve not made a brand-new Hull Pixelbot for a while. Today I made a new one which is powered by a Raspberry Pi PICO. I usually power the robot from four (or sometimes five) AA batteries. This gets me around 6 volts. I did that today with the new robot and it failed to work. It turns out that the Raspberry Pi doesn’t like voltages much higher than 6 volts, and shows its displeasure by not working. I had scrabble around to find a set of “slightly worn” batteries to get it going.

Merging Connected Little Boxes and the Hull Pixelbot

Two things that have occupied a lot of my time recently have been Connected Little Boxes and the Hull Pixelbot. And now I’m working on combining them. This will create a Connected Little Box which can operate as an autonomous robot. It will also being scripting to the Connected Little Box so that you can create tiny programs for each of the box interfaces. Whatever happens, it’s going to be fun.

Slow baud rates and the Raspberry Pi Pico

Hull University campus looking good

It’s strange the things you discover when you try to do something. Today it was all about slow baud rates.

What’s a baud rate? I hear you ask. Well, baud apparently stands for “binary asynchronous unit of data”. Or it’s an abbreviation for the name Emile Buadot who was a French pioneer of digital communication and had an amazing moustache and beard. Emile was sending text down a single wire and he was doing it one bit at a time. Assemble enough bits and you can match patterns of ons and offs to particular characters. The data stream would begin with a start bit (to tell the receiver that a character was coming) and then have a bunch of signal levels that represent the character being sent. One thing that was important is that the sender and the receiver needed to agree on the rate at which the data was sent. Otherwise things get garbled. So they invented the baud rate (number of bits per second) and created some standard speeds (110,300,600,1200, 2400, 9600, 115200 and so on…) Baud rates are still used today. The GPS receiver in your mobile phone will be sending position information into your phone processor via a serial data stream with a particular baud rate.

When I connect a Hull Pixelbot to a computer I have to set a baud rate for the serial connection. I use the horrendously slow “baud rate” of 1,200 bits per second. This is because the program that the robot receives is stored in EEPROM in the robot (EEPROM stands for “Electrically Erasable Programmable Read-Only Memory). This is so we can turn the robot off and it will still remember the program it has been given. EEPEOM is awesome, but it is also very slow to write. The hardware has to bash the bits into the hardware components in the memory device and this takes time. I could have added handshaking - where the robot sets a signal to tell the host computer to stop sending - but instead I did something quick and dirty, which was to slow down the robot baud rate to the point where the EEPROM could keep up.

This kludgy decision came back to haunt me today when I tried to use an Arduino programmed Raspberry Pi PICO at 1200 baud. The PICO seems to get upset when you try to talk to it via a serial port running at 1200 baud. Not sure why, but the result is that my robot code doesn’t work properly. Oh well. I’ll just have to speed up the serial port and add some handshaking. I believe this is called “paying off technical debt”….

Migrating Arduino C to PICO C

Nothing to do with the subject of the post. Although the I guess you can see the “SEa”

You’d think it would be easy to move a C program from the Arduino platform to the Raspberry Pi PICO. After all, we have the wonderful libraries from Earle F. Philhower, III and the fabulous PlatformIO framework you can use to manage your project (don’t forget to perform this stuff before you try to build anything). And anyway, C is the same everywhere. Right?

Wrong.

When I write the Arduino stuff a while back I made one or two questionable design decisions. One of them was to use the char data type to hold 8 bit values. This was kind of OK back in the day (and by this I mean the 1980’s) but it turned out to be a stupid thing to do. Because some C compilers think that char holds a signed value (-128 to 127) and some think it holds unsigned (0 to 255). Of course the Arduino C compiler goes one way and the PICO C compiler goes the other way. Neither are wrong - the C language standard doesn’t specify this - and you could argue that anyone daft enough to perform maths with variables that are supposed to just hold character codes deserves all the trouble they get. But we are where we are, which in my case was looking at a program that has been working for years and has suddenly gone nuts.

I actually fixed it quite quickly once I figured out the stupid thing I’d done. The Pico debug probe proved very useful for this. I was able to set breakpoints in the timer interrupt handlers and then watch as various counters were updated. When I saw the code subtract 1 from 0 and get the answer 255 I knew exactly what had happened…..

The return of the Hull Pixelbot

Actually it never went away…

A few years ago I made some little robots called “Hull Pixelbots”. They have this name because they are from Hull and they have a pixel on the top. We had quite a lot of fun building them and playing with them, but then I went on to other things.

Well, I’m going back to them. I’m going to make a version with a PICO rather than the ESP devices I’ve used before, create a web based code editor and bring the robot into the “Connected Little Boxes” fold.

Should be fun.