Once you have finished adding your chip and board detection code, or if you just want to see what the board and chip are currently being detected as, you can run the detection test script.

If you followed the instruction in the environment setup, you should have the Adafruit_Python_PlatformDetect folder in your home directory. Inside of there is a bin folder, and inside of that there is a file called detect.py. This is a useful script that can be used to see what PlatformDetect is seeing.

The easiest way to test your edited files on your board is by installing the latest version of PlatformDetect from PyPI using pip and then overwriting the files. You can install the latest version by typing:

pip3 install --upgrade Adafruit-PlatformDetect

Keep in mind that if you have already installed PlatformDetect, this will upgrade it to the latest version if a newer one is available.

After installing, you can see where the files are located by typing the following command:

pip3 show Adafruit-PlatformDetect

In this case, the files were located in the /usr/local/lib/python3.7/dist-packages folder. You can just use the cp command to overwrite them. For instance, if you uploaded your modified files to a folder named adafruit_platformdetect inside your home directory and your files were in the same location as ours, you could just type:

sudo cp -R ~/Adafruit_Python_PlatformDetect/adafruit_platformdetect /usr/local/lib/python3.7/dist-packages

The -R flag will recursively copy the folder and all of the files over.

Once you have everything copied over, make sure you are in the bin folder and then run the detect script by typing the following:

cd ~/Adafruit_Python_PlatformDetect/bin
python3 detect.py

This should output something like the following:

At the top, it displays the Chip ID and Board ID that it has detected and then it will check a few other boards to make sure that it isn't incorrectly detecting something else. Once you have your board being correctly detected, you may want to add to this file so that your board is detected by others who want to add a new board in the future.

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

This page (Testing Detection) was last updated on Mar 08, 2024.

Text editor powered by tinymce.