Skip to content

Pb fastled and Https #5091

Closed
Closed

Description

@patrice916

Board / MCU

ESP32

LED Chipset

WS2812B / NeoPixel

FastLED Version

3.10.9

Arduino / PlatformIO version

Arduino 2.3.10

Operating System

Windows

Description

I'm sorry, but there's a problem between FastLED and HTTPS with the latest version of FastLED and Expressive version 3. The connection returns a 200 code on the first loop iteration, but then returns -1. However, it works with Expressive version 2.0.17 and FastLED version 6.4.0.

Steps to reproduce

yes

Minimal sketch

#include "FastLED.h"
#include <WiFi.h>
#include <WiFiMulti.h>
#include <HTTPClient.h>
#include <WiFiClientSecure.h>

WiFiMulti wifiMulti;

const char*    ssid = "XXXXXXXXXXX";                 // your network SSID (name)
const char*    password = "xxxxxxxxxxxxxxxxx";       // your network password
const String  host = "https://aviationweather.gov/api/data/metar?format=json&ids=";


// Define Leds
#define No_Stations          35      // Number of Stations also Number of LEDs
#define DATA_PIN              5      // Connect to pin D5/P5 with 330 to 500 Ohm Resistor
#define LED_TYPE         WS2812      // WD2811 or WS2812 or NEOPIXEL
#define COLOR_ORDER         GRB      // WD2811 are RGB or WS2812 are GRB
#define BRIGHTNESS           10      // Master LED Brightness (<12=Dim 20=ok >20=Too Bright/Much Power)



// Define STATIONS & Global Variables   
const std::vector<String> Stations {    //   << Set Up   - Do NOT change this line
  "NULL, STATION NAME         ",        // 0 << Reserved - Do NOT change this line
  "LPPT, LISBONE, GA          ",        // 1
  "LEMD, MADRID, GA           ",        // 2
  "LEVC, VALENCE, GA          ",        // 3
  "LEBL, BARCELONE, GA        ",        // 4
  "LFBO, TOULOUSE, GA         ",        // 5
  "LFMT, MONTPELLIER, GA      ",        // 6
  "LFTW, UZES NIMES, GA       ",        // 7
  "LFML, MARSEILLE, GA        ",        // 8
  "LFMN, NICE, GA             ",        // 9
  "LFKJ, AJACCIO, GA          ",        // 10
  "LIEE, CAGLIARI, GA         ",        // 11
  "LIRN, NAPLES, GA           ",        // 12
  "LIRP, PISE, GA             ",        // 13
  "LIPZ, VENISE, GA           ",        // 14
  "LIMC, MILAN, GA            ",        // 15
  "LSGG, GENEVE, GA           ",        // 16
  "LFLL, LYON, GA             ",        // 17
  "LFLC, CLERMONT FERRAND, GA ",        // 18
  "LFPO, ORLY, GA             ",        // 19
  "LFPG, CDG, GA              ",        // 20
  "LFST, STRASBOURG, GA       ",        // 21
  "LSZH, ZURICH, GA           ",        // 22
  "EDDM, MUNICH, GA           ",        // 23
  "EDDF, FRANKFURT, GA        ",        // 24
  "ESGG, GOTEBORG, GA         ",        // 25
  "EHAM, AMSTERDAM, GA        ",        // 26
  "EGLL, LONDRE, GA           ",        // 27
  "EIDW, DUBLIN, GA           ",        // 28
  "LFRC, CHERBOURG, GA        ",        // 29
  "LFRB, BREST, GA            ",        // 30
  "LFRZ, STNAZAIRE, GA        ",        // 31
  "LFBH, LAROCHELLE, GA       ",        // 32
  "LFBD, BORDEAUX, GA         ",        // 33
  "LFBA, AGEN, GA             ",        // 34
  "LFBZ, BIARRITZ, GA         ",        // 35
}; 

String metar;          // Raw METAR data                                     // << Do NOT change this line

String         rem[No_Stations + 1];  // Remarks
String        wind[No_Stations + 1];  // wind speed
String    category[No_Stations + 1];  // NULL   VFR    MVFR   IFR    LIFR
//..............................................Black  Green   Blue   Red    Magenta



void setup() {
  Serial.begin(115200);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED){
    delay(300);                          // Wait a little bit
  }
  WiFi.mode(WIFI_STA);
  wifiMulti.addAP(ssid, password);

}

void loop() {
String urls = "";
  for (int j = 1; j <= No_Stations; j++) {
      String station = Stations[j].substring(0, 5);
      urls = urls + String (station);
  }
  int len = urls.length();
  urls = urls.substring(0, len - 1);
  if (wifiMulti.run() == WL_CONNECTED) {
  	WiFiClientSecure client;
  	client.setInsecure();
  	HTTPClient https;
  	if (https.begin(client, host + urls)) {
      https.addHeader("Connection", "close"); 
  		metar = "";
  		int httpCode = https.GET();
      Serial.println(httpCode);
  		if (httpCode == HTTP_CODE_OK) {
      		metar = https.getString();
  		}
  	https.end();
    } else {
      delay(5000);
      return;
    }
  } 
delay(10000);

}

Serial / debug output

Checklist

  • I have searched existing issues for duplicates
  • I have tested with the latest FastLED release or git master
  • I can reproduce this with a minimal sketch

Activity

  1. added
    status: triage
    type: bug
    on Nov 6, 2026
  2. added
    sanitized
    on Nov 6, 2026
  3. moved this from Triage to Done in FastLED Trackeron Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    sanitizedstatus: triagetype: bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions