Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
2e637ce
Added basic HABPack support, LoRa only
daveake May 9, 2018
09feda4
Added basic HABPack support, LoRa only
daveake May 9, 2018
8d53901
Support for Python camera script
daveake Jun 3, 2018
335a355
Quick tidy
daveake Jun 3, 2018
def91e5
L80 support
daveake Sep 7, 2018
30943ab
Added support for RTTY via LoRa module
Sep 26, 2018
482f263
Added support for RTTY via LoRa module
Sep 26, 2018
b2b3f8c
Tidy
daveake Sep 27, 2018
e13ee0e
Tidy
daveake Sep 27, 2018
61d8073
Tidy
daveake Sep 27, 2018
c84af87
Minor updates
daveake Nov 21, 2018
5a6c307
Added support for MS5611 pressure/temperature sensor
daveake Nov 21, 2018
37fbd29
Added support for V1 and V2 Strobon LEDs
daveake Nov 22, 2018
cb415ad
Support for Strobon LEDs
daveake Nov 22, 2018
701f264
Added piezo buzzer support
daveake Nov 22, 2018
5787df6
SSDV Uplink fixes; LoRa RTTY fix
daveake Nov 30, 2018
9ab9fc7
Added take_photo.sample as documented for gphoto2 usage
daveake Dec 4, 2018
209b562
Minor change to MS5611 to work on old compilers
daveake Dec 6, 2018
1f6400b
Fixed calling mode
daveake Jan 23, 2019
3f10e4d
Cache writes to log files
daveake May 9, 2019
0ae06ce
Send prediction payload before actual payload
daveake May 9, 2019
5f0fb32
Fixed CRC check for replaying GPS file
daveake Jul 7, 2019
a39da4d
Fixed CRC check for replaying GPS file
daveake Jul 7, 2019
db0b364
Fixed CRC check for replaying GPS file
daveake Jul 7, 2019
8058a77
Fix warnings from gcc in Raspbian Buster
daveake Jul 8, 2019
5bdc539
Fix warnings from gcc in Raspbian Buster
daveake Jul 8, 2019
8308a86
Fixed AV for cold start GPS when replaying NMEA file
daveake Jul 14, 2019
ff290de
Fixed startup error where all logging disabled; fixed error in LoRa R…
daveake Jul 23, 2019
433d535
UBlox pedestrian mode
daveake Aug 27, 2019
0283f66
UBlox pedestrian mode
daveake Aug 27, 2019
ded59f8
No null packets in mode 0 for missing camera
daveake Feb 14, 2020
b5124fb
Fixed bug where GPU temperature only read once
daveake Mar 2, 2020
9e3f67f
Fixed bug where GPU temperature only read once
daveake Mar 2, 2020
d9f1a02
Cutdown with uplink
daveake Jan 4, 2021
ae1262e
Extend uplink options
daveake Jan 21, 2021
c01c100
Fixed SSDV wraparound of image number
daveake Apr 20, 2021
243b7b9
Fixed bug that killed RTTY if no cutdown pin configured
daveake Jun 6, 2021
fa78a6a
Add LoRa calling mode options
geftactics Oct 14, 2021
9acbc81
Link to LoRa calling mode
geftactics Oct 14, 2021
00f11fa
Merge pull request #44 from geftactics/patch-3
PiInTheSky Oct 16, 2021
13028b7
Updates to replace depracated stime, and remove errors in gcc 7
daveake May 6, 2022
ec47715
Updates to replace depracated stime, and remove errors in gcc 7
daveake May 6, 2022
3b755c5
First commit to add EnableADCVolt option
KevWal Aug 4, 2022
20fc24b
Main commit to add EnableADCVolt option
KevWal Aug 4, 2022
2edb4a1
Pre Test commit to add EnableADCVolt option
KevWal Aug 4, 2022
83c9de8
Final commit to add EnableADCVolt option
KevWal Aug 4, 2022
290e928
Added GPS example flight files for use by gps_source= option
KevWal Aug 4, 2022
1a90104
Added GPS example flight files for use by gps_source= option
KevWal Aug 4, 2022
5330d2b
Added MOTD, changed startup to rc.local and Screen
KevWal Aug 4, 2022
e63b1b9
Added boot/pisky.current.txt as link to /boot/pisky.txt
KevWal Aug 4, 2022
b708470
Added boot/pisky.documented.txt aligned with original pisky.txt
KevWal Aug 4, 2022
fdd9297
Updated README for all commits so far
KevWal Aug 4, 2022
be2d71e
Adding boot cmdline.txt and config.txt files
KevWal Aug 6, 2022
b9a13a3
Add logging for the camera script to camera.txt
KevWal Aug 15, 2022
3499231
Changed links to copies of files in /boot
KevWal Aug 15, 2022
4cbe185
Changed links to copies of files in /boot
KevWal Aug 15, 2022
989e523
Adding Git pre-commit
KevWal Aug 16, 2022
3b88421
Merge pull request #46 from KevWal/develop
PiInTheSky Aug 17, 2022
f300e1f
Revert "Add Enable_ADC_Volt to force enabling the ADC."
PiInTheSky Aug 21, 2022
7042535
Merge pull request #47 from PiInTheSky/revert-46-develop
PiInTheSky Aug 21, 2022
52b620b
Added fieldlist option
daveake Sep 21, 2022
1d036bd
V1.9.1 - Support for external camera
daveake Oct 10, 2022
9857507
Added support for new Pi camera software
daveake Jun 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tracker/tracker
tracker/download
tracker/keep
tracker/ssdv_done_*
tracker/coonvert_*
tracker/convert_*
tracker/tweets.log
tracker/webstuff.py
tracker/batc
Expand All @@ -18,7 +18,8 @@ tracker/ex_*
*.old
telemetry.txt
gps.txt
take*
prediction.txt
take_pic*
convert*
*.bin
accelcal.txt
Expand Down
594 changes: 363 additions & 231 deletions README.md

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions boot/pisky.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ payload=CHANGEME
disable_monitor=N
frequency=434.250
baud=300
camera=Y
camera=R
low_width=320
low_height=240
high=2000
Expand All @@ -15,11 +15,13 @@ adc_vmax=18.5
logging=GPS,Telemetry
Disable_RTTY=N
info_messages=2
Send_Field_List=N

