Help needed: Arduino Wireless Notice Board project



  • I'm making a Wireless Notice Board for my project purpose. Simply the expected working is... "Sending a message from our mobile handset to sim which inserted to SIM900A GSM Module Arduino read the message and display through P10 LED display."

    Recieving SMS system and P10 LED display are working separately. These programs are combined. SMS are received (we can see in serialmonitor). But it cannot display. Displaying what is written in the program only

    #include <SoftwareSerial.h>
    #include <SPI.h>
    #include <DMD.h>
    #include <TimerOne.h>
    #include "SystemFont5x7.h"
    #include "Arial_black_16.h"
    
    #define ROW 1
    #define COLUMN 1
    #define FONT Arial_Black_16
    
    DMD led_module(ROW, COLUMN);
    
    String st; 
    const char *msg;
    unsigned int LengMsg;
    SoftwareSerial mySerial(3, 2);
    
    void scan_module(){
      led_module.scanDisplayBySPI();
    }
    
    void setup() {
      Timer1.initialize(2000);
      Timer1.attachInterrupt(scan_module);
      led_module.clearScreen( true );
      
      Serial.begin(4800);
      mySerial.begin(4800);
      Serial.println("Starting..."); 
      delay(1000);
      mySerial.println("AT");
      pollSms();
      mySerial.println("AT+CMGF=1"); 
      pollSms();
      mySerial.println("AT+CNMI=1,2,0,0,0");
      pollSms();
    }
    
    void loop(){
      pollSms();
      delay(500);
    
      //Start print in led matrix 
      led_module.selectFont(FONT);
      led_module.drawMarquee(msg,LengMsg, (32 * ROW), 0);
      long start = millis();
      long timming = start;
      boolean flag = false;
      while (!flag){
        if((timming + 20) < millis()){
            flag = led_module.stepMarquee(-1, 0);
            timming = millis();
          }
        }
      }
    
    void pollSms(){
      delay(500);
      while (Serial.available()) {
        mySerial.write(Serial.read());
        String st = String(Serial.read());
        Serial.println(st);
      }
      while(mySerial.available()) {
        Serial.write(mySerial.read());
        st = String(Serial.readString());
        Serial.println(st);
        LengMsg = st.length();
        st.toCharArray(msg,LengMsg);    
      }
      delay(500);
    }
    


  • @SAFVAN Thanks for posting the query. I would like to know what is the exact part number or any picture of the Display you're using and I wanna know what connections have you made.

    Please post these details such that it becomes easy for us to review.!!



  • @SAFVAN are you getting any error or something ?



  • @salmanfaris no any error, issue is in that LED metrix library print function parameters are *const char. So need to convert SMS boast string to const char *Variable.



  • @kowshik1729 display is 16ร—32 P10 LED display.
    RX and TX connected pin 3&2.
    P10 connected as https://circuitdigest.com/microcontroller-projects/digital-notice-board-using-p10-led-matrix-display-and-arduino



  • Hi @rafitc99, You can convert the string to char array using toCharArray() it will Copies the Stringโ€™s characters to the supplied buffer.

    • Syntax
    myString.toCharArray(buf, len)
    
    • Parameters
      myString: a variable of type String.
      buf: the buffer to copy the characters into. Allowed data types: array of char.
      len: the size of the buffer. Allowed data types: unsigned int.

    more : https://www.arduino.cc/reference/en/language/variables/data-types/string/functions/tochararray/ , https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings

    also @SAFVAN is using const char* to hold message array You cannot change the contents of the location(s) this pointer points to.



  • @salmanfaris Rewrite all code and uploaded. But SMS is not displaying correctly in LED Board, .. I'm attaching code and display output. take a look ,

    #include <SoftwareSerial.h>
    #include <SPI.h>
    #include <DMD.h>
    #include <TimerOne.h>
    #include "SystemFont5x7.h"
    #include "Arial_black_16.h"
    
    #define ROW 1
    #define COLUMN 1
    #define FONT Arial_Black_16
    
    DMD led_module(ROW, COLUMN);
    
    String st; 
    const char *msg;
    unsigned int LengMsg;
    SoftwareSerial mySerial(3, 2);
    
    void scan_module(){
      led_module.scanDisplayBySPI();
    }
    
    void setup() {
      Timer1.initialize(2000);
      Timer1.attachInterrupt(scan_module);
      led_module.clearScreen( true );
      
      Serial.begin(4800);
      mySerial.begin(4800);
      Serial.println("Starting..."); 
      delay(1000);
      mySerial.println("AT");
      pollSms();
      mySerial.println("AT+CMGF=1"); 
      pollSms();
      mySerial.println("AT+CNMI=1,2,0,0,0");
      pollSms();
    }
    
    void loop(){
      pollSms();
      delay(500);
    
      //Start print in led matrix 
      led_module.selectFont(FONT);
      led_module.drawMarquee(msg,LengMsg, (32 * ROW), 0);
      long start = millis();
      long timming = start;
      boolean flag = false;
      while (!flag){
        if((timming + 20) < millis()){
            flag = led_module.stepMarquee(-1, 0);
            timming = millis();
          }
        }
      }
    
    void pollSms(){
      delay(500);
      while (Serial.available()) {
        mySerial.write(Serial.read());
        //String st = String(Serial.read());
        //Serial.println(st);
      }
      while(mySerial.available()) {
        Serial.write(mySerial.read());
        st = String(mySerial.readString());
        Serial.println(st);
        LengMsg = st.length();
        st.toCharArray(msg,LengMsg);    
      }
      delay(500);
    }
    

    output video : video link



  • Can you print the SMS on the serial monitor too? so we can conclude the problem



  • @salmanfaris in serial monitor getting normal text. No problem in there.



  • @rafitc99 Okay, it might be sending char from SMS buffer to LED panel. let me check, I'll get back to you.


