Hot answers tagged

26

the ESP8266 has a builtin led that is attached to D4 as labeled on LoLin boards which maps to GPIO2. One thing to Note is that the led is active low. In other words ... setting PIN 2 to '0' will turn the LED ON and setting PIN 2 to '1' will turn the LED OFF Lolin Builtin_Led Picture This is the only LED on the LoLin boards and differs from other devkits ...


24

There is confusion about what is and what isn't possible with this board. This is because there are different versions with different power arrangements. NodeMCU 0.9 In this board the USB's 5V and the 5V pin are directly connected together. The combined result is then fed through a diode before entering the 3.3V voltage regulator. With this arrangement the ...


19

The top one is a real NodeMCU version 1 board (ESP-12E module). The bottom one is a knock-off copy - looks like the same module on it. The biggest difference is the USB interface. The real one uses a CP2102 USB to UART bridge. The copy uses a CH340G chip. The CH340G is notoriously unstable and liable to die at a moments notice. The CP2102 is far more ...


13

The Flash button on NodeMCU is connected between io 0 and ground. You can use it as a button. Set pinMode(0, INPUT_PULLUP) and you will read io 0 LOW if the button is pressed. NodeMCU schema To put the module in flashing mode, first the Flash button must be held and the Reset button pushed, only then should the Flash button be released. Normally, the ...


12

Lua, like many scripting languages, tends to make you a lot more productive as a programmer: things become far easier as you work at a higher abstraction level and do not worry about trivial things like memory management. You achieve the same goals with far less lines of code. On the other hand, whereas it makes development faster, it also makes program ...


11

Using the Arduino IDE is custom firmware. That's what you're writing. You don't need any new firmware because the new firmware is what you are writing. I can't think of any downsides to using C++ to program the ESP8266 instead of Lua - in fact it can only be a benefit since you are not using an interpreted language which is going to be slower than natively ...


10

Certain pins of the ESP8266 perform special functions at bootup. GPIO15, when HIGH, makes the ESP8266 boot from an SD card. You can read more about the special functions of the pins here. The solution? Don't use GPIO 0, 2 or 15 for things that can affect the boot sequence.


9

Arduino's ESP8266 support includes an example sketch called CheckFlashConfig. This probes the board, and prints the flash memory size.


8

I have several of these modules. They have an optional opto-isolator built-in, but you have to remove the jumper to use it. Connect your GPIO trigger as you have it Run the relay's Vcc and Gnd pins to the MCU, not the power plug. connect the power plug's +5v to the left-most pin, where the jumper once stood: JDVcc connect the power plug ground to the MCU or ...


7

The numeric value of A0 is 17, as defined here. But unlike on an Arduino board, you can't use it as a digital pin. It only work for pin numbers 0-16. If you are using as a parameter for analogRead, the numeric values would be 0 and 17, as seen here. And as such, these three calls would do the same: analogRead(A0); analogRead(17); analogRead(0);


7

The easiest way (windows at least) is to use Espressif's flash download tool - don't select anything to flash to the device, select the appropriate com port, click start, and the details of the device will appear in the Detected Info window


7

I have nodeMCU v3 and Pin 2 worked for me. #define LED_BUILTIN 2 void setup() { pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output } // the loop function runs over and over again forever void loop() { digitalWrite(LED_BUILTIN, LOW); // Turn the LED on (Note that LOW is the voltage level ...


7

In C you can not use quotation marks inside quotation marks (thus nested). Replace message2 += " <meta name="viewport" content="width=device-width, initial-scale=1">"; to message2 += " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">"; By using the escape character \ it means that \" is a character (") instead of ...


7

Port forwarding is required to allow a device outside your router to access a device inside a router that performs NAT (Network Address Translation). When a NodeMCU is acting as a simple server to respond to requests, it is inside your network, and so the port-forwarding is required so that your phone or computer on the Outside can access it. However, for ...


6

This error is caused by using a 6.x.x version of the ArduinoJson library with code that was written for a pre-6.x.x version of the library. You have two options to solve the problem: A. Downgrade the library to a version that is compatible with your code For now, this is probably the best option because the 6.x.x version of the ArduinoJson is still in ...


6

Pin D8 is esp8266 pin 15. This pin is one of the boot configuration pins and for use on a dev board, it must be pulled down at boot. So the NodeMcu has a pull down circuit on this pin and internal pullup is weaker then this external pulldown.


6

Simply Switch #include <ESP8266HTTPClient.h> #include <ESP8266WiFi.h> to #include <ESP8266WiFi.h> #include <ESP8266HTTPClient.h>


6

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 ...


6

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 ...


5

So here comes my solution: I was playing around with NeoPixelBus by Makuna and the examples. I noticed in one of his examples, it said: // You can also use one of these for Esp8266, // each having their own restrictions // // These two are the same as above as the DMA method is the default // NOTE: These will ignore the PIN and use GPI03 pin //NeoPixelBus&...


5

The ESP8266 doesn't have any EEPROM. Instead it emulates it using Flash. In order not to wear out your flash you have to "commit" changes to the flash once they have been queued for writing - otherwise they will be lost. Instead of using the Arduino examples you should be using the ESP8266 specific examples included with the ESP8266 EEPROM emulation ...


5

An ammeter is basically a small resistor in series over which the voltage drop is measured. That resistance will play a part in the effective output impedance of your power source (battery). This increased impedance will reduce the overall amount of current the battery can provide before the voltage drops to an unacceptable level. For instance, I just did ...


5

Maybe you have a space in your WIFI SSID so you should check this in your router. Also maybe your WIFI is on 5Ghz and the ESP can't see it because it is only for 2.4 Ghz. Also if your WIFI AP is on a channel from 13 - 14 it also couldn't be seen by the ESP. And to test your ESP you can run the scan example and if it works you should try the web server ...


5

That water level sensor uses bare metal which is in contact with the water. The PH sensors are sensitive for that kind of voltage in the water, even if it would be 0V. There are isolated PH sensor amplifier modules. On forums are often discussions whether to ground an aquarium or not for a PH sensor. With a isolated PH sensor, you avoid most of those ...


5

No. The Vendor Name is associated with the OUI. The OUI is the first three parts of the MAC address. The OUI's are all registered with IEEE here and Espressif's entries are: 18-FE-34 (hex) Espressif Inc. 24-0A-C4 (hex) Espressif Inc. 24-B2-DE (hex) Espressif Inc. 2C-3A-E8 (hex) Espressif Inc. 30-AE-A4 (hex) ...


5

The description in the link of where you bought the strip says: Description: LED Type: 5050SMD with External IC WS2811 (1 IC control 3leds) So, this is probably as intended. Note the application circuits in the datasheet for the controller IC (WS2811) [Page 5] where, for 5V, you can address a single LED, but for a 12V configuration, you must ...


5

The situation you describe is called MultiMaster. It is normally done in hardware using the I2C peripheral in the MCU. However the ESP8266 doesn't have one (or if it does, it's not used), and uses bit-banging to implement I2C in software. If you can add MultiMaster functionality to the ESP8266's Wire library then possibly yes, you could do it. Another ...


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

I STRONGLY RECOMMEND TO STAY WITH THE ARDUINO IDE! Despite programming in C++ not being as friendly and versatile as Lua (working with Esplorer is really a dream come true!), Lua is VERY UNSTABLE AND UNPREDICTABLE!!! You can run a simple program of ten lines and it works ok for a day... two... and suddenly, on the 3rd day the chip hangs unexpectedly, and ...


4

The simplest method is just a voltage divider - just as if you were interfacing a 5V logic signal output with a 3.3V input. However it may not work. A voltage divider will only really be of use if the output of the pH sensor is low impedance. If it's not then you will need a very high impedance voltage divider, and the analog input of the ESP8266 isn't high ...


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