We’re rewarding the question askers & reputations are being recalculated! Read more.

Hot answers tagged

21

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


17

The VIN pin is directly connected to the USB's 5V supply. Which means that when the board is powered by USB you can take 5V out of that pin. You cannot control that voltage. It is always on, and always 5V (or whatever your USB port happens to provide - 4.75v - 5.25v). You must never ever connect VIN to a power source and connect the USB socket. That can ...


11

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


10

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


9

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


8

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


8

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.


8

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 sould the Flash button be released. Normally, the ...


7

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

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

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


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.


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

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


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

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


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

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


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


4

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


4

As pointed out by Ignacio Vazquez-Abrams and jsotola, you need to use a state machine, like the one from the Blink Without Delay Arduino tutorial. Yours would be slightly more complicated because you need a way to turn it on and off, and because you use different on and off periods. Here is an example code that abstract the blinking logic into three ...


4

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


4

An example how to use NTPClient is available at the projects github #include <NTPClient.h> // change next line to use with another board/shield #include <ESP8266WiFi.h> //#include <WiFi.h> // for WiFi shield //#include <WiFi101.h> // for WiFi 101 shield or MKR1000 #include <WiFiUdp.h> const char *ssid = "<SSID>"; ...


3

Yes, it is the same as Arduino. The TX and RX pins connect to a CH340G chip to convert the serial into USB. If you use USB serial you can't use the pins for anything else.


3

According to §1.7 (Pulse-Width Modulation) of espressif.com's ESP8266 technical reference document, “PWM frequency range is adjustable from 1000 μs to 10000 μs, i.e., between 100Hz and 1 kHz.” That range is shown in other sections of that reference, and in other ESP8266 documents as well. I don't know whether that range reflects any hardware limitations, ...


3

As stated by Majenko in the comments, I thought that all MCUs analog gpios had a pullup resistor built in, so I have been able to solve the problem using an external pullup, in this case connecting a 10K resistor like in the diagram: . Special thanks to Majenko for his time and patience. Cheers!


3

This line of code should hopefully do a difference. wifi_station_set_hostname(myHostname); For more information : https://www.reddit.com/r/esp8266/comments/3zl3pi/change_esp8266_network_name/


3

The ESP8266 ESP-12E has only one analog input, that is A0 (which tolerates a range 0-1 volt). digitalRead() statements are not appropriate for a photocell within a potential divider since you will simply get a boolean result 0 or 1 from the connected pin. You can read one photocell connected on A0 by analogRead( A0 ) assuming it is so connected within a ...


3

The relay has no reference for what the voltage from the NodeMCU is. Since the power supplies of the two devices are isolated (from each other; the laptop may not be isolated itself, but the battery certainly should be) you can (and in fact must) connect the grounds of the relay board and the NodeMCU together. If neither power supply is isolated or if you ...


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