Author Archives: Chris Owens

RaspberryPi Camera not detected – Ubuntu 20.04.5 LTS

Hi everyone,

I ran into a bit of an issue with a RaspberryPi 4 running Ubuntu 20.04.5 this morning. Running vcgencmd get_camera should have returned supported=1 detected=1 but instead I was getting supported=0 detected=0.

This was a bit of a hard one to track down with Google but I eventually came across a stackoverflow post suggesting the following:

  • Run sudo nano /boot/firmware/config.txt
  • Add start_x=1 at the end
  • Reboot

Check out this post for more info: https://askubuntu.com/a/1244259/770194.

If you’re using a new camera you may also run into this error:

mmal: Cannot read camera info, keeping the defaults for OV5647
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
mmal: Failed to create camera component
mmal: main: Failed to create camera component
mmal: Only 76M of gpu_mem is configured. Try running "sudo raspi-config" and ensure that "memory_split" has a value of 128 or greater

The fix for this one is to simply append another line to /boot/firmware/config.txt. All you’ll need is gpu_mem=128.

Another issue you might run into is VHCI initialization failed. Generally, that just means you need to add your current user to the video group.

# Check your current user's groups.
groups

# Add your user to the video group.
sudo usermod -aG video <username>

Once you’ve added the group, rebooting should be enough to get past that error.

ROS2 on Parallels unable to be reached by other nodes

Hi everyone,

I’ve been messing around with ROS2 on a RaspberryPi and a Mac using Parallels to run Ubuntu. I hit a small snag when trying to get the nodes to communicate. The nodes on the RaspberryPi could not reach the ones being hosted on Ubuntu (Parallels).

While I initially assumed that I had messed up my ROS workspaces, it turned out to be a problem with my Parallels config. I was using a shared network. Switching to bridged immediately resolved the issue.

Gazebo classic material colors not working in Gazebo Ignition

Hi everyone,

I’m doing a few tutorials to simulate a lidar based navigation system and I’ve hit a few issues when trying to use Gazebo classic features in Gazebo Ignition.

A recent one is that Gazebo Ignition was ignoring the material colours that I’d specified in my urdf. This is an example of what was working in Gazebo classic:

    <gazebo reference="left_wheel">
        <material>Gazebo/Blue</material>
    </gazebo> 

This Github issue revealed the following format that can be used instead:

     <gazebo reference="chassis">
        <visual>
            <material>
                <ambient>0 0 1 1</ambient>
                <diffuse>0 0 1 1</diffuse>
                <specular>0 0 1 1</specular>
            </material>
        </visual>
    </gazebo>

Once updated, Gazebo ignition finally started rendering my material colors:

Gazebo Classic to Gazebo Ignition Diff Drive Conversion

Hi everyone,

I’m currently following some ros2 tutorials for simulating a diff drive robot in Gazebo Classic. I’m using Gazebo Ignition and unfortunately the definitions aren’t interchangeable.

Just in case anyone else hits the same issue, this is the definition I ended up using instead:

        <plugin
            filename="libignition-gazebo-diff-drive-system.so"
            name="ignition::gazebo::systems::DiffDrive"
        >
            <!-- Wheel info: https://youtu.be/IjFcr5r0nMs?t=876 -->
            <left_joint>left_wheel_joint</left_joint>
            <right_joint>right_wheel_joint</right_joint>
            <wheel_separation>0.35</wheel_separation>
            <wheel_diameter>0.1</wheel_diameter>

            <!-- Limits -->
            <max_wheel_torque>200</max_wheel_torque>
            <max_wheel_acceleration>10.0</max_wheel_acceleration>

            <!-- Output -->
            <odometry_frame>odom</odometry_frame>
            <robot_base_frame>base_link</robot_base_frame>

            <publish_odom>true</publish_odom>
            <publish_odom_tf>true</publish_odom_tf>
            <publish_wheel_tf>true</publish_wheel_tf>

        </plugin>

The following links were pretty helpful when it came to tracking down the differences:
https://github.com/chapulina/dolly/issues/28
https://github.com/gazebosim/gz-sim/blob/main/examples/worlds/visualize_lidar.sd

