What is the best way to connect a Photon 2 to a USB ELM327 device? I tried searching for a compatible USB shield but could not find any (maybe I used the wrong search terms). ChatGPT also provided some sample code that uses USBHost and ELMduino that do not seem to be available for Photon 2. Is there an equivalent?
I would not recommend doing that. The Photon 2 does not support USB host or USB OTG mode, and the USB host shields generally do not work well.
If you want to use OBD-II you should use a MCP2515 or MCP25625 chip connected by SPI to the Photon 2. That should work well.
Sorry I am not familiar with the MCP2515. Does it replace the ELM327?
I can connect a PC to a USB ELM327 USB device and send commands and receive feedback. I was hoping there was a way to replicate that with a Photon 2.
It won't be possible to do what you're looking at doing with the Photon 2. If you want something smaller than a PC, you should use something that's natively a USB host, like a Raspberry Pi.
The Photon 2 (and the rest of the lineup of Particle IoT devices) is intended to be used with lower-level chipsets like the MCP2515 CAN controller, which is programmed very differently.