For project updates, visit: AgriVision - Raspberry Pi SSTV Camera.

The goal of this project is to use the Raspberry Pi with the PiCam as a wireless camera which can transmit images over long distances, usually tenths of kilometers. Images will be transmitted by amateur radio (ham-radio) using slow scan television (SSTV) on the 2 meter band (144.5 MHz).

Since the Pi can generate the HF FM signal itself, no additional electronics are needed for low power transmissions. For a little bit more power a one or two transistor amplifier will be suitable. Furthermore a low pass filter is recommended to filter out higher harmonics of the signal.

This project also contains a python script which detects movement. Using this script the Raspberry Pi can be used as a wireless security cam at distances far outside the range of normal WiFi networks.

Be aware that you need a ham-radio license to use this application!

Here is a video of the camera in action:


Step 1: Capturing the Image

First thing to do is capturing the image we want to transmit. This can easily be done with raspistill:

raspistill -t 1 --width 320 --height 256 -e png -o /tmp/image.png   

For sstv we need a small image, of 320 x 256, it is saved into the /tmp directory as png.

<p>Hi, i try to compile the program but have a error:<br><br>pisstv.c:(.text+0x485): referencia a `magic_open' sin definir</p><p>pisstv.c:(.text+0x4a5): referencia a `magic_load' sin definir</p><p>pisstv.c:(.text+0x4bf): referencia a `magic_file' sin definir</p><p>pisstv.c:(.text+0x561): referencia a `magic_close' sin definir</p><p>/tmp/cckZd77k.o: En la funci&oacute;n `playtone':</p><p>pisstv.c:(.text+0x622): referencia a `sin' sin definir</p><p>/tmp/cckZd77k.o: En la funci&oacute;n `buildaudio':</p><p>pisstv.c:(.text+0x9c7): referencia a `gdImageGetTrueColorPixel' sin definir<br><br>I run ubuntu 14.04, some idea? THX for share</p>
<p>gcc -o sstv sstv.c -lm -lgd -lmagic</p>
<p>Thanks!!! for share!!</p>
<p>Port to <strong>openwrt </strong>15.05 AR71XX / AR91XX / AR93XX :</p><p>link to binary exe: sstv</p><p>before start install dependencies: </p><p><strong>opkg install libgd</strong></p><p><strong>opkg install file</strong></p><p>// ENJOY sstv for 120mA on Wifi router : </p><p>Created soundfile in 53 seconds. /11kHz</p><p></p>
<p>sstv bin : </p><p>https://drive.google.com/file/d/0B-fg490HfaS6b3dhbktrVWhlNVE/view?usp=sharing</p>
<p>sadly the same here: </p><p>:~# gcc -lgd -lmagic -o sstv sstv.c<br>/tmp/cc8WnnPs.o: In function `main':<br>sstv.c:(.text+0x3f5): undefined reference to `gdImageCreateFromJpeg'<br>sstv.c:(.text+0x416): undefined reference to `gdImageCreateFromPng'<br>/tmp/cc8WnnPs.o: In function `filetype':<br>sstv.c:(.text+0x505): undefined reference to `magic_open'<br>sstv.c:(.text+0x522): undefined reference to `magic_load'<br>sstv.c:(.text+0x53b): undefined reference to `magic_file'<br>sstv.c:(.text+0x5e1): undefined reference to `magic_close'<br>/tmp/cc8WnnPs.o: In function `playtone':<br>sstv.c:(.text+0x6ac): undefined reference to `sin'<br>/tmp/cc8WnnPs.o: In function `buildaudio':<br>sstv.c:(.text+0xb1f): undefined reference to `gdImageGetTrueColorPixel'<br>collect2: error: ld returned 1 exit status</p>
<p>fix for debian x86:</p><p>compile whit: gcc -o sstv sstv.c -lm -lgd -lmagic</p>
<p>on raspi i get : </p><p>root@raspberrypi:/home/pi# gcc -lgd -lmagic -o sstv sstv.c<br>/usr/bin/ld: /tmp/ccBLc9lA.o: undefined reference to symbol 'sin@@GLIBC_2.4'<br>//lib/arm-linux-gnueabihf/libm.so.6: error adding symbols: DSO missing from command line<br>collect2: error: ld returned 1 exit status</p><p>any ideas from author ?</p><p>73</p>
<p>fix: </p><p>root@raspberrypi:/home/pi# gcc -lgd -lmagic -o sstv sstv.c <strong>-lm</strong><br>root@raspberrypi:/home/pi# ./sstv<br>Usage: ./sstv wavfile.wav [sample rate]<br> default sample rate = 11025<br> maximum samplerate = 22050</p>
<p>any one can confirm tis is working nowdays ? or it is obsolete </p>
<p>Would this work with the A+ or not? </p><p>KD2DVF</p>
Since the A+ only differs in pin number and memory, I expect yes.
<p>How does one go about figuring out the timing for ones pi? And where would I make that change in the python config? I have it transmitting but the timing is off and I cannot seem to figure it out. </p>
<p>What kind of distance can you expect out of this rig with just a small antenna and no signal boosting from say a HAB? </p>
a distance of 10km is reported.
<p>Amazing! Thanks for the reply. Any idea how high the signal was being sent from in order to achieve those types of results? </p>
<p>Hi, PySSTV dev here. Yes, the Pi is really slow for pure Python PySSTV, so we've developed UNIXSSTV that performs the most CPU intensive part in native code. This way you get the best of both worlds, since PySSTV is versatile and can handle many modes, but converting images on a RPi model A is under 30 seconds. See https://github.com/dnet/unixsstv and http://hsbp.org/rpi-sstv</p>
Thanks, this is indeed much better than the minutes needed for PySSTV, although still 30s, where the c implementation I'm using now is just 4 s.<br>But indeed that one is less versatile as it only does Martin 1.<br>I certainly will give it a try.<br>
<p>Does the image get screwed over if there is any noise on the frequency? Some of my friends were playing with tcp/ip over ax.25 and some jerk was broadcasting over us and all the packets would become currupted.</p>
<p>depends on the signal strength, strongest signal wins, the same as with WiFi or other wireless techniques. You can increase your signal strength by using more power, or better use directional antenna's with high gain on both the receive and transmit side.</p>
<p>Also, since it's an analog method of transmission, there's no &quot;digital cliff&quot; (Google the term if you haven't heard it before), so even with noise, some of the original image can be seen.</p>
<p>Happy to see more use of ham radio on the site, especially <br>in this useful of a project! I would like to add though that the 2 meter band is in the VHF range, not HF.</p>
James,<br><br>you are right, but what I ment here is high frequency (either HF or VHF) compared to low frequency like audio.<br><br>Best,<br>Gerrit.
<p>wow this is great.</p><p>I'm hoping to implement your version of pifm and a usb gps dongle into a aprs beacon. you have inspired me, but I don't know if I have the programing skills.</p><p>73</p>
<p>I'm using your custom code but I'm getting a 'Segmentation fault' error? How do I fix this?</p><p>Cheers</p>
<p>I'm an idiot... Fixed it. I tried to use another image...</p>
<p>Alternatively we can use walkie-talkie pair with shared band(channel) to use this without getting arrested by FCC.</p><p>(Or,a FM-band low power transmitter that doesn't interfere with commercial radiowaves)</p>
<p>Thanks for sharing. I have been snooping around for something similar ever since PiFM was announced. This was a great step by step guide. The steps were easy to follow and and I even took the step to mod. the text color in sstvcatch.py to yellow for better contrast.</p><p>73!</p>

About This Instructable




More by soldeerridder:Raspberry Pi (security) Slow Scan Television Camera Make it Glow Box (a polariscope from sunglasses) Team Pong 
Add instructable to: