Problem: The ESP8266 example sketch StreamHttpClient, seems to be broken for 3.1.x version of the Arduino SDK. The URL is broken because it returns HTTP code 301. However, even if you fix the URL, the subsequent read from the stream fails and it prints "read timeout" error.
ESP8266 StreamHttpClient example broken - prints "read timeout" error
12 Views Asked by Parag Thakur At
1
There are 1 best solutions below
Related Questions in ESP8266
- Wifi disconnects and connects again and again while using esp8266, max30100 and oled display
- I can't find a conenction diagarm for the OV7670 camera to the ESP8266
- ESP8266 - Unable to connect to MQTT Server via SSL (mutual authentication)
- esp-01 wifi module STM32F4 discovery firebase
- How to get my data to actually show up in the DynamoDB?
- Is there a way to upload/edit files from Android to LittleFS
- ESP8266 StreamHttpClient example broken - prints "read timeout" error
- Using FastLED and SharpIR Libraries with Generic ESP8266 Board
- Problems sending websocket message from esp8266 as client
- "Blynk Connection Issue with Arduino and ESP8266 in IoT Project"
- How to receive a float array using esp8266 via I2c
- Communication between Arduino UNO and ESP8266 via TXS0108E
- ESP8226 connected by USB to TTL using USB A to USB Mini B cable to temperature sensor DHT22 error with Arduino IDE - upload (Thingsboard IOT WIFI)
- Can't open serial monitor while pyserial script is working, using nodemcu
- WebSocket connection with a ESP-01S (ESP8266) and arduino
Related Questions in ARDUINO-ESP8266
- How to POST to a RESTful API on an ESP8266 using authentication?
- Sending request from browser to ESP8266WebServer fails
- ESP8266 Arduino request content encoding
- File does not exist error compiling for board NodeMCU 1.0 (ESP-12E Module)
- create a timed 3 state push button in arduino
- NodeMCU auto-join open wifi
- Can't serial print in setup() using HiLetgo ESP8266 with ESP8266WiFi.h library and Arduino IDE
- ESP8266 Micropython - connecting to University Wi-fi ( WPA2 Enterprise PEAP )
- Esp8266 Arduino IDE setup
- Sending requests from Browser to Arduino has high latency
- Is this battery compatible with the Node MCU ESP8266?
- Ardunio ESP8266 board creating hex file
- Modify static variable in Arduino libraries
- Copy byte* to char array goes wrong
- Receiving data in serial port ESP8266
Related Questions in ESP8266WIFI
- ESP 12E Module ESP8266 | Unable to call Https Api. Connection Failed
- Connecting to a MySQL database with an ESP8266WiFi chip
- nodemcu esp8266 http request returns -1 " connection Fails "
- Not able to send data from nodeMCU-8266 to localhost (database)
- WIFI Module can't get the data from the server
- ESP8266 chips using different encryption for softAP
- Cannot perform a handshake with google`s cloud speech-to-text on ESP32. [PK - The pubkey tag or value is invalid (only RSA and EC are supported)]
- ERR_CONNECTION_REFUSED when communicating with my ESP8266 over WiFi
- ESP 8266 WiFiManager.h> //https://github.com/tzapu/WiFiManager wifiManager.setConnectTimeout(180);
- ESP32 board can't compile the ESP8266wifi.h include file
- How to display text file on async Webserver using esp8266
- How to use C Compiler for esp8266
- In firebase, how to create a user and add data in user object from ESP 8266?
- Problem uploading sketch to arduino uno/esp8266
- FirebaseHttpClient_Esp8266.cpp:8:25: fatal error: ESP8266WiFi.h: No such file or directory
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The current sketch uses some outdated code.
Current Sketch Code: (Broken)
// get tcp stream WiFiClient* stream = &client;
This no longer works. The following call returns 0 and does not populate any data and you get "read timeout" error: int c = stream->readBytes(buff, std::min((size_t)len, sizeof(buff)));
Correct Code:
WiFiClient stream = http->getStream();
int c = stream.readBytes(buff, std::min((size_t)len, sizeof(buff)));