Mkr 1010 et Beacon

Pour un projet on dois détecter des beacon avec un MKR1010, beacon émis par des téléphones avec des application comme BeaconSimulator, sauf qu'on n'y arrive pas. On a chercher partout et on sait juste que certaine ancien carte Arduino ne supporte pas cette technologie, mais étant donnée que le MKR 1010 supporte le bluetooth BLE ca devrait être bon. On arrive juste pas a trouver un code permettant de détecter les beacons. On a pour l'instant que le code de scan donnée par la bibliothèque ArduinoBLE-1.3.6 :

/*
  Scan

  This example scans for Bluetooth® Low Energy peripherals and prints out their advertising details:
  address, local name, advertised service UUID's.

  The circuit:
  - Arduino MKR WiFi 1010, Arduino Uno WiFi Rev2 board, Arduino Nano 33 IoT,
    Arduino Nano 33 BLE, or Arduino Nano 33 BLE Sense board.

  This example code is in the public domain.
*/

#include <ArduinoBLE.h>

void setup() {
  Serial.begin(9600);
  while (!Serial);

  // begin initialization
  if (!BLE.begin()) {
    Serial.println("starting Bluetooth® Low Energy module failed!");

    while (1);
  }

  Serial.println("Bluetooth® Low Energy Central scan");

  // start scanning for peripheral
  BLE.scan();
}

void loop() {
  // check if a peripheral has been discovered
  BLEDevice peripheral = BLE.available();

  if (peripheral) {
    // discovered a peripheral
    Serial.println("Discovered a peripheral");
    Serial.println("-----------------------");

    // print address
    Serial.print("Address: ");
    Serial.println(peripheral.address());

    // print the local name, if present
    if (peripheral.hasLocalName()) {
      Serial.print("Local Name: ");
      Serial.println(peripheral.localName());
    }

    // print the advertised service UUIDs, if present
    if (peripheral.hasAdvertisedServiceUuid()) {
      Serial.print("Service UUIDs: ");
      for (int i = 0; i < peripheral.advertisedServiceUuidCount(); i++) {
        Serial.print(peripheral.advertisedServiceUuid(i));
        Serial.print(" ");
      }
      Serial.println();
    }

    // print the RSSI
    Serial.print("RSSI: ");
    Serial.println(peripheral.rssi());

    Serial.println();
  }
}

Bluetooth Beacon Manufacturer

Le forum dispose d'une section dédiée à votre langue maternelle. J'ai déplacé votre sujet là-bas.

Lorsque vous postez dans la section anglaise du forum, veuillez utiliser la langue anglaise.


The forum has a dedicated section for your native language. I've moved you're topic there.

When posting in the English section of the forum, please use the English language.

Bonjour

Les balises BLE (Beacon) sont des objets BLE spécifiques qui se contentent de diffuser périodiquement une brève info, on n'interagis pas avec elles par les services et leurs caractéristiques

Dans le cas des ESP32 un exemple Beacon_Scanner est proposé,
C'est peut être aussi le cas pour ta carte, je ne connais pas la bibliothèque BLE qu'elle utilise .

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