Does the cubesatsim support a "full-size" Pi board as a drop-in replacement of the Pi Zero? #385
-
For my research and testing, I wish to swap out the Pi Zero that is intended for use with the cubesatsim with a more performant and capable Pi 4 (or 5) board. Is there anything I need to keep in mind with respect to OS or hardware compatibility, considering that I will flash the full-size Pi's SDcard with the same image as the Pi Zero and use an extra GPIO stacking header to connect to the battery board? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 5 replies
-
Hi Agastya, The CubeSatSim software is based on Debian 11 Bullseye and should run on a Pi 3B or 4. It won't run on a Pi 5 which requires Debian 12 Bookworm. The code could be ported to Bookworm - there's just a lot of annoying Python, camera, and configuration issues to sort through. I tested the existing SD card image on a Pi 4 and it seems to work! I couldn't get a decode on APRS packets for some reason, but they sounded correct. The other modes and rpitx seemed to work, along with the Pico serial communication and Command and Control. Note that to save power, the software only uses one CPU (the maxcpus=1 in /boot/cmdline.txt forces this). So you could remove this to get more CPU processing on the Pi Zero 2 (which has 3 CPUs) or the 3B or 4. The CubeSatSim hardware is designed to run directly on the battery voltage, which is in the range 4.1 V to 3.5 V for three NiMH cells. This battery voltage powers the Raspberry Pi through GPIO pins 2 and 4, which are nominally 5 V. The Pi Zero, Pi Zero W, and Pi Zero 2 all run fine with this voltage between 3.3 V and 5 V. The Pi Zero generates the regulated 3.3 V which powers everything except the FM transceiver module, which also runs at the battery voltage. This is a problem for a Pi 3B or Pi 4 which needs to run on 5 V. These Pi's all complain if this voltage drops by even 0.1 V or so. This is why many USB-C power supplies designed for the Raspberry Pi actually output more the 5 V (some of them even exceed the USB voltage maximum) so that the Pi never sees a voltage below 5 V and so doesn't complain. This means that a Pi 3B or Pi 4 plugged into the board stack where the Pi Zero is usually plugged in can't be powered through the battery pack. It also can't be powered through the USB-C port on the Main board unless you bypassed the two series diodes D1 and D4. Even then, it might not work unless you used a Raspberry Pi power supply USB-C that supplied a higher than 5 V. Without diodes D1 and D4, the charging voltage and current would be too high for the batteries. Without a Battery board (or with the JST connector unplugged to the Battery board), you can power the Pi 3B or Pi 4 directly, and it will then power the rest of the CubeSatSim through GPIO pins 2 and 4, and everything should work. This is how I tested it. If you really needed to still run it on batteries, you could try either a Boost Converter circuit between the battery and the GPIO that would boost the 3.5 V to 4.1 V up to 5 V (or a little higher). The other thing you could try is a battery pack with four NiMH cells - this would give you a battery voltage above 5 V which might power a Pi 3B or Pi 4. I have tested this in the past with a Pi Zero and it works, but charging the batteries will require some kind of charging circuit. Of course, the Pi 3B or Pi 4 wouldn't fit in the frame without some modifications, either. Good luck, and let us know if you get this working! Alan |
Beta Was this translation helpful? Give feedback.
-
Uncommenting the line
from /boot/config.txt usually fixes these types of HDMI issues. Note that to use the Raspberry Pi Graphical User Interface, you will need to use the very latest iso image and also use Alan |
Beta Was this translation helpful? Give feedback.
-
Thanks for your help on this matter! I noticed that the rate of logging of sensor data in /dev/serial0 is far slower with the pi 4 as opposed to with the pi zero. Why would that be? Could this have something to do with you not being able to decode APRS packets? |
Beta Was this translation helpful? Give feedback.
-
Can you copy and paste a few pages of the main log so I can see it? The output of this command: CubeSatSim/log Alan |
Beta Was this translation helpful? Give feedback.
-
Thank you for posting the log file with the I looked it over and I don't see any delays in recording payload sensor data. It happens about every 4.6 seconds most of the time. You can find each instance by searching for I do, however, occasionally see a longer than expected loop time. This would result in the payload sensor data being read less frequently. For instance, at timestamp 18:17:11 you see:
Notice the Loop time of 8.4 seconds instead of 4.6 seconds. The reason seems to be a 6.9 second delay in sending data over TCP where it says What made you think that there were delays in the payload sensor data? Was it from looking at What do you see in the timestamps in this file: Alan |
Beta Was this translation helpful? Give feedback.
Uncommenting the line
hdmi_force_hotplug=1
from /boot/config.txt usually fixes these types of HDMI issues.
Note that to use the Raspberry Pi Graphical User Interface, you will need to use the very latest iso image and also use
sudo rasp-config
to enable boot to Desktop. The default is to boot to command line.Alan