ESP8266 baud rate change, firmware upload,..

After a week or so of sweating through websites, blogs, trials with my ESP8266 Node MCU v1.0 development board and ESP8266 ESP12-F modules to get them to connect and speak to beyond the Arduino IDE I found a working solution to my primary question:
how to change permanently the baudrate to one that where SoftwareSerial.h can function without errors (ie below 56kbaud), and where I can open up this black box that Arduino makes it out to be.

The reason I need lower baud rates than the ones that are firmware programmed in the more recent ESP826 boards is that I need the hardware serial for other peripherals, so the ESP8266 is delegated to the softwareserial connections. And no, I do not need the Mega; my project involves Aruino Pro Mini, with just one hardware serial port.
I made an instructable with my work, first of all because in a weeks' time I will have forgotten all how-to's -and I still want to know later how I did "this and that"-, and because this might be helpful to others.
I my quest (because that was what it was: numerous sleepless nights the past week,..) I found too many websites, blogs, pages,.. with unreliable, contradictory, erroneous,.. information. Apparently this subject is still in its infancy because even Espressif does not document well beyond chinese language and their bbs is not very responsive.

So, if you want to change the baud rate of your ESP8266, or change the AT instruction set, or just for fun want to upload different firmware: read this: ESP8266 Firmware Upgrade or Flashing : 7 Steps - Instructables

Are you sure you need any AVR at all?

ElCaron:
Are you sure you need any AVR at all?

  1. in case you need a ADC (analog to digital conversion)
  2. in case a controller centralises data from different sensors and needs to use a RTC module (real time clock) to drive sensor reading timing and/or drives an output based on time scheduling that needs the exact time to be kept over periods of months or years

Otherwise it would indeed be more cost-efficient to use the ESP8266 to function as a controller too. Although I would not yet know how to program/use it in the capacity, some learning curve ahead :slight_smile:

Is it possible that you only know the ESP-01? The ESP8266 has a single AD which could be expanded with an analog multiplexer, and it can also communicate with an RTC without any problems.

It is programmed just like an Arduino-AVR, using the Arduino IDE. The major caveat is that stuff like PWM is implemented in software, so messing around with interrupts may interfere. Aside from that, it is much more powerful than an ATMEGA in basically all regards and using it directly saves you from the major pain in the ass of communicating with AT commands over a serial connection.

Have a look at the Wemos D1 Mini. The manufacturer has a documentation on how to set up the IDE.

Interesting.
I currently use Node MCU and ESP8266-ESP12F for testing since a week or so, I was not even aware of the ADC capabilities.
I will do some research here based on your post.
I notice that there are several ways to program the ESP:

  • LUA
  • Arduino IDE
  • ..?..
    Still trying to sift through the trees without seeing the wood :o

The ADC is labeled A0 on the NodeMCU. Make sure what the max Voltage is. The ESP is fixed to 1V max, but the Wemos D1 Mini adds a voltage divider on the PCB. Don't know about the NodeMCU. I don't like it, it is much too large.

You can program it in LUA; but why would you if you are able to program Arduino C?

In 90% of the cases (exceptions include low-power applications, maybe sophisticated timer stuff and other advanced uses of the hardware periphery), people do not need an AVR with an ESP8266. If they do, it is at least worth considering to make the AVR a "dumb" I2C client and leave the main logic to the ESP.
I2C ADCs and port expanders (MCP23017) are also options.
Everything is better than running it over AT commands.

So the ESP8266 can be programmed to:

  1. connect over hardware serial (TX and RX pins) to a HC12 RF module, and poll a remote sensor connected to another HC12 RF module to send data once an hour for example
  2. connect with I2C to several other modules (DS3231 RTC, BMP280 barometric sensor, HTU21 ambient moisture sensor
  3. be programmed with an algorithm that calculates driving one digital output based on above modules' inputs
  4. send once per day (or 2, or 6 times, not more) data to Thingspeak

Can that be done?
Using Arduino IDE?
Or the Wemos D1 mini you referred to?

PS: the analog input I referred to earlier needs to be taken from the remote sensor connected to the HC12 from my post above.

brice3010:
So the ESP8266 can be programmed to:

  1. connect over hardware serial (TX and RX pins) to a HC12 RF module, and poll a remote sensor connected to another HC12 RF module to send data once an hour for example

Yes, via SoftSerial or via HardwareSerial if you detach it during initial flashing (later flashing can be done OTA).

brice3010:
2. connect with I2C to several other modules (DS3231 RTC, BMP280 barometric sensor, HTU21 ambient moisture sensor

Yes, I2C is on GPIOs 4/5, D1 and D2 on the Wemos D1 Mini.

brice3010:
3. be programmed with an algorithm that calculates driving one digital output based on above modules' inputs

Yes. The ESP8266 has an 80MHz processor that is much more powerful then the Arduino-AVRs.

brice3010:
4. send once per day (or 2, or 6 times, not more) data to Thingspeak

Of course.

brice3010:
Using Arduino IDE?

Yes. you have to find Libraries that support the ESP (a lot do), and the Pins are named differently (D*) everything else works just like with the Arduino-AVR.

brice3010:
Or the Wemos D1 mini you referred to?

That is just the name of the Module that puts the ESP-12F module together with a USB-to-serial chip and that sort of jazz. ESP8266 is to Wemos D1 mini or NodeMCU like ATMEGA328PU is to Arduino Uno or Nano.

ElCaron +1
You do not happen to be Catalan? :slight_smile:

brice3010:
ElCaron +1
You do not happen to be Catalan? :slight_smile:

Nope, Eastern neighborhood.

ElCaron:
Nope, Eastern neighborhood.

East of Catalonia?
Middle East?
East-Germany :grin: ?

brice3010:
East of Catalonia?
Middle East?
East-Germany :grin: ?

East of your top level domain :slight_smile: