Hot answers tagged

5

As @Majenko commented, the A0 input has a fixed voltage divider (see NodeMCU Schematics) that connects the A0 input to a 220kOhm resistor, then to the ADC pin of the ESP8266, then to ground via a 100kOhm resistor. This effectively fixes the resistor values that can be used to scale the input of the NodeMCU. For a 0-5.0V input range (with sufficiently low ...


4

No, never! 220V is way way way too much for a microcontroller. The Uno runs on 5V, the ESP8266 on 3.3V. You should never connect any more voltage than that to the microcontroller. Also you must not connect a negative voltage to the microcontroller pins. Besides the voltage difference: You should also not connect a voltage to the pins of a microcontroller, ...


3

Considering the very limited and difficult use of the SPI Flash pins, why do ESP boards break these out to the user? Why aren't they just kept internal, making the board a little smaller? The ESP32 is not designed specifically for Arduino. There are other boot modes, such as SD card boot, whereby the internal flash is not directly used. In this situation ...


3

You can't. The password does not exist. In short: The password is used to create a key The key is used to encrypt the connection If both ends agree on the encryption then it's "connected" and packets can travel back and forth. There is no password for you to print, only the fact that encryption didn't agree. It actuality it's more complex than that, but ...


3

It's quite simple: ESP8266WiFi.h - Runs on the ESP8266 to control the WiFi. WiFiEsp.h - Runs on an Arduino to communicate with an ESP8266 module with AT commands WiFi.h - Runs on an Arduino to work with the Arduino WiFi shield. So the one you want, which is part of the ESP8266 core, is ESP8266WiFi.h.


3

On the nodeMCU board all the 3.3v pins have continuity. That means they all do the same thing. And yes, you can apply ~3.3v to them. I have trouble with voltages under ~2.8 though, 2.5v is likely not going to work. Use a buck+boost to keep it 3.3v if needed. For cheap dc/dc converters, I strongly prefer ones with XL semi chips; clean enough to please the ...


3

Linear Regulator Dropouts The linear voltage regulators found on that board are going to expect more than 5V at the barrel jack, because they require a minimum "drop out" voltage. The AMS1117 that is on that board, so far as I can tell, has a drop out voltage up to 1.3V. So you would want at least 6.3V (perhaps better 7V) at the barrel jack in ...


2

I realize this is really old, but it is still the top of the list when you search for RTCmem read/write. While it isn't maybe as "by the book" as the 'correct' answer above, there is a really simple way to deal with the "the rtcmem value is something ridiculous on first read" issue. When you first power on the esp8266 or after a button-...


2

If you want to use SPI- The homepage of the library you mentioned, clearly explains the circuit connections.- The MPU-9250 pins should be connected as: VDD: this should be a 2.4V to 3.6V power source. GND: ground. VDDI: digital I/O supply voltage. This should be between 1.71V and VDD. FSYNC: not used, should be grounded. INT: (optional) used for the ...


2

PCF8574 takes around 256us to update pins (at standard 100khz i2c). This too high compared to hx711 sck timing constraint which is 50us max. So, it's not possible to communicate with hx711 using PCF8574. wasted two days in finding out this.


2

I read heap and stack memory are facing each other and if heap or stack gets full and reachs another strange things happen. Indeed they do. And such things can be a pain to track down. So i am wondering if can we use ESP.getFreeHeap() to get free heap and conclude usage of stack. No, you can't. The "free" amount of heap does not equate to the top ...


2

It says in your description that you have the Rx connected to Rx and the Tx connected to Tx. That's backwards. What one transmits the other needs to receive. When you have a conversation with someone, do you talk into their mouth and listen to their ears? You should have Rx-Tx and Tx-Rx. You also need to be sure that it is OK to feed a 5V Tx into that ...


2

On the NodeMCU “v3” (and only on the v3) there’s a pin called VU (Vusb) that is connected to the +5V on the USB bus of the NodeMCU socket. This pin can be used to feed external components when it’s connected to USB, within the limits of the USB power supply it’s connected to. The Vin pin (which is available on all NodeMCUs (and not just the v3) is a +5V ...


2

In order to connect to Wifi from ESP32 and other boards, the WiFi connection needs to be 2.4GHz, wireless mode must be legacy. It cannot be set to Auto or N only. Go to your router box web page, and change this setting under Advanced Settings > Wireless. The only code required to connect is. void loop() { ... WiFi.begin(MY_SSID, MY_PWD); } void setup(...


2

To write code that will not cause memory leak, you need to understand of where and what caused the memory leak first. The memory leak in this particular case is caused by the line serial_data_read.concat(character); When you instantiate a String object with String serial_data_read = "", Arduino String class create a memory allocation using ...


2

You can do Serial.swap() in setup() to swap Serial away from RX/TX pin. Serial is then on D7 as RX and D8 as TX (and you can wire some serial module there). Bridge with jumper wire D4 pin with TX pin. the Serial1 output will go over the USB chip to Serial Monitor and you will see the prints to Serial1. This will not disturb the flashing mode, because ...


2

Does the loop function work after being woken up from deep sleep? YES loop function isn't magical. its just a function that gets called over and over. In other words, if it gets called once, it can be called again except if it did something to deactivate itself never reached the end during that first call. Check that you are not activating some sort of ...


2

You are using Serial.println() to send the message. That function will add the combination \r\n as line ending to your message, which are the ASCII codes for return carriage and newline. In your receiving code, you read until \n, so your message now reads "0\r", which is of course not equal to "0". Thus the if condition will never trigger....


2

From your description it sounds like a Watchdog Timer reset. The ESP8266 needs to regularly run internal householding tasks outside of your own code, such as Wifi/network related tasks. It will normally take some processing time for those tasks with every loop() iteration and with every delay() command. If your code is doing things that take longer than ...


2

The firmware update over WiFi is called OTA update. OTA stands for "over the air". The esp8266 can OTA update itself. The Arduino library for this is called ArduinoOTA and it is bundled with the ESP8266 Arduino boards support package. See the example for ArduinoOTA library in IDE Examples menu. Other MCU have the self update option too. ESP32 has ...


2

SPIFFS (SPI Flash File System) is also know as FS(File system) . so What you are seeing as FS is basically SPIFFS .The OTA partition on esp8266 is compulsory so you cant get rid of it . Hope this helps


2

Modifications to the ArduinoISP.ino sketch I made the following changes to the ArduinoISP.ino file it exists in IDE version 1.8.13, and uploaded it to the NodeMCU board. In short, I commented out (by way of #if 0) the heartbeat, err, etc LED related stuff. Not doing this causes the board to reset for reasons that would probably be apparent if I researched ...


2

You connected the V- and V+ probes of the INA module direct to the V- and V+ of the solar panel. That means you connect V+ with V- from solar panel over a 0.1 Ohm resistor. That is like a short. The Solar panel gets overloaded and the voltage breaks down. Lucky you, the solar panel can not provide more current. If it could, then the shunt resistor would be ...


1

The short answer is, don't use the String class at all. You need to read up on using C strings (which are simply null-terminated arrays of characters. There are C library functions for manipulating C strings. You'll want to avoid printf, scanf, and related functions, as the library that supports those is quite large The basic idea is to use statically ...


1

The VIN pin is NOT directly connected to the USB's 5V supply as it is an VIN PIN for powering the MCU from an external source other than the USB - this means the pin cannot be used as a 5V supply output. Never ever connect VIN to a power source AND connect the USB plug. That can destroy the USB port in your computer. There is zero back-powering protection ...


1

First of all do yourself a favour and listen to your IDE This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences. and in an if else there is no in between so either let it run as a state machine especially inyour case A != B != C != other: void subfunction(){ if(A){ // code to ...


1

The low end of the values is limited by how much current your sensor can provide. If you use 1Ω and 2Ω resistors in series then your sensor will need to provide 1.67A to create 5V across the divider. I doubt that your sensor can do that. For most sensors, you would want to use resistors in the kilohm or tens of kilohm range. The high end is ...


1

Doing something as complex as a HTTP request in an interrupt is a very very silly idea. Instead set a flag in the interrupt routine and examine that in the main loop() function to perform your HTTP request.


1

Your echoPin Is defined as 3. GPIO3 of the NodeMCU is also the “RX” pin needed for serial communication to the host. This might explain why you don’t see any output. You should change it to a different pin (for example pin 5 / D1 is a safe choice). Each pin on the NodeMCU has a “GPIO” number (which is just the pin number as defined by the ESP8266 ...


1

The signal is probably "bouncing" between HIGH and LOW instead of performing a clean edge, just like it happens with buttons. Two simple solutions: Hardware solution: use a schmidt-trigger instead of a comparator Software solution: define a dead-time for the signal aquisition (disable the interrupt when the desired edge has been detected and enable it ...


Only top voted, non community-wiki answers of a minimum length are eligible