ESP_WROOM_02 MINI D1. Probleme de gestion de carte?

Bonjour,
j'ai un WeMos D1 ESP-Wroom-02 ESP8266 - 18650 batterie.
https://fr.aliexpress.com/item/32813501130.html?spm=a2g0o.order_list.order_list_main.4.36105e5b2glnsH&gatewayAdapt=glo2fra

J'arrive à lire des données depuis le port série, mais je n'arrive pas à faire fonctionner le blink et le programme mis à la fin ( qui fonctionne avec un esp32)

C'est peut etre un probleme de board manager

Mais j'ai essayé le generic, tout les LOLIN, tout les nodeMcu et rien ne fonctionne complètement.
Dois je acheter une ESP32?

/*---------------------------------------------------------------------------------------------

  Open Sound Control (OSC) library for the ESP8266/ESP32

  Example for receiving open sound control (OSC) messages on the ESP8266/ESP32
  Send integers '0' or '1' to the address "/led" to turn on/off the built-in LED of the esp8266.

  This example code is in the public domain.

--------------------------------------------------------------------------------------------- */
#ifdef ESP8266
#include <ESP8266WiFi.h>
#else
#include <WiFi.h>
#endif
#include <WiFiUdp.h>
#include <OSCMessage.h>
#include <OSCBundle.h>
#include <OSCData.h>

//char ssid[] = "Iphone de ben"; // your network SSID (name)
//char pass[] = "cacaprout";  // your network password

//char ssid[] = "Bbox-E69F0626";       // your network SSID (name)
//char pass[] = "NKg5Ad1m3mXFgx142p";  // your network password

char ssid[] = "SFR-d078";       // your network SSID (name)
char pass[] = "DEDW3VPARYGZ";  // your network password



// A UDP instance to let us send and receive packets over UDP
WiFiUDP Udp;
//const IPAddress outIp(10,40,10,105);        // remote IP (not needed for receive)
//const IPAddress outIp(192, 168, 1, 77); // heltec 
//const IPAddress outIp(192,168,1,97); // node32s 97
//const IPAddress outIp(192,168,0,26); // node32s 26
 const IPAddress outIp(192,168,0,31); // esp8288

const unsigned int outPort = 9999;    // remote port (not needed for receive)
const unsigned int localPort = 8000;  // local port to listen for UDP packets (here's where we send the packets)

OSCErrorCode error;
unsigned int ledState = LOW;  // LOW means led is *on*

//------------ END  ESP and OSC setting

#ifndef BUILTIN_LED
#ifdef LED_BUILTIN
#define BUILTIN_LED LED_BUILTIN
#else
#define BUILTIN_LED 13
#endif
#endif

#include <FastLED.h>
#define NUM_LEDS 64
#define PIN_CONTROLLING_STRIP 1// esp8266//21 // 21 node 97 // 1
CRGB leds[NUM_LEDS];

//----------- END FastLed setting

//-----------    Receive with start- and end-markers combined with parsing

    const byte numChars = 200;
    char receivedChars[numChars];
    char tempChars[numChars];        // temporary array for use when parsing

//-----------  variables to hold the parsed data
    char messageFromPC[numChars] = {0}; //or 5 doesn't change anything

// ABOVE not USED

#define numberOfDataPerLed 3
#define numberOfLed 64

int number_of_received_packets;// = 0;
int size;

//String ledR, ledB, ledG;

int valuesOfEachLed[numberOfDataPerLed] = { 0 };

int valueOfRed[NUM_LEDS];
int valueOfGreen[NUM_LEDS];
int valueOfBlue[NUM_LEDS];

float floatFromPC = 0.0; // not used for the moment

boolean newData = false;

void setup() {

  Serial.println("local ip"); // with node32s ip is 10.0.1.778 // to get IP adress 192.168.0.26
  Serial.println(WiFi.localIP());


  pinMode(BUILTIN_LED, OUTPUT);
  digitalWrite(BUILTIN_LED, ledState);  // turn *on* led

  Serial.begin(115200);

  // Connect to WiFi network
  Serial.println();
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);
  WiFi.begin(ssid, pass);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");

  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());

  Serial.println("Starting UDP");
  Udp.begin(localPort);
  Serial.print("Local port: ");
  
#ifdef ESP32
  Serial.print("LocalportESP32: ");
  Serial.println(localPort);
#else
  Serial.println(Udp.localPort());
#endif

  Serial.println(Udp.localPort());

 // control LED with FastLed
  FastLED.addLeds<NEOPIXEL, PIN_CONTROLLING_STRIP>(leds, NUM_LEDS);
  FastLED.setBrightness(250);
  for (int i = 0; i <= NUM_LEDS; i++) {
    //  leds[i] = CRGB ( 2*i,255-(2*i), 255-(2*i));
    leds[i] = CRGB(0, 0, 0);  // turn off all
    FastLED.show();
  }
}

void loop() {
  Serial.println (".");
    OSCMessage msg;
    size = Udp.parsePacket();
    
    if (size > 0) {
    while (size--) {
      msg.fill(Udp.read());
    }

    if (!msg.hasError()) {
    
      msg.dispatch("/matrixdata",assignDataParsed); // read only 1/8 datadata and write it 1/64 ( so it light only pixel 0 0)

    }

    else {
      error = msg.getError();
      Serial.print("error: ");
      Serial.println(error);
    }
  }

  for (int i = 0; i < NUM_LEDS; i++) {
  // leds[i] = CRGB ( valueOfRed[j],valueOfGreen[k],valueOfBlue[l]);  
  // leds[i] = CRGB ( valueOfRed[i],valueOfGreen[i],valueOfBlue[i]);  
  // leds[i] = CRGB (msg.getInt(i*3), msg.getInt(i*3+1), msg.getInt(i*3+2));
  }
  //FastLED.show();
 // }
}

void assignDataParsed(OSCMessage &msg) {
  
  for (uint8_t i = 0; i < NUM_LEDS; i++) {
 //    for (uint8_t i = NUM_LEDS-1; i >= NUM_LEDS/2; i--) {
  /*
    Serial.print (" led number "); Serial.print (i);  Serial.print ("");
    Serial.print ( " h"); Serial.print (msg.getInt(i*3));
    Serial.print ( " r"); Serial.print (msg.getInt(i*3+1)); 
    Serial.print ( " g"); Serial.print (msg.getInt(i*3+2));
    Serial.print ( " b"); Serial.println (msg.getInt(i*3+3));
  */
    leds[i] = CRGB (msg.getInt(i*3), msg.getInt(i*3+1), msg.getInt(i*3+2)); // , msg.getInt(i*3+3)               
  }

  FastLED.show();
}

C'est une carte avec un ESP8266 donc rien à voir avec un ESP32.
Il faut ajouter le support de l'ESP8266.
Ajouter l'URL suivante dans le gestionnaire de carte supplémentaire dans les références.

https://arduino.esp8266.com/stable/package_esp8266com_index.json

Bonsoir,

J'ai bien les drivers de l'esp8266, comme on peut voir sur la photo mise dans mon post precedent.
J'arrive à connaitre l'ip local de l'esp8266.

J'ai essayé plusieurs board manager, comme dit précédemment.

Dans le loop, j'ai mis

 Serial.println (".");

Mais je ne vois rien dans le monitor, à part des caractères incongrus. J'ai bien choisi 115200 pour les bauds

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.