ESP32 Server and Apple Devices

AppdigEng
Posts: 13
Joined: Thu Feb 08, 2018 8:50 pm

ESP32 Server and Apple Devices

Postby AppdigEng » Fri Aug 24, 2018 2:02 pm

I am using the AT Command set to run the ESP32 as a server.
In my test configuration I am servering a minimal webpage consisting of the following:

<h1>Hello</h1>

Every device I connect (Android, and WIndows) have not problem.
But when I try the iPad, I do not get any display in the brower, just the following message

"Safari cannot open the page because the network connection was lost"

This happens if I close the connection immediately after sending the html or if I wait a bit.

Is there other information I need to send for Apple Devices?

ESP_Sprite
Posts: 9708
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 Server and Apple Devices

Postby ESP_Sprite » Sat Aug 25, 2018 2:25 am

Is that the only thing you send over the socket? Http needs a header as well.

AppdigEng
Posts: 13
Joined: Thu Feb 08, 2018 8:50 pm

Re: ESP32 Server and Apple Devices

Postby AppdigEng » Mon Aug 27, 2018 1:55 am

That is the only thing I send and it works fine for Android and PC devices.
What information would need to be in the header?

ESP_Sprite
Posts: 9708
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 Server and Apple Devices

Postby ESP_Sprite » Mon Aug 27, 2018 2:49 am

That's all documented in the relevant RFC; suggest you read that first otherwise you will keep on running into situations where you break the protocol. In this specific case, you break the protocol by not sending any headers; behaviour in situations like that is undefined, and as you see, some browsers will try to make sense of what you sent anyway, others will just crap out.

Resch2061
Posts: 40
Joined: Mon May 01, 2017 1:56 pm

Re: ESP32 Server and Apple Devices

Postby Resch2061 » Mon Aug 27, 2018 2:22 pm

Here is a useful site for you that should help you chug along, although it mostly covers HTTP 1.0, with a brief passing mention of HTTP 1.1

http://www.jmarshall.com/easy/http/

AppdigEng
Posts: 13
Joined: Thu Feb 08, 2018 8:50 pm

Re: ESP32 Server and Apple Devices

Postby AppdigEng » Tue Aug 28, 2018 10:19 am

Thanks for the help.
I just needed to add the HTTP/1.1 200 OK and it is working.

Who is online

Users browsing this forum: No registered users and 85 guests