• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

SAP

Q&A Forum › Category: ESP8266 › SAP
0 Vote Up Vote Down
chsneer asked 6 years ago

HI
How to send data from ESP8266 to APP when i config the ESP to 
Soft Access Point

8 Answers
0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

Which app do you want to send the ESP8266 data to? An android app that you’re going to create?
Or are you talking about building a web server to display sensor reading?
Thanks!

0 Vote Up Vote Down
chsneer answered 6 years ago

Hi Rui
The Android APP We create. But We want to send sensor reading from ESP8266 to Smartphone Directly without router. 
If there is any code example we would be very happy
Thanks in advance for your help

0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

If you want to use Wi-Fi, you need to set the ESP8266 as an access point. Then, you establish a Wi-Fi connection with your ESP8266. Your Android app can make HTTP requests to get data or publish data to your ESP8266.
However, with that setup in your Android phone, you need to be connected to the ESP8266 access point.

0 Vote Up Vote Down
chsneer answered 6 years ago

Tanks Rui
Do you have any example of code execution

0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

I don’t have any tutorial on that exact subject. But basically, you need to follow these two steps:

1. Set ESP as an Access Point (AP) (I have a tutorial for the ESP32: https://randomnerdtutorials.com/esp32-access-point-ap-web-server/ ) If you change that code:

// Load Wi-Fi library
#include <WiFi.h>

To this:

// Load Wi-Fi library
#include <ESP8266WiFi.h>

It should work for you.

2. Setup a ESP8266 web server that will receive/respond to HTTP commands

I personally don’t like use it as an Access Point, because you need to be disconnected from your main router/Internet connection and manually connect to the ESP8266 Access Point. I understand that in some scenarios that’s ideal…

0 Vote Up Vote Down
chsneer answered 6 years ago

Hi Rui
tanks for your answer i try to put the cod there same problem
that i can’t solve
WiFiClient = server.available();
Arduino: 1.8.7 (Windows 7), Board: “NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, 4M (1M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200”
 
esp_8266_test7:42:14: error: expected unqualified-id before ‘=’ token
WiFiClient = server.available();
^
esp_8266_test7:43:8: error: ‘client’ was not declared in this scope
if (!client) {
^
esp_8266_test7:49:11: error: ‘client’ was not declared in this scope
while (!client.available()) {
^
esp_8266_test7:54:16: error: ‘client’ was not declared in this scope
String req = client.readStringUntil(‘\r’);
^
exit status 1
expected unqualified-id before ‘=’ token
This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.
 

0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

I’m not sure what you uploaded, but if you modify the Sketch to look like this: https://gist.github.com/RuiSantosdotme/3de7c553657be162fd80c8d8d93452be
It will compile for the ESP8266 board. Can you try it?
Thanks!

0 Vote Up Vote Down
chsneer answered 6 years ago

Many thanks Mr. RUI
It works

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.