Sunday, April 10, 2016

Wifibroadcast receiving on a PC

Yup, you definitely can watch on a PC. (And there's no limit on how many! :D)
Tested on a Lenovo x230 running Ubuntu 14.01 LTS x64 with a TP-Link TP-WN722N.

Installing wifibroadcast:
open Terminal or some other commanline and input:

  • sudo apt-get install mercurial libpcap-dev iw
  • hg clone
  • cd wifibroadcast
  • make
If there's no screaming or error, you may proceed with connecting the wifi card and waiting until it lights up. Then proceed with setting it up:
  • cd $HOME/wifibroadcast
  • sudo ifconfig wlan1 down
  • sudo iw dev wlan1 set monitor otherbss fcsfail
  • sudo ifconfig wlan1 up
  • sudo iwconfig wlan1 channel 13
Run the program with:
  • sudo ./rx -b 8 -r 4 -f 1024 wlan1 | gst-launch-1.0 -v fdsrc ! h264parse ! avdec_h264 !  xvimagesink sync=false
Once there is a valid signal from the transmitter, the wifi LED will start flashing and shortly after you should see a window with the stream pop up. 
To infinity and beyond!

You can close it with ALT+F4 and stop the wifi with 

  • sudo ifconfig wlan1 down

To start it up again, repeat the setup (no need to install anything again) and run the program. Here I'm using wlan1, because I'm assuming that like me, you'll be using a laptop, so wlan0 will likely be taken by the internal wifi card. This may however not be the case, unless you are sure, check with ifconfig

Scripting it because typing everything is for noobs

1) create a new file (with no extension) and open with a text editor of your choice (I used gedit)
2) paste the following into it:
  • cd $HOME/wifibroadcast
  • ifconfig wlan1 down
  • iw dev wlan1 set monitor otherbss fcsfail
  • ifconfig wlan1 up
  • iwconfig wlan1 channel 13
  • ./rx -b 8 -r 4 -f 1024 wlan1 | gst-launch-1.0 -v fdsrc ! h264parse ! avdec_h264 !  xvimagesink sync=false
3) save to a convenient place, like /home
4) type the following into terminal, replacing "script_name" with the actual one you saved:
  • chmod 755 "script_name"
This gives the script read and write permissions.
5) to run the script, you only have to type:
  • sudo ./script_name
Again, replacing "script_name" with the actual one. You have to use sudo, because it needs permissions to tweak the wifi dongle. Without it, it'll never run.

1 comment: