Closed maxmvanderwel closed 6 years ago
I have never tried it myself on a PC, so cannot really help much. From the top of my head, I'd say you probably have to remove the wiringPi library from the Makefile (and tracker.c which uses it) to make it run. Also you need to run the sharedmem_init_rx program before to initialize the shared memory.
I’m gonna try that. Thanks for your help
On Sat, Apr 7, 2018 at 2:18 PM Rodizio notifications@github.com wrote:
I have never tried it myself so cannot really help much. From the top of my head, I'd say you probably have to remove the wiringPi library from the Makefile (and tracker.c which uses it) to make it run on a PC. Also you need to run the sharedmem_init_rx program before to initialize the shared memory.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bortek/EZ-WifiBroadcast/issues/108#issuecomment-379465210, or mute the thread https://github.com/notifications/unsubscribe-auth/AdCFjIXSB4EycwJnv-ldAmDNO7tDFVXpks5tmK5rgaJpZM4TGqYo .
You can use PC for both RX and TX role. (As for a video stream )But take attention at video player at RX side. For example vlc gives me around 1- 2 second of latency , and nothing less. With same settings at TX side mplayer shows 0.25 sec or 250 ms of latency .
Can confirm that mavlink two way control work too. PC1 (Ground Control) Mission Planner (udp 14550) <-> Ethernet <-> PC2 (Ground ReciveTransfer station) mavlink-routerd (rx_rc_telemetry_buf -p 1 . + tx_telemetry -p 3 ...) < Wireless link> PC3 (Air station) -> APM. It took some time to analyze and understand how./profile scripts works even if all work already done :) by Rodizio1 and community (probably) ...(Thx for great job btw) If it will be useful for someone I can public short version of commands needed to run that setup (tiny version of ./profile without RP dependency to just run mavlink connection ).
@rodizio1 Thank you for this really cool FPV.
I'm trying to do the same thing as maxmvanderwel since I want to run OpenCV on RX. My tx is a raspberry pi zero + RT5370 and working perfect. My RX is ubuntu 16.04 using the same wifi adapter as TX (i.e. RT5370).
Cloned, modified the make file, and removed the tracker and everything is compiling successfully. I didn't get what you mean by sharedmem_init_rx program? do you mean the rx_status executable? is there a specific order of execution?
Thanks
Changed my setup a little bit for easier troubleshooting. Following my progress so far:
Any help will be really appreciated :)
I was also tinkering around with Ubuntu and packet injection in the past. Back then I figured out that the drivers were overwriting/extending (something odd :D) parts of the radiotap header when they received the data (Not 100% sure it was the RT header.). That fucked up the whole protocol. WifiBroadcast drivers do not have that issue. It is sort of a cleaner pass through there. Maybe thats the case with your setup as well. The socket usually has a filter applied so only WBC can pass. You could go check with wireshark how the packets look like when they are sent and revieved. Just an idea. Maybe it helps :)
Thanks seeul8er, I successfully managed to send and receive using dummy data. It was as simple as making sure the TX and RX args are matched :)
Following my changes and steps so far:
1) Makefile changes:
2) Build executables Make tx rx
3) Run on two separate machines as root:
TX command:
cat /dev/zero | ./tx -d 6 -b 8 -r 4 -f 1024 -t 1 -y 0
However when I switched the TX with Raspberry Pi Zero which has wifibroadcast image installed I didn't receive my debugging messages on RX.
How would I know the args values passed to tx_rawsocket on RPZ?
Will try to decode this using wireshark. but this will need some time of course :(
Take a look at wifi channel. Maybe it not set to same channel at TX and RX? Just in case my code to start video: Maybe it will help you...
Air side:
init shared memory ./sharedmem_init_tx
Transfer data from web cam ( in my case /dev/video1 ) ffmpeg -f v4l2 -i /dev/video1 -vcodec libx264 -pix_fmt yuv420p -tune zerolatency -preset ultrafast -f mpegts pipe: | tx_rawsock -p 0 -b 8 -r 4 -f 1024 -t 1 -d 36 -y 0 wlan0
Ground side:
2 Init shared mem ./sharedmem_init_rx
... next post about MavLink and rssi
Great. Thanks user1321. Will try this right away.
Now I'm able to see my debugging messages on RX. TX RPZ <-> RX UBUNTU is working. The missing part was to specify channel 13 on RX (i.e. iwconfig wlo1 channel 13... Thanks user1321). Wireshark started to capture the TX traffic successfully and RX is showing my messages :)
Tomorrow I will work on the video part.
One more thing. A little mistake with name of wifi adapter, wlo and wlan0... but please, change it to name of yours wlan . Next code responsible for control APM 2.8 using MavLink protocol via wifi Air side: 1,2 Init wifi card, init shared mem. (done at code above. Just one time ) (Don`t remember, maybe it needed to init both rx and tx: ./sharedmem_init_tx + ./sharedmem_init_rx for mavlink and rssi )
4.#Recive data from ground station: ./rx_rc_telemetry -p 3 -o 0 -b 115200 -s /dev/ttyUSB1 -r 1 wlan0
Ground station: 1,2. Init wifi card (done at firs post) + shared mem init
Something like that. Sorry for gramma, its a quick post.
and one more more...) If you will run ./rx_rc_telemerty (1.6 RC6 ) for mavlink, there is a chance that you will get "Segmentation Fault" error. To fix it do: Change rx_rc_telemerty.c at line ~600 "int i;" to "int i = 0;" https://github.com/bortek/EZ-WifiBroadcast/issues/111
OK, I spent two days trying to make this work on my PC and I failed so far :(
I tried initially to setup RPZ as TX using the wifibroadcast image. I can receive the packets on RX but it keeps crashing in first packet processing. still trying to find out about sharedmem_init_rx program which I don't know what it is exactly or where is it in the code?!!
Switched to @user1321 suggestion. installed raspbian on RPZ, loaded the v4l2 driver to get a gain access to /dev/video0. and tx seems to work fine. on the RX side i still unable to see the video and RX keeps warning about performance issues and no video played at the end (I can see that this method is so slow when comparing the statistics reported by the Wifibroadcast image and this method).
I'm completely blocked and have no idea what to do. any ideas?
Good Day!
I use ffmpeg -f v4l2 -i /dev/video1 because i dont have RPi and I can
t run "raspivid" to capture video.
Minimal latency I can get so far is 190-250 ms. (Web cam must run at normal fps)
From your first post I understand that you run it at Linux based PC - I can help with it. In case with RP - I cant do really much, because I don
t have it.
As for sharedmem_init_rx , I want to hear some additional information. "about sharedmem_init_rx program which I don't know what it is exactly or where is it in the code?!!" Its sound to me like you don`t see source file named: sharedmem_init_rx.c , is it correct? Do you use lates 1.6 RC6 (https://drive.google.com/open?id=1OgKU4dQoQWsV4T4tVOjq_XM0VrXMXaxs) image with source codes from /root/wifibroadcast compeled at linux based PC or some other version?
Just in case I add archive with source`s and files compiled under Ubuntu. Out of uname -a:
Ps. If my guess about the wrong version is incorrect, please, add command that crash add error`s stdout. Thank you.
Thanks @user1321, will download the source you provided and try this today and report back. Many thanks for your help :)
Regarding your questions:
Please," correct me if I am wrong. but, you can't get latest (for today 16.04.2018 - version 1.6 RC6 ) by git clone "branch master" . I get source files from "EZ-Wifibroadcast-1.6RC6.zip" -> unzip -> mount image -> copy files from "/root/* .. Maybe this causes misunderstanding. To compare check your RPi. Login to RP with image 1.6 RC6 and check: ls /root/wifibroadcast folder and what you git clone.
Hi, finally I have stream from rpi to my notebook. Thank you @user1321 very much. Please can you describe how do you compile source files under Ubuntu? I try with information above, but no luck. Someone to start port on x64? ;-)
Thanks @user1321 this version of code you uploaded is the real deal. Everything is working like a charm :) I can receive the RPZ streaming on my Ubuntu 18.04 beta laptop.
my steps using your provided code:
and then the video window popped up with my ugly face on it :)
may I ask why the source is different than the one on the official git repo?
It would be awesome if someone could build a ISO Image for a Ubuntu based RX and maybe offer it to Rodizio so that he can make it available here for download as well? That would be awesome.
I'm thinking of a privileged docker that can run the RX full stack and stream the received video out of docker to a udp port that can be consumed by the external host via gstreamer or whatever.
i.e the docker will do the following:
I will try this and see what will result.
well, I tried docker but it is obvious the docker performance is not strong enough to handle the processing required.
here it is if anyone interested:
FROM ubuntu:16.04
ENV DISPLAY :0
ADD wifibroadcast /wifibroadcast/src
RUN apt update && \
apt install -y \
net-tools \
iw \
libpcap-dev \
build-essential \
wireless-tools
RUN cd /wifibroadcast/src && make
ADD startup.sh /bin/startup.sh
RUN chmod +x /bin/startup.sh
ENTRYPOINT /bin/startup.sh
startup.sh
echo "working on : $WLAN"
ifconfig $WLAN down && \
iw dev $WLAN set monitor otherbss fcsfail && \
ifconfig $WLAN up && \
iwconfig $WLAN channel 13
/wifibroadcast/src/sharedmem_init_rx
/wifibroadcast/src/rx -d 36 -b 8 -r 4 -f 1024 $WLAN
Build the image:
docker build -t wifibroadcast:latest .
Run it
docker run -it --net host -e WLAN=<<your wlan id>> wifibroadcast:latest bash | gst-launch-1.0 -v fdsrc ! h264parse ! avdec_h264 ! xvimagesinksync=false
I think a small shell script will be fine to install dependencies, build, configure, and run RX locally on a linux box.
Hi,
can I ask, where do you get /wifibroadcast/src
? From git? Image? Other source?
Does anybody have OSD working on linux? Thank you :-)
Sorry the source on Github is not up to date, you'll always find the latest source in the image though
@rodizio1 I downloaded the latest stable and opened the img, I dont understand where the source is. I dont see anything that looks like src in the image. Do I need the pre-release version?
Can someone just push the latest code to a branch on git, i mean... why are we collaborating with zip files on Github?
An IMG of a working Ubuntu RX would be awesome!
I found the source in the /root folder of the Linux Partition of the SD Card. There is also a lot of great stuff here: https://github.com/RespawnDespair/wifibroadcast-base
The source and additionally other repos from @RespawnDespair with scripts. I have the ./rx working on Ubuntu 18 compiled from the above source by simply running this patch:
diff --git a/Makefile b/Makefile
index 88b8408..5980252 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
-LDFLAGS=-lrt -lpcap -lwiringPi
+LDFLAGS=-lrt -lpcap
CPPFLAGS=-Wall -D _GNU_SOURCE
-all: rx_rc_telemetry_buf rx rx_rc_telemetry rssirx rssitx tx_rawsock tx_telemetry tx_measure rx_status tracker rssilogger syslogger channelscan check_alive rssi_forward wifiscan wifibackgroundscan sharedmem_init_rx sharedmem_init_tx
+all: rx_rc_telemetry_buf rx rx_rc_telemetry rssirx rssitx tx_rawsock tx_telemetry tx_measure rx_status rssilogger syslogger channelscan check_alive rssi_forward wifiscan wifibackgroundscan sharedmem_init_rx sharedmem_init_tx
%.o: %.c
gcc -c -o $@ $< $(CPPFLAGS)
Unfortunately theres some instability where it fails to receive sometimes and im still trying to hunt down the issue. If anyone else knows anything let me know.
Does anyone know how to get to the configuration file for @user1321 's code? I want to use the 2.3ghz bands on my Atheros cards but don't know how to set the proper channel on the receiving end.
I made this bash script, save it as a file called setwifi.sh and then chmod +x so it can run, then run it as sudo. 5.7 Ghz is 5700 so 2.3Ghz is probably 2300, so you would run setwifi.sh 2300. This script grabs the first WiFi adapter name so if you have more than 1 you will need to change it or just run the commands manually.
#!/bin/bash
if [[ -z "$1" ]]; then
echo 'Frequency required, try setwifi.sh 5700';
else
WLAN_FREQ=$1
WLAN=`iw dev | awk '$1=="Interface"{print $2}'`
service network-manager stop
ifconfig $WLAN down
iw dev $WLAN set monitor otherbss fcsfail
ifconfig $WLAN up
iw $WLAN set freq $WLAN_FREQ
fi
@shyam98 , @loopdude , ...
Hi guys!. If someone still interested in using PC as WFBC receiver or transmitter, you can check my post at rcgroup about it. In short in allow to receive video from RPI camera+receive video from IP camara via UDP, send two-way mavlink messages to pixhawk. Link to rcgroup: https://www.rcgroups.com/forums/showpost.php?p=40029102&postcount=5375 link to YouTube: https://www.youtube.com/watch?v=sevEihOZncQ&feature=youtu.be https://www.youtube.com/watch?v=a0qyPxrWKIg
LinkTo google drive: https://drive.google.com/file/d/1JRSdcg8JY8_02Exa0AYRVwa3EKi4t9EV/view https://drive.google.com/file/d/1ojG0juABSrutECBcRv7At_-FmtdUkLm4/view
P.S. As for RPi image - its was customized to allow IP camera work too. But, probably only for RPi camera you may try original. Also, if you interested in this, read rcgroup post. Thx. Hope thats help to someone.
Ps2. if someone interested in IP camera, not in RPi camera, say it, I will upload to gdrive new image with lower latency for IP camera. (I just don`t want to waste time if it not needed by anyone)
Hi @user1321
Iam trying to use an ip cam with wbc is it possible to share a image with lower latency for IP camera?
And is it possible to install your live cd instead?
Thanks BV
Hi!
I have limited access to PC now (vacation), i will have full access to it on Wednesday and i will share PC image.
in short, to get lower latency for ip camera ( same as RPi camera, around 200-300 ms at PC) you may use project https://github.com/svpcom/wifibroadcast for transfer video.
it allow to transfer udp packets with rtsp headers. that's just for info, or you may wait untill Wednesday and. I will upload it.
Thx.
Thank you for replying. I Will wait to test your image. Have a nice vacations.
Thanks Bernardino
How it work: RPi Airside:
also, take attention at .profile script, as you may see it start IP camera checker script after main RPi camera will be initialized. That mean that you have to connect RPi camera also to let start IP camera or you may change inside .profile script place from where IP camera checker script will be launched to avoid using of RPi camera. (I use both)
Url to LiveCD+RPi image+print screens: https://drive.google.com/open?id=11-jyhXLQnWHQr3q6BbOll5Y8j8FUcgG-
Thank you so much for this amazing work. I will give it a try, and send you feedback :+1:
Thanks B
Thanks user1321 !
Hello user1321,
Is it possible to Run it on a sdcard ? Whats the software to create the bootable média? Iam using Rufus but got a error about the version of my software.
Thank you
Can confirm that mavlink two way control work too. PC1 (Ground Control) Mission Planner (udp 14550) <-> Ethernet <-> PC2 (Ground ReciveTransfer station) mavlink-routerd (rx_rc_telemetry_buf -p 1 . + tx_telemetry -p 3 ...) < Wireless link> PC3 (Air station) -> APM. It took some time to analyze and understand how./profile scripts works even if all work already done :) by Rodizio1 and community (probably) ...(Thx for great job btw) If it will be useful for someone I can public short version of commands needed to run that setup (tiny version of ./profile without RP dependency to just run mavlink connection ).
may i ask you something sir?
Hi. You can try, but take in mind that from last post pass more than a year and many thing was forgotten. In any case I suggest you to take a look at OpenHD. It have way better support.
Hi. You can try, but take in mind that from last post pass more than a year and many thing was forgotten. In any case I suggest you to take a look at OpenHD. It have way better support.
thanks for your suggestion sir, can i got your email or contact sir? i want to ask about it. would you please?
@shyam98 , @loopdude , ...
Hi guys!. If someone still interested in using PC as WFBC receiver or transmitter, you can check my post at rcgroup about it. In short in allow to receive video from RPI camera+receive video from IP camara via UDP, send two-way mavlink messages to pixhawk. Link to rcgroup: https://www.rcgroups.com/forums/showpost.php?p=40029102&postcount=5375 link to YouTube: https://www.youtube.com/watch?v=sevEihOZncQ&feature=youtu.be https://www.youtube.com/watch?v=a0qyPxrWKIg
LinkTo google drive: https://drive.google.com/file/d/1JRSdcg8JY8_02Exa0AYRVwa3EKi4t9EV/view https://drive.google.com/file/d/1ojG0juABSrutECBcRv7At_-FmtdUkLm4/view
P.S. As for RPi image - its was customized to allow IP camera work too. But, probably only for RPi camera you may try original. Also, if you interested in this, read rcgroup post. Thx. Hope thats help to someone.
Ps2. if someone interested in IP camera, not in RPi camera, say it, I will upload to gdrive new image with lower latency for IP camera. (I just don`t want to waste time if it not needed by anyone)
Hi, what is the sudo password of LiveCD_with_IP_CAMERA.iso ?
Hello,
Is it possible to use a Linux laptop as rx?
I tested this: " sudo ./rx -b 8 -r 4 -f 1024 wlan0 | gst-launch-1.0 -v fdsrc ! h264parse ! avdec_h264 ! xvimagesink sync=false" but it didn't work