diff --git a/boards/beagleplay/05-demos.rst b/boards/beagleplay/05-demos.rst index 682c356b5aa97c5ac7b2756dc11732ced884a3d1..39ee1d933d42de3728f6223abaa714c563fa6153 100644 --- a/boards/beagleplay/05-demos.rst +++ b/boards/beagleplay/05-demos.rst @@ -65,6 +65,18 @@ Demos and tutorials beginner + .. card:: + :link: beagleplay-nodered + :link-type: ref + + **Using NodeRed** + ^^^ + Learn how to use NodeRed with BeaglePlay for rapid and easy prototyping. + +++ + .. admonition:: Complexity level + + beginner + .. card:: :link: beagleplay-rtc :link-type: ref @@ -173,4 +185,4 @@ Demos and tutorials demos-and-tutorials/beagleplay-kernel-development demos-and-tutorials/greybus-host demos-and-tutorials/understanding-boot - demos-and-tutorials/low-power-video-doorbell + demos-and-tutorials/using-nodered diff --git a/boards/beagleplay/demos-and-tutorials/beagleplay-kernel-development.rst b/boards/beagleplay/demos-and-tutorials/beagleplay-kernel-development.rst index bb88c2c0d9422bf662dd203d9ab17bbf3e44ead6..58053b55764435b3240d5752f9f2ccf030e9cdae 100644 --- a/boards/beagleplay/demos-and-tutorials/beagleplay-kernel-development.rst +++ b/boards/beagleplay/demos-and-tutorials/beagleplay-kernel-development.rst @@ -151,8 +151,6 @@ on `debugging with JTAG in CCS <https://www.ti.com/video/3874392631001?keyMatch= References ********** -- To understand more about booting code on BeaglePlay, see :ref:`beagleplay-understanding-boot`. - - For more details on the Linux kernel build system, see `The kernel build system <https://www.kernel.org/doc/html/latest/kbuild/index.html>`_ on kernel.org. - For additional guidance, see the `official TI-SDK documentation for AM62X <https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/latest/exports/docs/linux/Foundational_Components_Kernel_Users_Guide.html>`_ diff --git a/boards/beagleplay/demos-and-tutorials/iio_info_out.png b/boards/beagleplay/demos-and-tutorials/iio_info_out.png new file mode 100644 index 0000000000000000000000000000000000000000..fe5e8dd73497b87069f5fc3c0bc7a2a946b16806 Binary files /dev/null and b/boards/beagleplay/demos-and-tutorials/iio_info_out.png differ diff --git a/boards/beagleplay/demos-and-tutorials/nodered-base-flow-output.png b/boards/beagleplay/demos-and-tutorials/nodered-base-flow-output.png new file mode 100644 index 0000000000000000000000000000000000000000..95aa18bfa8fd696910e9a3c211829da5b4240580 Binary files /dev/null and b/boards/beagleplay/demos-and-tutorials/nodered-base-flow-output.png differ diff --git a/boards/beagleplay/demos-and-tutorials/nodered-base-flow.png b/boards/beagleplay/demos-and-tutorials/nodered-base-flow.png new file mode 100644 index 0000000000000000000000000000000000000000..d4a1abd9edecaa7a041c24ad772e8a9a3e31cf16 Binary files /dev/null and b/boards/beagleplay/demos-and-tutorials/nodered-base-flow.png differ diff --git a/boards/beagleplay/demos-and-tutorials/nodered-complete-gauges-flow.png b/boards/beagleplay/demos-and-tutorials/nodered-complete-gauges-flow.png new file mode 100644 index 0000000000000000000000000000000000000000..06440c3340422bc848012d90b3ec3a127a3f1fc5 Binary files /dev/null and b/boards/beagleplay/demos-and-tutorials/nodered-complete-gauges-flow.png differ diff --git a/boards/beagleplay/demos-and-tutorials/nodered-debug-logs.png b/boards/beagleplay/demos-and-tutorials/nodered-debug-logs.png new file mode 100644 index 0000000000000000000000000000000000000000..908471592a9f98bcb814287f0d43c17fdba106ea Binary files /dev/null and b/boards/beagleplay/demos-and-tutorials/nodered-debug-logs.png differ diff --git a/boards/beagleplay/demos-and-tutorials/using-nodered.rst b/boards/beagleplay/demos-and-tutorials/using-nodered.rst new file mode 100644 index 0000000000000000000000000000000000000000..9820c2c54c002c6741b02165a6f399df74ad78e9 --- /dev/null +++ b/boards/beagleplay/demos-and-tutorials/using-nodered.rst @@ -0,0 +1,117 @@ +.. _beagleplay-nodered: + +Using Node-RED +############## + +Node-RED provides a browser-based editor that makes it easy to wire together +flows using the wide range of nodes in the palette that can be deployed to +its runtime in a single-click. + +.. youtube:: 2llY2ZnTmnw + +Pre-requisites +************** + +.. note:: + If you're using the official BeaglePlay debian image then you most likely + can skip the :ref:`beagleplay-install-nodered` step. + +.. _beagleplay-install-nodered: + +Node-RED +******** + +Node-RED is pre-installed with the bb-node-red-installer package. (both xfce and cinnamon) +Manual steps to install Node-RED can be found in the `official guide +here <https://nodered.org/docs/getting-started/beaglebone>`_ + +MikroE +******** + +MikroE `Accel click <https://www.mikroe.com/accel-click>`_ is recommended, but many other boards +can work. More information about the mikroBUS interface can be found +`here <https://docs.beagleboard.org/boards/beagleplay/demos-and-tutorials/using-mikrobus.html>`_. + +Let's get started! +******************** + +First, we want to make sure the mikroBUSâ„¢ add-on board is connected and functioning as expected. +To do this, we make use of the `iio_info command <https://man.archlinux.org/man/iio_info.1.en>`_. + +Connecting mikroBUSâ„¢ add-on board +================================== + +``iio_info`` is a utility for displaying information about local or remote IIO devices, in +this case it's the `Accel click board <https://www.mikroe.com/accel-click>`_. + +.. figure:: ./iio_info_out.png + :width: 1040 + :align: center + + iio_info command output + +Accessing Node-RED +==================== + +Once your BeaglePlay is booted up and connected to your computer, access it from your browser by typing +``192.168.7.2:1880`` in your address bar. Learn more about remote browser in :ref:`start-browse-to-beagle`. + +Creating a basic flow +===================== + +In this flow we'll take a look at how we can get the accelerometer readings output on the node +red console. + +First, let's insert the exec function block. This will help us capture a linux command from +an entry like ``/sys/bus/iio/...``. + +Double click on the function block and in the command paste: + +.. code-block:: bash + + cat /sys/bus/iio/devices/iio\:device0.../in_accel_x_raw + +Give it some name and press Done. + +Next, we add the "Debug" node and connect it to the previous function block we made +to get the output. + +Optionally, as shown in the video we can also "Inject" a timestamp into the +function block which will then go into the debug console to give us the logs +with timestamps. + +.. figure:: ./nodered-debug-logs.png + :width: 1040 + :align: center + + Node-RED debug logs + +Adding a Gauge +============== + +.. figure:: ./nodered-base-flow.png + :width: 1040 + :align: center + + Node-RED base flow + +.. figure:: ./nodered-base-flow-output.png + :width: 400 + :align: center + + Node-RED base flow output + +Adding a Graph and 3 Axis +========================= + +.. todo:: + + * Add flow diagram + * * Show the output + +.. figure:: ./nodered-complete-gauges-flow.png + :width: 1040 + :align: center + + Node-RED complete gauges flow +