Comments (35)
It’s been discussed. Sounds like we have a guy that will play with it. Have you tried that feature?
Hoping someone more knowledgeable on the specifics will comment.
from openhd.
from openhd.
What do you mean ?
from openhd.
Following the advice of @svpcom, we modified the core/rtw_xmit.c
file from the driver :
replacing
u8 fixed_rate = MGN_1M, sgi = 0, bwidth = 0, ldpc = 0, stbc = 0;
by
u8 fixed_rate = MGN_1M, sgi = 0, bwidth = 0, ldpc = 0, stbc = 1;
But it didn't resolve the problem.
Do you think we could change this parameter with the .conf files ?
from openhd.
I've made an experiment: replace second antenna with terminator (50 ohm load) and run tx on MCS8 rate. No any packets was received! So in case of MIMO (MCS8+) you must receive signal from all TX antennas (which is false in case of WFB where multiple antennas using for diversity). So you can use only STBC and not MIMO modes.
from openhd.
What do you mean ?
@Yes21 @svpcom
The expert's explanation is what I mean
from openhd.
@Yes21 What problem do you want to solve? Enable STBC by default (it works by patching stbc = 1 in driver) or do this in runtume (need to rewrite code with hardcoded packet headers in https://github.com/HD-Fpv/Open.HD/blob/7c4519174f63b6de4defa6d08926c18717ec7fe9/wifibroadcast-base/tx_rawsock.c#L115 and add dynamic flags evaluation like is done in my code above)
from openhd.
@Yes21 What problem do you want to solve? Enable STBC by default (it works by patching stbc = 1 in driver) or do this in runtume (need to rewrite code with hardcoded packet headers in
and add dynamic flags evaluation like is done in my code above)
https://github.com/svpcom/wifibroadcast/blob/212f5c1d0151ddeba21ae19596e95bee80725887/src/wifibroadcast.hpp#L77
from openhd.
@Yes21 What problem do you want to solve?
The problem is to make the 2 antennas of AWUS036ACH (4 for AWUS1900) sending data in monitor mode.
Enable STBC by default (it works by patching stbc = 1 in driver) or do this in runtume (need to rewrite code with hardcoded packet headers in
Open.HD/wifibroadcast-base/tx_rawsock.c
Line 115 in 7c45191
0x04, 0x80, 0x00, 0x00, // <-- radiotap present flags (rate + tx flags)
and add dynamic flags evaluation like is done in my code above)
Do we just need to replace :
0x04, 0x80, 0x00, 0x00, // <-- radiotap present flags (rate + tx flags)
by :
0x00, 0x80, 0x08, 0x00, // <-- radiotap present flags: RADIOTAP_TX_FLAGS + RADIOTAP_MCS
??
from openhd.
#define IEEE80211_RADIOTAP_MCS_HAVE_BW 0x01
#define IEEE80211_RADIOTAP_MCS_HAVE_MCS 0x02
#define IEEE80211_RADIOTAP_MCS_HAVE_GI 0x04
#define IEEE80211_RADIOTAP_MCS_HAVE_FMT 0x08
#define IEEE80211_RADIOTAP_MCS_BW_20 0
#define IEEE80211_RADIOTAP_MCS_BW_40 1
#define IEEE80211_RADIOTAP_MCS_BW_20L 2
#define IEEE80211_RADIOTAP_MCS_BW_20U 3
#define IEEE80211_RADIOTAP_MCS_SGI 0x04
#define IEEE80211_RADIOTAP_MCS_FMT_GF 0x08
#define IEEE80211_RADIOTAP_MCS_HAVE_FEC 0x10
#define IEEE80211_RADIOTAP_MCS_HAVE_STBC 0x20
#define IEEE80211_RADIOTAP_MCS_FEC_LDPC 0x10
#define IEEE80211_RADIOTAP_MCS_STBC_MASK 0x60
#define IEEE80211_RADIOTAP_MCS_STBC_1 1
#define IEEE80211_RADIOTAP_MCS_STBC_2 2
#define IEEE80211_RADIOTAP_MCS_STBC_3 3
#define IEEE80211_RADIOTAP_MCS_STBC_SHIFT 5
#define MCS_KNOWN (IEEE80211_RADIOTAP_MCS_HAVE_MCS | IEEE80211_RADIOTAP_MCS_HAVE_BW | IEEE80211_RADIOTAP_MCS_HAVE_GI | IEEE80211_RADIOTAP_MCS_HAVE_STBC | IEEE80211_RADIOTAP_MCS_HAVE_FEC)
// For MCS#1 -- QPSK 1/2 20MHz long GI + STBC
#define MCS_FLAGS (IEEE80211_RADIOTAP_MCS_BW_20 | (IEEE80211_RADIOTAP_MCS_STBC_1 << IEEE80211_RADIOTAP_MCS_STBC_SHIFT))
#define MCS_INDEX 1
static uint8_t radiotap_header[] __attribute__((unused)) = {
0x00, 0x00, // <-- radiotap version
0x0d, 0x00, // <- radiotap header length
0x00, 0x80, 0x08, 0x00, // <-- radiotap present flags: RADIOTAP_TX_FLAGS + RADIOTAP_MCS
0x08, 0x00, // RADIOTAP_F_TX_NOACK
MCS_KNOWN , MCS_FLAGS, MCS_INDEX // bitmap, flags, mcs_index
};
from openhd.
This code is for set MCS modes (802.11n), not for legacy modes (802.11a/b/g)
from openhd.
for MCS#1 -- QPSK 1/2 20MHz long GI without STBC
#define MCS_FLAGS (IEEE80211_RADIOTAP_MCS_BW_20)
for stbc + ldpc:
#define MCS_FLAGS (IEEE80211_RADIOTAP_MCS_BW_20 | (IEEE80211_RADIOTAP_MCS_STBC_1 << IEEE80211_RADIOTAP_MCS_STBC_SHIFT) | IEEE80211_RADIOTAP_MCS_FEC_LDPC)
from openhd.
Hello SVP, so with this mod,, 88XXau board transmit same radio data through there 2 or 4 antennas ?
Idea is to have capability to receive data on the ground even if one antenna is NLOS.....
from openhd.
@roque-canales Yes, see https://en.wikipedia.org/wiki/Space%E2%80%93time_block_code for reference.
from openhd.
Thank you,
Yes is exactly this feature that I wait to be released on image.
I'm not expert user for compile image with this feature.
Could you please release an image with this feature activated for 88xxAU users ?
from openhd.
I'm trying to implement this code in Open.HD.
Please wait. I will share an image if it works ...
from openhd.
@roque-canales, if you want to test it, no need to build an image.
Just replace the "/home/pi/wifibroadcast-base/tx_rawsock.c" file by the one attached here, and execute "sudo make" in the "wifibroadcast-base/" directory. This should be done from a running Pi.
(delete the .txt extension)
from openhd.
@Yes21
This fragment is invalid:
static u8 u8aRadiotapHeader[] = {
0x00, 0x00, // <-- radiotap version
0x0d, 0x00, // <- radiotap header length
0x00, 0x80, 0x08, 0x00, // <-- radiotap present flags: RADIOTAP_TX_FLAGS + RADIOTAP_MCS
0x08, 0x00, // RADIOTAP_F_TX_NOACK
MCS_KNOWN , 0x00, 0x00 // bitmap, flags, mcs_index
};
If you set MCS_KNOWN you must use MCS modes, but not legacy rates:
{
0x00, 0x00, // <-- radiotap version
0x0d, 0x00, // <- radiotap header length
0x00, 0x80, 0x08, 0x00, // <-- radiotap present flags: RADIOTAP_TX_FLAGS + RADIOTAP_MCS
0x08, 0x00, // RADIOTAP_F_TX_NOACK
MCS_KNOWN , MCS_FLAGS, MCS_INDEX // bitmap, flags, mcs_index
};
Also you need to rewrite packet_header_init(uint8_t *packet_header, int type, int rate, int port)
to set rate via MCS_FLAGS and MCS_INDEX fields but not with legacy rates.
from openhd.
If you set MCS_KNOWN you must use MCS modes, but not legacy rates:
{ 0x00, 0x00, // <-- radiotap version 0x0d, 0x00, // <- radiotap header length 0x00, 0x80, 0x08, 0x00, // <-- radiotap present flags: RADIOTAP_TX_FLAGS + RADIOTAP_MCS 0x08, 0x00, // RADIOTAP_F_TX_NOACK MCS_KNOWN , MCS_FLAGS, MCS_INDEX // bitmap, flags, mcs_index };
Ok, with this settings, it seems that the 2 antennas of 036ACH are sending !
A great step in the right direction ...
Also you need to rewrite
packet_header_init(uint8_t *packet_header, int type, int rate, int port)
to set rate via MCS_FLAGS and MCS_INDEX fields but not with legacy rates.
I will look for this later ...
And many thanks Vasily for your help and your patience !!
from openhd.
Hello,
@svpcom:
Also you need to rewrite packet_header_init(uint8_t *packet_header, int type, int rate, int port) to set rate via MCS_FLAGS and MCS_INDEX fields but not with legacy rates.
could you please tell me the values that need to be replaced ?
switch (rate) {
case 1:
u8aRadiotapHeader[8]=0x02;
break;
case 2:
u8aRadiotapHeader[8]=0x04;
break;
case 5: // 5.5
u8aRadiotapHeader[8]=0x0b;
break;
case 6:
u8aRadiotapHeader[8]=0x0c;
break;
case 11:
u8aRadiotapHeader[8]=0x16;
break;
case 12:
u8aRadiotapHeader[8]=0x18;
break;
case 18:
u8aRadiotapHeader[8]=0x24;
break;
case 24:
u8aRadiotapHeader[8]=0x30;
break;
case 36:
u8aRadiotapHeader[8]=0x48;
break;
case 48:
u8aRadiotapHeader[8]=0x60;
break;
default:
fprintf(stderr, "ERROR: Wrong or no data rate specified (see -d parameter)\n");
exit(1);
break;
}
memcpy(packet_header, u8aRadiotapHeader, sizeof(u8aRadiotapHeader));
pu8 += sizeof(u8aRadiotapHeader);
switch (type) {
case 0: // short DATA frame
fprintf(stderr, "using short DATA frames\n");
port_encoded = (port * 2) + 1;
u8aIeeeHeader_data_short[4] = port_encoded; // 1st byte of RA mac is the port
memcpy(pu8, u8aIeeeHeader_data_short, sizeof (u8aIeeeHeader_data_short)); //copy data short header to pu8
pu8 += sizeof (u8aIeeeHeader_data_short);
break;
case 1: // standard DATA frame
fprintf(stderr, "using standard DATA frames\n");
port_encoded = (port * 2) + 1;
u8aIeeeHeader_data[4] = port_encoded; // 1st byte of RA mac is the port
memcpy(pu8, u8aIeeeHeader_data, sizeof (u8aIeeeHeader_data)); //copy data header to pu8
pu8 += sizeof (u8aIeeeHeader_data);
break;
case 2: // RTS frame
fprintf(stderr, "using RTS frames\n");
port_encoded = (port * 2) + 1;
u8aIeeeHeader_rts[4] = port_encoded; // 1st byte of RA mac is the port
memcpy(pu8, u8aIeeeHeader_rts, sizeof (u8aIeeeHeader_rts));
pu8 += sizeof (u8aIeeeHeader_rts);
break;
default:
fprintf(stderr, "ERROR: Wrong or no frame type specified (see -t parameter)\n");
exit(1);
break;
}
Kind regards
from openhd.
replace first switch with
u8aRadiotapHeader[MCS_FLAGS_OFF] = mcs_flags;
u8aRadiotapHeader[MCS_IDX_OFF] = mcs_index;
from openhd.
Thank you :) ok and after?
from openhd.
You need to replace
switch (rate) {
...
}
with this two lines.
mcs_flags is desired flags (depend what you want to enable: stbc, lpdc, 20 or 40 mhz channels)
mcs_index is number of mcs mode (from 0 to 7).
from openhd.
Ok so I supress the first switch with /* */, so the switch rate by the two lines you told upper.
/* switch (rate) {
case 1:
u8aRadiotapHeader[8]=0x02;
break;
case 2:
u8aRadiotapHeader[8]=0x04;
break;
case 5: // 5.5
u8aRadiotapHeader[8]=0x0b;
break;
case 6:
u8aRadiotapHeader[8]=0x0c;
break;
case 11:
u8aRadiotapHeader[8]=0x16;
break;
case 12:
u8aRadiotapHeader[8]=0x18;
break;
case 18:
u8aRadiotapHeader[8]=0x24;
break;
case 24:
u8aRadiotapHeader[8]=0x30;
break;
case 36:
u8aRadiotapHeader[8]=0x48;
break;
case 48:
u8aRadiotapHeader[8]=0x60;
break;
default:
fprintf(stderr, "ERROR: Wrong or no data rate specified (see -d parameter)\n");
exit(1);
break;
} */
u8aRadiotapHeader[MCS_FLAGS_OFF] = mcs_flags;
u8aRadiotapHeader[MCS_IDX_OFF] = mcs_index;
memcpy(packet_header, u8aRadiotapHeader, sizeof(u8aRadiotapHeader));
pu8 += sizeof(u8aRadiotapHeader);
switch (type) {
case 0: // short DATA frame
fprintf(stderr, "using short DATA frames\n");
port_encoded = (port * 2) + 1;
u8aIeeeHeader_data_short[4] = port_encoded; // 1st byte of RA mac is the port
memcpy(pu8, u8aIeeeHeader_data_short, sizeof (u8aIeeeHeader_data_short)); //copy data short header to pu8
pu8 += sizeof (u8aIeeeHeader_data_short);
break;
case 1: // standard DATA frame
fprintf(stderr, "using standard DATA frames\n");
port_encoded = (port * 2) + 1;
u8aIeeeHeader_data[4] = port_encoded; // 1st byte of RA mac is the port
memcpy(pu8, u8aIeeeHeader_data, sizeof (u8aIeeeHeader_data)); //copy data header to pu8
pu8 += sizeof (u8aIeeeHeader_data);
break;
case 2: // RTS frame
fprintf(stderr, "using RTS frames\n");
port_encoded = (port * 2) + 1;
u8aIeeeHeader_rts[4] = port_encoded; // 1st byte of RA mac is the port
memcpy(pu8, u8aIeeeHeader_rts, sizeof (u8aIeeeHeader_rts));
pu8 += sizeof (u8aIeeeHeader_rts);
break;
default:
fprintf(stderr, "ERROR: Wrong or no frame type specified (see -t parameter)\n");
exit(1);
break;
}
And after ? the code is ok or it need another upgrade?
I want to use stbc 20mhz.
from openhd.
@Yes21
It test your file but I Don't see any change on output.
Wich datarate you set? I test with 4 with no success.
from openhd.
@Yes21
It test your file but I Don't see any change on output.
Wich datarate you set? I test with 4 with no success.
Need delete tx rawsock.o and execute "sudo make tx_rawsock" in the "wifibroadcast-base/" directory.
from openhd.
@Yes21
It test your file but I Don't see any change on output.Wich datarate you set? I test with 4 with no success.
There was an error in it.
Here is the later version :
tx_rawsock.c.txt
from openhd.
Hello Vasily, thank you so much for yesterday, now I'm trying to finish de rawsock file.
Could you please help me for activate STBC 20mhz.?
I bypass switch rate:
/* switch (rate) {……………….}*/
I write theses two lines below:
u8aRadiotapHeader[MCS_FLAGS_OFF] = mcs_flags;
u8aRadiotapHeader[MCS_IDX_OFF] = mcs_index;
and after what I must to do?
Thank you so much for help us.
from openhd.
// offset of MCS_FLAGS and MCS index
#define MCS_FLAGS_OFF 11
#define MCS_IDX_OFF 12
// Settings for MCS#1 -- QPSK 1/2 20MHz long GI + STBC
#define MCS_FLAGS (IEEE80211_RADIOTAP_MCS_BW_20 | (IEEE80211_RADIOTAP_MCS_STBC_1 << IEEE80211_RADIOTAP_MCS_STBC_SHIFT))
#define MCS_INDEX 1
If you want to select it statically - just remove switch (rate) {……………….}
and add these defines before struct u8aRadiotapHeader definition. If you want to set radio modes based on command-line arguments - you need to write code (if or switch) which will parse them and set corresponding mcs_flags and mcs_index.
from openhd.
@Yes21
It test your file but I Don't see any change on output.
Wich datarate you set? I test with 4 with no success.There was an error in it.
Here is the later version :
tx_rawsock.c.txt
from openhd.
Hello Vasily could you please tell me the good values for activate stbc with 20mhz channel and datarate 4 equivalent rate?
from openhd.
Hi @zipray, what do you want to show us with this link ?
from openhd.
@roque-canales use
#define MCS_FLAGS (IEEE80211_RADIOTAP_MCS_BW_20 | (IEEE80211_RADIOTAP_MCS_STBC_1 << IEEE80211_RADIOTAP_MCS_STBC_SHIFT))
#define MCS_INDEX _mcs_index_from_table_
where _mcs_index_from_table_
is from http://mcsindex.com/
See orange column 20Mhz GI = 800ns for required bandwidth
from openhd.
Thank you Vasily
from openhd.
Closing, refer to new combined rtl8812au issue
#115
from openhd.
Related Issues (20)
- build error,what should I do ?
- Wifi Hotspot - main password can't be used. Can't connect HOT 9
- I cannot download OpenHD HOT 3
- AirPi: support MAVLink over a pair of local Unix FIFOs HOT 2
- Can I use Raspberry Pi official camera module v3 with openHD? HOT 1
- I am planning to use OpenHD for my unmanned vehicle, and I have some questions here HOT 2
- I noticed the 'Joystick RC' in the official website document, and I have some speculations here
- Realtek AMB82 HOT 1
- Improve camera documentation HOT 1
- [Feature Request] Separate settings for recording resolution, framerate and bitrate
- Possible running 2 RC Joysticks? HOT 1
- E: Unable to locate package rockchip-iq-openhd HOT 1
- Air unit can't receive packet from ground unit and got a lot loopback packets HOT 3
- 10Mhz channel width HOT 3
- Request for Air wifi to be active when disarmed HOT 1
- [Feature Request] Add date and time synchronization from the flight controller.
- RPI_MMAL cameras not supported under manual camera configs HOT 1
- the new release shall not have fewer functions than an older release unless it makes technical sense or can be justified (e.g. drop Pi0, drop JetsonNano)
- 2.5 Release preparation Checklist
- OpenHDImageWriter depends upon debian pacakges not requested HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openhd.