Jump to content
Electronics-Lab.com Community

iot_crab

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by iot_crab

  1. Materials AmebaD [RTL8722 CSM/DM] x 2 Example Introduction BLE connections use a server client model. The server contains the data of interest, while the client connects to the server to read the data. Commonly, a Bluetooth peripheral device acts as a server, while a Bluetooth central device acts as a client. Servers can contain many services, with each service containing a some set of data. Clients can send requests to read or write some data and can also subscribe to notifications so that the server can send data updates to a client. In this example, a basic battery client is set up on the Ameba Bluetooth stack. The client connects to another Ameba board running the corresponding BLE battery service to read the battery level data. Procedure On the first Ameba board, upload the BLEBatteryService example code and let it run. For the second Ameba board, open the example “Files” -> “Examples” -> “AmebaBLE” -> “BLEBatteryClient”. Upload the code and press the reset button on Ameba once the upload is finished. Open the serial monitor and observe the log messages as the Ameba board with the battery client scans, connects, and reads data from the Ameba board with the battery service. Highlighted in yellow, the Ameba board with the battery client first scans for advertising BLE devices with the advertised device name “AMEBA_BLE_DEV” and the advertised service UUID of 0x180F representing the battery service. After finding the target device, the Ameba board with the battery client forms a BLE connection and searches for a battery service on the connected device, highlighted in blue. With the client connected to the service, the battery client begins to read data using both regular data reads and notifications, highlighted in green. Code Reference BLEClient is used to create a client object to discover services and characteristics on the connected device. setNotifyCallback() is used to register a function that will be called when a battery level notification is received. BLE.configClient() is used to configure the Bluetooth stack for client operation. addClient(connID) creates a new BLEClient object that corresponds to the connected device. For more resources: If you need additional technical documents or the source code for this project. Please visit the official websites and join the Facebook group and forum. Ameba Official Website: https://www.amebaiot.com/en/ Ameba Facebook Group: https://www.facebook.com/groups/amebaioten Ameba Forum: https://forum.amebaiot.com/
  2. Materials Ameba D x 1 Android / iOS mobile phone Example Introduction This example configures the Ameba as a Bluetooth central device, uses the scan functionality to scan for other Bluetooth devices, and prints out the results to the serial monitor. Procedure Open the example, “Files” -> “Examples” -> “AmebaBLE” -> “BLEScan” Upload the code and press the reset button on Ameba once the upload is finished. Open the Arduino serial monitor, and you should see the scan results of nearby Bluetooth devices formatted and printed out. If you have the Bluetooth app nRF Connect installed, you can also use it to send out Bluetooth advertisements for the Ameba to pick up. Code Reference setScanMode(GAP_SCAN_MODE_ACTIVE) is used to set the scan mode. Active scanning will request for an additional scan response data packet from a device when it is found. Passive scanning will only look at the advertisement data, and not request for additional data. setScanInterval() and setScanWindow() are used to set the frequency and duration of scans in milliseconds. A scan will start every interval duration, and each scan will last for the scan window duration. The scan window duration should be lesser or equal to the scan interval. Set a short interval to discover devices rapidly, set a long interval to conserve power. setScanCallback(scanFunction) is used to register a function to be called when scan results are received. This can be used to set a user function for additional processing of scan data, such as looking for a specific device. If no function is registered, the scan results are formatted and printed to the serial monitor by default. beginCentral(0) is used to start the Bluetooth stack in Central mode. The argument 0 is used to indicate that no clients will be operating in central mode. startScan(5000) is used to start the scanning process for a specified duration of 5000 milliseconds. The scan will repeat according to the set scan interval and scan window values. After 5000 milliseconds, the scan process will stop, and will be ready to be started again. For more resources: If you need additional technical documents or the source code for this project. Please visit the official websites and join the Facebook group and forum. Ameba Official Website: https://www.amebaiot.com/en/ Ameba Facebook Group: https://www.facebook.com/groups/amebaioten Ameba Forum: https://forum.amebaiot.com/
  3. The most popular European and U.S. engineering online exhibition is coming! Realtek is invited to participate in the 2021 Industry Tech Days, a European and American engineering online exhibition. The exhibition will from September 13 to 17, 2021, Monday to Friday. Visitors can sign up to watch video channels anytime during the fair. ü Tips: This year, Massimo Banzi who invented Arduino was invited to attend. ü Our Live Webinar:Easy Start to Make your AIoT Dream with Ameba RTL8722DM_MINI Evaluation Board SDK ü Start Time: Monday September 13, 2021 - 10:00 PM CST ü 🔊🔊 FREE Registration now 🔊🔊 https://reurl.cc/R0x6Ar Realtek will introduce “Features of the demo version of Ameba IoT SDK”. It introduces the application of the demo version of Ameba IoT to the AIoT field and the practical operation AIoT machine learning is the main trend of contemporary technology, and is not easy to get started. Realtek’s demo version of Ameba RTL8722DM_MINI Evaluation Board the latest generation in the Ameba D series. It features dual-band Wifi and BT5.0 functions. Compared with the previous generation, it has a smaller size, a microphone, and a micro SD card while supporting three different development platform SDKs, making it easier for users to develop IoT application designs and create works in the field of AIoT rapidly. The theme of Realtek's participation in the exhibition is "Create Your Ingenuity". Let us inspire more new ideas to be realized. 🌍Know more about the event: https://reurl.cc/O09pj9
×
  • Create New...