Bluefruit-LE-Shield-Software-resources

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche


MCHobby investit du temps et de l'argent dans la réalisation de traduction et/ou documentation. C'est un travail long et fastidieux réalisé dans l'esprit Open-Source... donc gratuit et librement accessible.
SI vous aimez nos traductions et documentations ALORS aidez nous à en produire plus en achetant vos produits chez MCHobby.

Introduction

Cette page contient un certain nombre d'outils open source pour la plupart des plateformes supportant Bluetooth Low Energy.

Ces outils permettront de faciliter la communication entre le module Bluefruit LE et autres périphériques Centrales (SmartPhone, Ordinateur, etc).

Bluefruit LE Client Apps and Libraries

Adafruit à préparé une série d'application desktop et mobile ainsi que des bibliothèques pour faciliter, au maximum, les communication entre votre module Bluefruit LE et votre SmartPhone et Laptop. Les codes sources ont étés publiés où lorsque cela à été possible:

Bluefruit LE Connect (Android/Java)

Le support Bluetooth Low Energy a été ajouté depuis Android 4.3 (mais vraiment stable depuis Android 4.4).

Adafruit met donc à disposition Bluefruit LE Connect sur Play Store.

Les codes source complet de Bluefruit LE Connect pour Android est également disponible sur Github. Cela devrait vous aider à démarrer vos propres apps Android. Vous aurez besoin d'une version récente de Android Studio pour pouvoir ouvrir ce projet.

Bluefruit-LE-Shield-Software-resources-00.png
Crédit: AdaFruit Industries www.adafruit.com

Bluefruit LE Connect (iOS/Swift)

Apple a adopté Bluetooth Low Energy très rapidement et Adafruit propose également une version iOS de Bluefruit LE Connect app] (disponible sur l'Apple store).

Le code source swift complet de Bluefruit LE Connect pour iOS est également disponible sur Github. Vous aurez besoin de XCode et un accès au programme développeur d'Apple ("Apple developper program") pour utiliser ce project:

Bluefruit-LE-Shield-Software-resources-10.png
Crédit: AdaFruit Industries www.adafruit.com

Bluefruit LE Connect for OS X (Swift)

Les application bureau OS X sont basées sur le même code que la version 2.x de l'App pour iOS et offre un accès à BLE UART, manipulation des I/O et mise-à-jour OTA du firmware.

C'est un choix judicieux pour faire du logging des données de senseurs afin de les exporter en fichier CSV, JSON ou XML. Vous pourrez ainsi exploiter ces informations dans une autre application. Cette approche vous permet d'utiliser la matériel BLE disponible sur votre ordinateur, il n'est donc pas nécessaire d'ajouter un clé BLE si vous disposez d'un Mac récent.

Le code source complet est également disponible sur Github.

Bluefruit-LE-Shield-Software-resources-20.jpg
Crédit: AdaFruit Industries www.adafruit.com

Ligne de commande Bluefruit LE pour mise-à-jour via OS X (Swift)

Cet outil en ligne de commande expérimental (non supporté, disponible à titre de "test de concept") peut être utilisé pour faire une mise-à-jour du Firmware des périphériques Bluefruit.

Cet utilitaire effectue une mise-à-jour automatique du Firmware (comme celle réalisée par la version graphique du logiciel). Elle vérifie la version du firmware installé sur le périphérique Bluefruit (bia le service "Device Information") et le compare avec les versions du firmware disponibles en ligne. Si nécessaure, les fichiers son téléchargés en tâche de fond.

Installez simplement l'outil précompilé via le fichier DMG et placez le quelque par dans les répertoires systèmes -ou- exécutez le locallement via './bluefruit' (pour voir le message d'aide en anglais):

$ ./bluefruit
bluefruit v0.3
Usage:
	bluefruit <command> [options...]

Commands:
	Scan peripherals:   scan
	Automatic update:   update [--enable-beta] [--uuid <uuid>]
	Custom firmware:    dfu --hex <filename> [--init <filename>] [--uuid <uuid>]
	Show this screen:   --help
	Show version:       --version

Options:
	--uuid <uuid>    If present the peripheral with that uuid is used. If not present a list of peripherals is displayed
	--enable-beta    If not present only stable versions are used

Short syntax:
	-u = --uuid, -b = --enable-beta, -h = --hex, -i = --init, -v = --version, -? = --help

ABLE (Cross Platform/Node+Electron)

ABLE (Adafruit Bluefruit LE Desktop) is a cross-platform desktop application based on Sandeep Misty's noble library and the Electron project from Github (used by Atom).

