Merge branch 'dev' into dev-py-test-min

pull/114/head
alanbjohnston 5 years ago committed by GitHub
commit e03298b1be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4,9 +4,13 @@ The CubeSat Simulator https://github.com/alanbjohnston/CubeSatSim/wiki is a low
There are several hardware versions and software branches to go with them - see below for information.
See the Wiki Software Install page for more details: https://github.com/alanbjohnston/CubeSatSim/wiki/Software-Install. To build and run the software on a Raspberry Pi 4B, 3B, 3B+, Pi Zero or Pi Zero W:
Requires:
- Raspbian Stretch or Buster, full desktop or Lite
See the Wiki Software Install page for more details: https://github.com/alanbjohnston/CubeSatSim/wiki/2.-Software-Install. The software runs on any Raspberry Pi including the Raspberry Pi 4B, 3B, 3B+, Pi Zero or Pi Zero W.
There are two ways to get the CubeSatSim software for your Pi.
One option is to download the disk image file and write it to a 16GB micro SD card or larger. The image is based on Raspberry Pi OS (Rasbian) Lite, dated December 2020. All software is installed, you just need to login to change your password and set your amateur radio callsign if you have one. You can run the ./update.sh script to update all packages and update and compile the latest CubeSatSim software.
The other option is to start with any Raspberry Pi OS (Rasbian) image and run the installation script ./install.sh which will install and compile all the related software. This includes the following packages:
- wiringpi
- git
- libasound2-dev
@ -14,87 +18,20 @@ Requires:
- Direwolf
- rpitx
- cpulimit
- python3-pip
- python-smbus
See the Wiki Software Install page for more details: https://github.com/alanbjohnston/CubeSatSim/wiki/Software-Install. Runs on a Raspberry Pi 3B, 3B+, or Pi Zero W (Does NOT work on a Pi 4 since rpitx does not work on it yet). The Pi Zero W or Pi Zero are recommended since they are draw the least power and will result in the best performance under battery power.
These instructions assume a Pi Zero W with WiFi connectivity. If you have a Pi Zero, follow these instructions to get connectivity: https://desertbot.io/blog/headless-pi-zero-ssh-access-over-usb-windows
To begin the software install, after logging in type:
`sudo apt update -y && sudo apt dist-upgrade -y`
`sudo apt install -y wiringpi git libasound2-dev i2c-tools cpulimit`
If you are installing on a Pi 4B, you will need to install the 2.52 version of wiring pi by following these steps (you can skip these steps for any other Pi version):
`cd /tmp`
`wget https://project-downloads.drogon.net/wiringpi-latest.deb`
`sudo dpkg -i wiringpi-latest.deb`
`cd`
Run raspi-config and enable the I2C bus by selecting Option 5 Interfacing Options and then Option 5 I2C and selecting Y to enable the ARM I2C bus:
`sudo raspi-config`
Select Finish at the bottom to exit raspi-config. Then type:
`sudo cp /boot/config.txt /boot/config.txt.0`
`sudo nano /boot/config.txt`
Use the down arrow key to go down in the file until you find this line:
`# Additional overlays and parameters are documented /boot/overlays/README `
Add the following two lines under it: (NOTE: there seems to be an issue with the i2c-gpio.dtbo file in the latest kernal. I'm investigating this temporary fix: https://github.com/raspberrypi/firmware/issues/1401. If adding dtoverlay=i2c-gpio in this step causes your Pi not to boot, then you are encountering this issue)
`dtoverlay=i2c-gpio,bus=3,i2c_gpio_delay_us=1,i2c_gpio_sda=23,i2c_gpio_scl=24`
`dtoverlay=pi3-miniuart-bt`
Press Ctrl-X then type `y` then hit Enter to save the file and exit the editor. You should back at the pi@... prompt.
## Disk Image Option Steps
Edit the cmdline.txt file by typing:
See the Wiki Software Install page for details: https://github.com/alanbjohnston/CubeSatSim/wiki/2.-Software-Install.
`sudo cp /boot/cmdline.txt /boot/cmdline.txt.0`
## Installation Script Option Steps
`sudo nano /boot/cmdline.txt`
CubeSatSim runs on any version of Raspberry Pi OS (Desktop or Lite), although a Pi Zero or Pi Zero W should only run Lite. Your Pi will need to have internet access to update settings and install packages.
Remove the following text in cmdline.txt to prevent a console from running on the serial port:
To get the software follow these steps:
`console=serial0,115200`
Press Ctrl-X then type `y` then hit Enter to save the file and exit the editor. You should back at the pi@... prompt.
Now install the python packages:
`sudo apt install -y python3-pip python-smbus`
`sudo pip3 install --upgrade setuptools`
`sudo pip3 install adafruit-blinka RPI.GPIO adafruit-extended-bus adafruit-circuitpython-ina219`
Reboot by typing:
`sudo reboot now`
after logging back into the Pi, type:
`ls -a /dev/i2c*`
you should see two I2C buses:
`i2c-1 i2c-3`
Note, you might see these two I2C buses - this is fine to:
`i2c-1 i2c-11`
Continue the install by typing:
`cd`
Then type:
`sudo apt-get install -y git`
`git clone http://github.com/alanbjohnston/CubeSatSim.git`
@ -102,105 +39,17 @@ Then type:
`git checkout master`
Create a sim.cfg configuration file with your amateur radio callsign (in all caps, no lower case letters!) by typing:
`echo "callsign" >> sim.cfg`
`echo "ARG1=f" >> .mode`
This will set the telemetry mode to FSK. To set it to AFSK or BPSK, change it to ARG1=a or ARG1=b
Compile the code:
`make rebuild`
`cd`
`git clone https://github.com/alanbjohnston/direwolf.git`
`cd direwolf`
`make -j`
(takes a while)
`sudo make install`
`make install-rpi`
Note that this last command may fail if you are using Raspbian Lite since there is no Desktop (you may get an error such as this "ln: failed to create symbolic link '/home/pi/Desktop/direwolf.desktop': No such file or directory
make: *** [Makefile.linux:727: install-rpi] Error 1"
`cd`
`git clone https://github.com/F5OEO/rpitx.git`
`cd rpitx`
`./install.sh`
(Takes a while). It will prompt you if you want to modify /boot/config.txt file. Type a `y` and the script will complete.
`cd`
`git clone https://github.com/alanbjohnston/pi-power-button.git`
`cd pi-power-button`
`./script/install`
To make the demo.sh script run automatically on boot:
`sudo cp ~/CubeSatSim/systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service`
`sudo systemctl enable cubesatsim`
`sudo cp ~/CubeSatSim/systemd/rpitx.service /etc/systemd/system/rpitx.service`
`sudo systemctl enable rpitx`
Now reboot for all the changes to take effect:
`sudo reboot now`
After rebooting, tune your radio or SDR to 434.9 MHz FM, and you should get a signal from the CubeSatSim! If you just have a Pi, you will only hear your Morse Code (CW) callsign - no telemetry signal will be transmitted, since there is no Band Pass Filter installed to block interfering transmissions. If you have built the Main Board or the TFB and it is plugged into your Pi, you will hear telemetry readio signals.
On the Main Board, the green LED will be on when the CubeSatSim software is running. The red LED when charging is occuring either through the micro USB or through the solar panels. The blue LED will illuminate when the CubeSatSim is transmitting.
The push button with the pi-power-button software will cause the Pi to reboot, change telemetry mode, or shutdown. Pressing and holding the pushbutton will make the green power LED blink first once, then two times, then three times, then blinks slowly. Depending on when you release the button, different things will happen. Here's what happens if you:
Press and release (don't hold button in at all): reboots CubeSatSim. The green LED will go out, and after 30 seconds, the CubeSatSim will be transmitting again.
Press and release after one blink of green LED: switches to AFSK telemetry mode. After about 5 seconds, the telemetry mode will switch to AFSK.
Press and release after two blinks of green LED: switches to FSK mode. After about 5 seconds, the telemetry mode will switch to FSK.
Press and release after three blinks of green LED: switches to BPSK mode. After about 5 seconds, the telemetry mode will switch to BPSK.
Press and release after four blinks of green LED: switches to SSTV mode. After about 5 seconds, the telemetry mode will switch to SSTV transmitting PD120 mode SSTV.
Press and release after green LED begins slow blinking: shuts down CubeSatSim.
Once the CubeSatSim shuts down, the RBF pin can then be safely inserted. Removing the RBF pin or pressing the push button will cause the CubeSatSim to start up again. It will use the same mode it was running when it was shutdown.
You can also change the telemetry mode using the command line. Edit the CubeSatSim/.mode file and change the value to change the mode. A value of ARG1=a will give you AFSK, ARG1=f will give you FSK, ARG1=b gives BPSK, and ARG1=s gives SSTV. After saving the .mode file, restart the cubesatsim service to switch the mode by typing:
`sudo systemctl restart cubesatsim`
Note that to get FoxTelem to decode BPSK, you need to be in BPSK Fox/Husky mode (depending on which version of FoxTelem). Also, you usually need to click on the center of the FFT. For the first 30 seconds, it is just a carrier, so there will be no lock. After that, it should lock and the Phasor will show a line that jumps around, and the Frame count should start increasing at the bottom of the FoxTelem window.
You can stop the service when it is running by SSH into the Pi and typing:
`sudo systemctl stop cubesatsim`
You are now ready to install the software. In the following command, CALLSIGN is your amateur radio callsign in all capitals, if you have one. If you don't you can put some other word which will be transmitted as a CW ID.
After rebooting, it will start unless you disable it:
`./install.sh CALLSIGN`
`sudo systemctl disable cubesatsim`
The installation script will run for quite a while. It will prompt you if you want to modify /boot/config.txt file. Type a `y` and the script will complete. You will need to reboot.
See the Wiki for more details https://github.com/alanbjohnston/CubeSatSim/wiki
See the Wiki for more details about the CubeSatSim https://github.com/alanbjohnston/CubeSatSim/wiki
Older Versions
There are several versions of the hardware and software to go with them:
- The original design used a Digital Transceiver Board for the Raspberry Pi (DigitalTxRxRPi) and APRS AFSK 1200 bps telemetry only. Use the aprs-digitaltxrx branch https://github.com/alanbjohnston/CubeSatSim/tree/aprs-digitaltxrx for this and the vB2 wiki page https://github.com/alanbjohnston/CubeSatSim/wiki/vB2-Home
- An updated design that used the Transmitter/Filter Board (TFB) instead of the the Transceiver Board. For the same APRS AFSK telemetry, use the aprs-rpitx branch https://github.com/alanbjohnston/CubeSatSim/tree/aprs-rpitx and the vB3 wiki page https://github.com/alanbjohnston/CubeSatSim/wiki/vB3-Home. Note that this hardware can still use the master code branch.
- The original design used a Digital Transceiver Board for the Raspberry Pi (DigitalTxRxRPi) and APRS AFSK 1200 bps telemetry only. Use the aprs-digitaltxrx branch https://github.com/alanbjohnston/CubeSatSim/tree/aprs-digitaltxrx for this and the vB2 wiki page https://github.com/alanbjohnston/CubeSatSim/wiki/vB2-Home (e.g. run `git checkout aprs-digitaltxrx` before running the ./install.sh script)
- An updated design that used the Transmitter/Filter Board (TFB) instead of the the Transceiver Board. For the same APRS AFSK telemetry, use the aprs-rpitx branch https://github.com/alanbjohnston/CubeSatSim/tree/aprs-rpitx and the vB3 wiki page https://github.com/alanbjohnston/CubeSatSim/wiki/vB3-Home. (e.g. run `git checkout aprs-rpitx` before running the ./install.sh script) Note that this hardware can still use the master code branch.

@ -321,8 +321,9 @@ int main(int argc, char * argv[]) {
map[BUS] = BAT;
snprintf(busStr, 10, "%d %d", test_i2c_bus(1), test_i2c_bus(0));
} else if (vB5) {
map[MINUS_X] = PLUS_Z;
map[MINUS_X] = MINUS_Y;
map[PLUS_Z] = MINUS_X;
map[MINUS_Y] = PLUS_Z;
if (access("/dev/i2c-11", W_OK | R_OK) >= 0) { // Test if I2C Bus 11 is present
printf("/dev/i2c-11 is present\n\n");
@ -439,7 +440,6 @@ int main(int argc, char * argv[]) {
printf("INFO: I2C bus status 0: %d 1: %d 3: %d camera: %d\n", i2c_bus0, i2c_bus1, i2c_bus3, camera);
#endif
// if ((i2c_bus1 == OFF) && (i2c_bus3 == OFF)) {
if (i2c_bus3 == OFF) {
sim_mode = TRUE;
@ -1638,7 +1638,7 @@ void get_tlm_fox() {
encodeB(b, 43 + head_offset, (int)(sensor[GYRO_Z] + 0.5) + 2048);
// encodeA(b, 45 + head_offset, (int)(BME280humidity + 0.5)); // in place of sensor1
encodeA(b, 45 + head_offset, (int)(sensor[HUMI] + 0.5)); // in place of sensor1
encodeA(b, 45 + head_offset, (int)(sensor[HUMI] * 10 + 0.5)); // in place of sensor1
encodeB(b, 46 + head_offset, PSUCurrent);
// encodeA(b, 48 + head_offset, (int)(XSsensor2) + 2048);

@ -105,8 +105,9 @@ int main(int argc, char *argv[]) {
if (digitalRead(26) != HIGH)
{
printf("vB5 Present\n"); // Don't print normal board detection
map[MINUS_X] = PLUS_Z;
map[MINUS_X] = MINUS_Y;
map[PLUS_Z] = MINUS_X;
map[MINUS_Y] = PLUS_Z;
snprintf(busStr, 10, "%d %d", test_i2c_bus(1), test_i2c_bus(3));
printf("New Bus String: %s \n", busStr);

@ -19,6 +19,7 @@ int Sensor2 = 0;
float Sensor3 = 0;
void eeprom_word_write(int addr, int val);
short eeprom_word_read(int addr);
int first_time = true;
void setup() {
@ -34,8 +35,12 @@ void setup() {
delay(250);
blink(500);
delay(250);
blink(500);
led_set(greenLED, HIGH);
delay(250);
led_set(greenLED, LOW);
led_set(blueLED, HIGH);
delay(250);
led_set(blueLED, LOW);
if (bme.begin(0x76)) {
bmePresent = 1;
@ -82,7 +87,7 @@ void setup() {
void loop() {
if (Serial.available() > 0) {
if ((Serial.available() > 0)|| first_time == true) {
blink(50);
char result = Serial.read();
// Serial.println(result);
@ -93,8 +98,9 @@ void loop() {
setup();
}
if (result == '?')
if ((result == '?') || first_time == true)
{
first_time = false;
if (bmePresent) {
Serial.print("OK BME280 ");
Serial.print(bme.readTemperature());
@ -138,14 +144,14 @@ void loop() {
// Serial.println(acceleration);
if (acceleration > 1.2)
digitalWrite(greenLED, HIGH);
led_set(greenLED, HIGH);
else
digitalWrite(greenLED, LOW);
led_set(greenLED, LOW);
if (rotation > 5)
digitalWrite(blueLED, HIGH);
led_set(blueLED, HIGH);
else
digitalWrite(blueLED, LOW);
led_set(blueLED, LOW);
}
}
@ -206,14 +212,14 @@ void loop() {
// Serial.println(acceleration);
if (acceleration > 1.2)
digitalWrite(greenLED, HIGH);
led_set(greenLED, HIGH);
else
digitalWrite(greenLED, LOW);
led_set(greenLED, LOW);
if (rotation > 5)
digitalWrite(blueLED, HIGH);
led_set(blueLED, HIGH);
else
digitalWrite(blueLED, LOW);
led_set(blueLED, LOW);
}
}
@ -236,11 +242,15 @@ void blink_setup()
#if defined(ARDUINO_ARCH_STM32F0) || defined(ARDUINO_ARCH_STM32F1) || defined(ARDUINO_ARCH_STM32F3) || defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32L4)
// initialize digital pin PB1 as an output.
pinMode(PC13, OUTPUT);
pinMode(PB9, OUTPUT);
pinMode(PB8, OUTPUT);
#endif
#if defined __AVR_ATmega32U4__
pinMode(RXLED, OUTPUT); // Set RX LED as an output
// TX LED is set as an output behind the scenes
pinMode(greenLED, OUTPUT);
pinMode(blueLED,OUTPUT);
#endif
}
@ -266,3 +276,17 @@ void blink(int length)
TXLED0; //TX LED macro to turn LED ON
#endif
}
void led_set(int ledPin, bool state)
{
#if defined(ARDUINO_ARCH_STM32F0) || defined(ARDUINO_ARCH_STM32F1) || defined(ARDUINO_ARCH_STM32F3) || defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32L4)
if (ledPin == greenLED)
digitalWrite(PB9, state);
else if (ledPin == blueLED)
digitalWrite(PB8, state);
#endif
#if defined __AVR_ATmega32U4__
digitalWrite(ledPin, state);
#endif
}

@ -0,0 +1,313 @@
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#include <MPU6050_tockn.h>
#include <EEPROM.h>
#include <TinyGPS.h>
#define SEALEVELPRESSURE_HPA (1013.25)
Adafruit_BME280 bme;
MPU6050 mpu6050(Wire);
TinyGPS gps;
long timer = 0;
int bmePresent;
int RXLED = 17; // The RX LED has a defined Arduino pin
int greenLED = 9;
int blueLED = 8;
int Sensor1 = 0;
int Sensor2 = 0;
float Sensor3 = 0;
void eeprom_word_write(int addr, int val);
short eeprom_word_read(int addr);
void setup() {
Serial.begin(9600); // Serial Monitor for testing
Serial1.begin(9600); // Pi UART
Serial2.begin(9600); // GPS on STM32 pins PA2, PA3
Serial.println("Starting!");
blink_setup();
blink(500);
delay(250);
blink(500);
delay(250);
led_set(greenLED, HIGH);
delay(250);
led_set(greenLED, LOW);
led_set(blueLED, HIGH);
delay(250);
led_set(blueLED, LOW);
if (bme.begin(0x76)) {
bmePresent = 1;
} else {
Serial.println("Could not find a valid BME280 sensor, check wiring!");
bmePresent = 0;
}
mpu6050.begin();
if (eeprom_word_read(0) == 0xA07)
{
Serial.println("Reading gyro offsets from EEPROM\n");
float xOffset = ((float)eeprom_word_read(1)) / 100.0;
float yOffset = ((float)eeprom_word_read(2)) / 100.0;
float zOffset = ((float)eeprom_word_read(3)) / 100.0;
Serial.println(xOffset, DEC);
Serial.println(yOffset, DEC);
Serial.println(zOffset, DEC);
mpu6050.setGyroOffsets(xOffset, yOffset, zOffset);
}
else
{
Serial.println("Calculating gyro offsets and storing in EEPROM\n");
mpu6050.calcGyroOffsets(true);
eeprom_word_write(0, 0xA07);
eeprom_word_write(1, (int)(mpu6050.getGyroXoffset() * 100.0) + 0.5);
eeprom_word_write(2, (int)(mpu6050.getGyroYoffset() * 100.0) + 0.5);
eeprom_word_write(3, (int)(mpu6050.getGyroZoffset() * 100.0) + 0.5);
Serial.println(eeprom_word_read(0), HEX);
Serial.println(((float)eeprom_word_read(1)) / 100.0, DEC);
Serial.println(((float)eeprom_word_read(2)) / 100.0, DEC);
Serial.println(((float)eeprom_word_read(3)) / 100.0, DEC);
}
}
void loop() {
if (Serial.available() > 0) {
blink(50);
char result = Serial.read();
// Serial.println(result);
if (result == 'R') {
Serial.println("OK");
delay(500);
setup();
}
if (result == '?')
{
if (bmePresent) {
Serial.print("OK BME280 ");
Serial.print(bme.readTemperature());
Serial.print(" ");
Serial.print(bme.readPressure() / 100.0F);
Serial.print(" ");
Serial.print(bme.readAltitude(SEALEVELPRESSURE_HPA));
Serial.print(" ");
Serial.print(bme.readHumidity());
} else
{
Serial.print("OK BME280 0.0 0.0 0.0 0.0");
}
mpu6050.update();
Serial.print(" MPU6050 ");
Serial.print(mpu6050.getGyroX());
Serial.print(" ");
Serial.print(mpu6050.getGyroY());
Serial.print(" ");
Serial.print(mpu6050.getGyroZ());
Serial.print(" ");
Serial.print(mpu6050.getAccX());
Serial.print(" ");
Serial.print(mpu6050.getAccY());
Serial.print(" ");
Serial.print(mpu6050.getAccZ());
Serial.print(" XS ");
Serial.print(Sensor1);
Serial.print(" ");
Serial.print(Sensor2);
Serial.print(" ");
Serial.println(Sensor3);
float rotation = sqrt(mpu6050.getGyroX()*mpu6050.getGyroX() + mpu6050.getGyroY()*mpu6050.getGyroY() + mpu6050.getGyroZ()*mpu6050.getGyroZ());
float acceleration = sqrt(mpu6050.getAccX()*mpu6050.getAccX() + mpu6050.getAccY()*mpu6050.getAccY() + mpu6050.getAccZ()*mpu6050.getAccZ());
// Serial.print(rotation);
// Serial.print(" ");
// Serial.println(acceleration);
if (acceleration > 1.2)
led_set(greenLED, HIGH);
else
led_set(greenLED, LOW);
if (rotation > 5)
led_set(blueLED, HIGH);
else
led_set(blueLED, LOW);
}
}
if (Serial1.available() > 0) {
blink(50);
char result = Serial1.read();
// Serial1.println(result);
if (result == 'R') {
Serial1.println("OK");
delay(500);
setup();
}
if (result == '?')
{
if (bmePresent) {
Serial1.print("OK BME280 ");
Serial1.print(bme.readTemperature());
Serial1.print(" ");
Serial1.print(bme.readPressure() / 100.0F);
Serial1.print(" ");
Serial1.print(bme.readAltitude(SEALEVELPRESSURE_HPA));
Serial1.print(" ");
Serial1.print(bme.readHumidity());
} else
{
Serial1.print("OK BME280 0.0 0.0 0.0 0.0");
}
mpu6050.update();
Serial1.print(" MPU6050 ");
Serial1.print(mpu6050.getGyroX());
Serial1.print(" ");
Serial1.print(mpu6050.getGyroY());
Serial1.print(" ");
Serial1.print(mpu6050.getGyroZ());
Serial1.print(" ");
Serial1.print(mpu6050.getAccX());
Serial1.print(" ");
Serial1.print(mpu6050.getAccY());
Serial1.print(" ");
Serial1.print(mpu6050.getAccZ());
Serial1.print(" XS ");
Serial1.print(Sensor1);
Serial1.print(" ");
Serial1.print(Sensor2);
Serial1.print(" ");
Serial1.println(Sensor3);
float rotation = sqrt(mpu6050.getGyroX()*mpu6050.getGyroX() + mpu6050.getGyroY()*mpu6050.getGyroY() + mpu6050.getGyroZ()*mpu6050.getGyroZ());
float acceleration = sqrt(mpu6050.getAccX()*mpu6050.getAccX() + mpu6050.getAccY()*mpu6050.getAccY() + mpu6050.getAccZ()*mpu6050.getAccZ());
// Serial.print(rotation);
// Serial.print(" ");
// Serial.println(acceleration);
if (acceleration > 1.2)
led_set(greenLED, HIGH);
else
led_set(greenLED, LOW);
if (rotation > 5)
led_set(blueLED, HIGH);
else
led_set(blueLED, LOW);
}
}
bool newData = false;
unsigned long chars;
unsigned short sentences, failed;
// For one second we parse GPS data and report some key values
for (unsigned long start = millis(); millis() - start < 100;) // 1000;)
{
while (Serial2.available())
{
char c = Serial2.read();
Serial.write(c); // uncomment this line if you want to see the GPS data flowing
if (gps.encode(c)) // Did a new valid sentence come in?
newData = true;
}
}
if (newData)
{
float flon, flat;
unsigned long age;
gps.f_get_position(&flat, &flon, &age);
Sensor1 = flat * 100;
Sensor2 = flon * 100;
Sensor3 = (float) gps.altitude()/100.0;
}
// delay(100);
}
void eeprom_word_write(int addr, int val)
{
EEPROM.write(addr * 2, lowByte(val));
EEPROM.write(addr * 2 + 1, highByte(val));
}
short eeprom_word_read(int addr)
{
return ((EEPROM.read(addr * 2 + 1) << 8) | EEPROM.read(addr * 2));
}
void blink_setup()
{
#if defined(ARDUINO_ARCH_STM32F0) || defined(ARDUINO_ARCH_STM32F1) || defined(ARDUINO_ARCH_STM32F3) || defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32L4)
// initialize digital pin PB1 as an output.
pinMode(PC13, OUTPUT);
pinMode(PB9, OUTPUT);
pinMode(PB8, OUTPUT);
#endif
#if defined __AVR_ATmega32U4__
pinMode(RXLED, OUTPUT); // Set RX LED as an output
// TX LED is set as an output behind the scenes
pinMode(greenLED, OUTPUT);
pinMode(blueLED,OUTPUT);
#endif
}
void blink(int length)
{
#if defined(ARDUINO_ARCH_STM32F0) || defined(ARDUINO_ARCH_STM32F1) || defined(ARDUINO_ARCH_STM32F3) || defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32L4)
digitalWrite(PC13, LOW); // turn the LED on (HIGH is the voltage level)
#endif
#if defined __AVR_ATmega32U4__
digitalWrite(RXLED, LOW); // set the RX LED ON
TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF
#endif
delay(length); // wait for a lenth of time
#if defined(ARDUINO_ARCH_STM32F0) || defined(ARDUINO_ARCH_STM32F1) || defined(ARDUINO_ARCH_STM32F3) || defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32L4)
digitalWrite(PC13, HIGH); // turn the LED off by making the voltage LOW
#endif
#if defined __AVR_ATmega32U4__
digitalWrite(RXLED, HIGH); // set the RX LED OFF
TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF
#endif
}
void led_set(int ledPin, bool state)
{
#if defined(ARDUINO_ARCH_STM32F0) || defined(ARDUINO_ARCH_STM32F1) || defined(ARDUINO_ARCH_STM32F3) || defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32L4)
if (ledPin == greenLED)
digitalWrite(PB9, state);
else if (ledPin == blueLED)
digitalWrite(PB8, state);
#endif
#if defined __AVR_ATmega32U4__
digitalWrite(ledPin, state);
#endif
}

@ -0,0 +1,105 @@
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
Most Arduinos have an on-board LED you can control. On the Uno and
Leonardo, it is attached to digital pin 13. If you're unsure what
pin the on-board LED is connected to on your Arduino model, check
the documentation at http://arduino.cc
This example code is in the public domain.
modified 8 May 2014
by Scott Fitzgerald
Modified by Roger Clark. www.rogerclark.net for Maple mini 25th April 2015 , where the LED is on PC13
Added CubeSatSim Payload tests for STM32 and Pro Micro by Alan Johnston, KU2Y
*/
int sensorValue = 0;
int greenLED = 9;
int blueLED = 8;
// Calibration data for diode temperature sensor
float T1 = 25; // Temperature data point 1
float R1 = 373; // Reading data point 1
float T2 = 17; // Temperature data point 2
float R2 = 405; // Reading data point 2
// the setup function runs once when you press reset or power the board
void setup() {
#if defined(ARDUINO_ARCH_STM32F0) || defined(ARDUINO_ARCH_STM32F1) || defined(ARDUINO_ARCH_STM32F3) || defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32L4)
// initialize digital pin PB1 as an output.
pinMode(PB9, OUTPUT);
pinMode(PB8, OUTPUT);
pinMode(PA0, INPUT_ANALOG);
pinMode(PA1, INPUT_ANALOG);
pinMode(PA2, INPUT_ANALOG);
T2 = 25; // Temperature data point 1
R2 = 2111; // Reading data point 1
T1 = 23; // Temperature data point 2
R1 = 2097; // Reading data point 2
#endif
#if defined __AVR_ATmega32U4__
pinMode(greenLED, OUTPUT);
pinMode(blueLED,OUTPUT);
#endif
Serial.begin(9600);
}
// the loop function runs over and over again forever
void loop() {
ledWrite(greenLED, HIGH); // turn the LED on (HIGH is the voltage level)
ledWrite(blueLED, LOW); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
ledWrite(greenLED, LOW); // turn the LED off by making the voltage LOW
ledWrite(blueLED, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
sensorValue = readAnalog(0);
// Serial.println(sensorValue);
sensorValue = readAnalog(1);
float temp = T1 + (sensorValue - R1) *(T2 - T1)/(R2 - R1);
Serial.print("Temperature: ");
Serial.print(temp);
Serial.println(" C");
sensorValue = readAnalog(2);
// Serial.println(sensorValue);
}
void ledWrite(int ledPin, bool state)
{
#if defined(ARDUINO_ARCH_STM32F0) || defined(ARDUINO_ARCH_STM32F1) || defined(ARDUINO_ARCH_STM32F3) || defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32L4)
if (ledPin == greenLED)
digitalWrite(PB9, state);
else if (ledPin == blueLED)
digitalWrite(PB8, state);
#endif
#if defined __AVR_ATmega32U4__
digitalWrite(ledPin, state);
#endif
}
int readAnalog(int pin)
{
int value = 0;
#if defined(ARDUINO_ARCH_STM32F0) || defined(ARDUINO_ARCH_STM32F1) || defined(ARDUINO_ARCH_STM32F3) || defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32L4)
if (pin == 0)
value = analogRead(PA0);
else if (pin == 1)
value = analogRead(PA1);
else if (pin == 2)
value = analogRead(PA2);
#endif
#if defined __AVR_ATmega32U4__
value = analogRead(pin);
#endif
return(value);
}

@ -0,0 +1,79 @@
// --------------------------------------
// i2c_scanner
//
// Version 1
// This program (or code that looks like it)
// can be found in many places.
// For example on the Arduino.cc forum.
// The original author is not know.
// Version 2, Juni 2012, Using Arduino 1.0.1
// Adapted to be as simple as possible by Arduino.cc user Krodal
// Version 3, Feb 26 2013
// V3 by louarnold
// Version 4, March 3, 2013, Using Arduino 1.0.3
// by Arduino.cc user Krodal.
// Changes by louarnold removed.
// Scanning addresses changed from 0...127 to 1...119,
// according to the i2c scanner by Nick Gammon
// https://www.gammon.com.au/forum/?id=10896
// Version 5, March 28, 2013
// As version 4, but address scans now to 127.
// A sensor seems to use address 120.
// Version 6, November 27, 2015.
// Added waiting for the Leonardo serial communication.
//
//
// This sketch tests the standard 7-bit addresses
// Devices with higher bit address might not be seen properly.
//
#include <Wire.h>
void setup() {
Wire.begin();
Serial.begin(9600);
while (!Serial); // Leonardo: wait for serial monitor
Serial.println("\nI2C Scanner");
}
void loop() {
int nDevices = 0;
Serial.println("Scanning...");
for (byte address = 0x43; address < 127; ++address) {
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
Wire.beginTransmission(address);
Serial.print(address, HEX);
byte error = Wire.endTransmission();
if (error == 0) {
Serial.print("\nI2C device found at address 0x");
if (address < 16) {
Serial.print("0");
}
Serial.print(address, HEX);
Serial.println(" !");
++nDevices;
} else if (error == 4) {
Serial.print("Unknown error at address 0x");
if (address < 16) {
Serial.print("0");
}
Serial.println(address, HEX);
}
}
if (nDevices == 0) {
Serial.println("No I2C devices found\n");
} else {
Serial.println("\ndone\n");
}
delay(5000); // Wait 5 seconds for next scan
}

@ -0,0 +1,134 @@
#!/bin/bash
echo $1
if [ "$1" = "-r" ]; then
echo "Restarting CubeSatSim"
sudo systemctl restart cubesatsim
exit
elif [ "$1" = "-a" ]; then
echo "changing CubeSatSim to AFSK mode"
sudo echo "ARG1=a" > .mode
sudo systemctl restart cubesatsim
exit
elif [ "$1" = "-f" ]; then
echo "changing CubeSatSim to FSK mode"
sudo echo "ARG1=f" > .mode
sudo systemctl restart cubesatsim
exit
elif [ "$1" = "-b" ]; then
echo "changing CubeSatSim to BPSK mode"
sudo echo "ARG1=b" > .mode
sudo systemctl restart cubesatsim
exit
elif [ "$1" = "-s" ]; then
echo "changing CubeSatSim to SSTV mode"
sudo echo "ARG1=s" > .mode
sudo systemctl restart cubesatsim
exit
elif [ "$1" = "-h" ]; then
echo "./configh.sh [OPTIONS]"
echo
echo "Changes CubeSatSim mode, resets, or modifies configuration file"
echo
echo " -h This help info"
echo " -a Change to AFSK/APRS mode"
echo " -f Change to FSK/DUV mode"
echo " -b Change to BPSK mode"
echo " -s Change to SSTV mode"
echo " -r Restarts CubeSatsim software"
echo " -m Modified the configuration file sim.cfg"
echo " You can change callsign, reset count, or"
echo " latitude and longitude (used for APRS)"
echo
exit
elif [ "$1" = "-m" ]; then
echo -e "\nConfiguration script for CubeSatSim\n"
echo -e "Return keeps current value."
echo -e "Current sim.cfg configuration file: \n"
value=`cat sim.cfg`
echo "$value"
echo
set -- $value
#echo $1 $2 $3 $4
echo -e "Input callsign (all capitals): "
read callsign
if [ -z $callsign ] ; then
callsign="$1"
echo "Keeping value of" $callsign
fi
echo -e "Input reset count (integer): "
read resets
if [ -z $resets ] ; then
resets="$2"
echo "Keeping value of" $resets
fi
if ! [[ $resets =~ ^[0-9]+$ ]] ; then
echo "Error: not an integer!"
resets="$2"
echo "Keeping value of" $resets
fi
echo -e "Input latitude (decimal degrees, positive is north): "
read lat
if [ -z $lat ] ; then
lat="$3"
echo "Keeping value of" $lat
fi
if ! [[ $lat =~ ^[+-]?[0-9]+([.][0-9]+)?$ ]] ; then
echo "Error: not a number!"
lat="$3"
echo "Keeping value of" $lat
fi
echo -e "Input longitude (decimal degrees, positive is east): "
read long
if [ -z $long ] ; then
long="$4"
echo "Keeping value of" $long
fi
if ! [[ $long =~ ^[+-]?[0-9]+([.][0-9]+)?$ ]] ; then
echo "Error: not a number!"
long="$4"
echo "Keeping value of" $long
fi
echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n"
echo $callsign $resets $lat $long
echo $callsign $resets $lat $long > sim.cfg
echo "Restarting CubeSatSim with new configuraation file"
fi
sudo systemctl restart cubesatsim

@ -7,6 +7,18 @@ echo "Script to transmit SSTV images from Pi Camera using CubeSatSim Lite"
echo
echo "Transmitting stored image while preparing live image"
echo
#cat /home/pi/CubeSatSim/wav/sstv.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &
(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &
#(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 > /dev/null 2>&1 &
#(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &>/dev/null &
echo "Taking picture with Pi Camera to Desktop camera.jpg"
echo

@ -0,0 +1,31 @@
Here is information about the CubeSatSim v1.0 hardware
There are files for the main board, battery board, and STEM payload board of these types:
* cubesatsim-STEM-1.0_gerbers.zip -- All gerber files used to fabricate PCBs
* cubesatsim-STEM-1.0_schematic.pdf -- Schematic
* cubesatsim-STEM-1.0_board.png -- View of board
* cubesatsim-STEM-1.0_board_fill.png -- View of board with fill
* cubesatsim-STEM-1.0_topPCB.png -- Top view of PCB generated by gerbers
* cubesatsim-STEM-1.0_bottomPCB.png -- Bottom view of PCB generated by gerbers
* cubesatsim-STEM-1.0_tNames.pdf -- Top outline of components
* cubesatsim-STEM-1.0_bNames.pdf -- Bottom outline of components
* cubesatsim-STEM-1.0.mnt -- top SMD component placement data
* cubesatsim-STEM-1.0.mnb -- bottom SMD component placement data
* cubesatsim-STEM-1.0_bom.csv.txt -- Bill of Materials in CSV format
I use PCBWay to fabricate PCBs https://pcbway.com
Board sets are available on the AMSAT Store:
https://www.amsat.org/product/amsat-cubesatsim-pcb/

@ -0,0 +1,6 @@
JP4 38.30 64.49 180 JUMPER-SMT_2_NO_SILK SMT-JUMPER_2_NO_SILK
JP5 44.68 64.36 180 JUMPER-SMT_2_NO_SILK SMT-JUMPER_2_NO_SILK
JP17 11.25 36.42 90 JUMPER-SMT_2_NC_TRACE_SILK SMT-JUMPER_2_NC_TRACE_SILK
JP18 13.61 36.42 270 JUMPER-SMT_2_NO_SILK SMT-JUMPER_2_NO_SILK
JP19 6.99 36.42 90 JUMPER-SMT_2_NC_TRACE_SILK SMT-JUMPER_2_NC_TRACE_SILK
JP20 4.47 36.42 270 JUMPER-SMT_2_NO_SILK SMT-JUMPER_2_NO_SILK

@ -0,0 +1 @@
J4 32.55 74.23 0 CONN_20X2 2X20

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

@ -0,0 +1,25 @@
"Qty";"Value";"Device";"Package";"Parts";"Description";"PROD_ID";
"12";"";"M01NOSILK-KIT";"1X01NS-KIT";"JP1, JP2, JP3, JP6, JP7, JP8, JP9, JP10, JP11, JP14, JP15, JP16";"Header 1";"";
"1";"";"SPARKFUN_PRO_MICRO";"SPARKFUN_PRO_MICRO";"U1";"SparkFun Pro Micro";"";
"3";"100nF";"CAPPTH";"CAP-PTH-SMALL";"C1, C2, C3";"Capacitor";"";
"3";"10K";"RESISTORPTH-1/4W-VERT";"AXIAL-0.1";"R9, R10, R11";"Resistor";"";
"1";"1N4148";"DIODE-D-2.5";"D-2.5";"D4";"DIODE";"";
"3";"1N5817";"DIODE-D-2.5";"D-2.5";"D1, D2, D3";"DIODE";"";
"2";"1x20 female header";"M20NOSILK";"1X20_NOSILK";"J6, J7";"1x20 .1" header";"";
"2";"4.7k";"RESISTORPTH-1/4W-VERT";"AXIAL-0.1";"R1, R2";"Resistor";"";
"2";"470";"RESISTORPTH-1/4W-VERT";"AXIAL-0.1";"R3, R4";"Resistor";"";
"1";"BME280";"M04NO_SILK_ALL_ROUND";"1X04_NO_SILK_ALL_ROUND";"JP21";"Header 4";"";
"1";"Blue 5mm";"LED3MM";"LED3MM";"LED2";"LED";"";
"1";"CONN_20X2";"CONN_20X2";"2X20";"J4";"Multi connection point. Often used as Generic Header-pin footprint for 0.1 inch spaced/style header connections";"";
"1";"DNI-100";"RESISTORPTH-1/4W-VERT";"AXIAL-0.1";"R6";"Resistor";"";
"1";"DNI-1k";"RESISTORPTH-1/4W-VERT";"AXIAL-0.1";"R5";"Resistor";"";
"2";"DNI-1x2 pin header";"CONN_021X02_NO_SILK";"1X02_NO_SILK";"J1, J2";"Multi connection point. Often used as Generic Header-pin footprint for 0.1 inch spaced/style header connections";"";
"2";"DNI-1x3 pin header with jumper";"M031X03_NO_SILK";"1X03_NO_SILK";"JP12, JP13";"Header 3";"";
"1";"DNI-1x4 pin header";"CONN_041X04_NO_SILK";"1X04_NO_SILK";"J3";"Multi connection point. Often used as Generic Header-pin footprint for 0.1 inch spaced/style header connections";"CONN-09696";
"2";"DNI-4k";"RESISTORPTH-1/4W-VERT";"AXIAL-0.1";"R7, R8";"Resistor";"";
"1";"DNI-Blue 5mm";"LED3MM";"LED3MM";"LED4";"LED";"";
"1";"DNI-Green 5mm";"LED3MM";"LED3MM";"LED3";"LED";"";
"1";"Green 5mm";"LED3MM";"LED3MM";"LED1";"LED";"";
"2";"JUMPER-SMT_2_NC_TRACE_SILK";"JUMPER-SMT_2_NC_TRACE_SILK";"SMT-JUMPER_2_NC_TRACE_SILK";"JP17, JP19";"Normally closed trace jumper";"";
"4";"JUMPER-SMT_2_NO_SILK";"JUMPER-SMT_2_NO_SILK";"SMT-JUMPER_2_NO_SILK";"JP4, JP5, JP18, JP20";"Normally open jumper";"";
"1";"MPU6050";"M08NO_SILK_FEMALE_PTH";"1X08_NO_SILK";"J5";"Header 8";"CONN-08438";

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 801 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 KiB

@ -0,0 +1,5 @@
"Qty";"Value";"Device";"Package";"Parts";"Description";"DESCRIPTION";"DIGI-KEY_PART_NUMBER";"MF";"MP";"PACKAGE";"PURCHASE-URL";
"2";"";"CONN_01PTH_NO_SILK_KIT";"1X01NS_KIT";"J1, J2";"Single connection point. Often used as Generic Header-pin footprint for 0.1 inch spaced/style header connections";"";"";"";"";"";"";
"1";"AA battery holder BH3AA-PC";"BH3AA-PC";"BAT_BH3AA-PC";"BT1";"Holder Batt 3-Aa Cells Pc Mount";" Battery Holder (Open) AA 3 Cell PC Pin ";"BH3AA-PC-ND";"MPD";"BH3AAPC";"None";"https://pricing.snapeda.com/search/part/BH3AAPC/?ref=eda";
"1";"CONN_20X2";"CONN_20X2";"2X20";"JP13";"Multi connection point. Often used as Generic Header-pin footprint for 0.1 inch spaced/style header connections";"";"";"";"";"";"";
"1";"Micro JST";"M02JST-PTH-VERT";"JST-2-PTH-VERT";"JP15";"Standard 2-pin 0.1" header. Use with";"";"";"";"";"";"";

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 KiB

@ -0,0 +1 @@
JP3 11.99 33.49 90 VDD-EN SMT-JUMPER_2_NC_TRACE_SILK

@ -0,0 +1,11 @@
C1 16.43 73.32 270 1pF C0603
C2 16.43 71.86 270 1pF C0603
C3 20.17 72.63 0 20pF C0603
C4 21.64 72.63 0 20pF C0603
J1 32.55 66.61 0 CONN_20X2 2X20
L1 11.32 74.74 180 30nH L0603
L2 13.44 73.30 180 13nH L0603
L3 18.69 75.60 90 1.5nH L0603
L4 18.67 72.61 90 1.5nH L0603
R2 47.96 59.89 0 DNI-1k R0603
R6 55.98 59.79 0 DNI-1k R0603

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

@ -0,0 +1,30 @@
"Qty";"Value";"Device";"Package";"Parts";"Description";"MPN";"VALUE";
"1";"";"CN3085-MODULE";"CN3085-MODULE";"U6";"";"";"";
"2";"1.5nH";"SMD-FERRITE-CHIP-120-OHM-500MA(0603)";"L0603";"L3, L4";"303030001";"BLM18AG121SN1D";"120";
"1";"13nH";"SMD-FERRITE-CHIP-120-OHM-500MA(0603)";"L0603";"L2";"303030001";"BLM18AG121SN1D";"120";
"1";"1K";"RESISTORPTH-1/4W-VERT-KIT";"AXIAL-0.1EZ";"R1";"Resistor";"";"";
"7";"1N5817";"DIODE-D-2.5";"D-2.5";"D1, D2, D3, D4, D5, D6, D7";"DIODE";"";"";
"1";"1V-5V Boost 5V Regulator";"USB-BOOST";"USB-BOOST";"U7";"";"";"";
"2";"1pF";"CERAMIC-10PF-50V-5%-NPO(0603)";"C0603";"C1, C2";"302010097";"";"10pf";
"2";"20pF";"CERAMIC-10PF-50V-5%-NPO(0603)";"C0603";"C3, C4";"302010097";"";"10pf";
"1";"30nH";"SMD-FERRITE-CHIP-120-OHM-500MA(0603)";"L0603";"L1";"303030001";"BLM18AG121SN1D";"120";
"2";"4.7k";"RESISTORPTH-1/4W-VERT-KIT";"AXIAL-0.1EZ";"R3, R4";"Resistor";"";"";
"3";"470";"RESISTORPTH-1/4W-VERT-KIT";"AXIAL-0.1EZ";"R11, R12, R13";"Resistor";"";"";
"1";"5V1 Zener 1W";"ZENER-DIODEZD-2.5";"ZDIO-2.5";"D8";"Z-Diode";"";"";
"1";"Blue 5mm";"LED3MM";"LED3MM";"LED2";"LED";"";"";
"1";"CFP2-2RC4-AW";"SWITCH-DPDTOS";"OS";"S1";"DPDT Version of the COM-00597";"";"";
"1";"CONN_20X2";"CONN_20X2";"2X20";"J1";"Multi connection point. Often used as Generic Header-pin footprint for 0.1 inch spaced/style header connections";"";"";
"2";"DNI-0R";"RESISTORPTH-1/4W-VERT-KIT";"AXIAL-0.1EZ";"R9, R10";"Resistor";"";"";
"1";"DNI-1K";"RESISTORPTH-1/4W-VERT-KIT";"AXIAL-0.1EZ";"R5";"Resistor";"";"";
"2";"DNI-1k";"R-EU_R0603";"R0603";"R2, R6";"RESISTOR, European symbol";"";"";
"2";"DNI-4.7k";"RESISTORPTH-1/4W-VERT-KIT";"AXIAL-0.1EZ";"R7, R8";"Resistor";"";"";
"1";"DNI-5V1 Zener 1W";"ZENER-DIODEZD-2.5";"ZDIO-2.5";"D9";"Z-Diode";"";"";
"1";"Green 5mm";"LED3MM";"LED3MM";"LED1";"LED";"";"";
"8";"INA219 purple board";"INA219";"INA219";"U1, U2, U3, U4, U5, U8, U9, U10";"";"";"";
"8";"Micro JST";"M02JST-PTH-VERT";"JST-2-PTH-VERT";"JP1, JP2, JP4, JP5, JP6, JP7, JP8, JP10";"Standard 2-pin 0.1" header. Use with";"";"";
"1";"PTCPTH";"PTCPTH";"PTC";"F1";"Resettable Fuse PTC";"";"";
"1";"Red 5mm";"LED3MM";"LED3MM";"LED3";"LED";"";"";
"1";"SC1464-ND";"PG203J";"PG203J";"X1";"MIC/HEADPHONE JACK";"";"";
"1";"SMA-VERT";"SMA-VERT";"SMA-VERT";"X11";"";"";"";
"1";"VDD-EN";"JUMPER-SMT_2_NC_TRACE_SILK";"SMT-JUMPER_2_NC_TRACE_SILK";"JP3";"Normally closed trace jumper";"";"";
"1";"micro USB breakout board";"M05NO_SILK";"1X05_NO_SILK";"JP9";"Header 5";"";"";

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 879 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 664 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 738 KiB

@ -0,0 +1,30 @@
"Qty";"Value";"Device";"Package";"Parts";"Description";"MPN";"VALUE";
"2";"1.5nH";"SMD-FERRITE-CHIP-120-OHM-500MA(0603)";"L0603";"L3, L11";"303030001";"BLM18AG121SN1D";"120";
"1";"13nH";"SMD-FERRITE-CHIP-120-OHM-500MA(0603)";"L0603";"L12";"303030001";"BLM18AG121SN1D";"120";
"1";"1K";"RESISTORPTH-1/4W-VERT-KIT";"AXIAL-0.1EZ";"R8";"Resistor";"";"";
"7";"1N5817";"DIODE-D-2.5";"D-2.5";"D1, D3, D4, D5, D9, D12, D13";"DIODE";"";"";
"1";"1V-5V Boost 5V Regulator";"USB-BOOST";"USB-BOOST";"U$3";"";"";"";
"2";"1pF";"CERAMIC-10PF-50V-5%-NPO(0603)";"C0603";"C11, C20";"302010097";"";"10pf";
"2";"20pF";"CERAMIC-10PF-50V-5%-NPO(0603)";"C0603";"C5, C12";"302010097";"";"10pf";
"1";"30nH";"SMD-FERRITE-CHIP-120-OHM-500MA(0603)";"L0603";"L9";"303030001";"BLM18AG121SN1D";"120";
"2";"4.7k";"RESISTORPTH-1/4W-VERT-KIT";"AXIAL-0.1EZ";"R4, R6";"Resistor";"";"";
"3";"470";"RESISTORPTH-1/4W-VERT-KIT";"AXIAL-0.1EZ";"R1, R2, R3";"Resistor";"";"";
"1";"Blue 5mm";"LED3MM";"LED3MM";"D7";"LED";"";"";
"1";"CFP2-2RC4-AW";"SWITCH-DPDTOS";"OS";"S1";"DPDT Version of the COM-00597";"";"";
"1";"CN3085-MODULE";"CN3085-MODULE";"CN3085-MODULE";"U$1";"";"";"";
"1";"CONN_20X2";"CONN_20X2";"2X20";"JP13";"Multi connection point. Often used as Generic Header-pin footprint for 0.1 inch spaced/style header connections";"";"";
"2";"DNI-0R";"RESISTORPTH-1/4W-VERT-KIT";"AXIAL-0.1EZ";"R9, R10";"Resistor";"";"";
"1";"DNI-1K";"RESISTORPTH-1/4W-VERT-KIT";"AXIAL-0.1EZ";"R12";"Resistor";"";"";
"2";"DNI-1k";"R-EU_R0603";"R0603";"R11, R13";"RESISTOR, European symbol";"";"";
"2";"DNI-4.7k";"RESISTORPTH-1/4W-VERT-KIT";"AXIAL-0.1EZ";"R5, R7";"Resistor";"";"";
"1";"DNI-5.2V Zener";"ZENER-DIODEZD-2.5";"ZDIO-2.5";"D10";"Z-Diode";"";"";
"1";"Green 5mm";"LED3MM";"LED3MM";"D6";"LED";"";"";
"8";"INA219";"INA219";"INA219";"U$2, U$4, U$5, U$6, U$7, U$8, U$9, U$10";"";"";"";
"8";"Micro JST";"M02JST-PTH-VERT";"JST-2-PTH-VERT";"JP1, JP5, JP6, JP7, JP8, JP9, JP12, JP15";"Standard 2-pin 0.1" header. Use with";"";"";
"1";"PTCPTH";"PTCPTH";"PTC";"F1";"Resettable Fuse PTC";"";"";
"1";"Red 5mm";"LED3MM";"LED3MM";"D8";"LED";"";"";
"1";"SC1464-ND";"PG203J";"PG203J";"OUT2";"MIC/HEADPHONE JACK";"";"";
"1";"SMA-VERT";"SMA-VERT";"SMA-VERT";"X3";"";"";"";
"1";"VDD-EN";"JUMPER-SMT_2_NC_TRACE_SILK";"SMT-JUMPER_2_NC_TRACE_SILK";"JP4";"Normally closed trace jumper";"";"";
"1";"micro USB breakout board";"M05NO_SILK";"1X05_NO_SILK";"JP10";"Header 5";"";"";
"1";"zener 5.2v";"ZENER-DIODEZD-2.5";"ZDIO-2.5";"D2";"Z-Diode";"";"";
Can't render this file because it contains an unexpected character in line 23 and column 114.

@ -0,0 +1,18 @@
"Qty";"Value";"Device";"Package";"Parts";"Description";"PROD_ID";
"12";"";"M01NOSILK-KIT";"1X01NS-KIT";"JP10, JP11, JP12, JP14, JP15, JP17, JP18, JP19, JP20, JP21, JP22, JP23";"Header 1";"";
"3";"100nF";"CAPPTH";"CAP-PTH-SMALL";"C3, C7, C8";"Capacitor";"";
"3";"10K";"RESISTORPTH-1/4W-VERT";"AXIAL-0.1";"R6, R8, R9";"Resistor";"";
"1";"1N4148";"DIODE-D-2.5";"D-2.5";"D4";"DIODE";"";
"3";"1N5817";"DIODE-D-2.5";"D-2.5";"D3, D5, D8";"DIODE";"";
"2";"1x2 pin header";"CONN_02";"1X02";"J4, J5";"Multi connection point. Often used as Generic Header-pin footprint for 0.1 inch spaced/style header connections";"";
"2";"1x20 female header";"M20NOSILK";"1X20_NOSILK";"J10, U2";"1x20 .1" header";"";
"2";"1x3 pin header with jumper";"M03PTH";"1X03";"JP24, JP25";"Header 3";"";
"2";"4.7k";"RESISTORPTH-1/4W-VERT";"AXIAL-0.1";"R14, R15";"Resistor";"";
"4";"470";"RESISTORPTH-1/4W-VERT";"AXIAL-0.1";"R1, R2, R3, R4";"Resistor";"";
"1";"ARDUINO_PRO_MICRO";"ARDUINO_PRO_MICRO";"ARDUINO_PRO_MICRO";"U1";"";"";
"1";"BME280";"M04NO_SILK_ALL_ROUND";"1X04_NO_SILK_ALL_ROUND";"JP16";"Header 4";"";
"2";"Blue 5mm";"LED3MM";"LED3MM";"D2, D7";"LED";"";
"1";"CONN_20X2";"CONN_20X2";"2X20";"JP13";"Multi connection point. Often used as Generic Header-pin footprint for 0.1 inch spaced/style header connections";"";
"2";"DNI-4k";"RESISTORPTH-1/4W-VERT";"AXIAL-0.1";"R12, R13";"Resistor";"";
"2";"Green 5mm";"LED3MM";"LED3MM";"D1, D6";"LED";"";
"1";"MPU6050";"M08NO_SILK_FEMALE_PTH";"1X08_NO_SILK";"J3";"Header 8";"CONN-08438";

@ -0,0 +1,4 @@
"Qty";"Value";"Device";"Package";"Parts";"Description";"DESCRIPTION";"HEIGHT";"MANUFACTURER_NAME";"MANUFACTURER_PART_NUMBER";"MOUSER_PART_NUMBER";"MOUSER_PRICE-STOCK";
"1";"12BH331P-GR";"12BH331P-GR";"12BH331PGR";"U1";"Cylindrical Battery Contacts, Clips, Holders & Springs 3 "AA" PC LEADS BLK";"Cylindrical Battery Contacts, Clips, Holders & Springs 3 "AA" PC LEADS BLK";"17mm";"Eagle Plastic Devices";"12BH331P-GR";"12BH331P-GR";"https://www.mouser.com/Search/Refine.aspx?Keyword=12BH331P-GR";
"1";"CONN_20X2";"CONN_20X2";"2X20";"JP13";"Multi connection point. Often used as Generic Header-pin footprint for 0.1 inch spaced/style header connections";"";"";"";"";"";"";
"1";"Micro JST";"M02JST-PTH-VERT";"JST-2-PTH-VERT";"JP15";"Standard 2-pin 0.1" header. Use with";"";"";"";"";"";"";

@ -0,0 +1,28 @@
"Qty";"Value";"Device";"Package";"Parts";"Description";"MPN";"PARTNO";"PNPROTATION";"VALUE";
"1";"0.1uf";"CERAMIC-2.2UF-10V-10%-X7R(0603)";"C0603";"C14";"302010054";"CC0603KRX7R6BB225";"";"";"2.2uf";
"2";"1.5nH";"SMD-FERRITE-CHIP-120-OHM-500MA(0603)";"L0603";"L3, L11";"303030001";"BLM18AG121SN1D";"";"";"120";
"1";"100nF";"CERAMIC-100NF-50V-10%-X7R(0603)";"C0603";"C15";"302010138";"CC0603KRX7R9BB104";"";"";"100nf";
"1";"10uf";"CERAMIC-2.2UF-10V-10%-X7R(0603)";"C0603";"C8";"302010054";"CC0603KRX7R6BB225";"";"";"2.2uf";
"1";"13nH";"SMD-FERRITE-CHIP-120-OHM-500MA(0603)";"L0603";"L12";"303030001";"BLM18AG121SN1D";"";"";"120";
"1";"1N5817";"DIODE-D-2.5";"D-2.5";"D9";"DIODE";"";"";"";"";
"2";"1pF";"CERAMIC-10PF-50V-5%-NPO(0603)";"C0603";"C11, C20";"302010097";"";"";"";"10pf";
"2";"1x2 pin header";"M021X02_NO_SILK";"1X02_NO_SILK";"JP1, JP4";"Standard 2-pin 0.1" header. Use with";"";"";"";"";
"2";"20pF";"CERAMIC-10PF-50V-5%-NPO(0603)";"C0603";"C5, C12";"302010097";"";"";"";"10pf";
"2";"27R";"SMD-RES-1.2K-1%-1/10W(0603)";"R0603";"R9, R10";"301010206";"RC0603FR-071K2L";"";"";"1.2K";
"2";"3.3K";"RESISTORPTH-1/4W-VERT-KIT";"AXIAL-0.1EZ";"R1, R2";"Resistor";"";"";"";"";
"1";"30nH";"SMD-FERRITE-CHIP-120-OHM-500MA(0603)";"L0603";"L9";"303030001";"BLM18AG121SN1D";"";"";"120";
"2";"47pF";"CERAMIC-2.2UF-10V-10%-X7R(0603)";"C0603";"C1, C6";"302010054";"CC0603KRX7R6BB225";"";"";"2.2uf";
"1";"Blue 3mm";"LED3MM";"LED3MM";"D7";"LED";"";"";"";"";
"1";"CFP2-2RC4-AW";"SWITCH-DPDTOS";"OS";"S1";"DPDT Version of the COM-00597";"";"";"";"";
"1";"CONN_20X2";"CONN_20X2";"2X20";"JP13";"Multi connection point. Often used as Generic Header-pin footprint for 0.1 inch spaced/style header connections";"";"";"";"";
"2";"DNI/1K";"RESISTORPTH-1/4W-VERT-KIT";"AXIAL-0.1EZ";"R3, R8";"Resistor";"";"";"";"";
"2";"DNI/1K";"SMD-RES-1.2K-1%-1/10W(0603)";"R0603";"R11, R12";"301010206";"RC0603FR-071K2L";"";"";"1.2K";
"1";"FT231XQ-R ";"AS-ITM-00223";"QFN20";"U5";"IC USB SERIAL FULL UART 20QFN";"";"AS-ITM-00223";"270";"FT231XQ-R ";
"1";"Green 3mm";"LED3MM";"LED3MM";"D6";"LED";"";"";"";"";
"1";"JUMPER_SOLDER_1X2";"JUMPER_SOLDER_1X2";"JUMPER_SOLDER_1X2";"J1";"";"";"";"";"";
"1";"OR";"FERRITE-0603";"FB603";"L1";"Ferrite bead in various packages";"";"";"";"";
"1";"SC1464-ND";"PG203J";"PG203J";"3.5MM_JACK";"MIC/HEADPHONE JACK";"";"";"";"";
"1";"SMA-VERT";"SMA-VERT";"SMA-VERT";"X3";"";"";"";"";"";
"1";"ST-USB-001G";"MICRO-USB-SMD-B-WITHOUT-POST-W/P(ST-USB-001G)";"MICRO-USB5+4P-SMD-0.65-B";"USB1";"320010000";"ST-USB-001G";"";"";"ST-USB-001G";
"1";"USB4-2.0-90D";"DIP-USB-A-TYPE-FMAL(4+2P-2.0-90D)";"USB4+2P-2.0-90D";"USB2";"320010007";"";"";"";"USB4-2.0-90D";
"1";"zener 5.2v";"ZENER-DIODEZD-2.5";"ZDIO-2.5";"D2";"Z-Diode";"";"";"";"";

@ -0,0 +1,128 @@
#!/bin/bash
echo -e "\ninstallation script for CubeSatSim\n"
sudo apt-get update && sudo apt-get dist-upgrade -y
sudo apt-get install -y wiringpi git libasound2-dev i2c-tools cpulimit
cd /tmp
wget https://project-downloads.drogon.net/wiringpi-latest.deb
sudo dpkg -i wiringpi-latest.deb
cd
sudo apt install -y python3-pip python-smbus
sudo pip3 install --upgrade setuptools
sudo pip3 install adafruit-blinka RPI.GPIO adafruit-extended-bus adafruit-circuitpython-ina219
cd ~/CubeSatSim
git pull
make debug
FILE=/home/pi/CubeSatSim/.mode
if [ -f "$FILE" ]; then
echo "$FILE exists."
else
echo "creating $FILE"
echo "ARG1=f" >> .mode
fi
FILE=/home/pi/CubeSatSim/sim.cfg
if [ -f "$FILE" ]; then
echo "$FILE exists."
else
echo "creating $FILE"
echo $1 >> sim.cfg
fi
cd
git clone https://github.com/alanbjohnston/direwolf.git
cd direwolf
make -j
sudo make install
make install-rpi
cd
git clone https://github.com/alanbjohnston/pi-power-button.git
cd pi-power-button
./script/install
cd
git clone https://github.com/F5OEO/rpitx.git
cd rpitx
./install.sh
cd
sudo cp ~/CubeSatSim/systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service
sudo systemctl enable cubesatsim
sudo cp ~/CubeSatSim/systemd/rpitx.service /etc/systemd/system/rpitx.service
sudo systemctl enable rpitx
sudo cp /boot/config.txt /boot/config.txt.0
sudo cp /boot/cmdline.txt /boot/cmdline.txt.0
sudo raspi-config nonint do_i2c 0
#if [ "$1" = "u" ]; then
#fi
sudo sed -i 's/console=serial0,115200 //g' /boot/cmdline.txt
sudo sed -i 's/#dtparam=i2c_arm=on/dtparam=i2c_arm=on/g' /boot/config.txt
if [[ $(grep 'dtoverlay=i2c-gpio,bus=3,i2c_gpio_delay_us=1,i2c_gpio_sda=23,i2c_gpio_scl=24' /boot/config.txt) ]]; then
echo "dtoverlay=i2c-gpio already in /boot/config.txt"
else
echo "adding dtoverlay=i2c-gpio to /boot/config.txt"
sudo sh -c 'echo "\ndtoverlay=i2c-gpio,bus=3,i2c_gpio_delay_us=1,i2c_gpio_sda=23,i2c_gpio_scl=24" >> /boot/config.txt'
fi
if [[ $(grep 'dtoverlay=pi3-miniuart-bt' /boot/config.txt) ]]; then
echo "dtoverlay=pi3-miniuart-bt already in /boot/config.txt"
else
echo "adding dtoverlay=pi3-miniuart-bt to /boot/config.txt"
sudo sh -c 'echo "\ndtoverlay=pi3-miniuart-bt" >> /boot/config.txt'
fi
if [[ $(grep 'dtoverlay=dwc2' /boot/config.txt) ]]; then
echo "dtoverlay=dwc2 aalready in /boot/config.txt"
else
echo "adding dtoverlay=dwc2 to /boot/config.txt"
sudo sh -c 'echo "\ndtoverlay=dwc2" >> /boot/config.txt'
fi
if [[ $(grep 'modules-load=dwc2,g_ether' /boot/cmdline.txt) ]]; then
echo "modules-load=dwc2,g_ether already in /boot/cmdline.txt"
else
echo "adding modules-load=dwc2,g_ether to /boot/cmdline.txt"
sudo sed -i 's/ rootwait/ rootwait modules-load=dwc2,g_ether/g' /boot/cmdline.txt
fi
echo "You need to reboot to complete the installation\n"

@ -0,0 +1,43 @@
#!/bin/bash
echo -e "\nupdate script for CubeSatSim\n"
if [ "$1" = "u" ]; then
sudo apt-get update && sudo apt-get dist-upgrade -y
sudo apt-get install -y wiringpi git libasound2-dev i2c-tools cpulimit
fi
cd /home/pi/CubeSatSim
git pull > .updated
make debug
FLAG=0
if [[ $(grep 'cubesatsim.service' /home/pi/CubeSatSim/.updated) ]]; then
echo "copying cubesatsim.service"
sudo cp systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service
FLAG=1
else
echo "no changes to cubesatsim.service"
fi
if [[ $(grep 'rpitx.service' /home/pi/CubeSatSim/.updated) ]]; then
echo "copying rpitx.service"
sudo cp systemd/rpitx.service /etc/systemd/system/rpitx.service
FLAG=1
else
echo "no changes to rpitx.service"
fi
if [ $FLAG -eq 1 ]; then
echo "systemctl daemon-reload"
sudo systemctl daemon-reload
else
echo "systemctl restart cubesatsim"
sudo systemctl restart cubesatsim
fi
Loading…
Cancel
Save

Powered by TurnKey Linux.