diff --git a/Makefile b/Makefile
index 6b5d00dc..a545bd17 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,13 @@
+all: DEBUG_BEHAVIOR=
all: libax5043.a
all: radioafsk
all: radiocw
+debug: DEBUG_BEHAVIOR = -DDEBUG_LOGGING
+debug: libax5043.a
+debug: radioafsk
+debug: radiocw
+
rebuild: clean
rebuild: all
@@ -44,67 +50,73 @@ libax5043.a: ax5043/spi/ax5043spi.o
radiochat: libax5043.a
radiochat: chat/chat_main.o
- gcc -o radiochat -pthread -L./ chat/chat_main.o -lwiringPi -lax5043
+ gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o radiochat -pthread -L./ chat/chat_main.o -lwiringPi -lax5043
radiocw: libax5043.a
radiocw: cw/cw_main.o
radiocw: afsk/ax25.o
radiocw: afsk/ax5043.o
radiocw: afsk/send_afsk.o
- gcc -o radiocw -L./ afsk/ax25.o afsk/ax5043.o afsk/send_afsk.o cw/cw_main.o -lwiringPi -lax5043
+ gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o radiocw -L./ afsk/ax25.o afsk/ax5043.o afsk/send_afsk.o cw/cw_main.o -lwiringPi -lax5043
radiopiglatin: libax5043.a
radiopiglatin: piglatin/piglatin_main.o
- gcc -o radiopiglatin -pedantic -Wall -Wextra -L./ piglatin/piglatin_main.o -lwiringPi -lax5043
+ gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o radiopiglatin -pedantic -Wall -Wextra -L./ piglatin/piglatin_main.o -lwiringPi -lax5043
testax5043tx: libax5043.a
testax5043tx: transmit/transmit_main.o
- gcc -o testax5043tx -pedantic -Wall -Wextra -L./ transmit/transmit_main.o -lwiringPi -lax5043
+ gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o testax5043tx -pedantic -Wall -Wextra -L./ transmit/transmit_main.o -lwiringPi -lax5043
testax5043rx: libax5043.a
testax5043rx: receive/receive_main.o
- gcc -o testax5043rx -pedantic -Wall -Wextra -L./ receive/receive_main.o -lwiringPi -lax5043
+ gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o testax5043rx -pedantic -Wall -Wextra -L./ receive/receive_main.o -lwiringPi -lax5043
testax5043init: libax5043.a
testax5043init: init/init_main.o
- gcc -o testax5043init -pedantic -Wall -Wextra -L./ init/init_main.o -lwiringPi -lax5043
+ gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o testax5043init -pedantic -Wall -Wextra -L./ init/init_main.o -lwiringPi -lax5043
testax50432freq: libax5043.a
testax50432freq: transmit2freq/transmit2freq_main.o
- gcc -o testax50432freq -pedantic -Wall -Wextra -L./ transmit2freq/transmit2freq_main.o -lwiringPi -lax5043
+ gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o testax50432freq -pedantic -Wall -Wextra -L./ transmit2freq/transmit2freq_main.o -lwiringPi -lax5043
testafsktx: libax5043.a
testafsktx: afsktx/ax25.o
testafsktx: afsktx/ax5043.o
testafsktx: afsktx/main.o
- gcc -o testafsktx -pedantic -Wall -Wextra -L./ afsktx/ax25.o afsktx/ax5043.o afsktx/main.o -lwiringPi -lax5043
+ gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o testafsktx -pedantic -Wall -Wextra -L./ afsktx/ax25.o afsktx/ax5043.o afsktx/main.o -lwiringPi -lax5043
radioafsk: libax5043.a
radioafsk: afsk/ax25.o
radioafsk: afsk/ax5043.o
radioafsk: afsk/main.o
radioafsk: afsk/ina219.h
- gcc -o radioafsk -pedantic -Wall -Wextra -L./ afsk/ax25.o afsk/ax5043.o afsk/main.o -lwiringPi -lax5043
+radioafsk: Adafruit_INA219/Adafruit_INA219.o
+radioafsk: Adafruit_INA219/Adafruit_INA219.h
+ gcc $(DEBUG_BEHAVIOR) -o radioafsk -pedantic -Wall -Wextra -L./ afsk/ax25.o afsk/ax5043.o afsk/main.o Adafruit_INA219/Adafruit_INA219.o -lwiringPi -lax5043
+
+Adafruit_INA219/Adafruit_INA219.o: Adafruit_INA219/Adafruit_INA219.c
+Adafruit_INA219/Adafruit_INA219.o: Adafruit_INA219/Adafruit_INA219.h
+ cd Adafruit_INA219; gcc $(DEBUG_BEHAVIOR) -I -pedantic -Wconversion -Wall -Wextra -c Adafruit_INA219.c; cd ..
ax5043/generated/configcommon.o: ax5043/generated/configcommon.c
ax5043/generated/configcommon.o: ax5043/generated/configrx.h
ax5043/generated/configcommon.o: ax5043/generated/configtx.h
ax5043/generated/configcommon.o: ax5043/axradio/axradioinit.h
ax5043/generated/configcommon.o: ax5043/axradio/axradioinit_p.h
- cd ax5043/generated; gcc -pedantic -Wall -Wextra -c configcommon.c
+ cd ax5043/generated; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c configcommon.c
ax5043/generated/configrx.o: ax5043/generated/configrx.c
ax5043/generated/configrx.o: ax5043/generated/configrx.h
ax5043/generated/configrx.o: ax5043/axradio/axradioinit.h
ax5043/generated/configrx.o: ax5043/axradio/axradioinit_p.h
- cd ax5043/generated; gcc -pedantic -Wall -Wextra -c configrx.c
+ cd ax5043/generated; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c configrx.c
ax5043/generated/configtx.o: ax5043/generated/configtx.c
ax5043/generated/configtx.o: ax5043/generated/configtx.h
ax5043/generated/configtx.o: ax5043/axradio/axradioinit.h
ax5043/generated/configtx.o: ax5043/axradio/axradioinit_p.h
- cd ax5043/generated; gcc -pedantic -Wall -Wextra -c configtx.c
+ cd ax5043/generated; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c configtx.c
ax5043/generated/config.o: ax5043/generated/config.c
ax5043/generated/config.o: ax5043/generated/config.h
@@ -113,12 +125,12 @@ ax5043/generated/config.o: ax5043/axradio/axradioinit_p.h
ax5043/generated/config.o: ax5043/spi/ax5043spi.h
ax5043/generated/config.o: ax5043/spi/ax5043spi_p.h
ax5043/generated/config.o: ax5043/crc/crc.h
- cd ax5043/generated; gcc -pedantic -Wall -Wextra -c config.c
+ cd ax5043/generated; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c config.c
ax5043/spi/ax5043spi.o: ax5043/spi/ax5043spi.c
ax5043/spi/ax5043spi.o: ax5043/spi/ax5043spi.h
ax5043/spi/ax5043spi.o: ax5043/spi/ax5043spi_p.h
- cd ax5043/spi; gcc -pedantic -Wall -Wextra -c ax5043spi.c
+ cd ax5043/spi; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c ax5043spi.c
ax5043/ax5043support/ax5043init.o: ax5043/ax5043support/ax5043init.c
ax5043/ax5043support/ax5043init.o: ax5043/ax5043support/ax5043init.h
@@ -126,7 +138,7 @@ ax5043/ax5043support/ax5043init.o: ax5043/axradio/axradioinit.h
ax5043/ax5043support/ax5043init.o: ax5043/axradio/axradioinit_p.h
ax5043/ax5043support/ax5043init.o: ax5043/spi/ax5043spi.h
ax5043/ax5043support/ax5043init.o: ax5043/spi/ax5043spi_p.h
- cd ax5043/ax5043support; gcc -pedantic -Wall -Wextra -c ax5043init.c
+ cd ax5043/ax5043support; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c ax5043init.c
ax5043/ax5043support/ax5043rx.o: ax5043/ax5043support/ax5043rx.c
ax5043/ax5043support/ax5043rx.o: ax5043/ax5043support/ax5043rx.h
@@ -134,7 +146,7 @@ ax5043/ax5043support/ax5043rx.o: ax5043/axradio/axradioinit.h
ax5043/ax5043support/ax5043rx.o: ax5043/axradio/axradioinit_p.h
ax5043/ax5043support/ax5043rx.o: ax5043/spi/ax5043spi.h
ax5043/ax5043support/ax5043rx.o: ax5043/spi/ax5043spi_p.h
- cd ax5043/ax5043support; gcc -pedantic -Wall -Wextra -c ax5043rx.c
+ cd ax5043/ax5043support; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c ax5043rx.c
ax5043/ax5043support/ax5043tx.o: ax5043/ax5043support/ax5043tx.c
ax5043/ax5043support/ax5043tx.o: ax5043/ax5043support/ax5043tx.h
@@ -142,7 +154,7 @@ ax5043/ax5043support/ax5043tx.o: ax5043/axradio/axradioinit.h
ax5043/ax5043support/ax5043tx.o: ax5043/axradio/axradioinit_p.h
ax5043/ax5043support/ax5043tx.o: ax5043/spi/ax5043spi.h
ax5043/ax5043support/ax5043tx.o: ax5043/spi/ax5043spi_p.h
- cd ax5043/ax5043support; gcc -pedantic -Wall -Wextra -c ax5043tx.c
+ cd ax5043/ax5043support; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c ax5043tx.c
ax5043/axradio/axradioinit.o: ax5043/axradio/axradioinit.c
ax5043/axradio/axradioinit.o: ax5043/axradio/axradioinit.h
@@ -152,7 +164,7 @@ ax5043/axradio/axradioinit.o: ax5043/spi/ax5043spi.h
ax5043/axradio/axradioinit.o: ax5043/spi/ax5043spi_p.h
ax5043/axradio/axradioinit.o: ax5043/generated/config.h
ax5043/axradio/axradioinit.o: ax5043/crc/crc.h
- cd ax5043/axradio; gcc -pedantic -Wall -Wextra -c axradioinit.c
+ cd ax5043/axradio; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c axradioinit.c
ax5043/axradio/axradiomode.o: ax5043/axradio/axradiomode.c
ax5043/axradio/axradiomode.o: ax5043/axradio/axradiomode.h
@@ -162,7 +174,7 @@ ax5043/axradio/axradiomode.o: ax5043/axradio/axradioinit_p.h
ax5043/axradio/axradiomode.o: ax5043/spi/ax5043spi.h
ax5043/axradio/axradiomode.o: ax5043/spi/ax5043spi_p.h
ax5043/axradio/axradiomode.o: ax5043/generated/config.h
- cd ax5043/axradio; gcc -pedantic -Wall -Wextra -c axradiomode.c
+ cd ax5043/axradio; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c axradiomode.c
ax5043/axradio/axradiorx.o: ax5043/axradio/axradiorx.c
ax5043/axradio/axradiorx.o: ax5043/axradio/axradiorx.h
@@ -172,7 +184,7 @@ ax5043/axradio/axradiorx.o: ax5043/axradio/axradioinit.h
ax5043/axradio/axradiorx.o: ax5043/axradio/axradioinit_p.h
ax5043/axradio/axradiorx.o: ax5043/spi/ax5043spi.h
ax5043/axradio/axradiorx.o: ax5043/spi/ax5043spi_p.h
- cd ax5043/axradio; gcc -pedantic -Wall -Wextra -c axradiorx.c
+ cd ax5043/axradio; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c axradiorx.c
ax5043/axradio/axradiotx.o: ax5043/axradio/axradiotx.c
ax5043/axradio/axradiotx.o: ax5043/axradio/axradiotx.h
@@ -186,11 +198,11 @@ ax5043/axradio/axradiotx.o: ax5043/generated/config.h
ax5043/axradio/axradiotx.o: ax5043/axradio/axradiomode.h
ax5043/axradio/axradiotx.o: ax5043/axradio/axradiomode_p.h
ax5043/axradio/axradiotx.o: ax5043/crc/crc.h
- cd ax5043/axradio; gcc -pedantic -Wall -Wextra -c axradiotx.c
+ cd ax5043/axradio; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c axradiotx.c
ax5043/crc/crc.o: ax5043/crc/crc.c
ax5043/crc/crc.o: ax5043/crc/crc.h
- cd ax5043/crc; gcc -pedantic -Wall -Wextra -c crc.c
+ cd ax5043/crc; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c crc.c
chat/chat_main.o: chat/chat_main.c
chat/chat_main.o: ax5043/spi/ax5043spi.h
@@ -204,13 +216,13 @@ chat/chat_main.o: ax5043/axradio/axradiorx_p.h
chat/chat_main.o: ax5043/axradio/axradiotx.h
chat/chat_main.o: ax5043/axradio/axradiotx_p.h
chat/chat_main.o: ax5043/generated/configtx.h
- cd chat; gcc -I../ax5043 -pedantic -Wconversion -Wall -Wextra -c chat_main.c; cd ..
+ cd chat; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I../ax5043 -pedantic -Wconversion -Wall -Wextra -c chat_main.c; cd ..
afsk/ax25.o: afsk/ax25.c
afsk/ax25.o: afsk/ax25.h
afsk/ax25.o: afsk/ax5043.h
afsk/ax25.o: afsk/status.h
- cd afsk; gcc -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c ax25.c; cd ..
+ cd afsk; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c ax25.c; cd ..
afsk/ax5043.o: afsk/ax5043.c
afsk/ax5043.o: afsk/ax25.h
@@ -219,21 +231,21 @@ afsk/ax5043.o: afsk/status.h
afsk/ax5043.o: afsk/utils.h
afsk/ax5043.o: afsk/main.c
afsk/ax5043.o: ax5043/spi/ax5043spi.h
- cd afsk; gcc -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c ax5043.c; cd ..
+ cd afsk; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c ax5043.c; cd ..
afsk/main.o: afsk/main.c
afsk/main.o: afsk/status.h
afsk/main.o: afsk/ax5043.h
afsk/main.o: afsk/ax25.h
afsk/main.o: ax5043/spi/ax5043spi.h
- cd afsk; gcc -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c main.c; cd ..
+ cd afsk; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c main.c; cd ..
afsk/send_afsk.o: afsk/send_afsk.c
afsk/send_afsk.o: afsk/send_afsk.h
afsk/send_afsk.o: afsk/status.h
afsk/send_afsk.o: afsk/ax5043.h
afsk/send_afsk.o: afsk/ax25.h
- cd afsk; gcc -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c send_afsk.c; cd ..
+ cd afsk; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c send_afsk.c; cd ..
cw/cw_main.o: cw/cw_main.c
cw/cw_main.o: ax5043/spi/ax5043spi.h
@@ -247,7 +259,7 @@ cw/cw_main.o: ax5043/axradio/axradiorx_p.h
cw/cw_main.o: ax5043/axradio/axradiotx.h
cw/cw_main.o: ax5043/axradio/axradiotx_p.h
cw/cw_main.o: ax5043/generated/configtx.h
- cd cw; gcc -I../ax5043 -pedantic -Wconversion -Wall -Wextra -c cw_main.c; cd ..
+ cd cw; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I../ax5043 -pedantic -Wconversion -Wall -Wextra -c cw_main.c; cd ..
piglatin/piglatin_main.o: piglatin/piglatin_main.c
piglatin/piglatin_main.o: ax5043/spi/ax5043spi.h
@@ -261,7 +273,7 @@ piglatin/piglatin_main.o: ax5043/axradio/axradiorx_p.h
piglatin/piglatin_main.o: ax5043/axradio/axradiotx.h
piglatin/piglatin_main.o: ax5043/axradio/axradiotx_p.h
piglatin/piglatin_main.o: ax5043/generated/configtx.h
- cd piglatin; gcc -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c piglatin_main.c; cd ..
+ cd piglatin; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c piglatin_main.c; cd ..
receive/receive_main.o: receive/receive_main.c
receive/receive_main.o: ax5043/axradio/axradioinit.h
@@ -273,7 +285,7 @@ receive/receive_main.o: ax5043/axradio/axradiomode_p.h
receive/receive_main.o: ax5043/axradio/axradiorx.h
receive/receive_main.o: ax5043/axradio/axradiorx_p.h
receive/receive_main.o: ax5043/generated/configrx.h
- cd receive; gcc -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c receive_main.c; cd ..
+ cd receive; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c receive_main.c; cd ..
transmit/transmit_main.o: transmit/transmit_main.c
transmit/transmit_main.o: ax5043/axradio/axradioinit.h
@@ -285,7 +297,7 @@ transmit/transmit_main.o: ax5043/axradio/axradiomode_p.h
transmit/transmit_main.o: ax5043/axradio/axradiotx.h
transmit/transmit_main.o: ax5043/axradio/axradiotx_p.h
transmit/transmit_main.o: ax5043/generated/configtx.h
- cd transmit; gcc -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c transmit_main.c; cd ..
+ cd transmit; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c transmit_main.c; cd ..
transmit2freq/transmit2freq_main.o: transmit2freq/transmit2freq_main.c
transmit2freq/transmit2freq_main.o: ax5043/axradio/axradioinit.h
@@ -297,20 +309,20 @@ transmit2freq/transmit2freq_main.o: ax5043/axradio/axradiomode_p.h
transmit2freq/transmit2freq_main.o: ax5043/axradio/axradiotx.h
transmit2freq/transmit2freq_main.o: ax5043/axradio/axradiotx_p.h
transmit2freq/transmit2freq_main.o: ax5043/generated/configtx.h
- cd transmit2freq; gcc -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c transmit2freq_main.c; cd ..
+ cd transmit2freq; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c transmit2freq_main.c; cd ..
init/init_main.o: init/init_main.c
init/init_main.o: ax5043/axradio/axradioinit.h
init/init_main.o: ax5043/axradio/axradioinit_p.h
init/init_main.o: ax5043/spi/ax5043spi.h
init/init_main.o: ax5043/spi/ax5043spi_p.h
- cd init; gcc -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c init_main.c; cd ..
+ cd init; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c init_main.c; cd ..
afsktx/ax25.o: afsktx/ax25.c
afsktx/ax25.o: afsktx/ax25.h
afsktx/ax25.o: afsktx/ax5043.h
afsktx/ax25.o: afsktx/status.h
- cd afsktx; gcc -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c ax25.c; cd ..
+ cd afsktx; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c ax25.c; cd ..
afsktx/ax5043.o: afsktx/ax5043.c
afsktx/ax5043.o: afsktx/ax25.h
@@ -318,11 +330,11 @@ afsktx/ax5043.o: afsktx/ax5043.h
afsktx/ax5043.o: afsktx/status.h
afsktx/ax5043.o: afsktx/utils.h
afsktx/ax5043.o: ax5043/spi/ax5043spi.h
- cd afsktx; gcc -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c ax5043.c; cd ..
+ cd afsktx; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c ax5043.c; cd ..
afsktx/main.o: afsktx/main.c
afsktx/main.o: afsktx/status.h
afsktx/main.o: afsktx/ax5043.h
afsktx/main.o: afsktx/ax25.h
afsktx/main.o: ax5043/spi/ax5043spi.h
- cd afsktx; gcc -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c main.c; cd ..
+ cd afsktx; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c main.c; cd ..
diff --git a/afsk/ax5043.c b/afsk/ax5043.c
index 8ed001f5..f8c3b2e9 100644
--- a/afsk/ax5043.c
+++ b/afsk/ax5043.c
@@ -1071,7 +1071,9 @@ int ax5043_wait_for_transmit() {
/* tx is done */
__tx_frame_end(__ax5043_conf);
transmittedPostamble = 0;
- printf("INFO: TX done\n");
+ #ifdef DEBUG_LOGGING
+ printf("INFO: TX done\n");
+ #endif
return PQWS_SUCCESS;
}
@@ -1130,7 +1132,9 @@ int ax5043_wait_for_transmit() {
if (radiostate == 0) {
/* tx is done */
__tx_active = 0;
- printf("INFO: TX done\n");
+ #ifdef DEBUG_LOGGING
+ printf("INFO: TX done\n");
+ #endif
}
}
}
diff --git a/afsk/main.c b/afsk/main.c
index 58f90813..af9bdabd 100644
--- a/afsk/main.c
+++ b/afsk/main.c
@@ -19,10 +19,7 @@
* along with this program. If not, see .
*/
-//#include //Needed for I2C port
#include //Needed for I2C port
-//#include //Needed for I2C port
-
#include
#include
#include
@@ -34,11 +31,9 @@
#include
#include
#include
-#include "ina219.h"
#include
-
-
-#define CALLSIGN "" // Put your callsign here!
+#include "../Adafruit_INA219/Adafruit_INA219.h"
+/*
#define VBATT 15
#define ADC5 17
#define ADC6 18
@@ -47,22 +42,33 @@
#define TIME 8
#define UCTEMP 30
#define UPTIME_SEC 8
+*/
#define A 1
#define B 2
#define C 3
#define D 4
-
+/*
#define SENSOR_40 0
#define SENSOR_41 3
#define SENSOR_44 6
#define SENSOR_45 9
#define SENSOR_4A 12
#define VOLTAGE 0
-#define CURRENT 1
+#define CURRENTV 1
#define POWER 2
+*/
#define VBATT 15
-
-uint32_t tx_freq_hz = 440310000;
+#define PLUS_X 0
+#define PLUS_Y 1
+#define PLUS_Z 2
+#define BAT 3
+#define MINUS_X 4
+#define MINUS_Y 5
+#define MINUS_Z 6
+#define BUS 7
+#define OFF -1
+
+uint32_t tx_freq_hz = 434900000 + FREQUENCY_OFFSET;
uint32_t tx_channel = 0;
ax5043_conf_t hax5043;
@@ -73,6 +79,16 @@ int get_tlm(int tlm[][5]);
long int timestamp;
void config_x25();
void trans_x25();
+void setCalibration_32V_2A(int fd);
+void setCalibration_32V_1A(int fd);
+void setCalibration_16V_400mA(int fd);
+void setCalibration_16V_2A(int fd);
+float getBusVoltage_V(int fd);
+float getShuntVoltage_mV(int fd);
+float getCurrent_mA(int fd);
+float getPower_mW(int fd);
+void powerSave(int fd, int on);
+
//long int timestamp;
int tempSensor;
@@ -80,12 +96,12 @@ int upper_digit(int number);
int lower_digit(int number);
int charging = 0;
-uint16_t config = (0x2000 | 0x1800 | 0x0180 | 0x0018 | 0x0007 );
+uint16_t x_config = (0x2000 | 0x1800 | 0x0180 | 0x0018 | 0x0007 );
int x_fd; // I2C bus 0 address 0x40
int x_powerMultiplier;
int x_currentDivider;
-int x_calValue;
+int x_calValue_x;
int y_fd; // I2C bus 0 address 0x41
int z_fd; // I2C bos 0 address 0x44
@@ -126,7 +142,19 @@ struct SensorData read_sensor_data(int sensor) {
return data;
}
-int main(void) {
+int sensor[8]; // 7 current sensors in Solar Power PCB plus one in MoPower UPS V2
+float voltsBus[8];
+float voltsShunt[8];
+float current[8];
+float power[8];
+char src_addr[5] = "";
+char dest_addr[5] = "CQ";
+
+int main(int argc, char *argv[]) {
+
+ if (argc > 1) {
+ strcpy(src_addr, argv[1]);
+ }
wiringPiSetup () ;
pinMode (0, OUTPUT) ;
@@ -136,179 +164,242 @@ int main(void) {
digitalWrite (0, HIGH) ; delay (500) ;
digitalWrite (0, LOW) ; delay (500) ;
}
- digitalWrite (0, HIGH) ;
-
- setSpiChannel(SPI_CHANNEL);
- setSpiSpeed(SPI_SPEED);
- initializeSpi();
-
- int tlm[7][5];
- memset(tlm, 0, sizeof tlm);
+ digitalWrite (0, HIGH) ;
+
+ setSpiChannel(SPI_CHANNEL);
+ setSpiSpeed(SPI_SPEED);
+ initializeSpi();
- timestamp = time(NULL);
-
- int file_i2c;
- //char *filenam1e = (char*)"/dev/i2c-3";
- if ((file_i2c = open("/dev/i2c-3", O_RDWR)) < 0)
- {
- fprintf(stderr,"ERROR: /dev/ic2-3 bus not present\n");
- tempSensor = -1;
- } else
- {
- tempSensor = wiringPiI2CSetupInterface("/dev/i2c-3", 0x48);
- }
+ int tlm[7][5];
+ memset(tlm, 0, sizeof tlm);
-// fprintf(stderr,"tempSensor: %d \n",tempSensor);
-
- int arduinoI2C;
- if ((arduinoI2C = open("/dev/i2c-0", O_RDWR)) < 0)
- {
- fprintf(stderr,"ERROR: /dev/i2c-0 bus not present\n");
- } else {
- arduinoI2C = wiringPiI2CSetupInterface("/dev/i2c-0", 0x4B);
-// fprintf(stderr,"arduinoI2C: %d\n", arduinoI2C);
- if (arduinoI2C > 0) {
- if(wiringPiI2CReadReg16(arduinoI2C,0) < 0) {
- arduinoI2C = -1; // Disable reading of Arduino payload information
- fprintf(stderr,"Arduino payload not present\n");
- }
- } else {
- fprintf(stderr,"Arduino payload not present\n");
- }
- }
+ timestamp = time(NULL);
-// new INA219 current reading code
+ int file_i2c = access("/dev/i2c-3", W_OK | R_OK);
+ //char *filenam1e = (char*)"/dev/i2c-3";
+ if (file_i2c < 0)
+ {
+ fprintf(stderr,"ERROR: /dev/ic2-3 bus not present\n");
+ tempSensor = OFF;
+ } else
+ {
+ tempSensor = wiringPiI2CSetupInterface("/dev/i2c-3", 0x48);
+ }
- x_calValue = 8192;
+ #ifdef DEBUG_LOGGING
+ fprintf(stderr,"tempSensor: %d \n",tempSensor);
+ #endif
+
+/* start of old master code
+ x_calValue_x = 8192;
x_powerMultiplier = 1;
x_currentDivider = 20;
- config = INA219_CONFIG_BVOLTAGERANGE_16V |
- INA219_CONFIG_GAIN_40MV |
+ x_config = INA219_CONFIG_BVOLTAGERANGE_32V |
+ INA219_CONFIG_GAIN_1_40MV |
INA219_CONFIG_BADCRES_12BIT |
- INA219_CONFIG_SADCRES_12BIT_4S_2130US |
- //INA219_CONFIG_SADCRES_12BIT_1S_532US |
+ // INA219_CONFIG_SADCRES_12BIT_4S_2130US |
+ INA219_CONFIG_SADCRES_12BIT_1S_532US |
INA219_CONFIG_MODE_SANDBVOLT_CONTINUOUS;
if ((file_i2c = open("/dev/i2c-0", O_RDWR)) < 0)
{
fprintf(stderr,"ERROR: /dev/ic2-0 bus not present\n");
- x_fd = -1; // Disable reading -X, -Y, and -Z telemetry
- y_fd = -1;
- z_fd = -1;
+ x_fd = OFF;
+ y_fd = OFF;
+ z_fd = OFF;
} else
{
x_fd = wiringPiI2CSetupInterface("/dev/i2c-0", 0x40);
-// fprintf(stderr,"Opening of -X fd %d\n", x_fd);
y_fd = wiringPiI2CSetupInterface("/dev/i2c-0", 0x41);
-// printf("Opening of -Y fd %d\n", y_fd);
- z_fd = wiringPiI2CSetupInterface("/dev/i2c-0", 0x44);
-// printf("Opening of -Z fd %d\n", z_fd);
- }
-
- int ret;
- uint8_t data[1024];
-
- tx_freq_hz -= tx_channel * 50000;
-
- init_rf();
-
-// ax25_init(&hax25, (uint8_t *) "CubeSatSim", '2', (uint8_t *) CALLSIGN, '2',
- ax25_init(&hax25, (uint8_t *) "CQ", '1', (uint8_t *) CALLSIGN, '1',
- AX25_PREAMBLE_LEN,
- AX25_POSTAMBLE_LEN);
-
-
- /* Infinite loop */
- for (;;) {
- sleep(1);
-
- fprintf(stderr,"INFO: Getting TLM Data\n");
-
- get_tlm(tlm);
-
- fprintf(stderr,"INFO: Preparing X.25 packet\n");
-
- char str[1000];
- char tlm_str[1000];
-
- char header_str[] = "\x03\xf0hi hi ";
- strcpy(str, header_str);
-
- int channel;
- for (channel = 1; channel < 7; channel++) {
-// printf("%d %d %d %d \n", tlm[channel][1], tlm[channel][2], tlm[channel][3], tlm[channel][4]);
- sprintf(tlm_str, "%d%d%d %d%d%d %d%d%d %d%d%d ",
- channel, upper_digit(tlm[channel][1]), lower_digit(tlm[channel][1]),
- channel, upper_digit(tlm[channel][2]), lower_digit(tlm[channel][2]),
- channel, upper_digit(tlm[channel][3]), lower_digit(tlm[channel][3]),
- channel, upper_digit(tlm[channel][4]), lower_digit(tlm[channel][4]));
- printf("%s \n",tlm_str);
- strcat(str, tlm_str);
+ z_fd = wiringPiI2CSetupInterface("/dev/i2c-0", 0x44);
+ #ifdef DEBUG_LOGGING
+ fprintf(stderr, "Opening of -X %d, -Y %d, -Z %d\n", x_fd, y_fd, z_fd);
+ #endif
+ } // moved here
+end of old code */
+ int test;
+ if (((test = open("/dev/i2c-1", O_RDWR))) > 0) // Test if I2C Bus 1 is present
+ {
+ close(test);
+ sensor[PLUS_X] = wiringPiI2CSetupInterface("/dev/i2c-1", 0x40);
+ sensor[PLUS_Y] = wiringPiI2CSetupInterface("/dev/i2c-1", 0x41);
+ sensor[PLUS_Z] = wiringPiI2CSetupInterface("/dev/i2c-1", 0x44);
+ sensor[BAT] = wiringPiI2CSetupInterface("/dev/i2c-1", 0x45);
+ sensor[BUS] = wiringPiI2CSetupInterface("/dev/i2c-1", 0x4a);
+ } else
+ {
+ printf("ERROR: /dev/i2c-1 not present \n");
+ sensor[PLUS_X] = OFF;
+ sensor[PLUS_Y] = OFF;
+ sensor[PLUS_Z] = OFF;
+ sensor[BAT] = OFF;
+ sensor[BUS] = OFF;
}
-
- if (arduinoI2C > 0) { /* Read Arduino payload */
- for(int reg = 0; reg < 4; reg++) {
- sprintf(tlm_str, " %04x",wiringPiI2CReadReg16(arduinoI2C,reg));
- printf("%s \n",tlm_str);
- strcat(str,tlm_str); /* Append payload telemetry */
- usleep(100000);
- }
+ if (((test = open("/dev/i2c-0", O_RDWR))) > 0) // Test if I2C Bus 0 is present
+ {
+ close(test);
+ sensor[MINUS_X] = wiringPiI2CSetupInterface("/dev/i2c-0", 0x40);
+ sensor[MINUS_Y] = wiringPiI2CSetupInterface("/dev/i2c-0", 0x41);
+ sensor[MINUS_Z] = wiringPiI2CSetupInterface("/dev/i2c-0", 0x44);
+
+ } else
+ {
+ printf("ERROR: /dev/i2c-0 not present \n");
+ sensor[MINUS_X] = OFF;
+ sensor[MINUS_Y] = OFF;
+ sensor[MINUS_Z] = OFF;
}
+// } Extra close bracket??
+// } // move up!
+
+// new INA219 current reading code
+/*
+ x_calValue = 8192;
+ x_powerMultiplier = 1;
+ x_currentDivider = 20;
+ x_config = INA219_CONFIG_BVOLTAGERANGE_16V |
+ INA219_CONFIG_GAIN_40MV |
+ INA219_CONFIG_BADCRES_12BIT |
+ INA219_CONFIG_SADCRES_12BIT_4S_2130US |
+ //INA219_CONFIG_SADCRES_12BIT_1S_532US |
+ INA219_CONFIG_MODE_SANDBVOLT_CONTINUOUS;
+
+ file_i2c = access("/dev/i2c-0", W_OK | R_OK);
+ if (file_i2c < 0)
+ {
+ fprintf(stderr,"ERROR: /dev/ic2-0 bus not present\n");
+ x_fd = -1; // Disable reading -X, -Y, and -Z telemetry
+ y_fd = -1;
+ z_fd = -1;
+ } else
+ {
+ x_fd = wiringPiI2CSetupInterface("/dev/i2c-0", 0x40);
+ y_fd = wiringPiI2CSetupInterface("/dev/i2c-0", 0x41);
+ z_fd = wiringPiI2CSetupInterface("/dev/i2c-0", 0x44);
+
+ #ifdef DEBUG_LOGGING
+ fprintf(stderr, "Opening of -X fd %d\n", x_fd);
+ fprintf(stderr, "Opening of -Y fd %d\n", y_fd);
+ fprintf(stderr, "Opening of -Z fd %d\n", z_fd);
+ #endif
+ }
+*/
+ int ret;
+ uint8_t data[1024];
+
+ tx_freq_hz -= tx_channel * 50000;
+
+ init_rf();
- digitalWrite (0, LOW);
-
+ ax25_init(&hax25, (uint8_t *) dest_addr, '1', (uint8_t *) src_addr, '1',
+ AX25_PREAMBLE_LEN,
+ AX25_POSTAMBLE_LEN);
+
+ /* Infinite loop */
+ for (;;) {
+ sleep(1); // Delay 1 second
+
+ #ifdef DEBUG_LOGGING
+ fprintf(stderr,"INFO: Getting TLM Data\n");
+ #endif
+
+ get_tlm(tlm);
+
+ #ifdef DEBUG_LOGGING
+ fprintf(stderr,"INFO: Preparing X.25 packet\n");
+ #endif
+
+ char str[1000];
+ char tlm_str[1000];
+
+ char header_str[] = "\x03\xf0hi hi ";
+ strcpy(str, header_str);
+ // printf("%s-1>CQ-1:hi hi ", CALLSIGN);
+ printf("%s-1>%s-1:hi hi ", (uint8_t *)src_addr, (uint8_t *)dest_addr);
+
+
+ int channel;
+ for (channel = 1; channel < 7; channel++) {
+ sprintf(tlm_str, "%d%d%d %d%d%d %d%d%d %d%d%d ",
+ channel, upper_digit(tlm[channel][1]), lower_digit(tlm[channel][1]),
+ channel, upper_digit(tlm[channel][2]), lower_digit(tlm[channel][2]),
+ channel, upper_digit(tlm[channel][3]), lower_digit(tlm[channel][3]),
+ channel, upper_digit(tlm[channel][4]), lower_digit(tlm[channel][4]));
+ printf("%s",tlm_str);
+ strcat(str, tlm_str);
+ }
+/*
+ if (arduinoI2C > 0) { // Read Arduino payload
+ for(int reg = 0; reg < 4; reg++) {
+ sprintf(tlm_str, " %04x",wiringPiI2CReadReg16(arduinoI2C,reg));
+ #ifdef DEBUG_LOGGING
+ printf("%s \n",tlm_str);
+ #endif
+ strcat(str,tlm_str); // Append payload telemetry
+ printf("%s",tlm_str);
+ usleep(100000);
+ }
+ }
+*/
+ printf("\n");
+
+ digitalWrite (0, LOW);
+
/*
- char cmdbuffer[1000];
+char cmdbuffer[1000];
- if (charging) {
- FILE* file1 = popen("/home/pi/mopower/mpcmd LED_STAT=1", "r");
- fgets(cmdbuffer, 999, file1);
- pclose(file1);
+ if (charging) {
+ FILE* file1 = popen("/home/pi/mopower/mpcmd LED_STAT=1", "r");
+ fgets(cmdbuffer, 999, file1);
+ pclose(file1);
// printf("LED state: %s\n", cmdbuffer);
- }
+ }
*/
- fprintf(stderr,"INFO: Transmitting X.25 packet\n");
-
- memcpy(data, str, strnlen(str, 256));
- ret = ax25_tx_frame(&hax25, &hax5043, data, strnlen(str, 256));
- if (ret) {
- fprintf(stderr,
- "ERROR: Failed to transmit AX.25 frame with error code %d\n",
- ret);
- exit(EXIT_FAILURE);
- }
- ax5043_wait_for_transmit();
- digitalWrite (0, HIGH);
-
+ #ifdef DEBUG_LOGGING
+ fprintf(stderr,"INFO: Transmitting X.25 packet\n");
+ #endif
+ memcpy(data, str, strnlen(str, 256));
+ ret = ax25_tx_frame(&hax25, &hax5043, data, strnlen(str, 256));
+ if (ret) {
+ fprintf(stderr,
+ "ERROR: Failed to transmit AX.25 frame with error code %d\n",
+ ret);
+ exit(EXIT_FAILURE);
+ }
+
+ ax5043_wait_for_transmit();
+ digitalWrite (0, HIGH);
+
/*
- FILE* file2 = popen("/home/pi/mopower/mpcmd LED_STAT=0", "r");
- fgets(cmdbuffer, 999, file2);
- pclose(file2);
+ FILE* file2 = popen("/home/pi/mopower/mpcmd LED_STAT=0", "r");
+ fgets(cmdbuffer, 999, file2);
+ pclose(file2);
// printf("LED state: %s\n", cmdbuffer);
*/
- if (ret) {
- fprintf(stderr,
- "ERROR: Failed to transmit entire AX.25 frame with error code %d\n",
- ret);
- exit(EXIT_FAILURE);
- }
+ if (ret) {
+ fprintf(stderr,
+ "ERROR: Failed to transmit entire AX.25 frame with error code %d\n",
+ ret);
+ exit(EXIT_FAILURE);
}
+ }
- return 0;
+ return 0;
}
static void init_rf() {
- int ret;
+ int ret;
+ #ifdef DEBUG_LOGGING
fprintf(stderr,"Initializing AX5043\n");
-
- ret = ax5043_init(&hax5043, XTAL_FREQ_HZ, VCO_INTERNAL);
- if (ret != PQWS_SUCCESS) {
- fprintf(stderr,
- "ERROR: Failed to initialize AX5043 with error code %d\n", ret);
- exit(EXIT_FAILURE);
- }
+ #endif
+ ret = ax5043_init(&hax5043, XTAL_FREQ_HZ, VCO_INTERNAL);
+ if (ret != PQWS_SUCCESS) {
+ fprintf(stderr,
+ "ERROR: Failed to initialize AX5043 with error code %d\n", ret);
+ exit(EXIT_FAILURE);
+ }
}
// Returns lower digit of a number which must be less than 99
@@ -334,126 +425,218 @@ int upper_digit(int number) {
fprintf(stderr,"ERROR: Not a digit in upper_digit!\n");
return digit;
}
+
int get_tlm(int tlm[][5]) {
+ // Reading I2C voltage and current sensors
+/*
+ char cmdbuffer[1000];
+ FILE* file = popen("sudo python /home/pi/CubeSatSim/python/readcurrent.py 2>&1", "r");
+ fgets(cmdbuffer, 999, file);
+ pclose(file);
+ #ifdef DEBUG_LOGGING
+ fprintf(stderr,"I2C Sensor data: %s\n", cmdbuffer);
+ #endif
-
-// Reading I2C voltage and current sensors
+ char ina219[16][20]; // voltage, currents, and power from the INA219 current sensors x4a, x40, x41, x44, and x45.
+ int i = 0;
+ char * data2 = strtok (cmdbuffer," ");
+
+ while (data2 != NULL) {
+ strcpy(ina219[i], data2);
+// #ifdef DEBUG_LOGGING
+// printf ("ina219[%d]=%s\n",i,ina219[i]);
+// #endif
+ data2 = strtok (NULL, " ");
+ i++;
+ }
+*/
- char cmdbuffer[1000];
- FILE* file = popen("sudo python /home/pi/CubeSatSim/python/readcurrent.py 2>&1", "r");
- fgets(cmdbuffer, 999, file);
- pclose(file);
- fprintf(stderr,"I2C Sensor data: %s\n", cmdbuffer);
-
- char ina219[16][20]; // voltage, currents, and power from the INA219 current sensors x4a, x40, x41, x44, and x45.
- int i = 0;
- char * data2 = strtok (cmdbuffer," ");
-
- while (data2 != NULL) {
- strcpy(ina219[i], data2);
- // printf ("ina219[%d]=%s\n",i,ina219[i]);
- data2 = strtok (NULL, " ");
- i++;
+// read i2c current sensors //
+// code added back from master
+ double x_current, y_current, z_current;
+ #ifdef DEBUG_LOGGING
+ double x_voltage, x_power, y_voltage, y_power, z_voltage, z_power;
+ uint16_t value;
+ #endif
+/* Disable old code
+ if (x_fd != OFF) {
+ wiringPiI2CWriteReg16(x_fd, INA219_REG_CALIBRATION, x_calValue_x);
+ wiringPiI2CWriteReg16(x_fd, INA219_REG_CONFIG, x_config);
+ wiringPiI2CWriteReg16(x_fd, INA219_REG_CALIBRATION, x_calValue_x);
+ x_current = wiringPiI2CReadReg16(x_fd, INA219_REG_CURRENT) / x_currentDivider;
+ #ifdef DEBUG_LOGGING
+// x_voltage = wiringPiI2CReadReg16(x_fd, INA219_REG_BUSVOLTAGE) / 1000;
+ value = (uint16_t)wireReadRegister(x_fd, INA219_REG_BUSVOLTAGE);
+ x_voltage = ((double)(value >> 3) * 4) / 1000;
+ x_power = wiringPiI2CReadReg16(x_fd, INA219_REG_POWER) * x_powerMultiplier;
+ #endif
+ wiringPiI2CWriteReg16(y_fd, INA219_REG_CALIBRATION, x_calValue_x);
+ wiringPiI2CWriteReg16(y_fd, INA219_REG_CONFIG, x_config);
+ wiringPiI2CWriteReg16(y_fd, INA219_REG_CALIBRATION, x_calValue_x);
+ y_current = wiringPiI2CReadReg16(y_fd, INA219_REG_CURRENT) / x_currentDivider;
+ #ifdef DEBUG_LOGGING
+// y_voltage = wiringPiI2CReadReg16(y_fd, INA219_REG_BUSVOLTAGE) / 1000;
+ value = (uint16_t)wireReadRegister(y_fd, INA219_REG_BUSVOLTAGE);
+ y_voltage = ((double)(value >> 3) * 4) / 1000;
+ y_power = wiringPiI2CReadReg16(y_fd, INA219_REG_POWER) * x_powerMultiplier;
+ #endif
+ wiringPiI2CWriteReg16(z_fd, INA219_REG_CALIBRATION, x_calValue_x);
+ wiringPiI2CWriteReg16(z_fd, INA219_REG_CONFIG, x_config);
+ wiringPiI2CWriteReg16(z_fd, INA219_REG_CALIBRATION, x_calValue_x);
+ z_current = wiringPiI2CReadReg16(z_fd, INA219_REG_CURRENT) / x_currentDivider;
+ #ifdef DEBUG_LOGGING
+// z_voltage = wiringPiI2CReadReg16(z_fd, INA219_REG_BUSVOLTAGE) / 1000;
+ value = (uint16_t)wireReadRegister(z_fd, INA219_REG_BUSVOLTAGE);
+ z_voltage = ((double)(value >> 3) * 4) / 1000;
+ z_power = wiringPiI2CReadReg16(z_fd, INA219_REG_POWER) * x_powerMultiplier;
+ #endif
}
-
- // Reading MoPower telemetry info
-/*
- file = popen("/home/pi/mopower/mpcmd show data", "r");
-
- fgets(cmdbuffer, 999, file);
-
- pclose(file);
-// printf("MoPower data: %s\n", cmdbuffer);
-
- char mopower[64][14];
-// char str[] ="- This, a sample string.";
- char * pch;
-// printf ("Splitting string \"%s\" into tokens:\n",str);
-// pch = strtok (str," ");
- i = 0;
- pch = strtok (cmdbuffer," ,.-");
- while (pch != NULL)
- {
- strcpy(mopower[i], pch);
-// printf ("mopwer[%d]=%s\n",i,mopower[i]); // pch);
- pch = strtok (NULL, " ");
- i++;
- }
- printf("Battery voltage = %s\n", mopower[16]);
- if (strtof(mopower[17],NULL) > -0.5) {
- charging = 1;
- printf("Charging on\n");
- }
- else {
- charging = 0;
- printf("Charging off\n");
-
- }
+ #ifdef DEBUG_LOGGING
+ printf("-X %+4.2f V %+4.2fmA %+4.2fmW -Y %+4.2fV %+4.2fmA %+4.2fmW -Z %+4.2fV %+4.2fmA %+4.2fmW \n",
+ x_voltage, x_current, x_power, y_voltage, y_current, y_power, z_voltage, z_current, z_power);
+ #endif
*/
-// read i2c current sensors //
+
struct SensorData x_data = read_sensor_data(x_fd);
struct SensorData y_data = read_sensor_data(y_fd);
struct SensorData z_data = read_sensor_data(z_fd);
- printf("-X 0x40 current %4.2f power %4.2f -Y 0x41 current %4.2f power %4.2f -Z 0x44 current %4.2f power %4.2f \n",
- x_data.current, x_data.power, y_data.current, y_data.power, z_data.current, z_data.power);
+ int count;
+ for (count = 0; count < 7; count++)
+ {
+ if (sensor[count] != OFF)
+ {
+ #ifdef DEBUG_LOGGING
+ printf("Read sensor[%d] ", count);
+ #endif
+ setCalibration_16V_400mA(sensor[count]);
+ current[count] = getCurrent_mA(sensor[count]);
+ voltsBus[count] = getBusVoltage_V(sensor[count]);
+ voltsShunt[count] = getShuntVoltage_mV(sensor[count])/1000;
+ power[count] = getPower_mW(sensor[count]);
+ }
+ else
+ {
+ voltsShunt[count] = 0;
+ voltsBus[count] = 0;
+ current[count] = 0;
+ power[count] = 0;
+ }
+ #ifdef DEBUG_LOGGING
+ printf("%+4.2fV %+4.2fV %+4.2fmA %+4.2fmW \n",
+ voltsBus[count], voltsShunt[count], current[count], power[count]);
+ #endif
+ }
+ if (sensor[BUS] != OFF) // For MoPower V2 INA219
+ {
+ #ifdef DEBUG_LOGGING
+ printf("Read sensor[%d] ", BUS);
+ #endif
+ setCalibration_16V_2A(sensor[BUS]);
+ current[BUS] = getCurrent_mA(sensor[BUS]); // * 4;
+ voltsBus[BUS] = getBusVoltage_V(sensor[BUS]);
+ voltsShunt[BUS] = getShuntVoltage_mV(sensor[BUS])/1000;
+ power[BUS] = getPower_mW(sensor[BUS]); // *2;
+ }
+ else
+ {
+ voltsShunt[BUS] = 0;
+ voltsBus[BUS] = 0;
+ current[BUS] = 0;
+ power[BUS] = 0;
+ }
+ #ifdef DEBUG_LOGGING
+ printf("%+4.2fV %+4.2fV %+4.2fmA %+4.2fmW \n",
+ voltsBus[BUS], voltsShunt[BUS], current[BUS], power[BUS]);
+ #endif
+
+
+
+
+// delay(500);
+ // }
+/* wiringPiI2CWriteReg16(x_fd, INA219_REG_CALIBRATION, x_calValue);
+ x_current = wiringPiI2CReadReg16(x_fd, INA219_REG_CURRENT) / x_currentDivider;
+ x_power = wiringPiI2CReadReg16(x_fd, INA219_REG_POWER) * x_powerMultiplier;
+ wiringPiI2CWriteReg16(y_fd, INA219_REG_CALIBRATION, x_calValue);
+ wiringPiI2CWriteReg16(y_fd, INA219_REG_CONFIG, x_config);
+ wiringPiI2CWriteReg16(y_fd, INA219_REG_CALIBRATION, x_calValue);
+ y_current = wiringPiI2CReadReg16(y_fd, INA219_REG_CURRENT) / x_currentDivider;
+ y_power = wiringPiI2CReadReg16(y_fd, INA219_REG_POWER) * x_powerMultiplier;
+ wiringPiI2CWriteReg16(z_fd, INA219_REG_CALIBRATION, x_calValue);
+ wiringPiI2CWriteReg16(z_fd, INA219_REG_CONFIG, x_config);
+ wiringPiI2CWriteReg16(z_fd, INA219_REG_CALIBRATION, x_calValue);
+ z_current = wiringPiI2CReadReg16(y_fd, INA219_REG_CURRENT) / x_currentDivider;
+ z_power = wiringPiI2CReadReg16(y_fd, INA219_REG_POWER) * x_powerMultiplier;
+ }
+ printf("-X 0x40 current %4.2f power %4.2f -Y 0x41 current %4.2f power %4.2f -Z 0x44 current %4.2f power %4.2f \n",
+ x_current, x_power, y_current, y_power, z_current, z_power);
+*/
// printf("1B: ina219[%d]: %s val: %f \n", SENSOR_40 + CURRENT, ina219[SENSOR_40 + CURRENT], strtof(ina219[SENSOR_40 + CURRENT], NULL));
- tlm[1][A] = (int)(strtof(ina219[SENSOR_4A + CURRENT], NULL) / 15 + 0.5) % 100; // Current of 5V supply to Pi
- tlm[1][B] = (int) (99.5 - strtof(ina219[SENSOR_40 + CURRENT], NULL)/10) % 100; // +X current [4]
- tlm[1][C] = (int) (99.5 - x_data.current/10) % 100; // X- current [10]
- tlm[1][D] = (int) (99.5 - strtof(ina219[SENSOR_41 + CURRENT], NULL)/10) % 100; // +Y current [7]
-
- tlm[2][A] = (int) (99.5 - y_data.current/10) % 100; // -Y current [10]
- tlm[2][B] = (int) (99.5 - strtof(ina219[SENSOR_44 + CURRENT], NULL)/10) % 100; // +Z current [10] // was 70/2m transponder power, AO-7 didn't have a Z panel
- tlm[2][C] = (int) (99.5 - z_data.current/10) % 100; // -Z current (was timestamp)
+// tlm[1][A] = (int)(strtof(ina219[SENSOR_4A + CURRENTV], NULL) / 15 + 0.5) % 100; // Current of 5V supply to Pi
+ tlm[1][A] = (int)(voltsBus[BUS] / 15 + 0.5) % 100; // Current of 5V supply to Pi
+// tlm[1][B] = (int) (99.5 - strtof(ina219[SENSOR_40 + CURRENTV], NULL)/10) % 100; // +X current [4]
+ tlm[1][B] = (int) (99.5 - current[PLUS_X]/10) % 100; // +X current [4]
+// tlm[1][C] = (int) (99.5 - x_current/10) % 100; // X- current [10]
+ tlm[1][C] = (int) (99.5 - current[MINUS_X]/10) % 100; // X- current [10]
+// tlm[1][D] = (int) (99.5 - strtof(ina219[SENSOR_41 + CURRENTV], NULL)/10) % 100; // +Y current [7]
+ tlm[1][D] = (int) (99.5 - current[PLUS_Y]/10) % 100; // +Y current [7]
+// tlm[2][A] = (int) (99.5 - y_current/10) % 100; // -Y current [10]
+ tlm[2][A] = (int) (99.5 - current[MINUS_Y]/10) % 100; // -Y current [10]
+// tlm[2][B] = (int) (99.5 - strtof(ina219[SENSOR_44 + CURRENTV], NULL)/10) % 100; // +Z current [10] // was 70/2m transponder power, AO-7 didn't have a Z panel
+ tlm[2][B] = (int) (99.5 - current[PLUS_Z]/10) % 100; // +Z current [10] // was 70/2m transponder power, AO-7 didn't have a Z panel
+// tlm[2][C] = (int) (99.5 - z_current/10) % 100; // -Z current (was timestamp)
+ tlm[2][C] = (int) (99.5 - current[MINUS_Z]/10) % 100; // -Z current (was timestamp)
// tlm[2][C] = (int)((time(NULL) - timestamp) / 15) % 100;
- tlm[2][D] = (int)(50.5 + strtof(ina219[SENSOR_45 + CURRENT], NULL)/10.0) % 100; // NiMH Battery current
+// tlm[2][D] = (int)(50.5 + strtof(ina219[SENSOR_45 + CURRENTV], NULL)/10.0) % 100; // NiMH Battery current
+ tlm[2][D] = (int)(50.5 + current[BAT]/10.0) % 100; // NiMH Battery current
- tlm[3][A] = abs((int)((strtof(ina219[SENSOR_45 + VOLTAGE], NULL) * 10) - 65.5) % 100);
- tlm[3][B] = (int)(strtof(ina219[SENSOR_4A + VOLTAGE], NULL) * 10.0) % 100; // 5V supply to Pi
+// tlm[3][A] = abs((int)((strtof(ina219[SENSOR_45 + VOLTAGE], NULL) * 10) - 65.5) % 100);
+ tlm[3][A] = abs((int)((voltsBus[BAT] * 10) - 65.5) % 100);
+// tlm[3][B] = (int)(strtof(ina219[SENSOR_4A + VOLTAGE], NULL) * 10.0) % 100; // 5V supply to Pi
+ tlm[3][B] = (int)(voltsBus[BUS] * 10.0) % 100; // 5V supply to Pi
- if (tempSensor != -1) {
- int tempValue = wiringPiI2CReadReg16(tempSensor, 0);
-// printf("Read: %x\n", tempValue);
- uint8_t upper = (uint8_t) (tempValue >> 8);
- uint8_t lower = (uint8_t) (tempValue & 0xff);
- float temp = (float)lower + ((float)upper / 0x100);
-
- tlm[4][A] = (int)((95.8 - temp)/1.48 + 0.5) % 100;
- }
- FILE *cpuTempSensor = fopen("/sys/class/thermal/thermal_zone0/temp", "r");
- if (cpuTempSensor) {
+ if (tempSensor != OFF) {
+ int tempValue = wiringPiI2CReadReg16(tempSensor, 0);
+
+ uint8_t upper = (uint8_t) (tempValue >> 8);
+ uint8_t lower = (uint8_t) (tempValue & 0xff);
+ float temp = (float)lower + ((float)upper / 0x100);
+
+ #ifdef DEBUG_LOGGING
+ printf("Temp Sensor Read: %6.1f\n", temp);
+ #endif
+
+ tlm[4][A] = (int)((95.8 - temp)/1.48 + 0.5) % 100;
+ }
+
+ FILE *cpuTempSensor = fopen("/sys/class/thermal/thermal_zone0/temp", "r");
+ if (cpuTempSensor) {
double cpuTemp;
fscanf (cpuTempSensor, "%lf", &cpuTemp);
cpuTemp /= 1000;
- printf("CPU Temp Read: %6.1f\n", cpuTemp);
- tlm[4][B] = (int)((95.8 - cpuTemp)/1.48 + 0.5) % 100;
+ #ifdef DEBUG_LOGGING
+ printf("CPU Temp Read: %6.1f\n", cpuTemp);
+ #endif
+ tlm[4][B] = (int)((95.8 - cpuTemp)/1.48 + 0.5) % 100;
fclose (cpuTempSensor);
- }
-/*
-FILE *temperatureFile;
-double T;
-temperatureFile = fopen ("/sys/class/thermal/thermal_zone0/temp", "r");
-if (temperatureFile == NULL)
- ; //print some message
-fscanf (temperatureFile, "%lf", &T);
-T /= 1000;
-printf ("The temperature is %6.3f C.\n", T);
-fclose (temperatureFile);
-tlm[4][B] = (int)((95.8 - T)/1.48 + 0.5) % 100;
-*/
- tlm[6][B] = 0 ;
- tlm[6][D] = 49 + rand() % 3;
+ }
+
+ tlm[6][B] = 0 ;
+ tlm[6][D] = 49 + rand() % 3;
+ #ifdef DEBUG_LOGGING
// Display tlm
int k, j;
for (k = 1; k < 7; k++) {
- for (j = 1; j < 5; j++) {
- printf(" %2d ", tlm[k][j]);
- }
- printf("\n");
+ for (j = 1; j < 5; j++) {
+ printf(" %2d ", tlm[k][j]);
+ }
+ printf("\n");
}
- return 0;
+ #endif
+
+ return 0;
}
diff --git a/groundstation/aprs.sh b/groundstation/aprs.sh
old mode 100644
new mode 100755
diff --git a/groundstation/config_webrx.py b/groundstation/config_webrx.py
index a45298bd..1a549578 100644
--- a/groundstation/config_webrx.py
+++ b/groundstation/config_webrx.py
@@ -40,7 +40,7 @@ server_hostname="localhost" # If this contains an incorrect value, the web UI ma
max_clients=20
# ==== Web GUI configuration ====
-receiver_name="AMSATCubeSat Simulator Ground Station"
+receiver_name="AMSAT CubeSat Simulator Ground Station"
receiver_location=""
receiver_qra=""
receiver_asl=0
@@ -74,7 +74,7 @@ fft_voverlap_factor=0.3 #If fft_voverlap_factor is above 0, multiple FFTs will b
samp_rate = 250000
# samp_rate = 2400000
center_freq = 440450000
-rf_gain = 5 #in dB. For an RTL-SDR, rf_gain=0 will set the tuner to auto gain mode, else it will be in manual gain mode.
+rf_gain = 37 #in dB. For an RTL-SDR, rf_gain=0 will set the tuner to auto gain mode, else it will be in manual gain mode.
ppm = 0
audio_compression="adpcm" #valid values: "adpcm", "none"
diff --git a/groundstation/config_webrx_107.py b/groundstation/config_webrx_107.py
new file mode 100644
index 00000000..568e3a9b
--- /dev/null
+++ b/groundstation/config_webrx_107.py
@@ -0,0 +1,216 @@
+# -*- coding: utf-8 -*-
+
+"""
+config_webrx: configuration options for OpenWebRX
+
+ This file is part of OpenWebRX,
+ an open-source SDR receiver software with a web UI.
+ Copyright (c) 2013-2015 by Andras Retzler
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see .
+
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+ In addition, as a special exception, the copyright holders
+ state that config_rtl.py and config_webrx.py are not part of the
+ Corresponding Source defined in GNU AGPL version 3 section 1.
+
+ (It means that you do not have to redistribute config_rtl.py and
+ config_webrx.py if you make any changes to these two configuration files,
+ and use them for running your web service with OpenWebRX.)
+"""
+
+# NOTE: you can find additional information about configuring OpenWebRX in the Wiki:
+# https://github.com/simonyiszk/openwebrx/wiki
+
+# ==== Server settings ====
+web_port=8073
+server_hostname="localhost" # If this contains an incorrect value, the web UI may freeze on load (it can't open websocket)
+max_clients=20
+
+# ==== Web GUI configuration ====
+receiver_name="ARISS Ground Station"
+receiver_location=""
+receiver_qra=""
+receiver_asl=0
+receiver_ant="monopole"
+receiver_device="RTL-SDR"
+receiver_admin="ku2y@amsat.org"
+receiver_gps=(39.0302,-77.0747)
+photo_height=350
+photo_title="ARISS - Amateur Radio on the International Space Station"
+photo_desc="""
+You can add your own background photo and receiver information.
+Receiver is operated by: %[RX_ADMIN]
+Device: %[RX_DEVICE]
+Antenna: %[RX_ANT]
+Website: http://localhost
+"""
+
+# ==== sdr.hu listing ====
+# If you want your ham receiver to be listed publicly on sdr.hu, then take the following steps:
+# 1. Register at: http://sdr.hu/register
+# 2. You will get an unique key by email. Copy it and paste here:
+sdrhu_key = ""
+# 3. Set this setting to True to enable listing:
+sdrhu_public_listing = False
+
+# ==== DSP/RX settings ====
+fft_fps=9
+fft_size=4096 #Should be power of 2
+fft_voverlap_factor=0.3 #If fft_voverlap_factor is above 0, multiple FFTs will be used for creating a line on the diagram.
+
+#samp_rate = 250000
+samp_rate = 2400000
+center_freq = 107000000
+rf_gain = 37 #in dB. For an RTL-SDR, rf_gain=0 will set the tuner to auto gain mode, else it will be in manual gain mode.
+ppm = 0
+
+audio_compression="adpcm" #valid values: "adpcm", "none"
+fft_compression="adpcm" #valid values: "adpcm", "none"
+
+digimodes_enable=False # True #Decoding digimodes come with higher CPU usage.
+digimodes_fft_size=1024
+
+start_rtl_thread=True
+
+"""
+Note: if you experience audio underruns while CPU usage is 100%, you can:
+- decrease `samp_rate`,
+- set `fft_voverlap_factor` to 0,
+- decrease `fft_fps` and `fft_size`,
+- limit the number of users by decreasing `max_clients`.
+"""
+
+# ==== I/Q sources ====
+# (Uncomment the appropriate by removing # characters at the beginning of the corresponding lines.)
+
+#################################################################################################
+# Is my SDR hardware supported? #
+# Check here: https://github.com/simonyiszk/openwebrx/wiki#guides-for-receiver-hardware-support #
+#################################################################################################
+
+# You can use other SDR hardware as well, by giving your own command that outputs the I/Q samples... Some examples of configuration are available here (default is RTL-SDR):
+
+# >> RTL-SDR via rtl_sdr
+start_rtl_command="rtl_sdr -s {samp_rate} -f {center_freq} -p {ppm} -g {rf_gain} -".format(rf_gain=rf_gain, center_freq=center_freq, samp_rate=samp_rate, ppm=ppm)
+format_conversion="csdr convert_u8_f"
+
+#lna_gain=8
+#rf_amp=1
+#start_rtl_command="hackrf_transfer -s {samp_rate} -f {center_freq} -g {rf_gain} -l{lna_gain} -a{rf_amp} -r-".format(rf_gain=rf_gain, center_freq=center_freq, samp_rate=samp_rate, ppm=ppm, rf_amp=rf_amp, lna_gain=lna_gain)
+#format_conversion="csdr convert_s8_f"
+"""
+To use a HackRF, compile the HackRF host tools from its "stdout" branch:
+ git clone https://github.com/mossmann/hackrf/
+ cd hackrf
+ git fetch
+ git checkout origin/stdout
+ cd host
+ mkdir build
+ cd build
+ cmake .. -DINSTALL_UDEV_RULES=ON
+ make
+ sudo make install
+"""
+
+# >> Sound card SDR (needs ALSA)
+# I did not have the chance to properly test it.
+#samp_rate = 96000
+#start_rtl_command="arecord -f S16_LE -r {samp_rate} -c2 -".format(samp_rate=samp_rate)
+#format_conversion="csdr convert_s16_f | csdr gain_ff 30"
+
+# >> /dev/urandom test signal source
+# samp_rate = 2400000
+# start_rtl_command="cat /dev/urandom | (pv -qL `python -c 'print int({samp_rate} * 2.2)'` 2>&1)".format(rf_gain=rf_gain, center_freq=center_freq, samp_rate=samp_rate)
+# format_conversion="csdr convert_u8_f"
+
+# >> Pre-recorded raw I/Q file as signal source
+# You will have to correctly specify: samp_rate, center_freq, format_conversion in order to correctly play an I/Q file.
+#start_rtl_command="(while true; do cat my_iq_file.raw; done) | csdr flowcontrol {sr} 20 ".format(sr=samp_rate*2*1.05)
+#format_conversion="csdr convert_u8_f"
+
+#>> The rx_sdr command works with a variety of SDR harware: RTL-SDR, HackRF, SDRplay, UHD, Airspy, Red Pitaya, audio devices, etc.
+# It will auto-detect your SDR hardware if the following tools are installed:
+# * the vendor provided driver and library,
+# * the vendor-specific SoapySDR wrapper library,
+# * and SoapySDR itself.
+# Check out this article on the OpenWebRX Wiki: https://github.com/simonyiszk/openwebrx/wiki/Using-rx_tools-with-OpenWebRX/
+#start_rtl_command="rx_sdr -F CF32 -s {samp_rate} -f {center_freq} -p {ppm} -g {rf_gain} -".format(rf_gain=rf_gain, center_freq=center_freq, samp_rate=samp_rate, ppm=ppm)
+#format_conversion=""
+
+# >> gr-osmosdr signal source using GNU Radio (follow this guide: https://github.com/simonyiszk/openwebrx/wiki/Using-GrOsmoSDR-as-signal-source)
+#start_rtl_command="cat /tmp/osmocom_fifo"
+#format_conversion=""
+
+# ==== Misc settings ====
+
+shown_center_freq = center_freq #you can change this if you use an upconverter
+
+client_audio_buffer_size = 5
+#increasing client_audio_buffer_size will:
+# - also increase the latency
+# - decrease the chance of audio underruns
+
+start_freq = center_freq
+start_mod = "nfm" #nfm, am, lsb, usb, cw
+
+iq_server_port = 4951 #TCP port for ncat to listen on. It will send I/Q data over its connections, for internal use in OpenWebRX. It is only accessible from the localhost by default.
+
+#access_log = "~/openwebrx_access.log"
+
+# ==== Color themes ====
+
+#A guide is available to help you set these values: https://github.com/simonyiszk/openwebrx/wiki/Calibrating-waterfall-display-levels
+
+### default theme by teejez:
+waterfall_colors = "[0x000000ff,0x0000ffff,0x00ffffff,0x00ff00ff,0xffff00ff,0xff0000ff,0xff00ffff,0xffffffff]"
+waterfall_min_level = -88 #in dB
+waterfall_max_level = -20
+waterfall_auto_level_margin = (5, 40)
+### old theme by HA7ILM:
+#waterfall_colors = "[0x000000ff,0x2e6893ff, 0x69a5d0ff, 0x214b69ff, 0x9dc4e0ff, 0xfff775ff, 0xff8a8aff, 0xb20000ff]"
+#waterfall_min_level = -115 #in dB
+#waterfall_max_level = 0
+#waterfall_auto_level_margin = (20, 30)
+##For the old colors, you might also want to set [fft_voverlap_factor] to 0.
+
+#Note: When the auto waterfall level button is clicked, the following happens:
+# [waterfall_min_level] = [current_min_power_level] - [waterfall_auto_level_margin[0]]
+# [waterfall_max_level] = [current_max_power_level] + [waterfall_auto_level_margin[1]]
+#
+# ___|____________________________________|____________________________________|____________________________________|___> signal power
+# \_waterfall_auto_level_margin[0]_/ |__ current_min_power_level | \_waterfall_auto_level_margin[1]_/
+# current_max_power_level __|
+
+# 3D view settings
+mathbox_waterfall_frequency_resolution = 128 #bins
+mathbox_waterfall_history_length = 10 #seconds
+mathbox_waterfall_colors = "[0x000000ff,0x2e6893ff, 0x69a5d0ff, 0x214b69ff, 0x9dc4e0ff, 0xfff775ff, 0xff8a8aff, 0xb20000ff]"
+
+# === Experimental settings ===
+#Warning! The settings below are very experimental.
+csdr_dynamic_bufsize = False # This allows you to change the buffering mode of csdr.
+csdr_print_bufsizes = False # This prints the buffer sizes used for csdr processes.
+csdr_through = False # Setting this True will print out how much data is going into the DSP chains.
+
+nmux_memory = 50 #in megabytes. This sets the approximate size of the circular buffer used by nmux.
+
+#Look up external IP address automatically from icanhazip.com, and use it as [server_hostname]
+"""
+print "[openwebrx-config] Detecting external IP address..."
+import urllib2
+server_hostname=urllib2.urlopen("http://icanhazip.com").read()[:-1]
+print "[openwebrx-config] External IP address detected:", server_hostname
+"""
diff --git a/groundstation/config_webrx_145.py b/groundstation/config_webrx_145.py
new file mode 100644
index 00000000..549f93f7
--- /dev/null
+++ b/groundstation/config_webrx_145.py
@@ -0,0 +1,216 @@
+# -*- coding: utf-8 -*-
+
+"""
+config_webrx: configuration options for OpenWebRX
+
+ This file is part of OpenWebRX,
+ an open-source SDR receiver software with a web UI.
+ Copyright (c) 2013-2015 by Andras Retzler
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see .
+
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+ In addition, as a special exception, the copyright holders
+ state that config_rtl.py and config_webrx.py are not part of the
+ Corresponding Source defined in GNU AGPL version 3 section 1.
+
+ (It means that you do not have to redistribute config_rtl.py and
+ config_webrx.py if you make any changes to these two configuration files,
+ and use them for running your web service with OpenWebRX.)
+"""
+
+# NOTE: you can find additional information about configuring OpenWebRX in the Wiki:
+# https://github.com/simonyiszk/openwebrx/wiki
+
+# ==== Server settings ====
+web_port=8073
+server_hostname="localhost" # If this contains an incorrect value, the web UI may freeze on load (it can't open websocket)
+max_clients=20
+
+# ==== Web GUI configuration ====
+receiver_name="ARISS Ground Station"
+receiver_location=""
+receiver_qra=""
+receiver_asl=0
+receiver_ant="monopole"
+receiver_device="RTL-SDR"
+receiver_admin="ku2y@amsat.org"
+receiver_gps=(39.0302,-77.0747)
+photo_height=350
+photo_title="ARISS - Amateur Radio on the International Space Station"
+photo_desc="""
+You can add your own background photo and receiver information.
+Receiver is operated by: %[RX_ADMIN]
+Device: %[RX_DEVICE]
+Antenna: %[RX_ANT]
+Website: http://localhost
+"""
+
+# ==== sdr.hu listing ====
+# If you want your ham receiver to be listed publicly on sdr.hu, then take the following steps:
+# 1. Register at: http://sdr.hu/register
+# 2. You will get an unique key by email. Copy it and paste here:
+sdrhu_key = ""
+# 3. Set this setting to True to enable listing:
+sdrhu_public_listing = False
+
+# ==== DSP/RX settings ====
+fft_fps=9
+fft_size=4096 #Should be power of 2
+fft_voverlap_factor=0.3 #If fft_voverlap_factor is above 0, multiple FFTs will be used for creating a line on the diagram.
+
+#samp_rate = 250000
+samp_rate = 2400000
+center_freq = 145800000
+rf_gain = 37 #in dB. For an RTL-SDR, rf_gain=0 will set the tuner to auto gain mode, else it will be in manual gain mode.
+ppm = 0
+
+audio_compression="adpcm" #valid values: "adpcm", "none"
+fft_compression="adpcm" #valid values: "adpcm", "none"
+
+digimodes_enable=False # True #Decoding digimodes come with higher CPU usage.
+digimodes_fft_size=1024
+
+start_rtl_thread=True
+
+"""
+Note: if you experience audio underruns while CPU usage is 100%, you can:
+- decrease `samp_rate`,
+- set `fft_voverlap_factor` to 0,
+- decrease `fft_fps` and `fft_size`,
+- limit the number of users by decreasing `max_clients`.
+"""
+
+# ==== I/Q sources ====
+# (Uncomment the appropriate by removing # characters at the beginning of the corresponding lines.)
+
+#################################################################################################
+# Is my SDR hardware supported? #
+# Check here: https://github.com/simonyiszk/openwebrx/wiki#guides-for-receiver-hardware-support #
+#################################################################################################
+
+# You can use other SDR hardware as well, by giving your own command that outputs the I/Q samples... Some examples of configuration are available here (default is RTL-SDR):
+
+# >> RTL-SDR via rtl_sdr
+start_rtl_command="rtl_sdr -s {samp_rate} -f {center_freq} -p {ppm} -g {rf_gain} -".format(rf_gain=rf_gain, center_freq=center_freq, samp_rate=samp_rate, ppm=ppm)
+format_conversion="csdr convert_u8_f"
+
+#lna_gain=8
+#rf_amp=1
+#start_rtl_command="hackrf_transfer -s {samp_rate} -f {center_freq} -g {rf_gain} -l{lna_gain} -a{rf_amp} -r-".format(rf_gain=rf_gain, center_freq=center_freq, samp_rate=samp_rate, ppm=ppm, rf_amp=rf_amp, lna_gain=lna_gain)
+#format_conversion="csdr convert_s8_f"
+"""
+To use a HackRF, compile the HackRF host tools from its "stdout" branch:
+ git clone https://github.com/mossmann/hackrf/
+ cd hackrf
+ git fetch
+ git checkout origin/stdout
+ cd host
+ mkdir build
+ cd build
+ cmake .. -DINSTALL_UDEV_RULES=ON
+ make
+ sudo make install
+"""
+
+# >> Sound card SDR (needs ALSA)
+# I did not have the chance to properly test it.
+#samp_rate = 96000
+#start_rtl_command="arecord -f S16_LE -r {samp_rate} -c2 -".format(samp_rate=samp_rate)
+#format_conversion="csdr convert_s16_f | csdr gain_ff 30"
+
+# >> /dev/urandom test signal source
+# samp_rate = 2400000
+# start_rtl_command="cat /dev/urandom | (pv -qL `python -c 'print int({samp_rate} * 2.2)'` 2>&1)".format(rf_gain=rf_gain, center_freq=center_freq, samp_rate=samp_rate)
+# format_conversion="csdr convert_u8_f"
+
+# >> Pre-recorded raw I/Q file as signal source
+# You will have to correctly specify: samp_rate, center_freq, format_conversion in order to correctly play an I/Q file.
+#start_rtl_command="(while true; do cat my_iq_file.raw; done) | csdr flowcontrol {sr} 20 ".format(sr=samp_rate*2*1.05)
+#format_conversion="csdr convert_u8_f"
+
+#>> The rx_sdr command works with a variety of SDR harware: RTL-SDR, HackRF, SDRplay, UHD, Airspy, Red Pitaya, audio devices, etc.
+# It will auto-detect your SDR hardware if the following tools are installed:
+# * the vendor provided driver and library,
+# * the vendor-specific SoapySDR wrapper library,
+# * and SoapySDR itself.
+# Check out this article on the OpenWebRX Wiki: https://github.com/simonyiszk/openwebrx/wiki/Using-rx_tools-with-OpenWebRX/
+#start_rtl_command="rx_sdr -F CF32 -s {samp_rate} -f {center_freq} -p {ppm} -g {rf_gain} -".format(rf_gain=rf_gain, center_freq=center_freq, samp_rate=samp_rate, ppm=ppm)
+#format_conversion=""
+
+# >> gr-osmosdr signal source using GNU Radio (follow this guide: https://github.com/simonyiszk/openwebrx/wiki/Using-GrOsmoSDR-as-signal-source)
+#start_rtl_command="cat /tmp/osmocom_fifo"
+#format_conversion=""
+
+# ==== Misc settings ====
+
+shown_center_freq = center_freq #you can change this if you use an upconverter
+
+client_audio_buffer_size = 5
+#increasing client_audio_buffer_size will:
+# - also increase the latency
+# - decrease the chance of audio underruns
+
+start_freq = center_freq
+start_mod = "nfm" #nfm, am, lsb, usb, cw
+
+iq_server_port = 4951 #TCP port for ncat to listen on. It will send I/Q data over its connections, for internal use in OpenWebRX. It is only accessible from the localhost by default.
+
+#access_log = "~/openwebrx_access.log"
+
+# ==== Color themes ====
+
+#A guide is available to help you set these values: https://github.com/simonyiszk/openwebrx/wiki/Calibrating-waterfall-display-levels
+
+### default theme by teejez:
+waterfall_colors = "[0x000000ff,0x0000ffff,0x00ffffff,0x00ff00ff,0xffff00ff,0xff0000ff,0xff00ffff,0xffffffff]"
+waterfall_min_level = -88 #in dB
+waterfall_max_level = -20
+waterfall_auto_level_margin = (5, 40)
+### old theme by HA7ILM:
+#waterfall_colors = "[0x000000ff,0x2e6893ff, 0x69a5d0ff, 0x214b69ff, 0x9dc4e0ff, 0xfff775ff, 0xff8a8aff, 0xb20000ff]"
+#waterfall_min_level = -115 #in dB
+#waterfall_max_level = 0
+#waterfall_auto_level_margin = (20, 30)
+##For the old colors, you might also want to set [fft_voverlap_factor] to 0.
+
+#Note: When the auto waterfall level button is clicked, the following happens:
+# [waterfall_min_level] = [current_min_power_level] - [waterfall_auto_level_margin[0]]
+# [waterfall_max_level] = [current_max_power_level] + [waterfall_auto_level_margin[1]]
+#
+# ___|____________________________________|____________________________________|____________________________________|___> signal power
+# \_waterfall_auto_level_margin[0]_/ |__ current_min_power_level | \_waterfall_auto_level_margin[1]_/
+# current_max_power_level __|
+
+# 3D view settings
+mathbox_waterfall_frequency_resolution = 128 #bins
+mathbox_waterfall_history_length = 10 #seconds
+mathbox_waterfall_colors = "[0x000000ff,0x2e6893ff, 0x69a5d0ff, 0x214b69ff, 0x9dc4e0ff, 0xfff775ff, 0xff8a8aff, 0xb20000ff]"
+
+# === Experimental settings ===
+#Warning! The settings below are very experimental.
+csdr_dynamic_bufsize = False # This allows you to change the buffering mode of csdr.
+csdr_print_bufsizes = False # This prints the buffer sizes used for csdr processes.
+csdr_through = False # Setting this True will print out how much data is going into the DSP chains.
+
+nmux_memory = 50 #in megabytes. This sets the approximate size of the circular buffer used by nmux.
+
+#Look up external IP address automatically from icanhazip.com, and use it as [server_hostname]
+"""
+print "[openwebrx-config] Detecting external IP address..."
+import urllib2
+server_hostname=urllib2.urlopen("http://icanhazip.com").read()[:-1]
+print "[openwebrx-config] External IP address detected:", server_hostname
+"""
diff --git a/groundstation/config_webrx_440.py b/groundstation/config_webrx_440.py
new file mode 100644
index 00000000..d0725a9b
--- /dev/null
+++ b/groundstation/config_webrx_440.py
@@ -0,0 +1,216 @@
+# -*- coding: utf-8 -*-
+
+"""
+config_webrx: configuration options for OpenWebRX
+
+ This file is part of OpenWebRX,
+ an open-source SDR receiver software with a web UI.
+ Copyright (c) 2013-2015 by Andras Retzler
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see .
+
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+ In addition, as a special exception, the copyright holders
+ state that config_rtl.py and config_webrx.py are not part of the
+ Corresponding Source defined in GNU AGPL version 3 section 1.
+
+ (It means that you do not have to redistribute config_rtl.py and
+ config_webrx.py if you make any changes to these two configuration files,
+ and use them for running your web service with OpenWebRX.)
+"""
+
+# NOTE: you can find additional information about configuring OpenWebRX in the Wiki:
+# https://github.com/simonyiszk/openwebrx/wiki
+
+# ==== Server settings ====
+web_port=8073
+server_hostname="localhost" # If this contains an incorrect value, the web UI may freeze on load (it can't open websocket)
+max_clients=20
+
+# ==== Web GUI configuration ====
+receiver_name="ARISS Ground Station"
+receiver_location=""
+receiver_qra=""
+receiver_asl=0
+receiver_ant="monopole"
+receiver_device="RTL-SDR"
+receiver_admin="ku2y@amsat.org"
+receiver_gps=(39.0302,-77.0747)
+photo_height=350
+photo_title="ARISS - Amateur Radio on the International Space Station"
+photo_desc="""
+You can add your own background photo and receiver information.
+Receiver is operated by: %[RX_ADMIN]
+Device: %[RX_DEVICE]
+Antenna: %[RX_ANT]
+Website: http://localhost
+"""
+
+# ==== sdr.hu listing ====
+# If you want your ham receiver to be listed publicly on sdr.hu, then take the following steps:
+# 1. Register at: http://sdr.hu/register
+# 2. You will get an unique key by email. Copy it and paste here:
+sdrhu_key = ""
+# 3. Set this setting to True to enable listing:
+sdrhu_public_listing = False
+
+# ==== DSP/RX settings ====
+fft_fps=9
+fft_size=4096 #Should be power of 2
+fft_voverlap_factor=0.3 #If fft_voverlap_factor is above 0, multiple FFTs will be used for creating a line on the diagram.
+
+samp_rate = 250000
+# samp_rate = 2400000
+center_freq = 440450000
+rf_gain = 37 #in dB. For an RTL-SDR, rf_gain=0 will set the tuner to auto gain mode, else it will be in manual gain mode.
+ppm = 0
+
+audio_compression="adpcm" #valid values: "adpcm", "none"
+fft_compression="adpcm" #valid values: "adpcm", "none"
+
+digimodes_enable=False # True #Decoding digimodes come with higher CPU usage.
+digimodes_fft_size=1024
+
+start_rtl_thread=True
+
+"""
+Note: if you experience audio underruns while CPU usage is 100%, you can:
+- decrease `samp_rate`,
+- set `fft_voverlap_factor` to 0,
+- decrease `fft_fps` and `fft_size`,
+- limit the number of users by decreasing `max_clients`.
+"""
+
+# ==== I/Q sources ====
+# (Uncomment the appropriate by removing # characters at the beginning of the corresponding lines.)
+
+#################################################################################################
+# Is my SDR hardware supported? #
+# Check here: https://github.com/simonyiszk/openwebrx/wiki#guides-for-receiver-hardware-support #
+#################################################################################################
+
+# You can use other SDR hardware as well, by giving your own command that outputs the I/Q samples... Some examples of configuration are available here (default is RTL-SDR):
+
+# >> RTL-SDR via rtl_sdr
+start_rtl_command="rtl_sdr -s {samp_rate} -f {center_freq} -p {ppm} -g {rf_gain} -".format(rf_gain=rf_gain, center_freq=center_freq, samp_rate=samp_rate, ppm=ppm)
+format_conversion="csdr convert_u8_f"
+
+#lna_gain=8
+#rf_amp=1
+#start_rtl_command="hackrf_transfer -s {samp_rate} -f {center_freq} -g {rf_gain} -l{lna_gain} -a{rf_amp} -r-".format(rf_gain=rf_gain, center_freq=center_freq, samp_rate=samp_rate, ppm=ppm, rf_amp=rf_amp, lna_gain=lna_gain)
+#format_conversion="csdr convert_s8_f"
+"""
+To use a HackRF, compile the HackRF host tools from its "stdout" branch:
+ git clone https://github.com/mossmann/hackrf/
+ cd hackrf
+ git fetch
+ git checkout origin/stdout
+ cd host
+ mkdir build
+ cd build
+ cmake .. -DINSTALL_UDEV_RULES=ON
+ make
+ sudo make install
+"""
+
+# >> Sound card SDR (needs ALSA)
+# I did not have the chance to properly test it.
+#samp_rate = 96000
+#start_rtl_command="arecord -f S16_LE -r {samp_rate} -c2 -".format(samp_rate=samp_rate)
+#format_conversion="csdr convert_s16_f | csdr gain_ff 30"
+
+# >> /dev/urandom test signal source
+# samp_rate = 2400000
+# start_rtl_command="cat /dev/urandom | (pv -qL `python -c 'print int({samp_rate} * 2.2)'` 2>&1)".format(rf_gain=rf_gain, center_freq=center_freq, samp_rate=samp_rate)
+# format_conversion="csdr convert_u8_f"
+
+# >> Pre-recorded raw I/Q file as signal source
+# You will have to correctly specify: samp_rate, center_freq, format_conversion in order to correctly play an I/Q file.
+#start_rtl_command="(while true; do cat my_iq_file.raw; done) | csdr flowcontrol {sr} 20 ".format(sr=samp_rate*2*1.05)
+#format_conversion="csdr convert_u8_f"
+
+#>> The rx_sdr command works with a variety of SDR harware: RTL-SDR, HackRF, SDRplay, UHD, Airspy, Red Pitaya, audio devices, etc.
+# It will auto-detect your SDR hardware if the following tools are installed:
+# * the vendor provided driver and library,
+# * the vendor-specific SoapySDR wrapper library,
+# * and SoapySDR itself.
+# Check out this article on the OpenWebRX Wiki: https://github.com/simonyiszk/openwebrx/wiki/Using-rx_tools-with-OpenWebRX/
+#start_rtl_command="rx_sdr -F CF32 -s {samp_rate} -f {center_freq} -p {ppm} -g {rf_gain} -".format(rf_gain=rf_gain, center_freq=center_freq, samp_rate=samp_rate, ppm=ppm)
+#format_conversion=""
+
+# >> gr-osmosdr signal source using GNU Radio (follow this guide: https://github.com/simonyiszk/openwebrx/wiki/Using-GrOsmoSDR-as-signal-source)
+#start_rtl_command="cat /tmp/osmocom_fifo"
+#format_conversion=""
+
+# ==== Misc settings ====
+
+shown_center_freq = center_freq #you can change this if you use an upconverter
+
+client_audio_buffer_size = 5
+#increasing client_audio_buffer_size will:
+# - also increase the latency
+# - decrease the chance of audio underruns
+
+start_freq = center_freq
+start_mod = "nfm" #nfm, am, lsb, usb, cw
+
+iq_server_port = 4951 #TCP port for ncat to listen on. It will send I/Q data over its connections, for internal use in OpenWebRX. It is only accessible from the localhost by default.
+
+#access_log = "~/openwebrx_access.log"
+
+# ==== Color themes ====
+
+#A guide is available to help you set these values: https://github.com/simonyiszk/openwebrx/wiki/Calibrating-waterfall-display-levels
+
+### default theme by teejez:
+waterfall_colors = "[0x000000ff,0x0000ffff,0x00ffffff,0x00ff00ff,0xffff00ff,0xff0000ff,0xff00ffff,0xffffffff]"
+waterfall_min_level = -88 #in dB
+waterfall_max_level = -20
+waterfall_auto_level_margin = (5, 40)
+### old theme by HA7ILM:
+#waterfall_colors = "[0x000000ff,0x2e6893ff, 0x69a5d0ff, 0x214b69ff, 0x9dc4e0ff, 0xfff775ff, 0xff8a8aff, 0xb20000ff]"
+#waterfall_min_level = -115 #in dB
+#waterfall_max_level = 0
+#waterfall_auto_level_margin = (20, 30)
+##For the old colors, you might also want to set [fft_voverlap_factor] to 0.
+
+#Note: When the auto waterfall level button is clicked, the following happens:
+# [waterfall_min_level] = [current_min_power_level] - [waterfall_auto_level_margin[0]]
+# [waterfall_max_level] = [current_max_power_level] + [waterfall_auto_level_margin[1]]
+#
+# ___|____________________________________|____________________________________|____________________________________|___> signal power
+# \_waterfall_auto_level_margin[0]_/ |__ current_min_power_level | \_waterfall_auto_level_margin[1]_/
+# current_max_power_level __|
+
+# 3D view settings
+mathbox_waterfall_frequency_resolution = 128 #bins
+mathbox_waterfall_history_length = 10 #seconds
+mathbox_waterfall_colors = "[0x000000ff,0x2e6893ff, 0x69a5d0ff, 0x214b69ff, 0x9dc4e0ff, 0xfff775ff, 0xff8a8aff, 0xb20000ff]"
+
+# === Experimental settings ===
+#Warning! The settings below are very experimental.
+csdr_dynamic_bufsize = False # This allows you to change the buffering mode of csdr.
+csdr_print_bufsizes = False # This prints the buffer sizes used for csdr processes.
+csdr_through = False # Setting this True will print out how much data is going into the DSP chains.
+
+nmux_memory = 50 #in megabytes. This sets the approximate size of the circular buffer used by nmux.
+
+#Look up external IP address automatically from icanhazip.com, and use it as [server_hostname]
+"""
+print "[openwebrx-config] Detecting external IP address..."
+import urllib2
+server_hostname=urllib2.urlopen("http://icanhazip.com").read()[:-1]
+print "[openwebrx-config] External IP address detected:", server_hostname
+"""
diff --git a/groundstation/config_webrx_fm.py b/groundstation/config_webrx_fm.py
new file mode 100644
index 00000000..fbe61561
--- /dev/null
+++ b/groundstation/config_webrx_fm.py
@@ -0,0 +1,216 @@
+# -*- coding: utf-8 -*-
+
+"""
+config_webrx: configuration options for OpenWebRX
+
+ This file is part of OpenWebRX,
+ an open-source SDR receiver software with a web UI.
+ Copyright (c) 2013-2015 by Andras Retzler
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see .
+
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+ In addition, as a special exception, the copyright holders
+ state that config_rtl.py and config_webrx.py are not part of the
+ Corresponding Source defined in GNU AGPL version 3 section 1.
+
+ (It means that you do not have to redistribute config_rtl.py and
+ config_webrx.py if you make any changes to these two configuration files,
+ and use them for running your web service with OpenWebRX.)
+"""
+
+# NOTE: you can find additional information about configuring OpenWebRX in the Wiki:
+# https://github.com/simonyiszk/openwebrx/wiki
+
+# ==== Server settings ====
+web_port=8073
+server_hostname="localhost" # If this contains an incorrect value, the web UI may freeze on load (it can't open websocket)
+max_clients=20
+
+# ==== Web GUI configuration ====
+receiver_name="AMSATCubeSat Simulator Ground Station"
+receiver_location=""
+receiver_qra=""
+receiver_asl=0
+receiver_ant="monopole"
+receiver_device="RTL-SDR"
+receiver_admin="ku2y@amsat.org"
+receiver_gps=(39.0302,-77.0747)
+photo_height=350
+photo_title="ARISS - Amateur Radio on the International Space Station"
+photo_desc="""
+You can add your own background photo and receiver information.
+Receiver is operated by: %[RX_ADMIN]
+Device: %[RX_DEVICE]
+Antenna: %[RX_ANT]
+Website: http://localhost
+"""
+
+# ==== sdr.hu listing ====
+# If you want your ham receiver to be listed publicly on sdr.hu, then take the following steps:
+# 1. Register at: http://sdr.hu/register
+# 2. You will get an unique key by email. Copy it and paste here:
+sdrhu_key = ""
+# 3. Set this setting to True to enable listing:
+sdrhu_public_listing = False
+
+# ==== DSP/RX settings ====
+fft_fps=9
+fft_size=4096 #Should be power of 2
+fft_voverlap_factor=0.3 #If fft_voverlap_factor is above 0, multiple FFTs will be used for creating a line on the diagram.
+
+samp_rate = 250000
+# samp_rate = 2400000
+center_freq = 128000000
+rf_gain = 37 #in dB. For an RTL-SDR, rf_gain=0 will set the tuner to auto gain mode, else it will be in manual gain mode.
+ppm = 0
+
+audio_compression="adpcm" #valid values: "adpcm", "none"
+fft_compression="adpcm" #valid values: "adpcm", "none"
+
+digimodes_enable=False # True #Decoding digimodes come with higher CPU usage.
+digimodes_fft_size=1024
+
+start_rtl_thread=True
+
+"""
+Note: if you experience audio underruns while CPU usage is 100%, you can:
+- decrease `samp_rate`,
+- set `fft_voverlap_factor` to 0,
+- decrease `fft_fps` and `fft_size`,
+- limit the number of users by decreasing `max_clients`.
+"""
+
+# ==== I/Q sources ====
+# (Uncomment the appropriate by removing # characters at the beginning of the corresponding lines.)
+
+#################################################################################################
+# Is my SDR hardware supported? #
+# Check here: https://github.com/simonyiszk/openwebrx/wiki#guides-for-receiver-hardware-support #
+#################################################################################################
+
+# You can use other SDR hardware as well, by giving your own command that outputs the I/Q samples... Some examples of configuration are available here (default is RTL-SDR):
+
+# >> RTL-SDR via rtl_sdr
+start_rtl_command="rtl_sdr -s {samp_rate} -f {center_freq} -p {ppm} -g {rf_gain} -".format(rf_gain=rf_gain, center_freq=center_freq, samp_rate=samp_rate, ppm=ppm)
+format_conversion="csdr convert_u8_f"
+
+#lna_gain=8
+#rf_amp=1
+#start_rtl_command="hackrf_transfer -s {samp_rate} -f {center_freq} -g {rf_gain} -l{lna_gain} -a{rf_amp} -r-".format(rf_gain=rf_gain, center_freq=center_freq, samp_rate=samp_rate, ppm=ppm, rf_amp=rf_amp, lna_gain=lna_gain)
+#format_conversion="csdr convert_s8_f"
+"""
+To use a HackRF, compile the HackRF host tools from its "stdout" branch:
+ git clone https://github.com/mossmann/hackrf/
+ cd hackrf
+ git fetch
+ git checkout origin/stdout
+ cd host
+ mkdir build
+ cd build
+ cmake .. -DINSTALL_UDEV_RULES=ON
+ make
+ sudo make install
+"""
+
+# >> Sound card SDR (needs ALSA)
+# I did not have the chance to properly test it.
+#samp_rate = 96000
+#start_rtl_command="arecord -f S16_LE -r {samp_rate} -c2 -".format(samp_rate=samp_rate)
+#format_conversion="csdr convert_s16_f | csdr gain_ff 30"
+
+# >> /dev/urandom test signal source
+# samp_rate = 2400000
+# start_rtl_command="cat /dev/urandom | (pv -qL `python -c 'print int({samp_rate} * 2.2)'` 2>&1)".format(rf_gain=rf_gain, center_freq=center_freq, samp_rate=samp_rate)
+# format_conversion="csdr convert_u8_f"
+
+# >> Pre-recorded raw I/Q file as signal source
+# You will have to correctly specify: samp_rate, center_freq, format_conversion in order to correctly play an I/Q file.
+#start_rtl_command="(while true; do cat my_iq_file.raw; done) | csdr flowcontrol {sr} 20 ".format(sr=samp_rate*2*1.05)
+#format_conversion="csdr convert_u8_f"
+
+#>> The rx_sdr command works with a variety of SDR harware: RTL-SDR, HackRF, SDRplay, UHD, Airspy, Red Pitaya, audio devices, etc.
+# It will auto-detect your SDR hardware if the following tools are installed:
+# * the vendor provided driver and library,
+# * the vendor-specific SoapySDR wrapper library,
+# * and SoapySDR itself.
+# Check out this article on the OpenWebRX Wiki: https://github.com/simonyiszk/openwebrx/wiki/Using-rx_tools-with-OpenWebRX/
+#start_rtl_command="rx_sdr -F CF32 -s {samp_rate} -f {center_freq} -p {ppm} -g {rf_gain} -".format(rf_gain=rf_gain, center_freq=center_freq, samp_rate=samp_rate, ppm=ppm)
+#format_conversion=""
+
+# >> gr-osmosdr signal source using GNU Radio (follow this guide: https://github.com/simonyiszk/openwebrx/wiki/Using-GrOsmoSDR-as-signal-source)
+#start_rtl_command="cat /tmp/osmocom_fifo"
+#format_conversion=""
+
+# ==== Misc settings ====
+
+shown_center_freq = center_freq #you can change this if you use an upconverter
+
+client_audio_buffer_size = 5
+#increasing client_audio_buffer_size will:
+# - also increase the latency
+# - decrease the chance of audio underruns
+
+start_freq = center_freq
+start_mod = "nfm" #nfm, am, lsb, usb, cw
+
+iq_server_port = 4951 #TCP port for ncat to listen on. It will send I/Q data over its connections, for internal use in OpenWebRX. It is only accessible from the localhost by default.
+
+#access_log = "~/openwebrx_access.log"
+
+# ==== Color themes ====
+
+#A guide is available to help you set these values: https://github.com/simonyiszk/openwebrx/wiki/Calibrating-waterfall-display-levels
+
+### default theme by teejez:
+waterfall_colors = "[0x000000ff,0x0000ffff,0x00ffffff,0x00ff00ff,0xffff00ff,0xff0000ff,0xff00ffff,0xffffffff]"
+waterfall_min_level = -88 #in dB
+waterfall_max_level = -20
+waterfall_auto_level_margin = (5, 40)
+### old theme by HA7ILM:
+#waterfall_colors = "[0x000000ff,0x2e6893ff, 0x69a5d0ff, 0x214b69ff, 0x9dc4e0ff, 0xfff775ff, 0xff8a8aff, 0xb20000ff]"
+#waterfall_min_level = -115 #in dB
+#waterfall_max_level = 0
+#waterfall_auto_level_margin = (20, 30)
+##For the old colors, you might also want to set [fft_voverlap_factor] to 0.
+
+#Note: When the auto waterfall level button is clicked, the following happens:
+# [waterfall_min_level] = [current_min_power_level] - [waterfall_auto_level_margin[0]]
+# [waterfall_max_level] = [current_max_power_level] + [waterfall_auto_level_margin[1]]
+#
+# ___|____________________________________|____________________________________|____________________________________|___> signal power
+# \_waterfall_auto_level_margin[0]_/ |__ current_min_power_level | \_waterfall_auto_level_margin[1]_/
+# current_max_power_level __|
+
+# 3D view settings
+mathbox_waterfall_frequency_resolution = 128 #bins
+mathbox_waterfall_history_length = 10 #seconds
+mathbox_waterfall_colors = "[0x000000ff,0x2e6893ff, 0x69a5d0ff, 0x214b69ff, 0x9dc4e0ff, 0xfff775ff, 0xff8a8aff, 0xb20000ff]"
+
+# === Experimental settings ===
+#Warning! The settings below are very experimental.
+csdr_dynamic_bufsize = False # This allows you to change the buffering mode of csdr.
+csdr_print_bufsizes = False # This prints the buffer sizes used for csdr processes.
+csdr_through = False # Setting this True will print out how much data is going into the DSP chains.
+
+nmux_memory = 50 #in megabytes. This sets the approximate size of the circular buffer used by nmux.
+
+#Look up external IP address automatically from icanhazip.com, and use it as [server_hostname]
+"""
+print "[openwebrx-config] Detecting external IP address..."
+import urllib2
+server_hostname=urllib2.urlopen("http://icanhazip.com").read()[:-1]
+print "[openwebrx-config] External IP address detected:", server_hostname
+"""
diff --git a/groundstation/cubesatsim-lite-alt.sh b/groundstation/cubesatsim-lite-alt.sh
new file mode 100755
index 00000000..9ad01561
--- /dev/null
+++ b/groundstation/cubesatsim-lite-alt.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+# script to run CubeSat Simulator Lite
+#
+# on SDR application, listen at 107.9
+
+echo -e "\nScript to run CubeSat Simulator Lite \n"
+
+sudo /home/pi/CubeSatSim/PiFmRds/src/pi_fm_rds -audio /home/pi/CubeSatSim/wav/afsk2.wav -freq 107.5
diff --git a/groundstation/cubesatsim-lite.sh b/groundstation/cubesatsim-lite.sh
new file mode 100755
index 00000000..5a048954
--- /dev/null
+++ b/groundstation/cubesatsim-lite.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+# script to run CubeSat Simulator Lite
+#
+# on SDR application, listen at 107.9
+
+echo -e "\nScript to run CubeSat Simulator Lite \n"
+
+sudo /home/pi/CubeSatSim/PiFmRds/src/pi_fm_rds -audio /home/pi/CubeSatSim/wav/afsk2.wav -freq 107.9
diff --git a/groundstation/decode-lite.sh b/groundstation/decode-lite.sh
new file mode 100755
index 00000000..4db99571
--- /dev/null
+++ b/groundstation/decode-lite.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# script to auto decode CubeSat Simulator telemetry
+
+# kill openwebrx if it is running
+ps -ef | grep rtl | grep -v grep | awk '{print $2}' | sudo xargs kill
+
+echo -e "Script to auto decode CubeSat Simulator telemetry\n"
+
+sudo rtl_fm -f 107.906M -M wbfm -s 70000 -g 48 - | multimon-ng -a AFSK1200 -A -t raw -
+
diff --git a/groundstation/decode.sh b/groundstation/decode.sh
old mode 100644
new mode 100755
diff --git a/groundstation/default.conf b/groundstation/default.conf
new file mode 100644
index 00000000..7f3e052c
--- /dev/null
+++ b/groundstation/default.conf
@@ -0,0 +1,33 @@
+[General]
+configversion=2
+crashed=false
+
+[audio]
+gain=224
+udp_host=localhost
+
+[fft]
+fft_size=4096
+split=40
+
+[gui]
+geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x2\0\0\0\0\0\0\0\0\0$\0\0\x3\xff\0\0\x2\xff\0\0\0\0\0\0\0\x42\0\0\x2\xe8\0\0\x2\xed\0\0\0\0\x2\0\0\0\x4\0)
+state=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\x2\0\0\0\x1\0\0\x1&\0\0\x2\x65\xfc\x2\0\0\0\x2\xfc\0\0\0\x41\0\0\x1\x90\0\0\x1\x83\0\b\0 \xfa\0\0\0\x1\x2\0\0\0\x3\xfb\0\0\0\x18\0\x44\0o\0\x63\0k\0I\0n\0p\0u\0t\0\x43\0t\0l\x1\0\0\0\0\xff\xff\xff\xff\0\0\x1.\0\xff\xff\xff\xfb\0\0\0\x12\0\x44\0o\0\x63\0k\0R\0x\0O\0p\0t\x1\0\0\0\0\xff\xff\xff\xff\0\0\x1\x62\0\a\xff\xff\xfb\0\0\0\xe\0\x44\0o\0\x63\0k\0\x46\0\x66\0t\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\xc8\0\a\xff\xff\xfc\0\0\x1\xd7\0\0\0\xcf\0\0\0\xc8\0\xff\xff\xff\xfa\0\0\0\0\x2\0\0\0\x2\xfb\0\0\0\x12\0\x44\0o\0\x63\0k\0\x41\0u\0\x64\0i\0o\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\xc8\0\xff\xff\xff\xfb\0\0\0\xe\0\x44\0o\0\x63\0k\0R\0\x44\0S\0\0\0\0\0\xff\xff\xff\xff\0\0\0h\0\xff\xff\xff\0\0\0\x3\0\0\x2\xd4\0\0\0\xe9\xfc\x1\0\0\0\x1\xfb\0\0\0\x1a\0\x44\0o\0\x63\0k\0\x42\0o\0o\0k\0m\0\x61\0r\0k\0s\x1\0\0\0\0\0\0\x2\xd4\0\0\x1\x42\0\xff\xff\xff\0\0\x2\xd4\0\0\x1v\0\0\0\x1\0\0\0\x2\0\0\0\b\0\0\0\x2\xfc\0\0\0\x1\0\0\0\x2\0\0\0\x1\0\0\0\x16\0m\0\x61\0i\0n\0T\0o\0o\0l\0\x42\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0)
+
+[input]
+device="rtl=0"
+frequency=145800000
+gains=@Variant(\0\0\0\b\0\0\0\x1\0\0\0\x6\0L\0N\0\x41\0\0\0\x2\0\0\x1\xf0)
+sample_rate=512000
+
+[receiver]
+agc_decay=100
+agc_off=true
+demod=3
+filter_high_cut=5000
+filter_low_cut=-5000
+offset=-202000
+sql_level=-42.5
+
+[remote_control]
+allowed_hosts=::ffff:127.0.0.1
diff --git a/groundstation/gqrx.sh b/groundstation/gqrx.sh
new file mode 100755
index 00000000..7e995d2e
--- /dev/null
+++ b/groundstation/gqrx.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+# script to auto decode CubeSat Simulator telemetry
+
+# kill rtl if running
+ps -ef | grep rtl | grep -v grep | awk '{print $2}' | sudo xargs kill
+
+# kill openwebrx process if running
+ps -ef | grep openwebrx | grep -v grep | awk '{print $2}' | sudo xargs kill
+
+# kill csdr process if running
+ps -ef | grep csdr | grep -v grep | awk '{print $2}' | sudo xargs kill
+
+echo -e "Script to run Gqrx\n"
+
+/home/pi/gqrx-sdr-2.11.5-linux-rpi3/gqrx
+
diff --git a/groundstation/ipaddress.sh b/groundstation/ipaddress.sh
old mode 100644
new mode 100755
diff --git a/groundstation/kill_all.sh b/groundstation/kill_all.sh
new file mode 100755
index 00000000..2d9970ec
--- /dev/null
+++ b/groundstation/kill_all.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+# script to kill all SDR or RTL processes
+#
+
+echo -e "\nKilling all SDR or RTL processes \n"
+
+# kill rtl if running
+ps -ef | grep rtl_ | grep -v grep | awk '{print $2}' | sudo xargs kill > /dev/null 2>&1
+
+# kill openwebrx process if running
+ps -ef | grep openwebrx | grep -v grep | awk '{print $2}' | sudo xargs kill > /dev/null 2>&1
+
+# kill csdr process if running
+ps -ef | grep csdr | grep -v grep | awk '{print $2}' | sudo xargs kill > /dev/null 2>&1
+
+# kill gqrx process if running
+ps -ef | grep gqrx-sdr-2.11.5-linux-rpi3/gqrx | grep -v grep | awk '{print $2}' | sudo xargs kill > /dev/null 2>&1
+
+
diff --git a/groundstation/rtl-tcp-alt.sh b/groundstation/rtl-tcp-alt.sh
new file mode 100755
index 00000000..53cb0d6a
--- /dev/null
+++ b/groundstation/rtl-tcp-alt.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+# script to run RTL-TCP Server
+#
+# On SDR client, use 10.3.141.1:1234 to connect
+
+echo -e "\nScript to run RTL-TCP Server for ARISS Ground Station\n"
+
+echo -e "IP Address to use in web browsers is: "
+
+hostname -I|cut -f1 -d ' '
+
+./kill_all.sh
+
+sudo /bin/sh -c '/usr/local/bin/rtl_tcp -a $(hostname -I|cut -f2 -d " ")'
diff --git a/groundstation/rtl-tcp.sh b/groundstation/rtl-tcp.sh
new file mode 100755
index 00000000..9559643c
--- /dev/null
+++ b/groundstation/rtl-tcp.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+# script to run RTL-TCP Server
+#
+# On SDR client, use 10.3.141.1:1234 to connect
+
+echo -e "\nScript to run RTL-TCP Server for ARISS Ground Station\n"
+
+echo -e "IP Address to use in web browsers is: "
+
+hostname -I|cut -f1 -d ' '
+
+./kill_all.sh
+
+sudo /bin/sh -c '/usr/local/bin/rtl_tcp -a $(hostname -I|cut -f1 -d " ")'
diff --git a/groundstation/satnogs_readme.txt b/groundstation/satnogs_readme.txt
new file mode 100644
index 00000000..21f0ef05
--- /dev/null
+++ b/groundstation/satnogs_readme.txt
@@ -0,0 +1,19 @@
+This image has the SatNOGS client pre installed. It allows you to join the Satellite Network Operators Group network:
+
+https://network.satnogs.org
+
+To join, all you have to do is follow the instructions starting at SatNOGS Client Setup
+
+https://wiki.satnogs.org/SatNOGS_Client_Ansible#SatNOGS_Client_Setup
+
+You will need to Sign Up and create an account:
+
+https://network.satnogs.org/login/auth0
+
+Maybe include "ARISS" in your SatNOGS station name? For example: Joe's ARISS GS
+
+Once you have an account and have logged in, click on the upper right corner and select Dashboard. Click on the API Key button to copy and paste your API Key which you will need to configure using sudo satnogs-setup Basic Configuration SATNOGS_API_TOKEN
+
+Good luck and feel free to message me ku2y on SatNOGS!
+
+
diff --git a/groundstation/sdr-2m.sh b/groundstation/sdr-2m.sh
new file mode 100755
index 00000000..429cb736
--- /dev/null
+++ b/groundstation/sdr-2m.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+# script to run OpenWebRX SDR
+
+echo -e "\nScript to run SDR for ARISS Ground Station\n"
+
+echo -e "IP Address to use in web browsers is: "
+
+hostname -I|cut -f1 -d ' '
+
+
+./kill_all.sh
+
+cd ~/openwebrx
+
+chromium-browser http://localhost:8073 &
+
+sudo python openwebrx.py config_webrx_145
diff --git a/groundstation/sdr-70cm.sh b/groundstation/sdr-70cm.sh
new file mode 100755
index 00000000..e0895206
--- /dev/null
+++ b/groundstation/sdr-70cm.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+# script to run OpenWebRX SDR
+
+echo -e "\nScript to run SDR for ARISS Ground Station\n"
+
+echo -e "IP Address to use in web browsers is: "
+
+hostname -I|cut -f1 -d ' '
+
+
+./kill_all.sh
+
+./kill_all.sh
+
+cd ~/openwebrx
+
+chromium-browser http://localhost:8073 &
+
+sudo python openwebrx.py config_webrx_440
diff --git a/groundstation/sdr-fm.sh b/groundstation/sdr-fm.sh
new file mode 100755
index 00000000..188db296
--- /dev/null
+++ b/groundstation/sdr-fm.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+# script to run OpenWebRX SDR
+
+echo -e "\nScript to run SDR for ARISS Ground Station\n"
+
+echo -e "IP Address to use in web browsers is: "
+
+hostname -I|cut -f1 -d ' '
+
+
+./kill_all.sh
+
+cd ~/openwebrx
+
+chromium-browser http://localhost:8073 &
+
+sudo python openwebrx.py config_webrx_107
+
diff --git a/groundstation/sdr.sh b/groundstation/sdr.sh
old mode 100644
new mode 100755