Reputation: 1
I've been having this issue for over a month and I'm no where close of finding a solution, I'll do my best to describe the issue and what I've tried so far.
I have this application that was running fine with the Debian Buster distribution on a container with Balena OS, the Network Manager library was being used for 2 main features:
It is worth noting that we already have 500+ devices with this issue deployed in the field and the problem was not detected until it was too late. The problematic feature is the hotspot creation, as it extensively uses the NetworkManager library, and I'm trying to find a solution that changes as little as possible in the application code. I've tried previous approaches of updating the release to Bookworm to no avail, ao I guess I'm stuck with Buster.
I've tried was this fix from Klipper Screen developers which was having the same issue, where they include a modified version of NetworkManager: https://github.com/alfrix/KlipperScreen/commit/8576e7c11fd020e6782dee376d57cebf99a33a88#diff-22e80c068d300bc92c81caeafaf3f57ec305512ad8e8b4ed0ac81b588a1f2ff8
The modified version of NetworkManager.py solved the DNS error but it created more errors, namely in the following statement in line 863:
return socket.inet_ntop(family, struct.pack('I', addr))
The error is the following:
struct.error: required argument is not an integer
I've tried putting the if/else condidition in a try except format but the else condition also fails, I've tried modifying the condition in the following manner:
if family == socket.AF_INET:
# Convert IP address string to packed binary format
packed_addr = socket.inet_aton(addr)
# Use struct.pack to pack the binary address into a packed string
packed_string = struct.pack('I', struct.unpack('!I', packed_addr)[0])
# Convert the packed string back to a human-readable format
return socket.inet_ntop(family, packed_string)
It then creates a problem when setting the SSID for the hotspot as the field is passed in dbus.Byte format like this:
({'802-11-wireless': {'band': 'bg', 'mode': 'ap', 'ssid': [dbus.Byte(74), dbus.Byte(76), dbus.Byte(65), dbus.Byte(45)...
It does seem it's not being decoded before being passed to the settings, not sure why as the
ssid_to_python function should be doing this.
I'm reaching my wits end here, does anyone know of a way to fix this?
Thanks in advance for any help.
Upvotes: 0
Views: 179