It runs on OS X, Windows 7+ and select flavours of Linux (Ubuntu tested locally). Windows 7 support is particularly interesting since Windows 7 has no native support for Bluetooth Low Energy but the noble library talks directly to supported Bluetooth 4.0 USB dongles to emulate BLE on the system (though at this stage it's still in early BETA and drops the connection and takes more care to work with).

This app allows you to collect sensor data or perform many of the same functionality offered by the mobile Bluefruit LE Connect apps, but on the desktop.

The app is still in BETA, but full source is available in addition to the easy to use pre-compiled binaries.

Bluefruit-LE-Shield-Software-resources-40.png
Crédit: AdaFruit Industries www.adafruit.com

Bluefruit LE Python Wrapper

As a proof of concept, we've played around a bit with getting Python working with the native Bluetooth APIs on OS X and the latest version of Bluez on certain Linux targets.

There are currently example sketches showing how to retreive BLE UART data as well as some basic details from the Device Information Service (DIS).

This isn't an actively support project and was more of an experiment, but if you have a recent Macbook or a Raspberry Pi and know Python, you might want to look at Adafruit_Python_BluefruitLE in our github account.

Debug Tools

If your sense of adventure gets the better of you, and your Bluefruit LE module goes off into the weeds, the following tools might be useful to get it back from unknown lands.

AdaLink (Python)

This command line tool is a python-based wrapper for programming ARM MCUs using either a Segger J-Link or an STLink/V2. You can use it to reflash your Bluefruit LE module using the latest firmware from the Bluefruit LE firmware repo.

Details on how to use the tool are available in the readme.md file on the main Adafruit_Adalink repo on Github.

Completely reprogramming a Bluefruit LE module with AdaLink would require four files, and would look something like this (using a JLink):

adalink nrf51822 --programmer jlink --wipe
  --program-hex "Adafruit_BluefruitLE_Firmware/softdevice/s110_nrf51_8.0.0_softdevice.hex" 
  --program-hex "Adafruit_BluefruitLE_Firmware/bootloader/bootloader_0002.hex"
  --program-hex "Adafruit_BluefruitLE_Firmware/0.6.7/blefriend32/blefriend32_s110_xxac_0_6_7_150917_blefriend32.hex"
  --program-hex "Adafruit_BluefruitLE_Firmware/0.6.7/blefriend32/blefriend32_s110_xxac_0_6_7_150917_blefriend32_signature.hex"

You can also use the AdaLink tool to get some basic information about your module, such as which SoftDevice is currently programmed or the IC revision (16KB SRAM or 32KB SRAM) via the --info command:

$ adalink nrf51822 -p jlink --info
Hardware ID : QFACA10 (32KB)
Segger ID   : nRF51822_xxAC
SD Version  : S110 8.0.0
Device Addr : **:**:**:**:**:**
Device ID   : ****************

Adafruit nRF51822 Flasher (Python)

Adafruit's nRF51822 Flasher is an internal Python tool we use in production to flash boards as they go through the test procedures and off the assembly line, or just testing against different firmware releases when debugging.

It relies on AdaLink or OpenOCD beneath the surface (see above), but you can use this command line tool to flash your nRF51822 with a specific SoftDevice, Bootloader and Bluefruit firmware combination.

It currently supports using either a Segger J-Link or STLink/V2 via AdaLink, or GPIO on a Raspberry Pi if you don't have access to a traditional ARM SWD debugger. (A pre-built version of OpenOCD for the RPi is included in the repo since building it from scratch takes a long time on the original RPi.)

We don't provide active support for this tool since it's purely an internal project, but made it public just in case it might help an adventurous customer debrick a board on their own.

$ python flash.py --jtag=jlink --board=blefriend32 --softdevice=8.0.0 --bootloader=2 --firmware=0.6.7
jtag       	: jlink
softdevice 	: 8.0.0
bootloader 	: 2
board      	: blefriend32
firmware   	: 0.6.7
Writing Softdevice + DFU bootloader + Application to flash memory
adalink -v nrf51822 --programmer jlink --wipe --program-hex "Adafruit_BluefruitLE_Firmware/softdevice/s110_nrf51_8.0.0_softdevice.hex" --program-hex "Adafruit_BluefruitLE_Firmware/bootloader/bootloader_0002.hex" --program-hex "Adafruit_BluefruitLE_Firmware/0.6.7/blefriend32/blefriend32_s110_xxac_0_6_7_150917_blefriend32.hex" --program-hex "Adafruit_BluefruitLE_Firmware/0.6.7/blefriend32/blefriend32_s110_xxac_0_6_7_150917_blefriend32_signature.hex"
...



Basé sur "Bluefruit LE Shield" d'Adafruit Industries, écrit par Kevin Townsend - Traduit en Français par shop.mchobby.be CC-BY-SA pour la traduction
Toute copie doit contenir ce crédit, lien vers cette page et la section "crédit de traduction".

Based on "Bluefruit LE Shield" from Adafruit Industries, written by Kevin Townsend - Translated to French by shop.mchobby.be CC-BY-SA for the translation
Copies must includes this credit, link to this page and the section "crédit de traduction" (translation credit).

Traduit avec l'autorisation d'AdaFruit Industries - Translated with the permission from Adafruit Industries - www.adafruit.com