P10 panel with 433Mhz and Telegram (it was going well, but...)

And now ?

I took some things away and started testing a P10 LED panel, an esp8266 NodeMcu12E, a 433Mhz garage door remote control and Telegram.

But the fastBOT library is interfering with the P10 panel display. Every 5 seconds the panel goes completely off for about 100 milliseconds and comes on again, and stays like that forever. Working, but with this 'defect'.

I believe it is because fastBOT monitors every 5 seconds to see if there are any messages coming from Telegram.

But is it impossible to avoid this panel defect?

Does anyone have any: try this ?

// https://github.com/busel7/DMDESP
// https://github.com/GyverLibs/FastBot

#include <DMDESP.h>
#include <fonts/ElektronMart6x8.h>
#include <fonts/Mono5x7.h>
#include <RCSwitch.h>
#include <FastBot.h>
#include <ESP8266WiFi.h>

#define BOT_TOKEN "1234866909:DFSJDJSJFHyfEJzNqtpB2F2NwXT1lDSKbu4Q1f3Cmo"
#define CHAT_ID "5112388909"

FastBot bot(BOT_TOKEN);

RCSwitch mySwitch = RCSwitch();

#define DISPLAYS_WIDE 1 //--> Panel Columns
#define DISPLAYS_HIGH 1 //--> Panel Rows
DMDESP Disp(DISPLAYS_WIDE, DISPLAYS_HIGH);  //--> Number of Panels P10 used (Column, Row)

int nowifi;
char ssid[20] = "AAAAAAAA";
char password[20] = "BBBBBBBB";

int cron;

void setup() {

  Serial.begin(115200);
  delay(2000);
  mySwitch.enableReceive(D2);

  WiFi.mode(WIFI_STA);
  Serial.print("Conectando em: ");Serial.println(ssid);
  WiFi.begin(ssid, password);
     while (WiFi.status() != WL_CONNECTED) {
       delay(1000);
       nowifi++;
       Serial.print(nowifi);      
        if(nowifi > 9) {
           ESP.restart();    
        }
     } 
   
  bot.setToken(BOT_TOKEN); //se quiser alterar o TOKEN por este método
  bot.setChatID(CHAT_ID); //se quiser alterar o CHAT_ID por este método
  bot.attach(newMsg); // Ativa a função de manipulador    
  bot.setBufferSizes(512, 512); //Buffer de entrada, buffer de saída. Pode ser 1024, 512 

  Disp.start(); //--> Run the DMDESP library
  Disp.setBrightness(50); //--> Brightness level
  Disp.setFont(Mono5x7); //--> Determine the font used
  
}

void loop() {

  if (mySwitch.available()) {
    Serial.print("Received ");
    Serial.print( mySwitch.getReceivedValue() );
    Serial.print(" / ");
    Serial.print( mySwitch.getReceivedBitlength() );
    Serial.print("bit ");
    Serial.print("Protocol: ");
    Serial.println( mySwitch.getReceivedProtocol() );

    mySwitch.resetAvailable();
  }
 
  //  bot.tickManual();
  bot.tick();
  
  Disp.loop(); //--> Run "Disp.loop" to refresh the LED
  Disp.drawText(4, 0, "TEST"); //--> Display text "Disp.drawText(x position, y position, text)"
  Scrolling_Text(9, 50); //--> Show running text "Scrolling_Text(y position, speed);"
     
}
void newMsg(FB_msg& msg) {
  
  if(msg.text == "/start") {
    bot.sendMessage("Hello !");
    msg.text = "";
  }

}

//========================================================================Subroutines for scrolling Text
static char *Text[] = {"Test Panel P10"};

void Scrolling_Text(int y, uint8_t scrolling_speed) {
  static uint32_t pM;
  static uint32_t x;
  int width = Disp.width();
  Disp.setFont(Mono5x7);
  int fullScroll = Disp.textWidth(Text[0]) + width;
  if((millis() - pM) > scrolling_speed) { 
    pM = millis();
    if (x < fullScroll) {
      ++x;
    } else {
      x = 0;
      return;
    }
    Disp.drawText(width - x, y, Text[0]);
  }  
}

if (yes) {
thanks++;
}

In order to work P10 panels needs to be updated at least 100 times per second, so any process that interrupts this will interfere with panel.

'm testing another library, universalTelegramBot. I think it will work without interfering with the P10 panel. I mean, FastBot caused interference even without us sending anything via Telegram. This other one, the universal one, just turns off the P10 panel for 1 or 2 seconds, when I send a message from Telegram to Nodemcu. If it continues like this it will be fine.

Of course I would like to keep FastBot, but without programming knowledge I don't know how to solve the problem I reported in post#1

Grateful

I was wrong about this other library. My problem from Post#1 seems to have no solution. So I created a simple webserver. Through it I send a String. nodemcu receives this String, as if it were a password. If it is correct, I disable the P10 panel routine and it soon goes off, and at the same time I enable the Telegram routine in the loop, and I can change settings and receive data from the nodemcu. When I finish using Telegram, I send a command that deletes that String and the P10 panel immediately returns to its normal display. And without any interference.

That's fine. That's why I marked this topic as resolved.

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