Pro Mini + ESP8266 gives gibberish web server

I have a ESP8266 hooked up to an Arduino Pro Mini.

I can run the “WebClient” example from the WiFiExp library without changes other than providing my SSID and password in the secrets.h file and uploading the sketch without any other changes. Lots of fun. I’m sending temperature data from my wife’s kiln to ThinkSpeak and watching graphs update!

The “WebServer” example is not so fun. All of the time the serial monitor is showing the request from the browser as gibberish after I connect to the URL that the sketch prints out in the serial monitor, and I always get a “TIMEOUT” message.

When I run the same code on my Arduino Uno both examples work perfectly - no TIMEOUTs.

Is the Pro Mini not adequate (i.e. fast enough) to run the WebServer example without problems? Or might there be something wrong in the WebServer sketch?

Thanks for any insight.

  • Mike

Hi Mike.

Gibberish would usually indicate a baud rate issue, inverted logic or a missing ground.

Since things work on an Uno, we can rule out inverted logic and probably rule out a missing ground. That leaves us with baud rate as the most likely candidate for your issues.

Double check what voltage and clock speed your Pro Mini is and that the IDE is set to that same voltage / clock speed. If you program a 5 volt board with the IDE set to 3.3 volts, the code on the board will run at half the speed it’s supposed to and your baud rates will also be half as slow as you’re expecting. (Code for 9600 will actually run at 4800) The reverse is also true. programming a 3.3 volt board with the IDE set to 5 volts will run at double the speed. (Code for 9600 will run at 19200)

Once you have Arduino Pro or Pro Mini selected in the IDE, go back to the Tools menu and you should get an option for setting the processor type. You’re going to want either ATmega328P (5V, 16 MHz) or ATmega328P (3.3V, 8 MHz) depending on what board you are using.

The boards should be marked on the back of the board, but in case the marking is missing, the 5 volt board has a voltage regulator marked KB50 and the 3.3 volt board has a voltage regulator marked KB33.

Give that a try and I think this will correct your issue. If it doesn’t, please send some photos of your setup for us to look at.

Thanks so much for the advice. There seems to be a limit as to how many pictures I can attach to a post.

The ESP8266 → Pro Mini is connected as follows: 1 → GND, 2 → 2, 3 → NC, 4 → 3.3 V, 5 → NC, 6 → NC, 7 → 3, 8 → 3.3 V.

In my breadboarding and code I’m using pins 2 and 3 for RX and TX (your code used pins 6 and 7).

I should point out that I am actively recording data from the thermocouple, sending it up to a database I have on hostmonster.com (plotted using R).

I can monitor transmissions with serial monitor and there aren’t any errors - very robust. Leaving the connections and baud rates as is, it’s when I try to create an access point using the WebServerAP example, changing Serial1(6, 7) to Serial1(2, 3) that it doesn’t work (except on Uno). This is the only change I make to the example code. The serial monitor reports that my iphone connects to 192.168.4.1 as a new client, but then I get a TIMEOUT message on the serial monitor. I give up trying, and upload my other code and back to recording temperatures.

I would like to send you more info, but I’m really having trouble attaching more than 3 pictures.

  • Mike

ide.png

Capture.PNG

Hi,

I hooked up my cheap oscilloscope and found significant drops in voltage to pin 8 of the 8266 when it broadcasts. I put a big capacitor across pins 1 and 8 and oscilloscope trace of voltage is flat now. It seems my 3.3 V power isn’t sufficient on its own to power the 8266.

I’m afraid I’m going to have to open this issue again.

I have better power supply for breadboarding. I loaded the “WebServer” sketch from the WiFiEsp library after changing only ssid and pass to match my home settings.

This is what the serial monitor gave me. You’ll note that after echoing the “Accept” header the output becomes garbled.

WiFiEsp] Initializing ESP module
[WiFiEsp] Initilization successful - 1.5.4
Attempting to connect to WPA SSID: BEDDO
[WiFiEsp] Connected to BEDDO
You're connected to the network
SSID: BEDDO
IP Address: 192.168.254.100

To see this page in action, open a browser to http://192.168.254.100

[WiFiEsp] Server started on port 80
[WiFiEsp] New client 0
New client
GET / HTTP/1.1
Host: 192.168.254.100
Upgrade-Insecure-Requests: 1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agen: oill/.0(ihoe;CP ihoeOS123 ik Mc S ) pleebit60.115(KTM,lie eco)Vesin/2..1Mbie/5E48Saar/64.
Acep-Lngag: n-s
Acet-ncdig:gzp,delae
Cnncton kepalv

Sending response
[WiFiEsp] Disconnecting  0
Client disconnected

If I load the “WebClient” sketch I get this:

