Ad Hoc Mode

I have my PI setup to be able to reboot in ad hoc network mode (so I can connect to it directly from my Mac/iPhone) or as a client on a normal home Wifi.
It works great!

I want to do the same for a customer’s project but changes in the Raspberry Pi OS is breaking the solution I have. I’ve been searching for how to do this online, but I’m coming up with a lot of conflicting reports with comments saying “this doesn’t work for me”.

Does anyone know the right way to do this?

For the solution I have there will be cases where there will be no other network in existence to connect with, so setting the PI up as a stand-alone access point will be the only way to go.

Thanks in advance.

Could you describe what you consider “ad hoc mode”? Do you mean with a self-assigned address in the 169.254.x.x range?

Yeah,
The PI shows up as an access point over WiFi.
Anyone connecting to it can connect with all other clients.
There is no external network connected.
Like on a lot of devices where you connect to them to configure and then reboot so it finds your network.

It was very easy on my older raspian.