Enhancement: "compact device ID"

I’m working on migrating from a 3rd-party ACS solution to a self-hosted GenieACS setup. I noticed that GenieACS is correctly following the TR-069 spec by including the DeviceClass in the generated device ID, but that’s causing me interop problems, because the old solution doesn’t.

For example, an AVM FRITZ!Box device will show up on GenieACS with device ID 00040E-FRITZ%21Box-D424DDF3ABD8 (the %21 in the device ID will be the subject of a follow-up bug report), but it appeared on the old ACS as 00040E-D424DDF3ABD8, More to the point, the latter value is what’s printed on the box as the “CWMP ID”.

I’ve forked the repo and built an in-house version that uses a CWMP_COMPACT_DEVICE_ID flag to override the standards-compliant behaviour and always use only the OUI and serial number to generate the device ID. I’ve defaulted the flag to false to preserve the existing correct behaviour unless explicitly overridden.

OK to submit a PR? I’d prefer not to run a forked version if I can avoid it.

This is not a defect. This is by design. The component parts of the ACS ID are URL encoded.

Accepted. The bug comes when trying to create a task: if I use the device ID in the NBI URL, it gets decoded before attempting to retrieve the device from the database. So, if the _id in the database is 00040E-FRITZ%21Box-D424DDF3ABD8 and I attempt to create a task using that device ID, the actual _id value sent to MongoDB is 00040E-FRITZ!Box-D424DDF3ABD8 which obviously doesn’t match.

Any feedback on the proposed enhancement?

You need to encode the URI.

00040E-FRITZ%21Box-D424DDF3ABD8 becomes
00040E-FRITZ%2521Box-D424DDF3ABD8.

Yeah, that could work. URLencoding a URLencoded value is a bit meta, but hey.