Spawn entity timeout in Gazebo from Ros2

Hi everyone,

I’m currently following a tutorial to simulate a fairly basic lidar robot with ROS2 and Gazebo: https://www.youtube.com/watch?v=laWn7_cj434. Unfortunately, there have been a few updates since the tutorial was created and a number of the commands don’t map 1:1 (no copy and paste).

While trying to create a launch file I ran into the following error:

[create-3] [ERROR] [1668289712.483268807] [ros_gz_sim]: Request to create entity from service [/world/deafult/create] timed out.

This was the relevant line in the launch file:

# Run the spawner node from the gazebo_ros package. The entity name doesn't really matter if you only have a single robot.
spawn_entity = Node(package='ros_ign_gazebo', executable='create',
arguments=[
'-world', 'deafult',
'-topic', 'robot_description',
'-entity', 'my_bot'],
output='screen')

The issue causing it to hang is that the world doesn’t exist. In my case, it’s because of a typo. However, if you’ve defined a world that you haven’t created yet it will result in the same error.

libgl error pic id driver null – ros2 turtlesim

Hi everyone,

I’m currently following the ros2 turtlesim tutorial with Ubuntu on an M1 Mac with Parallels and Ubuntu. Unfortunately, I hit a ‘device not found’ when trying to start the control node.

A bit of Googling revealed that 3D acceleration might not be enabled. To fix this, all you need to do is the following:

  • Open settings in Parallels (the cog icon)
  • Click the Hardware tab up the top
  • Click Graphics on the left hand side
  • Click Advanced
  • Tick Enable 3D Acceleration

You’ll need to restart the VM, but once that’s done the libgl error should be resolved!

If this doesn’t work, there are a few other things you can check. First, double check that you’ve installed (or re-installed) Parallels Tools.

I have also found that the 3D Acceleration seems to randomly break or reset itself. If it hasn’t automatically unchecked itself, I’ve occasionally had to do the following to get it working again:

  • Stop the VM
  • Disable 3D Acceleration
  • Start the VM
  • Stop the VM
  • Enable 3D Acceleration
  • Start the VM

Another options mentioned in this thread is to set the following environment variable before starting rviz or gazebo:

export LIBGL_ALWAYS_SOFTWARE=1 

The Repository is not Signed – Ubuntu ros2 installation

Hi everyone,

I’m currently installing ros2 on Ubuntu (with Parallels) and ran into the following error:

Hit:1 http://au.ports.ubuntu.com/ubuntu-ports jammy InRelease
Hit:2 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease
Get:3 http://packages.ros.org/ros2/ubuntu jammy InRelease [4,673 B]
Hit:4 http://au.ports.ubuntu.com/ubuntu-ports jammy-updates InRelease
Err:3 http://packages.ros.org/ros2/ubuntu jammy InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F42ED6FBAB17C654
Get:5 http://ports.ubuntu.com/ubuntu-ports jammy-proposed InRelease [270 kB]
Hit:6 http://au.ports.ubuntu.com/ubuntu-ports jammy-backports InRelease
Reading package lists… Done
W: GPG error: http://packages.ros.org/ros2/ubuntu jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F42ED6FBAB17C654
E: The repository 'http://packages.ros.org/ros2/ubuntu jammy InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

I was following the official tutorial so I was little surprised to see this crop up. What I hadn’t realised was that I’d missed an error in the output dump while running sudo apt update:

chris@chris-parallels-ubuntu:~$ sudo apt update && sudo apt install curl gnupg lsb-release
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
Hit:1 http://au.ports.ubuntu.com/ubuntu-ports jammy InRelease
Hit:2 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease
Get:3 http://packages.ros.org/ros2/ubuntu jammy InRelease [4,673 B]
Err:3 http://packages.ros.org/ros2/ubuntu jammy InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F42ED6FBAB17C654
Hit:4 http://au.ports.ubuntu.com/ubuntu-ports jammy-updates InRelease
Hit:5 http://ports.ubuntu.com/ubuntu-ports jammy-proposed InRelease
Hit:6 http://au.ports.ubuntu.com/ubuntu-ports jammy-backports InRelease
Reading package lists… Done
W: GPG error: http://packages.ros.org/ros2/ubuntu jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F42ED6FBAB17C654
E: The repository 'http://packages.ros.org/ros2/ubuntu jammy InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
sudo: curl: command not found

