Forum >Replies by visualxl
userhead visualxl
Replies (20)
  • You Reply: I am running on version 1.8 by the way, and I do not bother to upgrade since I am no longer working on this anymore. Maybe that's why my version of Serial.print("+++"); works?

    Anyway, I managed to bind BLUNO's CENTRAL to another beacon. Nope, negative. It does not connect to it. It can only connect to another BLUNO's PERIPHERAL as far as I know, unless otherwise stated by Grey.
  • You Reply: I am running on version 1.8 by the way, and I do not bother to upgrade since I am no longer working on this anymore. Maybe that's why my version of Serial.print("+++"); works?

    Anyway, I managed to bind BLUNO's CENTRAL to another beacon. Nope, negative. It does not connect to it. It can only connect to another BLUNO's PERIPHERAL as far as I know, unless otherwise stated by Grey.
  • You Reply: Not sure who told you that BLUNO can only work on SLAVE mode. It definitely can work as a MASTER.

    I never tried binding the BLUNO to other beacon. Hold on. Lemme try.
  • You Reply: Not sure who told you that BLUNO can only work on SLAVE mode. It definitely can work as a MASTER.

    I never tried binding the BLUNO to other beacon. Hold on. Lemme try.
  • You Reply: You can send "+++" in one line. No problem. I did that before
    Code: Select all
    void masterConfiguration() {
      Serial.print("+++");
      delay(250);
    }
    
    I can understand your frustration since it was your first time playing with Arduino. BLUNO was my first device to play with too when I first started my Arduino journey.

    But Relax. Don't be mad at them. I can assure you that DF has one of the best support as compared to other hardware providers.

    By the way, you posted on Friday, after office hours. I am pretty sure DF does not operate on Weekends. So, to be fair to them, they perhaps have lots of posts to go through yesterday.

    Yesterday, I was on exam leave. So, I couldn't reply to you earlier as well as I only check this forum during office hours.
  • You Reply: You can send "+++" in one line. No problem. I did that before
    Code: Select all
    void masterConfiguration() {
      Serial.print("+++");
      delay(250);
    }
    
    I can understand your frustration since it was your first time playing with Arduino. BLUNO was my first device to play with too when I first started my Arduino journey.

    But Relax. Don't be mad at them. I can assure you that DF has one of the best support as compared to other hardware providers.

    By the way, you posted on Friday, after office hours. I am pretty sure DF does not operate on Weekends. So, to be fair to them, they perhaps have lots of posts to go through yesterday.

    Yesterday, I was on exam leave. So, I couldn't reply to you earlier as well as I only check this forum during office hours.
  • You Reply: And I looked at your codes.

    Of course the AT commands will not get executed. As such, you won't be able to read any data.

    You try the code below, and then bring up your Serial Monitor.
    Code: Select all
    void setup() {
      Serial.begin(115200);
      Serial.print("+++");
      Serial.println("AT+NAME=MAHMOUD");
    }
    
    I am pretty certain that the above code will work, and you shall see "OK" on your Serial Monitor.
  • You Reply: And I looked at your codes.

    Of course the AT commands will not get executed. As such, you won't be able to read any data.

    You try the code below, and then bring up your Serial Monitor.
    Code: Select all
    void setup() {
      Serial.begin(115200);
      Serial.print("+++");
      Serial.println("AT+NAME=MAHMOUD");
    }
    
    I am pretty certain that the above code will work, and you shall see "OK" on your Serial Monitor.
  • You Reply: Hi,

    Yes!! It will greatly help if you use an LCD and don't use the Serial Monitor to want to see the expected responses!

    Yes. I have some samples codes to grab the RSSI. Hold on.

    I have stopped doing Arduino/Bluno projects for quite some time. So, I can't remember whether the codes below works or not. Test it out and tell me whether it works or not. If not, I still have tons of samples!
    Code: Select all
    /*
     *  Get RSSI on 9600 Baud Rate
     *  This file only get the RSSI and display it to LCD
     */
     
    #include <LiquidCrystal.h>  //LCD library
    // select the pins used on the LCD panel
    LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
    
    #define MAXCHARS 50
    
    void setup() {  
      Serial.begin(115200);  //RSSI only works on 115200
      Serial.print("+++");
      lcd.begin(16, 2);              // start the library
      lcd.setCursor(0,0);
      lcd.print("BLE RSSI: "); // print a simple message
    }
    
    void loop() {
      if(Serial.available() > 0)
        getRSSI();
    }
    
    
    /*
      Read input serial
     */
    int readSerial(char result[]) {
      int i = 0;
      while(1) {
        while (Serial.available() > 0) {
          char inChar = Serial.read();
          if (inChar == '\n') {
            result[i] = '\0';
            Serial.flush();
            return 0;
          }
          if(inChar!='\r') {
            result[i] = inChar;
            i++;
          }
        }
      }
    }
    
    void getRSSI() {
      Serial.println("AT+RSSI=?");
      delay(150);
      lcd.setCursor(0,1);
      lcd.print(Serial.peek());
      while(Serial.available() > 0) {
        char rssiString[MAXCHARS];  // RSSI string to received from BLE
        readSerial(rssiString);  //read serial and store it inside rssiString
        String responseString = "";
        int i = 1; //ignore negative
        for(i; i<4; i++)  //get RSSI from the array
          responseString += rssiString[i];
        int rssi = abs(responseString.toInt());  //parse string to int
        //lcd.setCursor(0,1);
        //lcd.print(rssi);  //responseString
      }
    }
    
  • You Reply: Hi,

    Yes!! It will greatly help if you use an LCD and don't use the Serial Monitor to want to see the expected responses!

    Yes. I have some samples codes to grab the RSSI. Hold on.

    I have stopped doing Arduino/Bluno projects for quite some time. So, I can't remember whether the codes below works or not. Test it out and tell me whether it works or not. If not, I still have tons of samples!
    Code: Select all
    /*
     *  Get RSSI on 9600 Baud Rate
     *  This file only get the RSSI and display it to LCD
     */
     
    #include <LiquidCrystal.h>  //LCD library
    // select the pins used on the LCD panel
    LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
    
    #define MAXCHARS 50
    
    void setup() {  
      Serial.begin(115200);  //RSSI only works on 115200
      Serial.print("+++");
      lcd.begin(16, 2);              // start the library
      lcd.setCursor(0,0);
      lcd.print("BLE RSSI: "); // print a simple message
    }
    
    void loop() {
      if(Serial.available() > 0)
        getRSSI();
    }
    
    
    /*
      Read input serial
     */
    int readSerial(char result[]) {
      int i = 0;
      while(1) {
        while (Serial.available() > 0) {
          char inChar = Serial.read();
          if (inChar == '\n') {
            result[i] = '\0';
            Serial.flush();
            return 0;
          }
          if(inChar!='\r') {
            result[i] = inChar;
            i++;
          }
        }
      }
    }
    
    void getRSSI() {
      Serial.println("AT+RSSI=?");
      delay(150);
      lcd.setCursor(0,1);
      lcd.print(Serial.peek());
      while(Serial.available() > 0) {
        char rssiString[MAXCHARS];  // RSSI string to received from BLE
        readSerial(rssiString);  //read serial and store it inside rssiString
        String responseString = "";
        int i = 1; //ignore negative
        for(i; i<4; i++)  //get RSSI from the array
          responseString += rssiString[i];
        int rssi = abs(responseString.toInt());  //parse string to int
        //lcd.setCursor(0,1);
        //lcd.print(rssi);  //responseString
      }
    }
    
  • You Reply: Oh, you need to throw in some delay.

    Try something like this

    [code]
    void masterConfiguration() {
      Serial.print("+++");
      delay(150);
      Serial.println("AT+SETTING=DEFCENTRAL");
      delay(250);
      Serial.println("AT+ROLE=ROLE_CENTRAL");
      delay(150);
      Serial.println("AT+NAME=BabyRealMaster");
      delay(150);
      Serial.println("AT+BIND=0xD0FF50676DFD"); //Destination MAC to bind to
      Serial.println("AT+EXIT");
    }
    [/code]
  • You Reply: Ah you mean device discovery mode?

    I didn't think of that yet and not sure whether it has some big implication or not.

    But I think, if the whitelist function can be implemented for both CENTRAL and/or PERIPHERAL, the blacklist/hide function is redundant.
  • You Reply: Whatever sketch you upload, the variables (data) will be stored persistently until you upload another sketch.
  • You Reply: err... Grey,

    What I meant was that uploading the sketch to a CENTRAL/PERIPHERAL though a USB cable when both of them are connected via BLE link.

    BLUNO central can upload a sketch to BLUNO peripheral wirelessly?? How is that possible?
  • You Reply: One more thing is that, if both BLUNOs has been configured to connect to each other, and you are trying to upload a sketch when they are still in connected state, often you will get errors unless if you power off one of them.
  • You Reply: Have the 2 BLUNOs been configured to connect to each other?

    Were they powered up at the same time, and is the "LINK" light on when you tried to upload the sketch?
  • You Reply: Nope. It seems to be a GSM shield issue. I had to add a 'false' boolean in the GSM constructor. I shall write about that someday ~ ;)
  • You Reply: Hmm.. I may consider that. Another question that I have is, would a standard GSM shield interfere with the BLUNO?

    I noticed that whenever I issue a delay of let say 30 seconds within some loop, the GSM is not able to initialise. I am trying to replicate the same thing on a standard Uno to see whether will it give the same problem.
  • You Reply: Grey / Jose,

    Negative. Both:
    Code: Select all
    Serial.print("+++"); //it does enter AT mode.
    Serial.write("+++"); //It also enter AT mode
    
    I replaced with '.write', and my ROLE is still PERIPHERAL and the name still has not changed to reflect "BabyMaster" yet. That's mean it does not enter AT MODE?
    Code: Select all
    Serial.write("+++");
      delay(250);
      Serial.println("AT+SETTING=DEFCENTRAL");
      delay(250);
      Serial.println("AT+ROLE=ROLE_CENTRAL");
      delay(150);  //150
      Serial.println("AT+NAME=BabyMaster");
      delay(150);
      Serial.println("AT+BIND=0x883314DC6FEF"); //PERIPHERAL Bluno
      delay(150);
      Serial.println("AT+TXPOWER=0");
      Serial.println("AT+EXIT");
    
    I changed it back to "Serial.print("+++");" and it disappears from my phone. Well.. I don't why like that.
  • You Reply: Cool!!! I can't wait to try v.19!! :)