Git Product home page Git Product logo

nicla-sense-me-fw's Introduction

Nicla

Check Arduino status Compile Examples status Check License status Spell Check status

This repo contains everything needed to program Nicla Sense ME and to control it from another device. Further documentation can be found on the Arduino Docs website.

Nicla Sense ME belongs to Arduino Mbed OS boards and its core is available here. The packaged core can also be downloaded from Arduino IDE as 'Arduino Mbed OS Nicla Boards'

Table of Contents:

Repo structure


Arduino_BHY2 - is the library to be included when making sketches for Nicla. It can be used for configuring bhi's sensors and for retrieving bhi's sensors data either from a sketch running on Nicla (standalone mode) or from an external device (through ESLOV or BLE).

In examples there are already working examples for both scenarios:

  • Standalone mode - Standalone exploits bhi's sensors directly from Nicla.
  • Control from external device mode - App waits for external stimuli, coming from ESLOV or BLE channels.
  • Upload a Fail Safe Firmware - Fail_Safe_flasher uploads a binary to Anna's QSPIFlash. Pressing the button 3 times, Nicla checks if a Fail Safe firmware is present and, if it is valid, runs it.

Arduino_BHY2Host - is the library that an Arduino board should include in order to control the Nicla through the ESLOV port. It can also act as a passthrough, to allow the control of Nicla from a PC. There is an example for both these use cases in examples:


bootloader - contains the source code for Nicla's bootloader.


tools - contains the source code of the command line tool to control Nicla from a PC. There is also a webserver mode that allows to control Nicla from a browser on your PC. The bhy-controller executable files for the main operating systems can be downloaded from the latest release.


Main use cases

Nicla standalone mode

In this use case, Nicla will be able to control its own sensors without the need for an external host.

  • Make a standalone sketch importing Arduino_BHY2 library, follow this example to write the code.
  • Select Nicla Sense ME as the compilation target, then compile and upload.

Control Nicla from an arduino board through ESLOV

  • Upload the App example to Nicla.
  • Use an Arduino board, like a MKR, acting as a host by importing Arduino_BHY2Host and following the example.
  • Upload the host sketch to the Arduino MKR board.
  • Connect Nicla to the MKR board with an ESLOV cable or I2C pins.

Control Nicla from a PC - web server

A local web server has been implemented to manage Nicla from a browser. See browser compatibility.

BLE is used instead of ESLOV, thus there is no need for an intermediary arduino board.

  • Upload the App example to Nicla.
  • Access the command line tool folder.
  • Execute the following command ./bhy webserver to start the local web server.
  • Open the http://localhost:8000/index.html web page with a browser listed in the compatibility list. NB: make sure that WebBLE is enabled! If it is not, enable it from chrome://flags, setting "Experimental Web Platform features".

There are two web pages

  • sensor.html allows to configure the sensors and read their values in real time.
  • dfu.html allows to update the firmware of either Nicla or bhi.

Control Nicla from a PC - command line tool

The command line tool can be used to update the firmware of Nicla or bhi, manage Nicla's sensors and read their values in real time. Refer to tools for the list of available commands. Here the ESLOV protocol is employed, so an arduino board is needed between Nicla and the PC.

  • Upload the App example to Nicla.
  • Upload the Passthrough example to an arduino board.
  • Connect the arduino board to your PC via USB.
  • Connect the arduino board to Nicla through the ESLOV port.
  • Access the command line tool folder
  • Refer to tools for the list of available commands.

Update Nicla firmware

The procedure to update the firmware is the same for both bhi and Nicla. You just need to specify the target during the procedure.

Update procedure through BLE:

  • Follow these steps Control Nicla from a PC - web server.
  • Select DFU in the page located at http://localhost:8000/index.html - or directly go to http://localhost:8000/dfu.html.
  • Select the target (bhi or nicla).
  • Select the .bin firmware file.
  • Click on update and wait for the transfer to complete. Then, Nicla will reset and the firmware will be updated.

Update procedure through ESLOV:

  • Follow Control Nicla from a PC - command line tool
  • Execute the command ./bhy dfu -p YOUR_PORT -t TARGET -bin BIN_FILE
    • Replace YOUR_PORT with the serial port used by the arduino board
    • Replace TARGET with nicla or bhi
    • Replace BIN_FILE with the path of the binary file to be uploaded
  • Nicla will reset and the firmware will be updated

nicla-sense-me-fw's People

Contributors

giulcioffi avatar polldo avatar adbridge avatar 0xc0170 avatar aliphys avatar facchinm avatar lucasguocn avatar silvanocerza avatar c1728p9 avatar sebromero avatar umbynos avatar manchoz avatar mbedmain avatar per1234 avatar bstbud avatar cmonr avatar bridadan avatar alessandromrc avatar aentinger avatar evedon avatar gpsimenos avatar janjongboom avatar theotherjimmy avatar marcelosalazar avatar matteopologruto avatar sg- avatar ithinuel avatar youssif-am-saeed avatar amq avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.