diff --git a/Readme.md b/Readme.md index 077cd65..c0026a1 100644 --- a/Readme.md +++ b/Readme.md @@ -17,19 +17,21 @@ Plug a wire on GPIO 18, means Pin 12 of the GPIO header ([header P1](http://elin - from **IQ** files *.iq (could be generated by external software like gnuradio or by some few examples of modulations). - from **Frequency/Time** files *.ft (generally used implement easily digital modes) -Usage:rpitx [-i File Input][-m ModeInput] [-f frequency output] [-s Samplerate] [-l] [-p ppm] [-h] --m {IQ(FileInput is a Stereo Wav contains I on left Channel, Q on right channel)} - {IQFLOAT(FileInput is a Raw float interlaced I,Q)} - {RF(FileInput is a (double)Frequency,Time in nanoseconds} - {RFA(FileInput is a (double)Frequency,(int)Time in nanoseconds,(float)Amplitude} - {VFO (constant frequency)} --i path to File Input --f float frequency to output on GPIO_18 pin 12 in khz : (130 kHz to 750 MHz), --l loop mode for file input --p float frequency correction in parts per million (ppm), positive or negative, for calibration, default 0. --d int DMABurstSize (default 1000) but for very short message, could be decrease --h help (this help). +Usage: + rpitx [-i File Input][-m ModeInput] [-f frequency output] [-s Samplerate] [-l] [-p ppm] [-h] + -m {IQ(FileInput is a Stereo Wav contains I on left Channel, Q on right channel)} + {IQFLOAT(FileInput is a Raw float interlaced I,Q)} + {RF(FileInput is a (double)Frequency,Time in nanoseconds} + {RFA(FileInput is a (double)Frequency,(int)Time in nanoseconds,(float)Amplitude} + {VFO (constant frequency)} + -i path to File Input + -f float frequency to output on GPIO_18 pin 12 in khz : (130 kHz to 750 MHz), + -l loop mode for file input + -p float frequency correction in parts per million (ppm), positive or negative, for calibration, default 0. + -d int DMABurstSize (default 1000) but for very short message, could be decrease + -h help (this help). +

Modulation samples

Some modulations are included in the software and can be easily extended. They create files which could be ingest by rpitx. Some output in IQ (like ssb) other in FT(like sstv) diff --git a/install.sh b/install.sh index 378008f..b8d88dc 100755 --- a/install.sh +++ b/install.sh @@ -6,5 +6,6 @@ sudo apt-get install imagemagick sudo mknod /dev/rpidatv-mb c 100 0 cd src make -j4 +sudo make install cd .. echo Installation done diff --git a/src/Makefile b/src/Makefile index ac7b9cd..8d2d55a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,40 +1,46 @@ -all: PiTx Pissb pisstv pifsq pifm piam +all: ../rpitx ../pissb ../pisstv ../pifsq ../pifm ../piam #CFLAGS = -Wall -g -O2 -D DIGITHIN CFLAGS = -Wall -g -O2 -Wno-unused-variable LDFLAGS = -lm -lrt -lpthread -PiTx : RpiGpio.c RpiTx.c mailbox.c RpiDma.c +../rpitx: RpiGpio.c RpiTx.c mailbox.c RpiDma.c $(CC) $(CFLAGS) -o ../rpitx RpiTx.c RpiGpio.c mailbox.c RpiDma.c $(LDFLAGS) CFLAGS_Pissb = -Wall -g -O2 -Wno-unused-variable LDFLAGS_Pissb = -lm -lrt -lpthread -lsndfile -Pissb : ../ssbgen/test_ssb.c ../ssbgen/ssb_gen.c +../pissb: ../ssbgen/test_ssb.c ../ssbgen/ssb_gen.c $(CC) $(CFLAGS_Pissb) -o ../pissb ../ssbgen/ssb_gen.c ../ssbgen/test_ssb.c $(LDFLAGS_Pissb) CFLAGS_Pisstv = -Wall -g -O2 -Wno-unused-variable LDFLAGS_Pisstv = -lm -lrt -lpthread -pisstv : ../sstv/pisstv.c +../pisstv : ../sstv/pisstv.c $(CC) $(CFLAGS_Pisstv) -o ../pisstv ../sstv/pisstv.c $(LDFLAGS_Pisstv) CFLAGS_Pifsq = -Wall -g -O2 -Wno-unused-variable LDFLAGS_Pifsq = -lm -lrt -lpthread -pifsq : ../fsq/pifsq.c +../pifsq : ../fsq/pifsq.c $(CC) $(CFLAGS_Pisfq) -o ../pifsq ../fsq/pifsq.c $(LDFLAGS_Pisfq) CFLAGS_Pifm = -Wall -g -O2 -Wno-unused-variable LDFLAGS_Pifm = -lm -lrt -lpthread -lsndfile -pifm : ../fm/pifm.c +../pifm : ../fm/pifm.c $(CC) $(CFLAGS_Pifm) -o ../pifm ../fm/pifm.c $(LDFLAGS_Pifm) CFLAGS_Piam = -Wall -g -O2 -Wno-unused-variable LDFLAGS_Piam = -lm -lrt -lpthread -lsndfile -piam : ../am/piam.c +../piam : ../am/piam.c $(CC) $(CFLAGS_Piam) -o ../piam ../am/piam.c $(LDFLAGS_Piam) clean: - rm -f RpiTx.o mailbox.o RpiGpio.o RpiDma.o + rm -f ../rpitx ../pissb ../pisstv ../pifsq ../pifm ../piam RpiTx.o mailbox.o RpiGpio.o RpiDma.o - +install: all + install -m 0755 ../pisstv /usr/bin + install -m 0755 ../pifm /usr/bin + install -m 0755 ../piam /usr/bin + install -m 0755 ../pissb /usr/bin + install -m 0755 ../pifsq /usr/bin + install -m 0755 ../rpitx /usr/bin diff --git a/src/RpiTx.c b/src/RpiTx.c index 7ae5a78..d94b98b 100644 --- a/src/RpiTx.c +++ b/src/RpiTx.c @@ -901,7 +901,11 @@ main(int argc, char **argv) //Open File Input for modes which need it if((Mode==MODE_IQ)||(Mode==MODE_IQ_FLOAT)||(Mode==MODE_RF)||(Mode==MODE_RFA)) { - FileInHandle = open(FileName, 'r'); + if(strcmp(FileName,"-")==0) + { + FileInHandle = STDIN_FILENO; + } + else FileInHandle = open(FileName, 'r'); if (FileInHandle < 0) { fatal("Failed to read Filein %s\n",FileName); @@ -1159,7 +1163,7 @@ for (;;) close(FileInHandle); FileInHandle = open(FileName, 'r'); } - else + else if (FileInHandle != STDIN_FILENO) terminate(0); @@ -1227,7 +1231,7 @@ for (;;) FileInHandle = open(FileName, 'r'); NbRead=read(FileInHandle,TabRfSample+i,sizeof(samplerf_t)); } - else + else if (FileInHandle != STDIN_FILENO) { sleep(1); terminate(0); @@ -1275,7 +1279,7 @@ for (;;) FileInHandle = open(FileName, 'r'); NbRead=read(FileInHandle,TabRfSample+i,sizeof(samplerf_t)); } - else + else if (FileInHandle != STDIN_FILENO) terminate(0); } //for(i=0;i