Git Product home page Git Product logo

Comments (35)

pilotnbr1 avatar pilotnbr1 commented on May 20, 2024

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.

zipray avatar zipray commented on May 20, 2024

svpcom/wfb-ng@706af67

from openhd.

Yes21 avatar Yes21 commented on May 20, 2024

svpcom/wifibroadcast@706af67

What do you mean ?

from openhd.

Yes21 avatar Yes21 commented on May 20, 2024

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.

svpcom avatar svpcom commented on May 20, 2024

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.

zipray avatar zipray commented on May 20, 2024

svpcom/wfb-ng@706af67

What do you mean ?
@Yes21 @svpcom
The expert's explanation is what I mean

from openhd.

svpcom avatar svpcom commented on May 20, 2024

@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.

zipray avatar zipray commented on May 20, 2024

@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 avatar Yes21 commented on May 20, 2024

@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.

svpcom avatar svpcom commented on May 20, 2024
#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.

svpcom avatar svpcom commented on May 20, 2024

This code is for set MCS modes (802.11n), not for legacy modes (802.11a/b/g)

from openhd.

svpcom avatar svpcom commented on May 20, 2024

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.

roque-canales avatar roque-canales commented on May 20, 2024

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.

svpcom avatar svpcom commented on May 20, 2024

@roque-canales Yes, see https://en.wikipedia.org/wiki/Space%E2%80%93time_block_code for reference.

from openhd.

roque-canales avatar roque-canales commented on May 20, 2024

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.

Yes21 avatar Yes21 commented on May 20, 2024

I'm trying to implement this code in Open.HD.
Please wait. I will share an image if it works ...

from openhd.

Yes21 avatar Yes21 commented on May 20, 2024

@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.

tx_rawsock.c.txt

(delete the .txt extension)

from openhd.

svpcom avatar svpcom commented on May 20, 2024

@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.

Yes21 avatar Yes21 commented on May 20, 2024

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.

roque-canales avatar roque-canales commented on May 20, 2024

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.

svpcom avatar svpcom commented on May 20, 2024

replace first switch with

u8aRadiotapHeader[MCS_FLAGS_OFF] = mcs_flags;
u8aRadiotapHeader[MCS_IDX_OFF] = mcs_index;

from openhd.

roque-canales avatar roque-canales commented on May 20, 2024

Thank you :) ok and after?

from openhd.

svpcom avatar svpcom commented on May 20, 2024

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.

roque-canales avatar roque-canales commented on May 20, 2024

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.

roque-canales avatar roque-canales commented on May 20, 2024

@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.

zipray avatar zipray commented on May 20, 2024

@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 avatar Yes21 commented on May 20, 2024

@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.

roque-canales avatar roque-canales commented on May 20, 2024

@svpcom

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.

svpcom avatar svpcom commented on May 20, 2024
// 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.

zipray avatar zipray commented on May 20, 2024

@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

https://github.com/Toradex-Apalis-TK1-AndroidTV/rtl8812_au_tx_power/blob/15e55fc8ab3940007c16b7cf391a129012582245/include/ieee80211.h

from openhd.

roque-canales avatar roque-canales commented on May 20, 2024

@svpcom

Hello Vasily could you please tell me the good values for activate stbc with 20mhz channel and datarate 4 equivalent rate?

from openhd.

Yes21 avatar Yes21 commented on May 20, 2024

https://github.com/Toradex-Apalis-TK1-AndroidTV/rtl8812_au_tx_power/blob/15e55fc8ab3940007c16b7cf391a129012582245/include/ieee80211.h

Hi @zipray, what do you want to show us with this link ?

from openhd.

svpcom avatar svpcom commented on May 20, 2024

@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.

roque-canales avatar roque-canales commented on May 20, 2024

Thank you Vasily

from openhd.

htcohio avatar htcohio commented on May 20, 2024

Closing, refer to new combined rtl8812au issue
#115

from openhd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.