@jmltt
Update - I found the issue. I didn't realize how the voxl-modem service worked so I went back and looked at the sdk-1.1 version (that worked fine for me) and the sdk-1.3.2 version that shipped out with the new vehicles and noticed there's a change in logic that doesn't make sense to me
relevant portion of v1.1.0 voxl-modem
voxl-sdk/utilities/voxl-modem/-/blob/sdk-1.1.0/scripts/voxl-modem
starting at line 587
else:
print '[INFO] Using usb0 for Microhard'
while "usb0" not in dmesg_output:
time.sleep(1)
try:
dmesg_output = subprocess.check_output(["dmesg"], shell=True)
except:
print("waiting for usb0...")
print '[INFO] usb0 detected, pulling up'
if "qrb5165" in uname or "qrb5165-rb5" in uname or "m0104" in uname or "m0054" in uname or "m0052" in uname:
print("[INFO] Opening config file...")
config_file = open("/etc/modalai/voxl-modem.conf")
print("[INFO] Converting to json...")
config_dict = json.load(config_file)
print("[INFO] Reading Microhard IP...")
microhard_ip = config_dict["microhard_ip"]
print("[INFO] Waiting for usb0 interface to be available")
while "usb0" not in subprocess.check_output(["ifconfig"], shell=True):
time.sleep(1)
print("[INFO] Setting IP to:", microhard_ip)
subprocess.call(["ifconfig", "usb0", microhard_ip])
else:
subprocess.call(["ifup", "usb0"])
^ this just checks for "usb0" to show up as an available interface in the "ifconfig" call then assigns the appropriate ip address (microhard_ip) to that interface with the call to subprocess.call(["ifconfig", "usb0", microhard_ip])
relevant portion of v1.3.2 voxl-modem
voxl-sdk/utilities/voxl-modem/-/blob/sdk-1.3.2/scripts/voxl-modem
starting at line 610
else:
print '[INFO] Using usb0 for Microhard'
while "usb0" not in dmesg_output:
time.sleep(1)
try:
dmesg_output = subprocess.check_output(["dmesg"], shell=True)
except:
print("waiting for usb0...")
print '[INFO] usb0 detected, pulling up'
if "qrb5165" in uname or "qrb5165-rb5" in uname or "m0104" in uname or "m0054" in uname or "m0052" in uname:
print("[INFO] Opening config file...")
config_file = open("/etc/modalai/voxl-modem.conf")
print("[INFO] Converting to json...")
config_dict = json.load(config_file)
print("[INFO] Reading Microhard IP...")
microhard_ip = config_dict["microhard_ip"]
while(True):
print("Waiting for 'usb0' to have the correct IP address...")
try:
Execute the command to get network interface information
result = subprocess.check_output(["ifconfig usb0"], shell=True)
print(result)
# Check if the command executed successfully
if "inet 192.168.168." in result:
break
except Exception as e:
print("IP not yet set")
time.sleep(1)
print("[INFO] Setting IP to:", microhard_ip)
subprocess.call(["ifconfig", "usb0", microhard_ip])
else:
subprocess.call(["ifup", "usb0"])
^ since this is blocking on a check for ifconfig usb0 to already show up with an ip address assigned to the 192.168.168. subnet (and it's not because some network service is assigning an address on a different subnet via assumingly dhcp first) it never gets to the call to set the correct ip address for the microhard modem for the usb0 interface
I'm not sure why it's necessary to check for the existence of a usb0 interface that already has an ip address on the 192.168.168 subnet, I'm assuming it never will by default. Even if I could set it up to (maybe change the etc/networks file to use the correct subnet) I'm not sure I'd want to since I could have ip conflicts with other devices on the network on boot
Follow up questions:
- can the logic in this script in the voxl-modem package be reverted so it doesn't hang when it encounters the wrong ip here and just check for the interface and sets the correct one as done previously?
- where is this shell script located in the file system so I can change it in the interim without rebuilding the package? (or do I have to rebuild the package to realize changes regardless?)
also if anyone has experience turning off mac address randomization as per the second part of my original post I'd appreciate any tips
Thanks