Share My Creation Android smart watch ZGPAX and WIFI low cost module ESP8266 for SMART HOME

XorAndOr

Active Member
Licensed User
Longtime User
Hi, i installed the apk temperature and working properly. Kindly could have code B4A reported to the program ?, because I did some tests with httputils2 and module esp8266 and can only communicate with the sending of the instructions, but I have nothing in reception. Thank You. excuse the translation with google !.

Solved with B4A SOCKET.
 
Last edited:

Ambro

New Member
Good day,
I am an Italian radio Ham and I am facing to the esp8266 for the first times.
I would like to load a program that allows me to send the UART data to a web page accesible from the net.
I alredy have a MCU that send out uart data at 9600 8 n 1 to the ESP but still not able to send those data on the web: I will like to see data on my smart phone too.
Is this feasible ?
Could you please help me in describing the procedure in a step by step mode ?
Thanks a lot for the help.
Rehards,
Ambro
 

freedom2000

Well-Known Member
Licensed User
Longtime User
HI Italia !

Jump to this link : https://github.com/esp8266/arduino
install the full arduino package

Then go to the menu, examples/ESP8266Webserver and find the "hello client" sketch

For sure you will find a lot of other examples. Try it's easy

B4X:
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>

const char* ssid = "........";
const char* password = "........";

ESP8266WebServer server(80);

const int led = 13;

void handleRoot() {
  digitalWrite(led, 1);
  server.send(200, "text/plain", "hello from esp8266!");
  digitalWrite(led, 0);
}

void handleNotFound(){
  digitalWrite(led, 1);
  String message = "File Not Found\n\n";
  message += "URI: ";
  message += server.uri();
  message += "\nMethod: ";
  message += (server.method() == HTTP_GET)?"GET":"POST";
  message += "\nArguments: ";
  message += server.args();
  message += "\n";
  for (uint8_t i=0; i<server.args(); i++){
    message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
  }
  server.send(404, "text/plain", message);
  digitalWrite(led, 0);
}

void setup(void){
  pinMode(led, OUTPUT);
  digitalWrite(led, 0);
  Serial.begin(115200);
  WiFi.begin(ssid, password);
  Serial.println("");

  // Wait for connection
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.print("Connected to ");
  Serial.println(ssid);
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());

  if (MDNS.begin("esp8266")) {
    Serial.println("MDNS responder started");
  }

  server.on("/", handleRoot);

  server.on("/inline", [](){
    server.send(200, "text/plain", "this works as well");
  });

  server.onNotFound(handleNotFound);

  server.begin();
  Serial.println("HTTP server started");
}

void loop(void){
  server.handleClient();
}
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…