Reply
Regular Member
Posts: 467
Registered: ‎01-29-2009
Kudos: 66

iwpriv to make 2x2 devices work like 1x1

This is preliminary and will need more testing, but I started digging in the iwpriv commands, and first results look promising. Testing on a 3.5 km PtP link (2 x NanoBridge M5-22), both feedhorns mounted vertically (LEDs on the side). Here are the magic iwpriv commands:

iwpriv wifi0 txchainmask 1
iwpriv wifi0 rxchainmask 1
iwpriv ath0 tx_chainmask 1
iwpriv ath0 rx_chainmask 1

The wifi0 (without underscore) and ath0 (with underscore) ones seem to serve different purposes - the wifi0 ones change 2x2 to 1x1 display on the main page, but the ath0 ones also seem to be needed for any effect. At least the RX side appears to work - Site Survey shows no change for H polarity APs and significant reduction for V polarity APs at the same location. This also means Chain 0 is H and Chain 1 is V (same as Rocket + UBNT sector) when the feedhorn is vertical (as it is now - good, no need to climb to change it).

Polarity isolation in this simple test was 13 dB (from -77 to -90) - not perfect, but better than nothing. Maximum data rates drop from MCS15 to MCS7, as expected. Time to sleep now, more testing later...
Regular Member
Posts: 467
Registered: ‎01-29-2009
Kudos: 66

Re: iwpriv to make 2x2 devices work like 1x1

OK, after more testing I've come up with a handy script:

#! /bin/sh
if ; then
echo Usage: $0 txmask rxmask
exit 1
fi
ip link set ath0 down
iwpriv wifi0 txchainmask $1
iwpriv wifi0 rxchainmask $2
ip link set ath0 up

which can be installed as /etc/persistent/set_chainmask and invoked manually for testing, or from rc.poststart to set the desired masks at startup. Bit 0 = chain 0, bit 1 = chain 1 - so both masks are set to 3 by default on 2x2 devices, but can be changed to 1 or 2 to use a single chain (which could even be different for TX and RX). The down/up of ath0 is necessary to pick up the change from wifi0, otherwise there is no effect in AP mode. With TX on only one chain, I can see the expected ~15 dB difference between RX signal in the two chains at the other end, fairly good polarity isolation.

It's the same pair of early NBM5-22 devices that was showing a low signal level, and others said it must be bad alignment. Now, I've just discovered that setting up an unusual combination of masks, where one chain is TX only and the other is RX only ("1 2" or "2 1"), suddenly fixes it - the other end (which can be 2x2 or 1x1, doesn't matter) then shows the expected -62 instead of -74. No other combination has this effect - as soon as any of the chains is both TX and RX at the same time, the signal at the other end is lower again. I'm going to replace the devices with new NBM5-25's soon, to see if they work better.

The most important conclusion is: yes, the 2x2 devices can be made to work 1x1 with any polarity (H or V) if you need it for some reason, as well as 1x2 or 2x1. The NanoBridge feedhorn should be mounted vertically (LEDs on the side) to match the Rocket+sector (0=H, 1=V), still need to check the NSM5/LocoM5/PBM5 to confirm it's the same there - but even if not, Chain 0 is not really hardwired (can be disabled to use Chain 1 only, too). More testing is always good, and I encourage others to try playing with the chain masks.
Regular Member
Posts: 328
Registered: ‎01-12-2010
Kudos: 7

Re: iwpriv to make 2x2 devices work like 1x1

Simple question, why you do that?
Patrick
SuperUser
Posts: 5,797
Registered: ‎08-26-2009
Kudos: 1771
Solutions: 55

Re: iwpriv to make 2x2 devices work like 1x1

While it's cool that you can do this (and it may be particularly useful for doing airview scans on only one polarity), you may find that an easier fix for your RF environment (and one that results in a more robust signal) is to set mcs 7 max tx rate on one or both sides (mcs0-7 under dual-pol is STBC mode)
Regular Member
Posts: 344
Registered: ‎11-21-2009
Kudos: 21

Re: iwpriv to make 2x2 devices work like 1x1

I like the idea of being able to use one chain for TX and the other for RX, making the link work more like a real full duplex. Will try to test that in the weekend. Thanks for the commands!

Regards,
Marcelo
Regular Member
Posts: 467
Registered: ‎01-29-2009
Kudos: 66

Re: iwpriv to make 2x2 devices work like 1x1

No real full duplex, as it can't simultaneously transmit and receive on different frequencies (like Mikrotik Nstreme Dual, using two separate radios). But it could be used, for example, for a very long range PtP link using the Rocket with two different antennas for TX (low gain to stay within legal EIRP limits) and RX (high gain, no legal limits).

Now tested on NSM5 and LocoM5 as well, seems to work fine but LocoM5 has the polarities swapped (0=V, 1=H). Also, the Rocket has the restriction that Chain 0 can't be turned off completely - it must be enabled in at least one of the TX or RX masks, otherwise (with "2 2") the radio is turned off completely (doesn't transmit or receive anything).

The original reason I started looking for this is to get better separation from a lot of existing legacy 802.11a gear mostly in V polarity (reasonable quality sectors tend to be cheaper here in V than H, omnis are almost always V; it's partly my gear so I care about both causing and receiving interference to/from it), slowly migrate customers from the old to the new gear, and finally switch to 2x2 and shut down the old gear. Another one could be supply chain issues - if you can't get a Loco5 anywhere (happened about a year ago), LocoM5 can be a good replacement (again, without unnecessarily receiving or causing interference on the unused polarity if your base station is still only single polarity). It could also help with AirView or Site Survey scans, making them more selective. It's the kind of advanced option you rarely need in a typical greenfield deployment, but is nice to be able to try in some specific situations. STBC is another option worth trying, of course.
Established Member
Posts: 1,424
Registered: ‎03-16-2008
Kudos: 41
Solutions: 1

Re: iwpriv to make 2x2 devices work like 1x1

That makes a LOT of sense for migrating. Big ears is always a favorite config of mine, Mikrotik with the older SR cards made this very easy.

We use M gear to connect to Mikrotik/XR Vertical setups, most of the time it is done with BM2's and antennas. But for those occasions where it is just too hot for BM2's a NSM2 or NSM2Loco is used. Of course we spam the horizontal spectrum at the same time.

Setting a rocket to rx/tx in 1 chain and just rx in the other would be fine as the problem with Airmax is on the non-airmax radios connected. If it works on a GPS unit then you could have 3-4 sectors on the same channel all doing horizontal only while leaving your legacy uneffected.
SuperUser
Posts: 40,413
Registered: ‎06-23-2009
Kudos: 8156
Solutions: 1314

Re: iwpriv to make 2x2 devices work like 1x1

Something odd is going on.

First, 'toes', I had a long dialog with
Ubiquiti about MCS7 months ago;
my notion was it would cut one
chain, changing MIMO to SISO.
They told me it wasn't so, that both
chains would continue to be used,
and the only effect would be to
throttle data rates artificially.

I think I understood them correctly
that there was no advantage at all.

Another item is this greatly improved
NanoBridge received signal. I don't
doubt the observation (I wasn't there),
but I sure don't see the logic. This
seems more like a firmware glitch than
a bonus from shutting down a chain.

Last, I see the TX/RX split antenna
advantage for limited-EIRP situations--
but only if turning down rf output to
minimum still doesn't meet EIRP limits.
And the latest firmware is said to
permit a very low rf level setting. Dave

> HQ in Seacoast region New Hampshire U.S.A.
> Ubiquiti Certified Trainer [UCT] for:
     UBWA [AirMax] / UEWA [UniFi] / UBRSS [routers]
UBNT.NH@gmail.com
Member
Posts: 159
Registered: ‎12-11-2008
Kudos: 9

Re: iwpriv to make 2x2 devices work like 1x1

I need a way to transmit ONLY on horizontal on ~5.8Ghz. This is to avoid interfering with some existing 5.8Ghz gear on vertical polorization. Will this work for that?
Member
Posts: 178
Registered: ‎11-24-2008
Kudos: 11

Re: iwpriv to make 2x2 devices work like 1x1

I need a way to transmit ONLY on horizontal on ~5.8Ghz. This is to avoid interfering with some existing 5.8Ghz gear on vertical polorization. Will this work for that?


We would be looking at this for the same reason need the seperation with as many backhauls we have running to are noc. Prefer to run rockets over bullets on long distance backhauls single chain would come in handy.
SuperUser
Posts: 11,169
Registered: ‎10-28-2009
Kudos: 3760
Solutions: 320

Re: iwpriv to make 2x2 devices work like 1x1

I need a way to transmit ONLY on horizontal on ~5.8Ghz. This is to avoid interfering with some existing 5.8Ghz gear on vertical polorization. Will this work for that?


Yes, set radios on both ends to a max of MCS7 or it won't link back up. Change it to use only chain 0 (horizontal) (1 = chain 0, 2 = chain 1, 3 = both chains).
Tony Pierro
CTO - Wireless Internet Services, Inc.
Regular Member
Posts: 646
Registered: ‎01-15-2009
Kudos: 8

Re: iwpriv to make 2x2 devices work like 1x1


#! /bin/sh
if ; then
echo Usage: $0 txmask rxmask
exit 1
fi
ip link set ath0 down
iwpriv wifi0 txchainmask $1
iwpriv wifi0 rxchainmask $2
ip link set ath0 up



Ok, This seems to work good. The only problem I have is that it erases the default route. After running the commands manually, I figured out that it happens when you town down ath0. I figured a way to add the route back in, but we have sites that have different gateways, so it would be a pain to have to use the linux add route command. Is there some way you can restart the networking service so that it will add the default route back in?

Thanks.
Regular Member
Posts: 467
Registered: ‎01-29-2009
Kudos: 66

Re: iwpriv to make 2x2 devices work like 1x1

Ok, This seems to work good. The only problem I have is that it erases the default route. After running the commands manually, I figured out that it happens when you town down ath0. I figured a way to add the route back in, but we have sites that have different gateways, so it would be a pain to have to use the linux add route command. Is there some way you can restart the networking service so that it will add the default route back in?

Thanks.


Good catch. I haven't seen that issue because I'm running everything here in bridge mode (AP WDS - Station WDS), not affected as default route is on the bridge which is always up.

These iwpriv commands already exist (with default chain masks) in /etc/sysinit/radio.conf:
iwpriv "wifi0" txchainmask 3
iwpriv "wifi0" rxchainmask 3

which is not persistent (generated from the configuration), but could be edited by some awk/sed magic in /etc/persistent/rc.prestart so it would be run before routes are set up.

It would be best if UBNT could officially add the chain masks under advanced wireless settings, or at least make them editable in /tmp/system.cfg - "strings /sbin/ubntbox | grep chainmask" suggests radio.1.{tx,rx}chainmask=... should work, but it has no effect in 5.3.
Regular Member
Posts: 646
Registered: ‎01-15-2009
Kudos: 8

Re: iwpriv to make 2x2 devices work like 1x1

Good catch. I haven't seen that issue because I'm running everything here in bridge mode (AP WDS - Station WDS), not affected as default route is on the bridge which is always up.

These iwpriv commands already exist (with default chain masks) in /etc/sysinit/radio.conf:
iwpriv "wifi0" txchainmask 3
iwpriv "wifi0" rxchainmask 3

which is not persistent (generated from the configuration), but could be edited by some awk/sed magic in /etc/persistent/rc.prestart so it would be run before routes are set up.

It would be best if UBNT could officially add the chain masks under advanced wireless settings, or at least make them editable in /tmp/system.cfg - "strings /sbin/ubntbox | grep chainmask" suggests radio.1.{tx,rx}chainmask=... should work, but it has no effect in 5.3.



Couple of more questions. You only need to take down the ath0 interface if it's in AP mode? Also, I noticed that saving the configuration after making these changes doesn't save the changes. Is there some way to make it where it's saved in the config file? Last question: Did you find out that the iwpriv ath0 txchainmask $1 commands aren't necessary?

Also, it doesn't work for me unless i use "1" instead of "$1".
Regular Member
Posts: 646
Registered: ‎01-15-2009
Kudos: 8

Re: iwpriv to make 2x2 devices work like 1x1

Just wanted to let everyone know a success story about this. So right now we are getting ready to upgrade some sites to airmax. But most everything we have is still legacy B mode and not MIMO. We have had trouble sometimes getting NSM2's to work good on these legacy sites. Yesterday we tested at a place where we got around -70 signal. The throughput was only 300kbps to 1.1mbps and the pings were in the hundreds to thousands during the bandwidth test.

We were about ready to give up and use something else for the CPE, but we decided I should try to set the chainmasks to 2 (we run vertical polarization). After doing this, I immediately noticed the pings were better. The signal was about the same on the AP side, but the throughput jumped to 3-5mbps just like it should on 802.11b. Pings were mostly below 100 even when pulling 5mbps. Here is the rc.poststart script that I used for it:

#! /bin/sh
ip link set ath0 down
iwpriv wifi0 txchainmask 2
iwpriv wifi0 rxchainmask 2
ip link set ath0 up
route add default gw 10.0.3.1 ath0

I really wish Ubiquiti would consider adding the ability to turn chains on and off in the gui. This is proof that it could be useful. Also as someone else mentioned in another thread, they really should put in the option to do N-only mode. Mikrotik allows you to do B-only, b/g mixed, g-only, b/g/n mixed, or n-only. But, I digress. I'm just glad I figured out a way to make these MIMO CPE's work better on our legacy sites.
New Member
Posts: 3
Registered: ‎03-12-2011

Thank you for this thread,

Thanks needed the contend of this thread for some time (1 month)
I used it to write a script which made my NSM5 compatible to my providers old network. Now he has upgraded and i do not need to buy a new station (without this infos i would have bought a NS5).
If someone is in the same situation as i was, here is the script that i used.


#! /bin/sh

#File: /etc/persist/rc.prestart
#Description: Script to run NSM5 as in 1x1 Mode
#tested with: AirOS 5.3
#written by: Karl Fessel
#Inspired by: http://www.ubnt.com/forum/showthread.php?t=23245

#direct setup is overpowered by later startup script so:
#i use sed to edit sysinit scripts

sed -e's@iwpriv "wifi0" txchainmask 3@iwpriv "wifi0" txchainmask 2@' -i /etc/sysinit/radio.conf
sed -e's@iwpriv "wifi0" rxchainmask 3@iwpriv "wifi0" rxchainmask 2@' -i /etc/sysinit/radio.conf

#use horizontal chains only (Bit 2^0 vertical Bit 2^1 horizontal)
#(3 -> both, 2 -> horizontal, 1 -> vertical, 0 -> none)


i used ssh to transfer it to the Station /etc/persist/rc.prestart
and cfgmtd -w -p /etc/ to make persistent
if u use this script u do not need to add manual routes.
New Member
Posts: 3
Registered: ‎03-12-2011

Re: iwpriv to make 2x2 devices work like 1x1

Thanks,
for this thread i used it to write startup script that workes for me about month.
I have extended the comments a bit for this thread.


#! /bin/sh

#File: /etc/persist/rc.prestart
#Description: Script to run NSM5 as in 1x1 Mode
#tested with: AirOS 5.3
#Inspired by: http://www.ubnt.com/forum/showthread.php?t=23245
#Installation: copy to /etc/persist/rc.prestart (use e.g. ssh)
# after your next linksetup you should see 1x1 Link in GUI
# to make it persistent cfgmtd -w -p /etc/

#early direct setup is overpowered by later startup script
#and setting the link down and up again at removes routes which are setup by the gui
#i use sed to edit sysinit scripts

sed -e's@iwpriv "wifi0" txchainmask 3@iwpriv "wifi0" txchainmask 2@' -i /etc/sysinit/radio.conf
sed -e's@iwpriv "wifi0" rxchainmask 3@iwpriv "wifi0" rxchainmask 2@' -i /etc/sysinit/radio.conf

#use horizontal chains only (Bit 2^0 vertical Bit 2^1 horizontal)
#(3 -> both, 2 -> horizontal, 1 -> vertical, 0 -> none)


I am not sure about the numbers maybe horizontal and vertical chain are swapped but my provider told me to use horizontal only and the 2 worked for me.
New Member
Posts: 3
Registered: ‎03-12-2011

Thanks

Thank you for this thread. I wrote a prestart script that rewrites /etc/sysinit/radio.conf by using sed and it works.


#! /bin/sh

#File: /etc/persist/rc.prestart
#Description: Script to run NSM5 as in 1x1 Mode
#tested with: AirOS 5.3
#Inspired by: http://www.ubnt.com/forum/showthread.php?t=23245
#Installation: copy to /etc/persist/rc.prestart (use e.g. ssh)
# after your next linksetup you should see 1x1 Link in GUI
# to make it persistent cfgmtd -w -p /etc/

#direct setup is overpowered by later startup script
#and setting the link down and up again at a later time of statup removes routes which are setup by the gui

#i use sed to edit sysinit scripts

sed -e's@iwpriv "wifi0" txchainmask 3@iwpriv "wifi0" txchainmask 2@' -i /etc/sysinit/radio.conf
sed -e's@iwpriv "wifi0" rxchainmask 3@iwpriv "wifi0" rxchainmask 2@' -i /etc/sysinit/radio.conf

#use horizontal chains only (Bit 2^0 vertical Bit 2^1 horizontal)
#(3 -> both, 2 -> horizontal, 1 -> vertical, 0 -> none)


I am not sure about the numbers bay be the chains are swaped. My providers said use only horizontal and the 2 worked for me.
Established Member
Posts: 871
Registered: ‎12-10-2009
Kudos: 186
Solutions: 16

Re: iwpriv to make 2x2 devices work like 1x1

very interesting thread - thank you very much for sharing
Regular Member
Posts: 306
Registered: ‎09-17-2010
Kudos: 4

Could someone make sense of this?

My area is riddled with major noise problems and I would like to just use one chain either horz or vert depending on which is best for the particular area I am broadcasting in.
UBNT really needs to add the ability to disable one of the two chains VIA the GUI in the advanced tab!!!
UBNT???
Reply