Hot answers tagged

3

You must use a WiFi (2.4 GHz) antenna. From the picture in your post, you have one of the esp8266 modules with a "built-in" antenna implemented via traces on the PCB. You cannot add an external antenna without removing the old one first, and even that will be very dodgy - you'll likely render your esp8266 useless for any purpose. Instead, you could get an ...


3

What's your last error message? no matching function for call to 'PubSubClient::publish(const char [11], String&)' Read the documentation for the publish() method in PubSubClient: int publish (topic, payload) Publishes a string message to the specified topic. Parameters topic - the topic to publish to (const char[]) payload - ...


2

The sketch in the question is not for NodeMCU. It is for Arduino with esp8266 wired on pins 9 and 10. But the error in title is a current error for esp8266 Arduino boards package 2.6.0. The EspSoftwareSerial bundled with the esp8266 Arduino boards package version 2.6.0 has a compatibility breaking change. The problem was immediately reported and the ...


2

John Romkey provided you an excellent answer. I am adding this just to provide another perspective, hopefully complementary. Interrupts are meant to handle the most time-critical tasks. Those tasks that cannot wait for the next loop() iteration, such as counting a pulse from an encoder, or getting a byte out of the UART receive buffer. If you delay them too ...


2

Interrupts happen all the time and code works just fine without locking them out. It doesn't matter if it's at the exact moment that a function is saving something - a properly written interrupt handler will save any necessary state so that whatever was interrupted can continue without problems. If it doesn't, the software will crash hard. You should lock ...


1

No. Those three devices are I2C devices, not SPI devices. Using that is no different to using three individual sensors all wired to the same I2C bus.


1

GPIO12 must not be pulled high during boot. It's possible there's a pull-up resistor on the BME680 breakout board you're using that's pulling SCK high and interfering with the boot process. I would avoid using GPIO12 here. If you're out of pins on the ESP32 you can connect the BME680 via I2C rather than SPI. I2C only needs SDA and SCK (and power and ground, ...


1

Why shouldn't i power ESP8266 WiFi module directly from arduino nano 3.3V rail? The 3.3V rail of the Arduino is not meant to provide much current. The onboard regulator is a simple linear voltage regulator, which will dissipate the extra power as heat. As you draw more current through it, it will get hotter and finally get fried, as it cannot dissipate the ...


1

By adding strings together you are actually adding together the addresses in memory where those strings are. Instead you need to create a new empty buffer and fill it with the contents of the other strings. char buffer4[32]; // <-- Enough room for both strings and a NULL character strcpy(buffer4, mqtt_topic); // Copy in the first string strcat(buffer4,...


1

See Guide to PROGMEM on ESP8266 and Arduino IDE. Since you put your char array into PROGMEM, special functions must be used to load it from flash into RAM; so to load it into a String object, the FlashHelper class must be used. You can simply use the macro FPSTR(progmem_ptr). #include <Arduino.h> void setup() { Serial.begin(115200); Serial....


1

In general there is several ways to do it, none of them is the perfect one... pointer to mqtt at global scope Adafruit_MQTT_Client * mqtt_ptr; and initialize it by mqtt_ptr = new Adafruit_MQTT_Client(&client, AIO_SERVER, AIO_SERVERPORT, AIO_USERNAME, AIO_KEY); in setup. Then you have to use arrow operator instead dot to access its methods. Or you can ...


1

If the device turning the LEDs on / off runs on 3.3 Volts (has ground to 3.3 Volts outputs), then you might consider directly connecting the 3.3 Volt outputs to the GPIO pins of the ESP8266. If the device turning the LEDs on / off runs on higher voltages consider either using the appropriate level shifter or the appropriate optical isolator:


1

If you are using fauxmoESP library version 3.0 and above your device will not be detected by alexa, i dont know why this is. You may degrade fauxmoESp version to 2.4.0 so that your issue ie. .onSetState will be resolved. Are you able to connect wifi?


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