.. _ei_data_forwarder_sample: Edge Impulse: Data forwarder ############################ .. contents:: :local: :depth: 2 .. note:: Starting from the |EAI| release v2.2.0, this sample is deprecated and will be removed in a future |EAI| release. It is recommended to base your application on the :ref:`data_forwarder_sample`, which also supports the format accepted by `Edge Impulse's data forwarder`_. The Edge Impulse data forwarder sample demonstrates the usage of `Edge Impulse's data forwarder`_ to provide sensor data to `Edge Impulse studio`_ when :ref:`Integrating Edge Impulse with the nRF Connect SDK `. The sample forwards simulated accelerometer data generated by `Simulated sensor driver`_. Requirements ************ The sample supports the following development kits: .. table-from-sample-yaml:: Overview ******** The sample periodically performs the following operations: * Reads data from sensor. The sample reads simulated acceleration measurements for X, Y, and Z axes. * Forwards the data through UART using the protocol specified by `Edge Impulse's data forwarder`_. .. note:: The sample uses 2 separate UARTs to forward the sensor data and to provide console output (logs) at the same time. See `Edge Impulse`_ website for more information about the Edge Impulse platform. Configuration ************* |config| Setup ===== Before running the sample, you must complete the following steps: 1. :ref:`Set up Edge Impulse `. #. Prepare your own project using `Edge Impulse studio`_ external web tool. See :ref:`edge_impulse_integration` for more information about starting using the tool. Building and running ******************** .. |sample path| replace:: :file:`samples/edge_impulse/data_forwarder` Testing ======= |test_sample| 1. |connect_kit| #. |connect_terminal_kit| Connect to the serial device printing console output. It can be identified by output similar to the following: .. parsed-literal:: :class: highlight \*\*\* Booting nRF Connect SDK v3.2.0-5dcc6bd39b0f \*\*\* \*\*\* Using Zephyr OS v4.2.99-a57ad913cf4e \*\*\* The other UART port is used to forward the sensor data. Do not leave it open in a terminal application, as it will interfere with ``edge-impulse-data-forwarder``. This UART device can be identified by output similar to the following: .. parsed-literal:: :class: highlight 1.28,1.28,1.28 2.53,2.53,2.53 3.77,3.77,3.77 5.00,5.00,5.00 6.20,6.20,6.20 7.39,7.39,7.39 8.54,8.54,8.54 9.66,9.66,9.66 10.74,10.74,10.74 11.78,11.78,11.78 12.77,12.77,12.77 13.71,13.71,13.71 #. Run the ``edge-impulse-data-forwarder`` command line tool. The tool connects the device to your Edge Impulse project. When prompted about UART port, provide the port on which the sensor data is forwarded, not the one containing console logs. See `Edge Impulse's data forwarder`_ documentation for a guide. #. Trigger sampling data from the device using Edge Impulse studio: a. Go to the :guilabel:`Data acquisition` tab. #. In the **Collect data** panel, set the desired values and click :guilabel:`Start sampling`. .. figure:: ../../../../../samples/edge_impulse/data_forwarder/images/ei_data_acquisition.png :scale: 80 % :alt: Sampling under Data acquisition in Edge Impulse studio Sampling under Data acquisition in Edge Impulse studio #. Observe the received sample data on the raw data graph under the panel. For the default sample configuration, you should observe sine waves. .. figure:: ../../../../../samples/edge_impulse/data_forwarder/images/ei_start_sampling.png :scale: 80 % :alt: Sampling example Sampling example Dependencies ************ This sample uses the following |NCS| drivers: * `Simulated sensor driver`_ In addition, it uses the following Zephyr drivers: * UART driver