Right, the day before a planned user test I figure out that my iPad PhoneGap or Cordova application does not work on an iPad 3 IOS 5.1.1, while it did perfectly on the iPad 2 with the same IOS version! Dumb enough a person that I was, I ‘assumed’ that this would then be guaranteed to work on the newer iPad. Lesson learned, I guess.
I have an Arduino device that runs a webSocket Server smoothly. I’ve been testing my app with the same Arduino device on my laptop on Google Chrome latest development build, AND before on an iPad 2 with the latest iOS version: it worked like a charm!
On the iPad side, I am running a PhoneGap or Cordova HTML5 / JavaScript application which uses webSockets.
I am not relying on any third-party network / web socket service or technology, just the webkit web socket implementation which works on Google Chrome and apparently only the iPad 2..
So, in comes the iPad 3: the WebSocket connection seems to fail. I am not at all a network guru, although I think I know the basics, and I tried to find out using Wireshark if something went wrong with the handshake. But it seems there isn’t even a handshake. The iPad 3 stops at the ARP request!
I’ve included links to my Wireshark (promiscuous mode only, monitor mode doesn’t seem to work) outputs and screenshots thereof below:
Laptop output (Wireshark needed)
iPad 3 output (Wireshark needed)
What’s going on? Why is my Arduino device not responding to the ARP from the iPad 3, and it is responding to the ARP from the iPad 2?
The weird thing is: there should be nothing wrong with the web socket implementation on the iPad 3 side, I checked with this web socket demo site: http://www.websocket.org/echo.html
The cause was probably just the older implementation on both iPad2 and iPad 3 (latest IOS 5.1.1 at this time). I’ve updated the webSocket Server code several times, before it worked because the protocol used on the server side was older aswell. After that being updated, i realise i never tested the communication part of the app. Stupid!
I have 2 options: hope that the creator of the webSocket Server can provide a version with the older protocol implementation, or update to the IOS 6 beta 3 in which there is (according to caniuse.com) full websocket support (read: they implemented the correct protocol in safari mobile, only now…). I hope my mistake keep others from making the same: when using webSockets in your application, be sure to allways at every iteration test the communication flow!