Once you have the OS loaded, you will need to get to a terminal window and run a few commands that will help you out. Sometimes getting to a terminal is the trickiest part and it really depends on your specific board. Popular options include using SSH, connecting a USB to TTL Serial cable to some GPIO pins, or just connecting a display and keyboard directly to the board.

If you want to connect with a USB to TTL serial cable, we offer a few different cables, but either of these should cover most of your needs.

USB to TTL Serial Cable With Type A plug and 4 wire sockets
The cable is easiest way ever to connect to your microcontroller/Raspberry Pi/WiFi router serial console port. Inside the big USB plug is a USB<->Serial conversion chip and at...
$9.95
In Stock
FTDI Serial TTL-232 USB Type C Cable
Just about all electronics use a UART serial port with RX and TX pins for debugging, bootloading, programming, serial output, etc. But it's rare for a computer to have a serial...
$19.95
In Stock

Connect to a Network

The next step is to make sure your board is connected to a network, either by an ethernet cable or WiFi.

Ensure SSH is enabled

Some boards such as the Raspberry Pi have SSH disabled by default and you will need to either run a config utility or some other method to enable SSH, such as adding a specific empty file, otherwise all attempts will be denied. This is something you will need to check with the OS or manufacturer if you are not sure. For the Armbian on the Pine64, it is already enabled by default, so we don't need to worry.

Even if you don't plan on using SSH to connect to the terminal, it's still a good idea to enable it so that you can copy your updated PlatformDetect files over easily by FTP if you choose to do so.

Update Your OS and Python

Run the standard updates:

sudo apt-get update

sudo apt-get upgrade

and

sudo pip3 install --upgrade setuptools

If above doesn't work try

sudo apt-get install python3-pip

Enable mDNS

If you prefer to use SSH, you may need to connect with one of the alternative methods or lookup the IP address on your router first. Then once you're in, you can enable Multicast DNS if it is not done already, so you can connect without needing to know the IP address:

  • sudo apt-get install avahi-daemon

then reboot

Install Git

You'll want to make sure you have installed git so that you can clone PlatformDetect right onto your SBC.

  • sudo apt-get install git

Make sure you're using Python 3!

The default Python on your computer may not be Python 3. Python 2 is officially discontinued and all our libraries are Python 3 only.

We'll be using python3 and pip3 in our commands, use those versions of Python and pip to make sure you're using 3 and not 2.

Getting a copy of the code

Step 1 - Fork PlatformDetect to your GitHub account

If you don't already have the code from Adafruit_Python_PlatformDetect forked to your local GitHub repository, you'll want to start off by doing that. If you are not sure how to use GitHub, we have an excellent guide available on using Git and GitHub.

Step 2 - git clone the PlatformDetect fork to your single board computer

Once you have forked it, you can clone the repository both onto your local computer and onto your SBC. By using your local repository as a copy point, this makes things really easy. If you'd prefer to just edit right on your SBC and commit from there, you can do that too. In this guide, we'll assume you cloned it to your home directory on your SBC.

Some other options for copying over the files include using SFTP and an FTP client such as FileZilla or SCP. However, you decide to do it, the guide will assume that you have a copy of the repository in your home directory and that it is located inside the folder ~/Adafruit_Python_PlatformDetect.

This guide was first published on Mar 17, 2020. It was last updated on Mar 08, 2024.

This page (Environment Setup) was last updated on Mar 08, 2024.

Text editor powered by tinymce.