arduino-esp8266

Get Mac address of client connected with esp8266

最后都变了- 提交于 2019-12-23 17:50:19
问题 I turned my esp8266 as an access point, so that the mobile devices could connect to it. Want to get the macAddress of the devices connected to it. How could I get it? 回答1: I got the answer from here and it works #include <ESP8266WiFi.h> #include <ESP8266WebServer.h> extern "C" { #include<user_interface.h> } /* configuration wifi */ const char *ssid = "COblaster"; ESP8266WebServer server(80); void handleRoot() { server.send(200, "text/html", "<h1>You are connected</h1>"); String addy = server

ESP8266 Fails to add char to a very long String (>8000 chars)

為{幸葍}努か 提交于 2019-12-23 04:24:59
问题 After correctly getting the payload from an HTTPS request, adding the client's chars to a String stops after about 8000 characters, then resumes and stops again a few times Here's a snippet of my code: long streamSize = 0; Serial.println("Now reading payload..."); while (stream.connected()) { while (stream.available() > 0) { char ch = (char)stream.read(); Serial.println((String)"Reading [" + ++streamSize + "] " + ch); ret += ch; Serial.println(ret.length()); } } Which works fine, until:

Making a UDP class which doesn't block an ESP8266 / Arduino

拜拜、爱过 提交于 2019-12-13 09:06:06
问题 I have a need in my Arduino compatible project to listen on an ESP8266 to a specific UDP port and respond when an appropriate message is received, whilst doing other application stuff in the main program loop. I want to abstract the UDP stuff into its own class, and this is where my question comes. How do I let my class continue to listen, read a UDP packet, and then call a send response method, without putting lots of code into the main program loop? The interface for my class is: #ifndef

Espressif ESP8266 NONOS_SDK - Makefile

你离开我真会死。 提交于 2019-12-13 03:58:12
问题 I would like to compile my source-code for the ESP8266 (Extensa NONOS_SDK Toolchain is already installed and working). This is my folder structure: I use this Makefile from an example from Espressif: https://github.com/espressif/ESP8266_NONOS_SDK/blob/master/examples/simple_pair/Makefile and I also use this gen_misc.sh : https://github.com/espressif/ESP8266_NONOS_SDK/blob/master/examples/simple_pair/gen_misc.sh I am running Ubuntu 18 as a Linux Subsystem for Windows 10. This is how I called

NodeMCU - gpio programming

独自空忆成欢 提交于 2019-12-12 03:57:56
问题 I'm using a NodeMCU board, V3 pinout, and the Arduino IDE. I need to oscillate one of the output pins, and digging around I found this page: https://github.com/nodemcu/nodemcu-firmware/blob/master/docs/en/modules/gpio.md Very useful, especially the gpio.serout() function, but I can't get it to work. This is my code: #include <gpio.h>; #define LED D5 void setup() { gpio.mode(LED, OUTPUT); Serial.begin(9600); } void loop() { Serial.write("Starting blinking."); gpio.serout(LED, HIGH, 1000000, 10

Arduino WiFi shield failed to communicate with localhost server

时光怂恿深爱的人放手 提交于 2019-12-11 17:57:31
问题 I need to send data from Arduino through the WiFi shield to my localhost server and update my database and I'm stuck not knowing where or how has it gone wrong. My Arduino can connect to both the internet and to my localhost server via port 80. My server is set up using xampp and my .php file is located in the htdocs directory. I'm using HTTP POST on the server side, the code snippet for receiving the HTTP POST are as follow: $test_str = ""; if(isset($_POST["test_str"])){ echo "OK"; $test_str

parse an API link message as a server in C (Arduino IDE)

亡梦爱人 提交于 2019-12-11 16:34:30
问题 I am using Arduino IDE to program my micro-controller which has a built-in Wi-Fi chip (ESP8266 NodeMCU) , it connects to my internet router and then has a specific IP (as like 192.168.1.5 ). So I want to send commands (and data) by a message which added to the link, then the link becomes as : 192.168.1.5/?A=data1&B=data2 . When link above is launched from a device within LAN, then I can get the message in a String variable, here I have now a message which contains "?A=data1&B=data2" . So the