Fieldfox discovery tool
August 2021Example code to locate FieldFox handheld RF analysers connected to a LAN.
Fieldfox units broadcast a discovery packet on UDP port 987 for discovery by the official Fieldfox PC applications. This script simply watches for that broadcast and prints out the IP and model reported by the unit. Once you have the IP, you should be able to FTP in to the Fieldfox to retrieve saved traces.
Source
import socket
import threading
import re
class FoxHunter(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.name = 'thread_FoxHunter'
self.units = []
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.sock.bind(('', 987))
def run(self):
packet = self.sock.recvfrom(1024)
ip = packet[1][0]
data = packet[1].decode('utf-8', errors = 'ignore')
re_id = re.search(r'i\.MX31 SOM\-LV(\W+)(\w+)\;(\w+)\;', data)
if re_id:
info = dict()
model = re_id.group(2)
serial = re_id.group(3)
info['model'] = model
info['serial'] = serial
info['ip'] = ip
print('Found model ' + model + ' at ' + ip + ' - Serial ' + serial)
def add_unit(self, info):
for check in self.units:
if check['ip'] == info['ip']:
return
else:
self.units.append(info)
break
def get_units(self):
return self.units
foxh = FoxHunter()
foxh.run()
Also available on Github