by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 27 21:25
    schlammbad updated the wiki
  • Jul 27 19:35
    BlueAndi closed #359
  • Jul 27 18:39
    Makuna labeled #359
  • Jul 27 18:38
    Makuna closed #360
  • Jul 27 18:38
    Makuna opened #360
  • Jul 27 09:06
    Makuna labeled #359
  • Jul 27 09:06
    Makuna assigned #359
  • Jul 26 22:17
    BlueAndi edited #359
  • Jul 26 22:13
    BlueAndi opened #359
  • Jul 25 22:18
    Makuna closed #302
  • Jun 21 13:00
    shariramani updated the wiki
  • Jun 17 22:11
    Makuna closed #358
  • Jun 17 22:11
    Makuna opened #358
  • Jun 16 17:18
    Makuna labeled #357
  • Jun 16 04:20
    GerwinJanssen opened #357
  • Jun 09 23:20
    Makuna closed #356
  • Jun 09 23:20
    Makuna opened #356
  • Jun 09 07:11
    Makuna closed #355
  • Jun 09 07:11
    Makuna opened #355
  • May 31 08:10
    Makuna closed #354
Michael Miller
@Makuna
The Esp32 is more complex and is running threads for many things. The WiFi should not be effecting the data sending for RMT nor I2s methods; there are known issues in Core for both methods but I am unsure if your situation is the same.
djangosoe
@djangosoe

Hello, I have a question again :)
I got Neopixelbus working on the esp32 esp-idf with 6 strips with 60 leds (360 total), I use NeoEsp32Rmt0Ws2812xMethod - NeoEsp32Rmt5Ws2812xMethod. everything works great without glitches.
I also have a i2c connection between the esp32 (slave) and my raspberry pi(master) this works good.
I got my neopixelbus handling on core 0 and my i2c handling on core 1
When .Show() my strips over Rmt and receive data at the same time over i2c I get color glitcher.
When I only use the color Red in my strip there are 'random' Green pixels flickering for a short time.
When I ony use the color Green in my strip there are 'random' Blue pixels flickering for a short time.
When I ony use the color Green in my strip there are 'random' Red pixels flickering for a short time.

NeoPixelBus<NeoGrbFeature, NeoEsp32Rmt0Ws2812xMethod> strip0(MyConfigPtr->pixelCount, Strip0Pin);
strip0.SetPixelColor(count % MyConfigPtr->pixelCount, {0,0,100});
strip0.Show();
vTaskDelay((33) / portTICK_RATE_MS);
The color setting and show is in a While loop.
Are there any known issues between the i2c and Rmt drivers?

I will make a copy, rip everything non related out of the code an post my bare minimum for the issue
Michael Miller
@Makuna
@djangosoe Its all about having time enough to service all the RMT ISRs and then i2c ISRs. I don't know the details, but there seems to be issues when spread across threads even though everything is thread safe in core methods. I would try moving your i2c to the primary loop thread and see if that is any different.
djangosoe
@djangosoe
While keeping the led handeling on there own core task?
Michael Miller
@Makuna
Try to put them both on the same task.
djangosoe
@djangosoe
I will try it :)
Michael Miller
@Makuna
Still try to provide a minimum sketch. I can take a look and get the right esp32 people to take a glance.
djangosoe
@djangosoe
I got a minimum project with the problem, what is the best way to share it?
Michael Miller
@Makuna
How big is it? Create an issue and include it there. If its large, create an open Github repo and link to it.
djangosoe
@djangosoe
Already creating a github repo :)
I have stripped a lot of stuff out.
I send a stream of numbers from python (smbus2) to the esp32.
Mike Dunston
@atanisoft
does your example work with fewer strips?
djangosoe
@djangosoe
No
Mike Dunston
@atanisoft
does it work with one strip only?
djangosoe
@djangosoe
lol, i also could have stripped that out :P
I will try it with 1 strip
Mike Dunston
@atanisoft
I'm wondering if you are encountering the RMT ISR issue that @Makuna reported to IDF some time ago
djangosoe
@djangosoe
with 1 stip i dont see the glitches, but how bussyer the i2c and the strips are the more glitches
I will try it with 2 strips to narrow the issue down
Mike Dunston
@atanisoft
yes, likely you are seeing an ISR starvation issue
djangosoe
@djangosoe
with 2 stip i don' see the glitches, with more then 2 they start.
Does not matter how many leds are in 1 stip, I am now testing it with 3 stips with 10 leds (30 total) and have glitches
is there a workaround for the ISR starvation?
Mike Dunston
@atanisoft
not sure if that is the case or not
it may not be
it will need more debugging to trace into the I2C code
djangosoe
@djangosoe
I took the I2C code from the ESP32 i2c_self_test example.
krupis
@krupis
I have ran a command that you suggsted: NeoPixelBus<NeoGrbFeature, NeoWs2813Method> strip(PixelCount, PixelPin); The last LED ( 6th LED in my case) is glitching - sometimes going RED
krupis
@krupis
With my previous RMD command that I used, the glitching is less frequent but still there
 void Read_sensor(){
  sensor=digitalRead(SENSOR);//ALWAYS TAKE SENSOR READING EVERY 50MS
  //IF ITEM ACTIVATED, SET GREEN LIGHT AND WAIT FOR PERSON TO TOGGLE THE DEVICE
  if(number_to_pick>0){// LED TURNS GREEN IF WE NEED TO TAKE ITEM FROM THE BOX
    digitalWrite(LED_GREEN,1); 
  }  
    if(sensor==LOW && sensor_prev_state==HIGH){ // IF SENSOR IS TRIGGERED ON
      //Serial.println("sensor triggered\n"); // output serial monitor
      sensor_prev_state=LOW; // set the previous state to LOW
      Serial.print("sensor triggered\n"); // output serial monitor
      if (number_to_pick==0){ // IF NUMBER TO PICK ITEMS IS 0, SET RED LIGHT TO SHOW OPERATOR WRONG BOX
        digitalWrite(LED_RED,1);     //if the sensor active flag is 0 (item not activated), set the RED light on to indicate the wrong selection  
        //tone(BUZZER, frequency);
        //delay(1);
        strip.SetPixelColor(0, purple);
        strip.SetPixelColor(1, purple);
        strip.SetPixelColor(2, purple);
        strip.SetPixelColor(3, purple);
        strip.SetPixelColor(4, purple);
        strip.SetPixelColor(5, purple);
        strip.SetPixelColor(6, purple);
        //delay(1);
        strip.Show();      
      }
    }    
    else if(sensor==HIGH && sensor_prev_state==LOW){ //sensor deactivated
      Serial.println("sensor deactivated=");
      if(number_to_pick > 0){ // if we still need to take items from this box after
        char buffer2 [33];
        digitalWrite(LED_GREEN,0); //turn off GREEN LED // set the green LED off and reset the flag
        number_to_pick--;
        item_inside.quantity--;
        itoa (number_to_pick,buffer2,10);
        client.publish(number_to_pick_topic, buffer2); // publish a message that the sensor has been triggered    
        create_JSON_object();  // publish item_inside topic to update quantity
        //OLED_display(item_inside.quantity,number_to_pick);
        Serial.print("number_to_pick=");
        Serial.println(number_to_pick);
        sensor_prev_state = HIGH;
        delay(200);
        //CHECKIF NUMBER TO PICK GOT DECREMENTED TO 0 HERE 
        if(number_to_pick==0){ // if we finished collecting items from this box, blink yellow LED to notify operator 
          client.publish(status_topic,"DONE");
          client.publish(number_to_pick_topic,"0");// respond to topic that 0 items left
        }
      }
        else{
          digitalWrite(LED_RED,0);
         //delay(1); 
        strip.SetPixelColor(0, black);
        strip.SetPixelColor(1, black);
        strip.SetPixelColor(2, black);
        strip.SetPixelColor(3, black);
        strip.SetPixelColor(4, black);
        strip.SetPixelColor(5, black);
        strip.SetPixelColor(6, black);
        //delay(1);
          strip.Show();      
          sensor_prev_state = HIGH;
        }
    }
}
void loop() { if (!client.connected()){ reconnect(); } client.loop(); Read_sensor();//READING SENSOR EVERY }
krupis
@krupis
Sorry cannot figure out why my void loop() code tags are messed up
krupis
@krupis
From what I read, ESP32 wifi system inserts 5us delay every 1ms which can cause the problems. i am not sure if that is true or not
Mike Dunston
@atanisoft
@krupis there is no such forced delay on the esp32.
Benik3
@Benik3
ESP32 is also 2 Core, so you can run WiFi related things on the second core (if I remember right, it should be default in Espressif IDF, but not in Arduino).
Mike Dunston
@atanisoft
Arduino-esp32 uses core 0 for wifi by default
setup/loop run on core 1
Benik3
@Benik3
OK
Benik3
@Benik3
Then maybe try to disable the MQTT?
James Fowkes
@jamesfowkes_gitlab
Hi, I'm trying to use WS2801 pixels (SPI) with the ESP32 and I'm a bit unsure of which feature I should be using. The method is clear enough (one of the NeoWs2801Spi*MhzMethod methods, but the feature is what I'm unclear on.
James Fowkes
@jamesfowkes_gitlab
I think it's NeoGrbFeature - currently my setup isn't working and I want to eliminate that as an issue.
Michael Miller
@Makuna
@jamesfowkes_gitlab It all depends on the strips you are using. The Ws2801 is just a 3 channel chip, it can be connected to all white pixels if that is what the assembling company wanted.
I suggest using the test example (it sets only four pixels, but change the total count to the real count), and try one feature. The actual results displayed should lead you to the correct order.
James Fowkes
@jamesfowkes_gitlab
OK, cool, that was basically what I thought. The Neo*Features should do something and it's just finding the right one.
Michael Miller
@Makuna
It primarily changes the color order. There are specific features for specific and unique chips, but the wiki will call this out if the unique versions are needed.
James Fowkes
@jamesfowkes_gitlab
OK - and the default SPI pins are 18 and 23 for the ESP32?
Michael Miller
@Makuna
Not sure, the ESP32 you can use almost any pins.
When you call strip.begin, you can pass the pins
void Begin(int8_t sck, int8_t miso, int8_t mosi, int8_t ss)
James Fowkes
@jamesfowkes_gitlab
Yeah I saw that, didn't want to introduce extra complication at this stage, but I'll experiment later. Thanks for the help , I'll paypal you some $$.