how to read the text “XXX” from Arduino command server.send(200, “text/plain”,“XXX” ) by swift
good question but how are you planning to read that? via USB, serial port, wi-fi? It will all depend on the 3rd party libraries that you will use to communicate.
I am do it via wifi, but some time they are not communicating although wifi is still available, so i need some recieve signal from ESP. My planning is:
When ESP receive the command from IOS : WebView.loadRequest(request as URLRequest)
I need ESP respond to IOS, I using the command: server.send(200,“text/plain”,“XXX”)
But in IOS, I don’t know how to read this text “XXX”. IF I CAN READ THIS TEXT, I WILL EASY TO POST THE WARNING, IF STRING = “XXX”, WIFI CONNECTED ESLE WIFI NOT CONNECTED.
PLS HELP ME IN THIS CASE.
so you are running a web server on arduino and using a webview on iOS to request, is that correct?
If that is what you are after, then you need to look into URLSession (Apple Developer Documentation) to get data from an URL as you mentioned.
This topic was automatically closed after 166 days. New replies are no longer allowed.