Skip to content
WodoWiesel edited this page Apr 26, 2020 · 6 revisions

alt text

PiFunk Transmitter for CB/PMR with FM/AM-Modulation

PiFunk Pages

Commands:

changing config.txt of the pi obligatory!

for 1-wire configuration add line:

dtoverlay=w1-gpio,gpiopin=4,pullup=0,i2c-rtc,ds3231 (add pullup=1 if needed)

snd-bcm2835

i2c-dev

rtc-ds1307

for RTC D3231 with CR1220-battery coin cell

-> I2C-Bus needed with GPIO-Pins

Pin#1 3.3V

Pin#3 SDA

Pin#5 SCL

Pin#7 GPIO4

Pin#9 GND

temp-Range -40 to +85 C -> -40 to 185 F

Accuracy +- 5 ppm (+- 0,432 s / day)

output: 1 Hz - 32,768 kHz

400 kHz I2C

16-pol SO-Plug (300 mil)#

+2,3 V to +5,5 V

read time directly from rtc module

hwclock -r

update rtc module time from system time

(system time should be regularly updated by ntp from the internet if your pi is networked):

hwclock -w

update system time from the rtc module (this should happen on start-up):

hwclock -s

and the most fun of all - monitor the "drift" between your system clock and the rtc module:

hwclock -c

for display-script:

modprobe i2c_bcm2708

modprobe i2c_dev

chmod 666 /dev/i2c-1

adduser pi i2c

compile with g++ wpi-i2c.c -o wpi-i2c -lwiringPi

command for looking device up :

i2cdetect -l

i2cdetect -y 1


for installation of the program:

sudo apt-get install libsndfile-dev

then go to directory:

cd PiFunk

compile with:

-lm flag for math lib obligatory

-g for debugger

-lsndfile for ALSA snd lib

gcc -lm -g -std=c99 -lsndfile pifunk.c -o pifunk pifunk.o pifunk.a // sometimes -std=gnu99

make install

make

run with admin/root permissions:

arguments:

[filename (*.wav)] [freq (MHz)] [samplerate (kHz)] [modulation (fm/am)] [callsign (optional)]

extra single arguments:

[menu] as step-by-step-assistent

[help] for more infos and arguments

default: sudo pifunk sound.wav 100.0000 22050 fm callsign

Radio works with *.wav-file with 16-bit @ 22050.0 [Hz] mono (or 11.025/14500)

0.1-700 MHz (pi B+) range. you also can use a better pi (pi 3B+ with 1.2 GHz clock) or overclock it

Use '. dot' as decimal-comma separator!

Pi operates with square-waves (^2) PWM on GPIO 4/Pin 7 @ ~500 mA!

Links:

CTSS-tones in CSV-file

Client (standalone)

maybe Server in the future

German SRD law

Morse Code Table

Pi B+ GPIO pinout

(C) 2017-2019 by wodowiesel (all rights reserved)

Based on pifm

Sidebar:

Clone this wiki locally