Skip to content

Commit

Permalink
docs/ioc: add reccaster user-guide
Browse files Browse the repository at this point in the history
  • Loading branch information
minijackson committed Sep 4, 2024
1 parent 75afaf5 commit feb38c3
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/ioc/user-guides/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ User guides
./private-repo-setup.rst
./flake-registry.rst
./developing-modules.rst
./reccaster.rst
./mrf-devices.rst
./testing/index.rst

Expand Down
102 changes: 102 additions & 0 deletions docs/ioc/user-guides/reccaster.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
RecCaster configuration
=======================

RecCaster is an EPICS support module
that sends PV names and IOC metadata to a "RecCeiver" server.
This setup is often used to send such metadata to a ChannelFinder database.

.. seealso::

If you want to set up a RecCeiver and ChannelFinder server,
examine the guide
:doc:`../../nixos-services/user-guides/channel-finder`.

Configuration
-------------

To configure RecCaster,
first add it to your build environment:

.. code-block:: diff
:caption: :file:`flake.nix`
# Add your support modules here:
# ---
- #support.modules = with pkgs.epnix.support; [ StreamDevice mySupportModule ];
+ support.modules = with pkgs.epnix.support; [ reccaster ];
Make sure your app depends on the RecCaster library and DBD file:

.. code-block:: make
:caption: :file:`{example}App/src/Makefile`
# Replace "example" by the name of your application
example_DBD += reccaster.dbd
example_LIBS += reccaster
And load the RecCaster database:

.. code-block:: csh
:caption: :file:`iocBoot/ioc{Example}/st.cmd`
## Load RecCaster records
## Make sure to choose your prefix by setting the 'P' macro
dbLoadRecords("${RECCASTER}/db/reccaster.db", "P=YOUR-PV-PREFIX:")
This configuration is enough to start the RecCaster client.

.. note::

RecCaster doesn't need the address of the RecCeiver server.
The RecCeiver server scans for available IOCs on the network.

Firewall
--------

To accept connection from the RecCeiver service,
the firewall needs to allow the UDP announcert port,
which by default is 5049.

If your IOC is a NixOS machine,
you can open the firewall with this NixOS configuration:

.. code-block:: nix
:caption: Opening the firewall for RecCeiver
networking.firewall.allowedUDPPorts = [5049];
Checking synchronization status
-------------------------------

To check the RecCaster status of your IOC,
you can run:

.. code-block:: bash
# Replace 'YOUR-PV-PREFIX:' with your PV prefix
caget "YOUR-PV-PREFIX:Msg-I"
caget "YOUR-PV-PREFIX:State-Sts"
Adding IOC metadata
-------------------

You can choose to send more information to the RecCeiver server.

If you want to add metadata about the global IOC,
set it as environment variable
and expose it using the ``addReccasterEnvVars`` function.
For example:

.. code-block:: csh
:caption: :file:`iocBoot/ioc{Example}/st.cmd`
epicsEnvSet("CONTACT", "mycontact")
addReccasterEnvVars("CONTACT")
Make sure those environment variables are forwarded in RecCeiver.
See the RecCeiver guide's :ref:`recceiver-custom-metadata`.

For more information about what information RecCaster sends to the server,
examine the `RecSync README`_.

.. _RecSync README: https://github.com/ChannelFinder/recsync?tab=readme-ov-file#information-uploaded

0 comments on commit feb38c3

Please sign in to comment.