How to 'fix' this in an enclosure without glueing?

You can buy (or 3d print) fasteners made for such a case. Search PCB mounting feet. These include a standoff to help cooling and prevent shorts.

te


Cut a piece of pcb stock (or any sheet plastic) to fit properly in the housing, including screw holes to match those bosses.

Then attach your components to this base plate either with double sided tape, velcro, or cable ties going through holes in the plate.

Run the cable through a notch in the edge of the housing rather than a hole so it can be easily removed, but won't pull out by accident (unless you want it to be removable in the field).


I would try something like that:

POC

You assemble like that, put crazy glue on the legs, let it dry in the container. Then you can unscrew when fixed to pick up the device.