This was a clean install of Ubuntu and I hadn’t yet installed curl. Luckily, this is a simple fix:

sudo apt update
sudo apt install curl

Searching for a new site idea on Reddit!

Backstory

A bit of a different sort of post this time. I’ve been looking for a new side project for a couple of weeks after finally deciding to shelve the one I’ve been working on for the last six months or so.

I had intended to build a small scraping bot as a subscription service for recruiters but soon realised that this was a pretty typical (and bad) pattern for me. I enjoy the building phase so I tend to build apps without verifying the market. I then dread engaging an unknown market and move onto something else.

I decided I would at least try to do things properly this time. Instead of building an idea of my own I decided to find a business and ask them if they had any issues that were big enough that would pay a monthly subscription to fix.

My first point of contact was an old colleague that had hired me to do some freelance work a number of times. They were keen, but unfortunately they would be pretty tied up with another project for at least the next few months.

At this point I almost went back to the recruiting idea until thinking of an approach that was a little different and definitely outside my comfort zone…Reddit?

I searched a few entrepreneur subreddits but they didn’t seem to be quite right. I then came across https://www.reddit.com/r/smallbusiness which looked a bit more promising. I had hoped to find an Australian version so that I could work with someone a bit closer to home but there didn’t seem to be a decent equivalent. I did a bit more browsing and eventually decided that /r/smallbusiness was probably a pretty good starting point.

The Reddit Post

Posting to social media is definitely not something that I normally do. I occasionally comment, but for the most part I’m pretty passive. This is the post I ended up putting on the site:

I spent a bit of time thinking about how to approach this and decided that there were a few key things I needed for a businesses problem to be suitable.

Should be a subscription service

I have spent a lot of time building market places and platform services. Unfortunately these tend to take a long time to develop and accepting payments on behalf of another business can get complicated and potentially risky. Communicating these requirements via Reddit would be challenging at best.

A simple subscription service using stripe will significantly cut my development time. Building a product that charges a monthly subscription also gives me an easy way to evaluate how much a solution is worth to a customer. If they’re not willing to pay a subscription I immediately know that I need to look for another problem. I decided that $10/month was probably a good figure to start on. If they were willing to pay that I would consider the project, if not I’d move onto the next.

The scope should be small and easily defined

The proposed problem needs to have clear and easily defined requirements. It’s quite likely that I will only have a few short comments to get ALL of my information. I need to be able to understand it quickly and to be able to develop an MVP without any additional input from the user.

Preferably a B2B problem, not B2C

This one is more of a personal preference and definitely not firm but I find it’s easier to work with a business than a customer and there’s generally a bit less competition.

The Comments

I had half expected for my post to get removed and skim reading the very first comment definitely gave me a bit of a scare:

But luckily my post stayed up and it was only a short while later that the first business problem was posted:

I was pretty happy with this one. I have previously built a few booking systems for driving schools so I knew this was something I’d be able to do. Unfortunately, a few comments later confirmed my sneaking suspicion that this would be a fairly saturated market:

I was definitely still open to the idea, but decided to wait and see if there were any more ideas that cropped up.

It took a little while, but eventually there was another suggestion that piqued my interested:

It took a couple of comments to sort out exactly what was being requested for this one:

There were a few important bits to this one that put it at the top of my list. Firstly, the problem is well defined and there’s definitely room for an MVP with potential to extend the scope if things go well.

The problem is also something that I can see appealing to other businesses that are just chasing a bare bones asset management system. A fully fledged system is complex and requires a high price tag in order to justify the development cost. This was much smaller and definitely something that a single developer could pull off.

The third, and probably most important factor is that the seller would be elated to be able to find a solution for $25/month. The number here is important because I had only put forward a $10/month price – they were definitely keen to find a solution.

The snag

