|
|
3 years ago | |
|---|---|---|
| .. | ||
| esp32-cam-send-jpeg-serial | 3 years ago | |
| cubesatsim.h | 3 years ago | |
| cubesatsim.ino | 3 years ago | |
| pico-get-jpeg-serial.cpp | 3 years ago | |
| readme.MD | 3 years ago | |
| sstv1.h | 3 years ago | |
| sstv2.h | 3 years ago | |
readme.MD
This directory has experimental CubeSatSim code for the Raspberry Pi Pico. It is functionally equivalent to the CubeSatSim code that runs on the Raspberry Pi Zero, but on runs on the cheaper and easier to find Raspberry Pi Pico microcontroller.
Here's how to use it.
If all you want is a binary file to program your Pico, then go to the Releases https://github.com/alanbjohnston/CubeSatSim/releases and find the latest Pico release. Click on Assets and download the UF2 file. While holding down the BOOTSEL button on your Pico, plug it into your USB port and it will mount as a flash drive called RPI-RP2. Drag the UF2 file you downloaded to this drive and the software will be installed and the Pico will reboot and run it.
To see the log files and run configuration menus, you will need either the Arduino Serial Monitor or a terminal emulator such as PuTTY on Windows or miniterm on Linux.
To compile the code, you will need the Arduino IDE (Integrated Development Environment) application which you can download here: https://www.arduino.cc/en/software for different OSes.
I am using version 1.18.19
You will need to download the cubesatsim code on your computer. If you have git installed, you can clone the repository by typing:
git clone https://github.com/alanbjohnston/CubeSatSim.git
git checkout pico
git pull
If you don't, you can download a ZIP file with the code here: https://github.com/alanbjohnston/CubeSatSim/archive/refs/heads/pico.zip (if this link doesn't work, try this one: https://github.com/alanbjohnston/CubeSatSim/archive/refs/heads/master.zip)
Unzip the pico.zip file
Run the Arduino IDE
In the menu, select File Open then move to the CubeSatSim-pico/cubesatsim directory and you will see cubesatsim.ino. Select this file then click Open.
The "sketch" will open and you should see a view like this.
Next, you need to install the Raspberry Pi Pico Arduino core, called 'Arduino-Pico'. From their documentation: "Arduino-Pico is a community port of the RP2040 (Raspberry Pi Pico processor) to the Arduino ecosystem, intended to make it easier and more fun to use and program the Raspberry Pi Pico / RP2040 based boards."
IMPORTANT NOTE: You must select the version of Arduino-Pico of 2.3.2. If you use the latest version, SSTV mode will not work.
Here is the documentation for Arduino-Pico: https://arduino-pico.readthedocs.io/en/latest/
Follow the installation instructions listed here: https://arduino-pico.readthedocs.io/en/latest/install.html
If you use Windows, pay attention to this: "Note for Windows Users: Please do not use the Windows Store version of the actual Arduino application because it has issues detecting attached Pico boards. Use the “Windows ZIP” or plain “Windows” executable (EXE) download direct from https://arduino.cc. and allow it to install any device drivers it suggests. Otherwise the Pico board may not be detected."
Once you have installed it, you can now select the Pico board so you can compile the code.
Under the menu Tools / Board select "Raspbery Pi RP2040 Boards(2.1.1)" then select "Raspberry Pi Pico" which is the first one in the list. You can use a Pico W board, but select it as "Raspberry Pi Pico" anyway.
Next you need to install some libraries.
You need to download the Arduino-APRS library and the SSTV-Arduino-Scottie1 library and add to your Arduino libraries.
Go to the release page for each and download the ZIP file:
https://github.com/alanbjohnston/Arduino-APRS/releases
https://github.com/alanbjohnston/SSTV-Arduino-Scottie1/releases
https://github.com/alanbjohnston/Duino-hacks/releases
Select the latest release then download the zip files Arduino-APRS-Library.zip and SSTV-Arduino-Scottie-Library.zip and Duino-hacks.zip
In the Arduino IDE, under the menu select Sketch / Include Library then select "Add .ZIP library" find the ZIP files you downloaded and add both of them.
Next, install some libraries by going under the menu Tools/ Manage Libraries. At the search box at the top, type MPU6050_tockn and hit enter. Mouse over the library desciption and click on the Install button.
Do the same for the following libraries:
Adafruit INA219
Adafruit BME280
RPI_PICO_TimerInterrupt
JPEGDecoder
TJpg_Decoder
FastCRC
Find the ZIP file you downloaded and select it.
Do a test compile by clicking the check in the Arduino IDE. If you get an error, click on Copy Error Message and paste it into a text editor and see which library is missing.
To compile and download to your Pico board, you need to have the Port selected. If the Pico is mounted as a flash drive (look for a drive called "RPI-RP2" on your desktop), then you don't need to select anything for the Port. If it is not mounted as a flash drive, look under Port for "Raspberry Pi Pico" and select it. If it doesn't show, try unplugging and plugging in the Pico board again. If that still doesn't work, unplug the Pico, hold down the BOOTSEL button while plugging it back in and it should mount as a flash drive. Click on the Arrow to compile and upload. NOTE: the upload will always fail for the Pico if the Serial Monitor is open, so always close it before uploading. If you have to plug and unplug the Pico while you develop, don't unplug and plug the micro USB connector on the Pico. Instead, do it on the other end the cable. The micro USB connector is weak and may fail with too many cycles.