Log in to reply
 

Recent Posts

  • P

    @Anudeep Thanks a lot m8, I actually made a very silly mistake of including the https:// while entering FIREBASE_HOST, where I must have entered the Domain name alone and removed the https:// extension.

    Thanks again for replying that quick. Cheers.

    read more
  • A

    Hello @Palani, In the Firebase, there are two types of storage,

    Cloud Firestore (Very recent one & NoSQL database) Realtime Database (To which we upload the data using NodeMCU)

    In the Arduino Code, you can see that there is a variable named FIREBASE_AUTH.

    This variable should be assigned to the Database secret. This you can find in Project Settings -> Service accounts -> Database Secrets.

    My mistake is, i have mistakenly assigned thay to Web API key. This is found at Project Settings -> General.

    The error can also occur when u don't initialise a proper realtime database in Firebase. (This is not my case).

    read more
  • P

    @Anudeep Hello Anudeep could you please help me out by elaborating the fix to get rid of that error?
    Thanks in advance.

    read more
  • At Adobe, weโ€™re focused on bringing together the most intelligent, driven, diverse set of individuals and give them the freedom to nurture their intellectual curiosity. We provide them with the necessary resources and support to shape their ideas into tangible results.
    Through the Adobe India Women-in-Technology Scholarship, we are striving towards creating gender equality in science, technology and engineering domains by encouraging women to showcase their excellence in computing and technology and become future leaders and role models in the field.

    ๐—›๐—ผ๐˜„ ๐˜๐—ผ ๐—ฎ๐—ฝ๐—ฝ๐—น๐˜†?

    Applications must be submitted through their dedicated application portal which opens on August 20th, 2020 and will close on September 20th, 2020, 5 pm India time.

    ๐—”๐—ฝ๐—ฝ๐—น๐—ถ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐—ฑ๐—ฒ๐—ฎ๐—ฑ๐—น๐—ถ๐—ป๐—ฒ:

    Application deadline: September 20th, 2020, 5 pm India time.

    Visit:- https://research.adobe.com/adobe-india-women-in-technology-scholarship/

    read more
  • @kowshik1729 If you are using an external high-speed switch, there is only one one clock generator for both wifi and BLE and the high-speed switch you mentioned is Ultra-Wideband (UWB) 3โ€“8 GHz from its datasheet

    b2da6871-9110-40f1-8ff0-d8313547a17a-image.png

    you also check this solution that I shared in the previous post.

    @salmanfaris said in BT and WiFi Dual Core simultaneous operation using ESP32?:

    There is a special option called โ€œSoftware controls WiFi/ Bluetooth coexistenceโ€ it can control the ESP32's Bluetooth and Wi-Fi coexistence using software, more details: https://www.espressif.com/sites/default/files/documentation/ESP32_FAQs__EN.pdf

    read more