I worked on a few quick mocks and shared these with the potential customer. She seemed pretty happy and had a few suggestions around including imports/exports and a number of additional fields.

At this point I was pretty happy with things and decided to do a bit of competitor analysis. Unfortunately, this is when I came across AssetTiger:

They had literally everything that the customer was looking for and well within their budget of $25 per month. I double checked with them to confirm my suspicions and unfortunately it looked like AssetTiger was exactly what they were after:

They were were pretty appreciative and even offered to send a donation which was a really generous offer. Unfortunately, I’d now exhausted all of the project suggestions on the post.

What next?

I really liked the quick feedback on the suggestions in /r/smallbusiness and have decided that I will try this on a few more subreddits to see if the approach will work.

One thing that I would like to do a little differently is to try targeting an underserved industry specific subreddit e.g. agriculture or weddings. I think that this might help to mitigate the issue of suggestions that already exists – other redditors are likely to chip in with solutions that they use. Because everyone in the subreddit is in the same industry I think there’s also good chance that it will allow me to identify if multiple people are affected by the problem.

Anyway, if you’ve made it this far – thanks for reading! I’ll post an update on how the next reddit posts go!

Errors pushing an image to a new ECR repo on AWS

Hey everyone,

I normally use DigitalOcean or Azure for docker and kubernetes but have decided to give AWS a go this time around. I was following a guide on deploying an image to a new ECR repo and hit a couple of issues.

The first was that running the login command output help options instead of the password I was expecting:

aws ecr get-login --no-include-email --region us-east-2

usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:

  aws help
  aws <command> help
  aws <command> <subcommand> help

aws: error: argument operation: Invalid choice, valid choices are:

batch-check-layer-availability           | batch-delete-image                      
batch-get-image                          | batch-get-repository-scanning-configuration
complete-layer-upload                    | create-pull-through-cache-rule          
create-repository                        | delete-lifecycle-policy                 
delete-pull-through-cache-rule           | delete-registry-policy                  
delete-repository                        | delete-repository-policy                
describe-image-replication-status        | describe-image-scan-findings            
describe-images                          | describe-pull-through-cache-rules       
...

This turned out to be an issue because the command had been deprecated. Instead, use the following:

aws ecr get-login-password | docker login --username AWS --password-stdin "$(aws sts get-caller-identity --query Account --output text).dkr.ecr.<REGION_ID>.amazonaws.com"

There’s a pretty detailed thread on github here: https://github.com/aws/aws-cli/issues/5014

The second issue I ran into was an error while trying to run the new command:

An error occurred (AccessDeniedException) when calling the GetAuthorizationToken operation: User: arn:aws:iam::<ACCOUNT_ID>:user/<USER> is not authorized to perform: ecr:GetAuthorizationToken on resource: * because no identity-based policy allows the ecr:GetAuthorizationToken action

Adding the following role to my user resolved the issue: AmazonEC2ContainerRegistryPowerUser

Once I was passed this, I hit another issue using the command from the github link above:

Error response from daemon: login attempt to https://<ACCOUNT_ID>.dkr.ecr.us-east-2.amazonaws.com/v2/ failed with status: 400 Bad Request

This took a bit of digging, but eventually I came across a thread where someone was using the same command and had hit the same issue. Adding the region to the get-login-password call seemed to fix it:

aws ecr get-login-password --region <REGION_ID> | docker login --username AWS --password-stdin "$(aws sts get-caller-identity --query Account --output text).dkr.ecr.<REGION_ID>.amazonaws.com"

I was finally getting a login succeeded message and my push was working. This was the thread mentioning the region id just in case you need a bit more info: https://github.com/aws/aws-cli/issues/5317#issuecomment-835645395

Console.log output not appearing – AWS SAM Node.js

Hi everyone,

I ran into a bit of an interesting issue today after updating AWS SAM. All of my node log output stopped appearing in my console locally.

For now, there’s a pretty simple workaround:

sam build --use-container && sam local start-api 2>&1 | tr "\r" "\n"

Append 2>&1 | tr “\r” “\n” (including quotes) to your start-api command and you should begin to see the output as expected:

Thanks to the following links for the info: