New answers tagged

1

In your program there is this line of code: return redA->rssi > redB->rssi ? 1 : (redB->rssi < redA->rssi ? -1 : 0); Which appears to return a 1 if A is greater then B other wise it will return a 0. This code can not tell the difference between A < B and A == B. Consider altering this line of code to allow returning 1 for A > B, 0 ...


0

No, you're not doing anything wrong. Those simple MOSFET level shifters work by having both sides pulled up by resistors to their respective power supplies. When one side gets pulled low by a digital signal that LOW is mirrored to the other side of the MOSFET. If you connect your TX0 pin to GND you will see the TX1 pin go to 0V.


0

readBytes doesn't terminate the buffer with 0, but strstr expects a zero terminated string. Do buff[c] = 0; after readBytes. You initialize the buffer with zeros, but if the count of bytes read is equal to buffer size, there is no terminating zero. So make sure you have space in buffer for the zero. int c = client->readBytes(buff, ((size > sizeof(...


0

Your code will only do anything if a client has connected to it because of this line if (!client) { return; } Your physical button will never do anything on their own unless a client has connected and has sent some data. For the random direction you use a line like the following to randomly pick a direction int direction = random(0,2) ? 1 : 0 ; ...


0

In the question the OP said: I have soldered a wire from GPIO16 to RST. But, I'm going to post an answer for the people who find this question and need the ESP-01 modification instructions in order to wake an ESP-01 module up from deep-sleep: The ESP8266 mounted on an ESP-01 board will not wake up from deep-sleep because the ESP8266 wake up signal is ...


0

I guess you have a race condition between automatic connection to WiFi by the Espressif SDK and your WiFi.begin(). You have two options how to solve it. 1. option: Don't use WiFi.begin in this sketch. Use an utility sketch to set the SSID and password and the SDK remembers it persistent on flash. Then it is able to connect fast to WiFi specially on reset, ...


0

Try to add WiFi.hostname("ESP-host"); before WiFi.begin(ssid, password); - it works in my case.


2

(Answering in more detail, as this is the top search hit for "ESP8266 Vin", at least for me) TL;DR: Vin is NOT directly connected to USB power. There is a protection diode between USB+/VU and Vin, which has a limited current capacity. If your board provides VU, that one is directly connected to USB power. As long as you only power 1-2 tiny devices, it ...


1

I assume that you misunderstand how JavaScript works. JS is executed on the client side and therefore the esp can easily serve JS code the same way it would provide any html content. Take a look at the Webserver examples and embed your JavaScript code into the html content that the examples use. The important thing to note is that the esp does not execute ...


3

ARP isn't generally used the way you described. Per the spec, to resolve an IP address into a MAC address, you broadcast an ARP request for the IP address, and receive a unicast response from the host whose address it is - not a router. It also only resolves a single IP address in one request; it doesn't return the contents of the entire ARP cache. While ...


1

If you want server-push, you can use Server Sent Events or a Websocket instead of polling with XMLHttpRequest. So yes, it can be done, and I have implemented both using a Nano 33 IoT at one end and Javascript in a browser on the other. Some example code is here: https://github.com/ocrdu/arduino-webinterface-sse and here: https://github.com/ocrdu/arduino-...


0

ESP-01 was designed as WiFi network adapter, not as a controller board. The are 4 pins on esp-01. RX (io 3), TX (io 1), io 0 and io 2. SPI requires 3 pins: clock, MISO, MOSI plus one pin for every device connected to the bus. So you could in theory use one SPI device on this 4 pins. The esp8266 Arduino SPI library works only with hardware SPI on esp8266 ...


0

As @Juraj mentions in the comments, don't use 115200 baud with SoftwareSerial. The problem is that the AVR isn't fast enough to handle incoming data at that speed reliably. Yes, it can receive a byte fine at that speed, but what it can't necessarily do is store that byte away in the receive buffer in time to be ready to receive the next byte - so it ...


1

The problem stems from the fact that the author of the Neotimer "library" defined the methods in the header file, see neotimer.h. If you include this header in more than 1 source of your project, you will get these "multiple definition" errors. To solve this issue you have (at least) these options: Make Neotimer a correct library with separated header and ...


1

First and major point, is that if you want to repeat existing device, then you have wrong hardware. Comments in the code tell us: Main Hardware: - NodeMCU Development Board (Any ESP8266 dev board will work) - **OLED I2C Display (SH1106)** You have dot matrix display with MAX7219 chip (most likely), which uses completely different library to work with. ...


2

I use Tzapu's WiFiManager https://github.com/tzapu/WiFiManager. That starts your ESP as a WiFi access point (AP mode) which presents a web page at http://192.168.4.1 where you enter your WiFi SSID and password. It then stores the password and restarts WiFi as a station (STA mode). On restart if the password is already stored then it just connects as a ...


0

While it IS possible to reverse a password hash, especially MD5 (https://md5decrypt.net/en/), it doesn't buy you anything in the way of security since everyone else can also reverse them. If you happen to have a second LoLin, you could set it up as an Access Point and have the first device connect to it instead of having it connect to your router. Then you ...


0

I laud your intention and wish there were a good solution on the ESP8266 for what you're trying to do. MD5 is a one-way hash function, so you won't be able to simply recover the original string to use in WiFi.begin(). MD5 is also considered to be "cryptographically broken and unsuitable for further use" as of 2008. So if you're concerned about more than ...


1

The "definition" of uint16 system_adc_read(void) is inside the compiled archive/object file libmain.a inside one of the NONOSDK folders which is located in /tools/sdk/lib/ . The version is selected in platform.txt. For example in my platform.txt: # default SDK for all boards # (generic board overrides this variable) build.sdk=NONOSDK22x_190703 #build.sdk=...


2

Can I store an MD5 password hash instead No. MD5 is a "trapdoor" algorithm. It's one-way. You can make a hash from a password but you cannot make a password from a hash. You could AES encrypt it, but you would need to have the AES key in your sketch to decrypt the password, which just moves the problem elsewhere. Typically in a real-world situation you ...


2

On the ESP8266 there's very little to choose from between the two. It all really boils down to what you want to store and how you best want to access it. EEPROM emulation is ideal for small bits of data - configuration values and that sort of thing. Where you just want to store a few of values that would seldom change. SPIFFS though is better at dealing ...


2

I don't think it makes any difference from a hardware point of view. The benefits of using the eeprom library is that it avoids rewriting unchanged data (if you use spiffs you might want to implement that as well) and that the esp is compatible with the arduino environment, where there is a real eeprom. On the other hand, SPIFFS has its advantages (e.g. ...


0

For decent audio recordings, you need an external (16 or 24 bit, 44.1 KHz or more) ADC with at least two channels (stereo). To save it to an SD, you can buy a so called SD data logger, they are very cheap. Not all SD cards are compatible so you might have to try several ones. The protocol used is SPI.


2

I fixed the problem. It turned out to be that the flush function in Arduino WiFi library has toally different meaning from the one that defined in ESP8266WiFi librarry. From https://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/client-class.html: flush() returning true indicates that output data have effectively been sent, and false that a ...


2

In your code there is a possibility that you stop the client and then flush it after. That could lead to the observed error. // Client timeout, if client can't reach the server, // it should start to reconnect the server while(client.available() == 0) { if (millis() - timeout >= clientTimeout) { Serial.println(">>> Client Timetout !"); ...


0

I've found that when a flash fails with a space error, I've usually specified the wrong flash size option in Arduino (under Tools->Flash Size). Depending on the version of Arduino you're using, try picking the one with "No SPIFFS" or FS:none that matches the size of your flash memory. Once you make that change, recompile and reupload.


0

ESP8266 is a microcontroller with WiFi capability. it requires external flash memory and some antenna to work. There are different modules and development boards with this system. Some development boards use basic esp8266 modules and some integrate the chip, flash memory and the antenna on the PCB. NodeMcu is a development board with esp8266 and a firmware ...


2

From https://forum.arduino.cc/index.php?topic=616324.0: NodeMcu is the name of the firmware originally for the ESP8266 microcontroller, with support for the ESP32 microcontroller added more recently, that allows you to program these microcontrollers using the Lua programming language. NodeMCU firmware was developed so that AT commands can be ...


2

The WiFi shield and an ESP8266 with any of several popular WiFi services firmwares are different pieces of hardware, each of which can provide WiFi services to another device connected to it, such as an Arduino Uno. Their interfaces are different, despite that they could be used to do similar jobs - offloading the WiFi communications from the Arduino - and ...


0

If you've come upon this page because the ESP8266 on your (WeMos) Mega wifi won't connect to your router (etc), check the age/security of your router: Wifi stopped connecting (Wemos D1 Mini) This line of code that allowed connecting with my old router: WiFi.enableInsecureWEP(); which also highlights that I should upgrade it...


2

Ticker does not interrupt your code. It is a OS-timer and will call your function once the time is elapsed. The Tiker callback can be interrupted by a "real" interrupt or another Task with higher priority and does not provide any reliability - it will just be called. A solution (not the best) would be to disable manually all interrupts, if you can't solve ...


0

This int ctr = () should probably be int ctr = 0 The for loop syntax is incorrect, see: https://www.tutorialspoint.com/cplusplus/cpp_for_loop.htm The first for loop needs a } at the end.


1

On the ESP8266 flash is a very special case. Because the ESP8266 itself does not have any flash, but instead uses an external SPI-connected flash chip, accessing it is not an easy or technically obvious operation. Reading from the flash chip is slow. Very very slow (by comparison to reading RAM). Because of this where possible certain things are copied ...


1

I have figured it out There seem to be understandable limitations if what kind of function can be run as a result of asynchronous scanning (which doesn't seem to interrupt running of a loop function) So if I have used delay(x) or a while loop until there is input on serial, MCU resets after allotted time runs out. I have re-written code to start function ...


Top 50 recent answers are included