Forum >Replies by fullauto2009
userhead fullauto2009
Replies (7)
  • You Reply: Log:

    Connection Attempt No:1
    AT+EXIT
    Begin AT Bind

    Attempting to connect to MAC: 0x50658397CDC6
    RSSI Value=0
    Begin LED Output
    End LED Output

    Connection Attempt No:2
    AT+EXIT
    Begin AT Bind

    Attempting to connect to MAC: FakeMac2
    RSSI Value=0
    Begin LED Output
    End LED Output

    Connection Attempt No:3
    AT+EXIT
    Begin AT Bind

    Attempting to connect to MAC: FakeMac1
    AT+BIND=FakeMac1
    RSSI Value=0
    Begin LED Output
    End LED Output

    Connection Attempt No:4
    AT+EXIT
    Begin AT Bind

    Attempting to connect to MAC:
    RSSI Value=0
    Begin LED Output
    End LED Output

    Connection Attempt No:5
    AT+EXIT
    Begin AT Bind

    Attempting to connect to MAC: 0x50658397CDC6
    AT+BIND=0x50658397CDC6
    RSSI Value=0
    Begin LED Output
    End LED Output

    Connection Attempt No:6
    AT+EXIT
    Begin AT Bind

    Attempting to connect to MAC: FakeMac2
    RSSI Value=0
    Begin LED Output
    End LED Output

    Connection Attempt No:7
    AT+EXIT
    Begin AT Bind

    Attempting to connect to MAC: FakeMac1
    RSSI Value=129
    Begin LED Output
    End LED Output

    Connection Attempt No:8
    AT+EXIT
    Begin AT Bind

    Attempting to connect to MAC:
    RSSI Value=53
    Begin LED Output
    End LED Output

    Connection Attempt No:9
    AT+EXIT
    Begin AT Bind

    Attempting to connect to MAC: 0x50658397CDC6
    RSSI Value=53
    Begin LED Output
    End LED Output

    Connection Attempt No:10
    AT+EXIT
    Begin AT Bind

    Attempting to connect to MAC: FakeMac2
    RSSI Value=53
    Begin LED Output
    End LED Output

    Connection Attempt No:11
    AT+EXIT
    Begin AT Bind

    Attempting to connect to MAC: FakeMac1
    RSSI Value=53
    Begin LED Output
    End LED Output
  • You Reply: Code:


    char* mac[] = {"0x50658397CDC6", "FakeMac2", "FakeMac1"}; //6 is the correct number, 5 is not. It should not connect on 2nd or 3rd element
    unsigned long previousMillis = 0;
    const long interval = 5000; // interval at which to awitch the connection (milliseconds), at least 10 seconds
    int linkTo = 0; //MAC address variable
    int LEDno = 0; //LED output variable
    char Data[100];
    char RAW[3]; // RSSI array
    int INDEX;
    char Value = '-'; //RSSI beginning character
    int count = 1; //initialize cycle counter.

    void setup() {
    Serial.begin(115200);
    pinMode(2,OUTPUT); //set port as OUTPUT
    pinMode(3,OUTPUT);
    pinMode(4,OUTPUT);
    pinMode(13, OUTPUT);
    delay(100);


    }

    void loop() {

    LEDno = linkTo **;
    unsigned long currentMillis = millis(); // get current time

    if (currentMillis - previousMillis >= interval) { //Do this every 10 seconds
    previousMillis = currentMillis; //Set last ttime ran

    Serial.print("Connection Attempt No:"); // show cycle no.
    Serial.println(count);

    delay(50);

    Bind(mac[linkTo++], LEDno);

    delay(50);

    if(linkTo > 3) linkTo = 0;
    }
    }

    void Bind(char* Mac, int LEDno){
    digitalWrite(13, HIGH);
    delay(100);
    Serial.println("AT+EXIT"); // Make sure we're out of AT MODE
    delay(100);
    Serial.println("Begin AT Bind");
    Serial.println();
    Serial.print("Attempting to connect to MAC: ");
    Serial.println(Mac);
    delay(100);
    Serial.print("+++");// Enter AT mode of itself
    delay(1000);
    Serial.print("AT+BIND=");
    Serial.println(Mac); // BIND to specific MAC
    delay(1000);

    Serial.println("AT+RSSI=?"); // Ask about the RSSI, Check connection to specified MAC
    for(int x=0 ; Serial.available() > 0 ; x++ ){ // get the Enter AT mode words
    delay(100); // Slow down for accuracy
    Data[x] = Serial.read(); // Read and store Data Byte by Byte
    delay(50);
    if (Data[x] == Value ) // Look for the elemnt of the array that have "-" that's the start of the RSSI value
    {
    delay(50);
    INDEX=x;
    delay(50);
    }
    RAW[0] = Data[INDEX**]; // Copy the RSSI value to RAW Char array
    delay(50);
    RAW[1] = Data[INDEX**];
    delay(50);
    RAW[2] = Data[INDEX+3];
    //RAW[3] = Data[INDEX+3];
    }

    delay(100);
    Serial.println("AT+EXIT");
    delay(100);
    digitalWrite(13, LOW); //Get out of AT Mode

    delay(100);
    int RSSI = atoi(RAW); //Convert the Array to an integer
    Serial.print("RSSI Value="); //Display RSSI
    Serial.println(RSSI);

    Serial.println("Begin LED Output");
    if(RSSI != 0){ // If not connected it should be 0, If connected its non zero. 1 LED per MAC. Should blink LED 1, not LED 2 or 3.
    digitalWrite(LEDno, HIGH);
    delay(500);
    digitalWrite(LEDno, LOW);
    delay(500);
    digitalWrite(LEDno, HIGH);
    delay(500);
    digitalWrite(LEDno, LOW);
    delay(50);
    RSSI = 0; //Reset RSSI just in case although as it restarts it should be rewritten anyway.
    }
    else{ // If RSSI is 0 aka no connection, rapid blink LED 1 to show no connection
    digitalWrite(LEDno, HIGH);
    delay(100);
    digitalWrite(LEDno, LOW);
    delay(100);
    digitalWrite(LEDno, HIGH);
    delay(100);
    digitalWrite(LEDno, LOW);
    }

    delay(50);
    Serial.println("End LED Output"); //Display showing end of function was reached.
    Serial.println();
    digitalWrite(13, LOW);
    count++; //count inc
    delay(1000);

    }
  • You Reply: Bump
  • You Reply: Seeing as how there is basically no other way to contact DFRobot and the documentation for these products is terrible I guess I'm supposed to post my request for RMA here?
  • You Reply: Also, I can use AT commands and get board info works ok.

    Also it pairs with the Beetle OK.

    But I cannot upload any sketches anymore.
  • You Reply: Apparently discovering this device on a PC is not so easy. My phone can see the device.

    Using a BT dongle on a PC, I cannot.
    I bought a BT 4.0 + BLE Dongle, still cant see it.

    If I plug the dongle into a Raspberry Pi, I can see it.
    But my platform is Windows, not Linux..

    I bought the BLE Link from DF Robot. I guess is the only option.
    It comes in next week. So we'll see what happens then.
  • You Reply: I dont need it to connect. I just need it to be discoverable. When I scan for BT devices, bluno only need to show up