full_low_width=640
full_low_height=480
full_high_width=2592
full_high_height=1944
# 0 in either of the following tells the software to use full resolution from the Pi camera
full_high_width=0
full_high_height=0
full_image_period=60

#APRS_Callsign=CHANGE
Expand All @@ -30,8 +32,11 @@ APRS_Random=5
#LORA_Frequency_0=434.225
#LORA_Payload_0=CHANGEME
#LORA_Mode_0=0
#LORA_Calling_Frequency_0=433.650
#LORA_Calling_Count_0=5

#LORA_Frequency_1=434.275
#LORA_Payload_1=CHANGEME
#LORA_Mode_1=1

#LORA_Calling_Frequency_1=433.650
#LORA_Calling_Count_1=5
5 changes: 3 additions & 2 deletions tracker/DS18B20.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ void *DS18B20Loop(void *some_void_ptr)
int SensorCount;

GPS = (struct TGPS *)some_void_ptr;

GPS->DS18B20Count = 0;

while (1)
{
Expand All @@ -38,7 +40,7 @@ void *DS18B20Loop(void *some_void_ptr)
{
if ((dp->d_name[0] != 'W') && (dp->d_name[2] == '-'))
{
sprintf(filename, "%s/%s/w1_slave", folder, dp->d_name);
sprintf(filename, "%.40s/%.30s/w1_slave", folder, dp->d_name);
if ((fp = fopen(filename, "r")) != NULL)
{
// 44 02 4b 46 7f ff 0c 10 ee : crc=ee YES
Expand Down Expand Up @@ -85,7 +87,6 @@ void *DS18B20Loop(void *some_void_ptr)
fscanf (fp, "%lf", &T);
GPS->DS18B20Temperature[0] = T / 1000;
// printf ("GPU temperature is %6.3f C.\n", GPS->DS18B20Temperature[0]);
GPS->DS18B20Count = 1;
fclose (fp);
}
}
Expand Down
229 changes: 229 additions & 0 deletions tracker/MS5611.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <linux/i2c-dev.h>
#include <fcntl.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <errno.h>
#include <wiringPi.h>
#include <wiringPiI2C.h>
#include <inttypes.h>

#include "gps.h"
#include "misc.h"
#include "MS5611.h"

#define MS5611_ADDRESS 0x77

#define MS5611_CMD_ADC_READ 0x00
#define MS5611_CMD_RESET 0x1E
#define MS5611_CMD_CONV_D1 0x40
#define MS5611_CMD_CONV_D2 0x50
#define MS5611_CMD_READ_PROM 0xA2

#define MS5611_ULTRA_HIGH_RES 0x08
#define MS5611_HIGH_RES 0x06
#define MS5611_STANDARD 0x04
#define MS5611_LOW_POWER 0x02
#define MS5611_ULTRA_LOW_POWER 0x00

void ms5611WriteRegister(int fd, int Value)
{
unsigned char buf[1];

buf[0] = Value;

if ((write(fd, buf, 1)) != 1)
{
printf("Error writing to MS5611\n");
}
}

uint16_t ms5611ReadRegister16(int fd, uint8_t address)
{
unsigned char buf[2];

buf[0] = address;

if ((write(fd, buf, 1)) != 1) { // Send register we want to read from
printf("Error writing to i2c slave\n");
return -1;
}

if (read(fd, buf, 2) != 2) { // Read back data into buf[]
printf("Unable to read from slave\n");
return -1;
}

return (uint16_t) buf[0]<<8 | buf[1];
}

int32_t ms5611ReadRegister24(int fd, uint8_t address)
{
unsigned char buf[3];

buf[0] = address;

// Send register we want to read from
if ((write(fd, buf, 1)) != 1)
{
printf("Error writing to i2c slave\n");
return -1;
}

// Read back data into buf[]
if (read(fd, buf, 3) != 3)
{
printf("Unable to read from slave\n");
return -1;
}

return (int32_t) buf[0]<<16 | buf[1]<<8 | buf[2];
}

void ms5611ReadPROM(int fd, uint16_t *fc)
{
uint8_t offset;

for (offset = 0; offset < 6; offset++)
{
fc[offset] = ms5611ReadRegister16(fd, MS5611_CMD_READ_PROM + (offset * 2));
}
}

uint32_t ms5611ReadRawTemperature(int fd)
{
ms5611WriteRegister(fd, MS5611_CMD_CONV_D2 + MS5611_ULTRA_HIGH_RES);

delay(10);

return ms5611ReadRegister24(fd, MS5611_CMD_ADC_READ);
}

uint32_t ms5611ReadRawPressure(int fd)
{
ms5611WriteRegister(fd, MS5611_CMD_CONV_D1 + MS5611_ULTRA_HIGH_RES);

delay(10);

return ms5611ReadRegister24(fd, MS5611_CMD_ADC_READ);
}

double ms5611ReadTemperature(int fd, uint16_t *fc, int compensation)
{
uint32_t D2;
int32_t dT, TEMP, TEMP2;

D2 = ms5611ReadRawTemperature(fd);
dT = D2 - (uint32_t)fc[4] * 256;
TEMP = 2000 + ((int64_t) dT * fc[5]) / 8388608;
TEMP2 = 0;

if (compensation)
{
if (TEMP < 2000)
{
TEMP2 = (dT * dT) / (2 << 30);
}
}

TEMP = TEMP - TEMP2;

return ((double)TEMP/100);
}


double ms5611ReadPressure(int fd, uint16_t *fc, int compensation)
{
uint32_t D1, D2;
int32_t dT;
int64_t OFF, SENS, TEMP3;

D1 = ms5611ReadRawPressure(fd);

D2 = ms5611ReadRawTemperature(fd);

dT = D2 - (uint32_t)fc[4] * 256;

OFF = (int64_t)fc[1] * 65536 + (int64_t)fc[3] * dT / 128;

SENS = (int64_t)fc[0] * 32768 + (int64_t)fc[2] * dT / 256;

if (compensation)
{
int32_t TEMP;
int64_t OFF2, SENS2;

TEMP = 2000 + ((int64_t) dT * fc[5]) / 8388608;

OFF2 = 0;
SENS2 = 0;

if (TEMP < 2000)
{
OFF2 = 5 * ((TEMP - 2000) * (TEMP - 2000)) / 2;
SENS2 = 5 * ((TEMP - 2000) * (TEMP - 2000)) / 4;
}

if (TEMP < -1500)
{
OFF2 = OFF2 + 7 * ((TEMP + 1500) * (TEMP + 1500));
SENS2 = SENS2 + 11 * ((TEMP + 1500) * (TEMP + 1500)) / 2;
}

OFF = OFF - OFF2;
SENS = SENS - SENS2;
}

TEMP3 = (D1 * SENS) / 2097152 - OFF;

return (double)TEMP3 / 327680.0;
}

void *MS5611Loop(void *some_void_ptr)
{
struct TGPS *GPS;
int fd;
uint16_t fc[6];

GPS = (struct TGPS *)some_void_ptr;

// Initialise BMP085
if ((fd = open_i2c(MS5611_ADDRESS)) >= 0)
{
printf("MS6511 found OK\n");

// Reset device
ms5611WriteRegister(fd, MS5611_CMD_RESET);

delay(100);

ms5611ReadPROM(fd, fc);

close(fd);

while (1)
{
if ((fd = open_i2c(MS5611_ADDRESS)) >= 0)
{
GPS->BMP180Temperature = ms5611ReadTemperature(fd, fc, 1);
GPS->Pressure = ms5611ReadPressure(fd, fc, GPS->BMP180Temperature);

printf("**** Temperature is %5.2lf\n", GPS->BMP180Temperature);
printf("**** Pressure is %5.2lf\n", GPS->Pressure);

close(fd);
}

sleep(10);
}
}
return 0;
}

1 change: 1 addition & 0 deletions tracker/MS5611.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
void *MS5611Loop(void *some_void_ptr);
3 changes: 2 additions & 1 deletion tracker/aprs.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ void SendAPRS(struct TGPS *GPS)
{
char s[10];

sprintf(s, strncpy(s, Config.APRS_Callsign, 7));
strncpy(s, Config.APRS_Callsign, 7);
s[7] = '\0';
if(Config.APRS_ID) snprintf(s + strlen(s), 4, "-%i", Config.APRS_ID);

// Transmit telemetry definitions
Expand Down
Loading