Search code examples
iosswiftwifip2pobd-ii

OBD 2 iOS wifi swift communication


I want to create an iOS app to connect my Wifi OBD 2 to the iPhone. But i have no idea on how to do the peer connection with swift 2. I have the OBD doc to communicate with it (https://www.elmelectronics.com/wp-content/uploads/2016/07/ELM327DS.pdf - page 30). I tried to search the same thing on android and windows but the problem is my knowledge on peer to peer iOS communication. I see a lot of iOS app for OBD protocol on app store, I'm sure that anybody can help me ! Thank you !


Solution

  • You don't need to know about real wifi peer2peer communication. Once you attached your phone to the wifi network created by the obd2 wifi adapter, you will be able to establish a good old TCP-connection to it. By default most wifi adapters listen at 192.168.0.10:35000 for incoming connections.

    After establishing the TCP connection you can communicate via AT and PIDs by writing/reading to/from the socket. The actual protocol is described in ELM327 manual and the ISO/SAE standard documents.