raspberry pi 4b 2gb – more working observations

Arduino IDE configured to communicate with Circuit Playground Express

Working with the Raspberry Pi 4B continues. I installed the Arduino IDE version 1.8.9 (https://www.arduino.cc/en/Main/Software) and was able to quickly start it and have it working with a Circuit Playground Express. I found a sample C++ program on GitHub (https://github.com/adafruit/Adafruit_CircuitPlayground/tree/master/examples/FidgetSpinner) and created a simple project, compiling it, but not uploading it. That will come later. I just wanted to check out the basic installation to see if it worked up to a point, and it all does. My only comment is that when you download the IDE that you choose the ARM 32-bit version. It’s a standard tar file, no compression. Once untarred, then execute install.sh. It will not only place everything where it needs to be, but set up permissions, groups, and add a menu entry under Programming.

The IDE seems fully functional. One aspect of using the IDE natively on the RPi 4B with 2GB is that compiles are noticeably slower than they are on my MacBook Pro. But that’s to be expected, and the time taken is not excessive. Just noticeable.

During this period of testing I’ve also managed to force Raspbian to hit the swap space. Unlike the 1GB RPi 4B, the 2GB version’s use of swap is one to two orders less than the 1GB version with the same application load. Right now I’m seeing 4.5MB out of 2GB of swap being used, or essentially next to nothing.

Finally, I installed two more software packages, Swift for ARM and PowerShell Version 7 Preview 2 for ARM.

In order to install Swift on Raspbian Buster, you neeed to add a reference to the repo, then install Swift from that repo. Those steps are:

curl -s https://packagecloud.io/install/repositories/swift-arm/release/script.deb.sh | sudo bash
sudo apt install swift5=5.0.2-v0.4

Once installed you can run this basic test:

pi@raspberrypi:~ $ swiftc --version
Swift version 5.0.2 (swift-5.0.2-RELEASE)
Target: armv6-unknown-linux-gnueabihf
pi@raspberrypi:~ $

You can read about Swift ARM here: https://swift-arm.com/
Note that you should check to see what the current version of Swift ARM is when you install. I chose 5.0.2-v0.4 because that was what was published in the announcement on the web site.

PowerShell Core for Raspbian Buster is available as a regular tar file here: https://github.com/PowerShell/PowerShell/releases

Once downloaded, create a directory on your login home. In my case I simply created ~/powershell. Step into it and untar the newly downloaded archive into the newly created directory. Once untarred simply run pwsh. For example:

pi@raspberrypi:~/powershell $ ./pwsh 
PowerShell 7.0.0-preview.2
Copyright (c) Microsoft Corporation. All rights reserved.

Type 'help' to get help.

PS /home/pi/powershell> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.0.0-preview.2
PSEdition                      Core
GitCommitId                    7.0.0-preview.2
OS                             Linux 4.19.58-v7l+ #1245 SMP Fri Jul 12 17:31:45 BST 2019
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
WSManStackVersion              3.0

PS /home/pi/powershell> 

And that’s about it.

One more thing. The Flirc case runs warm, but not excessively so. CPU temperatures seem to run between 45°C and 50°C. I’m still working on a 40-pin ribbon cable connector that will easily fit inside the case over the GPIO header.

adabox 002 feather bluetooth le mini robot, part 1

These are my notes for building and programming the Adafruit ADABOX 002 Feature Bluetooth LE Mini Robot.

The ADABOX 002 was the second in the series when Adafruit first started its Ada Box quarterly subscription. It’s a neat concept, where you get a box of goodies every three months that can be used to build up quite a number of interesting projects. ADABOX 002 comes with Adafruit’s Mini 3-Layer Round Robot Chassis Kit 2WD with DC Motors (PRODUCT ID: 3244), a Feather 32u4 Bluefruit LE with Feather Stacking Headers already soldered on, a DC Motor & Stepper FeatherWing Add-on with its pins pre-soldered, and a bread board. All you need to do is assemble everything, stacking the DC Motor FeatherWing on top of the Feather 32u4, and then attaching that to the bread board. It’s all physical assembly with no soldering required.

What I intend to cover, starting with this post, are

  • Notes concerning the mechanical construction that differ from Adafruit’s
  • Notes concerning the installation of the Arduino IDE and supporting drivers
  • Notes concerning the software for controlling the robot


You can find the full original assembly instructions here: https://learn.adafruit.com/adabox002/assembling-your-robot. What follows are mods to those instructions.

Before you assemble the lower and middle decks to hold the motors, assemble the standoffs on the middle deck so that there are three in the back and one in the right front, unlike the way illustrated by Adafruit. If you wait to add the standoffs after attaching the lower and middle decks, you’ll discover that the angle you need to make between the supplied screwdriver and the screws will be difficult to deal with.

As you’ll note above the three standoffs are across the back. If you look at the mechanical only kit, that’s the way it’s built. Why someone decided to build it differently for this project is a mystery. Once the middle deck is attached to the lower and the motors are properly in place, then attach the upper deck.

You can see from this angle how the forth standoff is off to the right (right is looking down from the top with the big wheels to the back). That’s so you can move the AA battery box into and out of the space between the middle and upper deck pieces, so that you can change the batteries without taking the robot apart. If those batteries are dead that robot won’t move. One more piece of advice with regards to the battery box. Only put two of the rubber feet onto the back of the battery box. This allows the battery box to be held in place with friction, but makes it easy to slide the box in and out. It also keeps the small slide switch built into the box from being hit as you move it in and out of the middle of the robot.

Now we come to the second change to building the robot. The original directions had the breadboard mounted long axis front-to-back with the back excess breadboard hanging over the back edge. I mounted it 90 degrees, from side-to-side. The way the deck metal is cut, it would seem that’s what the original designer of the hardware had in mind.

The motors are connected to the motor controller board with four 4″ breadboard jumper wires, and tied down with a single miniature nylon cable tie. This is different than from what Adafruit provided, four pins that forced the motor controller board to be at the front of the bread board. With these four wires, a much better layout (to me, at least) is built, and all for an additional $2 worth of parts (if that much).

One other item which is called out on the Adafruit site and is attached here is a 3.7V 500mAh battery, connected to the microcontroller board. You need this battery if you want to run the robot without it having to be attached to the USB cable for power. I only paid an additional $8 for that item.

What it means is that the BOX 002 robot is about 95% there as far as having something easy to build. That extra 5% are the wires and the battery, costing another $10. Why Adafruit doesn’t include the battery with the kit (and raise the price accordingly) is another one of those unanswered mysteries. The fact all of this is easy to fix means it’s not going to stop you, or anyone else, from getting to a very nice looking and working little robot.