[WiFiEsp] Initializing ESP module
[WiFiEsp] Initilization successful - 1.5.4
Attempting to connect to WPA SSID: BEDDO
[WiFiEsp] Connected to BEDDO
You're connected to the network
SSID: BEDDO
IP Address: 192.168.254.100
Signal strength (RSSI):-602 dBm

Starting connection to server...
[WiFiEsp] Connecting to arduino.cc
Connected to server
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 21 May 2019 04:57:36 GMT
Content-Type: text/plain
Content-Length: 2263
Last-Modified: Wed, 02 Oct 2013 13:46:47 GMT
Connection: close
Vary: Accept-Encoding
ETag: "524c23c7-8d7"
Accept-Ranges: bytes


           `:;;;,`                      .:;;:.         
      .;;;;;;;;;`             ;;;;;;;;:    TM
     `;;;;;;;;;;;;          :;;;;;;;;;;;;    
    :;;;;;;;;;;;;;;        ;;;;;;;;;;;;;;;   
    ;;;;;;;;;;;;;;;;      .;;;;;;;;;;;;;;;       ;;;;;;:`  `;;;;;;;    ,;;;;;;.`  .;;;;;;   
 .;;;;;        ;;;;;;  .;;;;;;        ;;;;;  
 ;;;;;          ;;;;;; ;;;;;,          ;;;;. 
,;;;;            ;;;;;.;;;;;           ;;;;; 
 ;;;;             ;;;;;;;;;`    ```     ;;;;`
 ;;;;              ;;;;;;;,     ;;;     .;;;;
`;;;:              `;;;;;;       ;;      ;;;;
,;;;`   `,,,,,,     ;;;;;;    .,,;;,,    ;;;;
:;;;`   .;;;;;;      ;;;;,    :;;;;;;;    ;;;
:;;;`   .;;;;;;     `;;;;;     ;;;;;;;    ;;;;.;;;.               ;;;;;;.      ;;       ;;;; ;;;;               ;;;;;;;      ;;       ;;;; ;;;;              .;;;;;;;;     ;;;     ;;;;,
;;;;;            `;;;;;;;;;             ;;;; 
 ;;;;,          .;;;;; ;;;;;           ;;;;; 
 ;;;;;:         ;;;;;.  ;;;;;   
+IP,3,162,10.2.172.13,0:       ;;;;;     ;;;;;`      ;;;;;;,   ;;;;;;       ;;;;;:      ;;;;;;;::;;;;;;;:     ;;;;;;;;:;;;;;;;;   
   `;;;;;;;;;;;;;;;       ;;;;;;;;;;;;;;;;   
    ;;;;;;;;;;;;;;         ;;;;;;;;;;;;;:    
     ,;;;;;;
Disconnecting from server...

Do I have a bad esp9266? You can’t tell from the picture, but the pro mini and esp8266 share the same ground strip. Pro mini is powered by FTDI Basic and esp8266 by breadboard PS.

Hi mbeddo.

What guide are you following and can you provide a link to it? Is the code you’re using code we wrote? What happens if you follow the guide exactly, use the same hardware and unaltered code?

Hi mbeddo.

What guide are you following and can you provide a link to it? Is the code you’re using code we wrote? What happens if you follow the guide exactly, use the same hardware and unaltered code?

Hi mbeddo.

What guide are you following and can you provide a link to it? Is the code you’re using code we wrote? What happens if you follow the guide exactly, use the same hardware and unaltered code?

Refer to my previous post (viewtopic.php?p=204432#p204432). I installed the WiFiEsp library using the Arduino library tool. I then loaded the example sketch “WebServer.ino”. I hooked up the ESP8266 to the Pro Mini as described in the comments top of that sketch. The ONLY change I made to the sketch was to supply the SSID and password of my home wifi.

I don’t believe the WiFiEsp library is SparkFun’s, but my concern is the esp8266 chip (WRL-13678).

In my previous post, you’ll see in the first code block (if you scroll down) this output in my serial monitor:

User-Agen: oill/.0(ihoe;CP ihoeOS123 ik Mc S ) pleebit60.115(KTM,lie eco)Vesin/2..1Mbie/5E48Saar/64.
Acep-Lngag: n-s
Acet-ncdig:gzp,delae
Cnncton kepalv

Clearly something is wrong - letters go missing - and I don’t believe the baud rate is wrong because the output doesn’t get messed up until the sketch starts echoing out these HTTP headers.

  • Mike

Hi Mike.

I’d be happy to send another ESP8266 module for you to try.

If you purchased this directly from us, please fill out the form on the right hand side of [this page to start the return/RMA process. Don’t forget to enter your SparkFun order or invoice number in the form and if you know the part number, enter that as well. In the Why do you want an RMA? section, enter the URL for this forum post so the returns processor can see what troubleshooting steps have been taken.

If you purchased the part from a distributor of ours, you will need to contact them for a replacement.](Return Policy - SparkFun Electronics)