{"id":200,"date":"2020-06-14T22:50:25","date_gmt":"2020-06-14T22:50:25","guid":{"rendered":"https:\/\/blog.lns.com\/?p=200"},"modified":"2020-06-28T23:05:52","modified_gmt":"2020-06-28T23:05:52","slug":"compliance-mode-for-ubiquiti-airmax-radios","status":"publish","type":"post","link":"https:\/\/blog.lns.com\/?p=200","title":{"rendered":"Compliance Mode for Ubiquiti AirMax Radios"},"content":{"rendered":"<p>Sometime after &#8220;AirOS 5.3.3.9634.110726.1142&#8221; Ubiquiti took out what was called &#8220;Compliance Mode&#8221; that enabled frequencies outside of the Part 15 bands.\u00a0 This was handy if you wanted to run these radios in Part 97 or Amateur or &#8220;Ham&#8221; Bands.\u00a0 \u00a0There was a simple way of doing this right after they took this out by just doing a &#8230;<\/p>\n<pre> touch \/etc\/persistent\/ct\r\n save\r\n reboot<\/pre>\n<p>Alas, this was taken out after a while.<\/p>\n<p>After googling around and banging on this a bit, the &#8220;Country Code&#8221; for &#8220;Compliance Mode&#8221; that had an ID of 511 is now called &#8220;Licensed&#8221;.\u00a0 You can find it in\u00a0\/var\/etc\/ccodes.inc.\u00a0 The trick is to set the Atheros chipset on startup to the county code you want.\u00a0 \u00a0This would be done with a custom script that runs when the radio boots up.\u00a0 You will need firmware that supports that that has &#8220;cs&#8221; in the file name.\u00a0 Go to:<\/p>\n<p><a href=\"https:\/\/community.ui.com\/questions\/airOS-5-6-with-Custom-Script-Support-\/4bd71c6b-7e9c-43ee-9d9d-666a7a9708fd#comment\/e6d675ef-2e50-46f4-bf2a-7ef94dd12068\">https:\/\/community.ui.com\/questions\/airOS-5-6-with-Custom-Script-Support-\/4bd71c6b-7e9c-43ee-9d9d-666a7a9708fd#comment\/e6d675ef-2e50-46f4-bf2a-7ef94dd12068<\/a><\/p>\n<p>and find the firmware for your board (eg XM, XW or TI).\u00a0 Upgrade the radio with this firmware.<\/p>\n<p>After the upgrade and reboot, you can use this script that you should call &#8220;\/etc\/persistent\/rc.poststart&#8221; with the following:<\/p>\n<pre>#!\/bin\/sh\r\n# This is dependent on v6.3.0 of the firmware.  You may need \r\n# to point to the ubnt_spectral module someplace else if you\r\n# have a different firmware version.\r\ninsmod \/lib\/modules\/2.6.32.71\/ubnt_spectral.ko\r\niwpriv wifi0 setCountry Ub\r\nifconfig ath0 down\r\nifconfig wifi0 down\r\nsleep 5\r\nrmmod \/lib\/modules\/2.6.32.71\/ubnt_spectral.ko\r\nifconfig ath0 up\r\nifconfig wifi0 up\r\necho \"countrycode=511\" &gt; \/var\/etc\/atheros.conf\r\n# '840' is the Country Code for the US\r\nsed -i 's\/840\/511\/g' \/tmp\/system.cfg\r\necho \"&lt;option value=\"511\"&gt;Compliance Test&lt;\/option&gt;\" &gt;&gt; \/var\/etc\/ccodes.inc<\/pre>\n<p>After creating this script, make sure you &#8220;chmod a+x\u00a0\/etc\/persistent\/rc.poststart&#8221; and the type &#8220;save&#8221; and &#8220;reboot&#8221;.<\/p>\n<p>Once the radio has rebooted, you should be able to go to the &#8220;WIRELESS&#8221; tab and see that the Country Code is set for\u00a0 Licensed.\u00a0 If you select the &#8220;Frequency Scan List&#8221;, you should see a bunch of frequencies you can now select (see below).\u00a0 Alas, the script does not survive the reboot, but that is fine as the change to &#8220;License&#8221; will survive reboots.\u00a0 You can confirm this by ssh&#8217;ing into the radio and running the commands:<\/p>\n<pre class=\"p1\"><span class=\"s1\">XM.v6.3.0# iwpriv wifi0 getCountry\r\n<\/span><span class=\"s1\">wifi0 <span class=\"Apple-converted-space\">\u00a0 \u00a0 <\/span>getCountry:UB \r\n<\/span><span class=\"s1\">XM.v6.3.0# iwpriv wifi0 getCountryID\r\n<\/span><span class=\"s1\">wifi0 <span class=\"Apple-converted-space\">\u00a0 \u00a0 <\/span>getCountryID:511\u00a0\r\n<\/span><span class=\"s1\">XM.v6.3.0# <\/span><\/pre>\n<p>I guess the Country &#8220;UB&#8221; is &#8220;Ubiquiti&#8221; \ud83d\ude42<\/p>\n<p><a href=\"https:\/\/blog.lns.com\/wp-content\/uploads\/2020\/06\/Screen-Shot-2020-06-16-at-8.16.44-AM.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-203 aligncenter\" src=\"https:\/\/blog.lns.com\/wp-content\/uploads\/2020\/06\/Screen-Shot-2020-06-16-at-8.16.44-AM-300x228.png\" alt=\"\" width=\"624\" height=\"474\" srcset=\"https:\/\/blog.lns.com\/wp-content\/uploads\/2020\/06\/Screen-Shot-2020-06-16-at-8.16.44-AM-300x228.png 300w, https:\/\/blog.lns.com\/wp-content\/uploads\/2020\/06\/Screen-Shot-2020-06-16-at-8.16.44-AM-768x585.png 768w, https:\/\/blog.lns.com\/wp-content\/uploads\/2020\/06\/Screen-Shot-2020-06-16-at-8.16.44-AM-1024x780.png 1024w, https:\/\/blog.lns.com\/wp-content\/uploads\/2020\/06\/Screen-Shot-2020-06-16-at-8.16.44-AM-1200x914.png 1200w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometime after &#8220;AirOS 5.3.3.9634.110726.1142&#8221; Ubiquiti took out what was called &#8220;Compliance Mode&#8221; that enabled frequencies outside of the Part 15 bands.\u00a0 This was handy if you wanted to run these radios in Part 97 or Amateur or &#8220;Ham&#8221; Bands.\u00a0 \u00a0There was a simple way of doing this right after they took this out by just &hellip; <a href=\"https:\/\/blog.lns.com\/?p=200\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Compliance Mode for Ubiquiti AirMax Radios&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,4],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.lns.com\/index.php?rest_route=\/wp\/v2\/posts\/200"}],"collection":[{"href":"https:\/\/blog.lns.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.lns.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.lns.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.lns.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=200"}],"version-history":[{"count":5,"href":"https:\/\/blog.lns.com\/index.php?rest_route=\/wp\/v2\/posts\/200\/revisions"}],"predecessor-version":[{"id":208,"href":"https:\/\/blog.lns.com\/index.php?rest_route=\/wp\/v2\/posts\/200\/revisions\/208"}],"wp:attachment":[{"href":"https:\/\/blog.lns.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.lns.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.lns.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}