From e2fbeae9ac08633322cafcd3bb57e775bde216a8 Mon Sep 17 00:00:00 2001 From: Vasily Evseenko Date: Wed, 30 Nov 2022 14:46:03 +0300 Subject: [PATCH] Add primary/secondary role for multi-instance setup --- wfb_ng/conf/master.cfg | 1 + wfb_ng/server.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/wfb_ng/conf/master.cfg b/wfb_ng/conf/master.cfg index 9a5f47e..8dc9b2d 100644 --- a/wfb_ng/conf/master.cfg +++ b/wfb_ng/conf/master.cfg @@ -19,6 +19,7 @@ debug = False version = '0.0.1.trunk' commit = None +primary = True # Set to False if you use several wfb instances on one card. Only primary instance will set radio channel. log_file = None # Set to "wifibroadcast.log" to disable log to stdout link_id = "default" # It will be hashed and mapped to three bytes of MAC # You can use different link ids for multi-vehicle setup without stream remapping. diff --git a/wfb_ng/server.py b/wfb_ng/server.py index ea81e5c..bba116d 100644 --- a/wfb_ng/server.py +++ b/wfb_ng/server.py @@ -264,6 +264,10 @@ def init_wlans(profile, wlans): else: raise Exception('Unsupported bandwith %d MHz' % (max_bw,)) + if not settings.common.primary: + log.msg('Skip card init due to secondary role') + return + try: yield call_and_check_rc('iw', 'reg', 'set', settings.common.wifi_region) for wlan in wlans: