We are heading toward production for our 2nd product and have developed a somewhat hokey way of doing what you are asking. We have ruled out connecting to the particle cloud due to inconsistent connectivity through the great firewall and frankly poor internet at the factory. Doing the network scan is also inconsistent in our factory as they change the lines and products frequently so that doesn’t work for us either.
Since we are using an external antenna with the P0 module, we want to verify the conducted power output of each board first by plugging it directly to a spectrum analyzer via its coax connector and a bed of nails tester. The only firmware I could find that allows us to output a clean wifi signal is the FCC test firmware so we load that onto our device via JTAG and then plan to run 3-9 tests (low/med/high channels on b/g/n).
Once we validate that the signal is within expected range, we re-flash particle firmware and our software and go into regular test mode to test other components. If it doesn’t fall into range, we can quarantine it and either fix it or throw it out.
After assembly of our external antenna, we are planning to use a wireless connection to a local access point but will attenuate the output of the router by 30-40 dB so it looks like a weak signal even if it’s right in front of the device. Then we look for RSSI values to make sure the device can connect properly to the network.
This process tells us that the main board meets our criteria for conducted testing and the external connection and antenna will meet our wireless performance needs without having to write our own firmware at the base level. If any of these things is broken, we have now a few key points to hone in on from SMT to first test to assembly to final test.
We had a previous iteration of the product and had an onboard chip antenna relied on it making a simple connection to a router and capturing the rssi. This resulted in inconsistent performance (mostly attributed to poor wifi design) that caused us a lot of headaches so now we have swung the other way and want to be extra sure the WiFi works since what good is an IoT device that can’t connect to the internet??
good luck with your project!