openc3-cosmos-tool-docs 6.2.1 → 6.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. checksums.yaml +4 -4
  2. data/tools/staticdocs/404.html +1 -1
  3. data/tools/staticdocs/assets/images/cosmos-containers-7ecd745840fcff307f0fec01ac4d88a8fa76d531abeae407fee0e508f50a487c.png +0 -0
  4. data/tools/staticdocs/assets/images/cosmos-images-8e15c197653ac3a1f39e8c5eaa56155f364e67d87d66647cff1355b960093af1.png +0 -0
  5. data/tools/staticdocs/assets/images/horizontalbox-085c91cebe26fdd5f85b467556607dd4631da5bccabd84fb164d1f46e45e60c9.png +0 -0
  6. data/tools/staticdocs/assets/images/verticalbox-75738427d398302986b52afb373acef11abf3a24f60d20b8cca442688054b22b.png +0 -0
  7. data/tools/staticdocs/assets/js/1e02e6a3.12bdc98d.js +1 -0
  8. data/tools/staticdocs/assets/js/2bb7bf90.1772f030.js +1 -0
  9. data/tools/staticdocs/assets/js/35398c5c.fcf47881.js +1 -0
  10. data/tools/staticdocs/assets/js/411898ad.f7b3ff17.js +1 -0
  11. data/tools/staticdocs/assets/js/5b233ba7.9d6ba314.js +1 -0
  12. data/tools/staticdocs/assets/js/5bc719f6.6d27292c.js +1 -0
  13. data/tools/staticdocs/assets/js/5c6ce5ec.652b922b.js +1 -0
  14. data/tools/staticdocs/assets/js/6831b732.1318b398.js +1 -0
  15. data/tools/staticdocs/assets/js/696b4199.1e950fcb.js +1 -0
  16. data/tools/staticdocs/assets/js/6b210247.6a77064a.js +1 -0
  17. data/tools/staticdocs/assets/js/6f92e431.6439052e.js +1 -0
  18. data/tools/staticdocs/assets/js/75e64983.324643a8.js +1 -0
  19. data/tools/staticdocs/assets/js/{7f5b2696.72e3b019.js → 7f5b2696.a3dc640e.js} +1 -1
  20. data/tools/staticdocs/assets/js/867640d5.27d9d599.js +1 -0
  21. data/tools/staticdocs/assets/js/89e76475.e1b0dbdb.js +1 -0
  22. data/tools/staticdocs/assets/js/{9424f0b3.96e6dac4.js → 9424f0b3.3683501c.js} +1 -1
  23. data/tools/staticdocs/assets/js/964eb012.0e04c58d.js +1 -0
  24. data/tools/staticdocs/assets/js/97535711.e595488c.js +1 -0
  25. data/tools/staticdocs/assets/js/99581c43.841b4a2e.js +1 -0
  26. data/tools/staticdocs/assets/js/9d6e81d0.36405219.js +1 -0
  27. data/tools/staticdocs/assets/js/a677c089.cfa50691.js +1 -0
  28. data/tools/staticdocs/assets/js/a9987364.b418f772.js +1 -0
  29. data/tools/staticdocs/assets/js/a9b2dc27.805dc1ba.js +1 -0
  30. data/tools/staticdocs/assets/js/aa6b6c1b.ef9b0f38.js +1 -0
  31. data/tools/staticdocs/assets/js/b062d239.57d6e194.js +1 -0
  32. data/tools/staticdocs/assets/js/b6d70f94.a9228642.js +1 -0
  33. data/tools/staticdocs/assets/js/c24eae19.0575c394.js +1 -0
  34. data/tools/staticdocs/assets/js/ce89ef36.6b89b0fe.js +1 -0
  35. data/tools/staticdocs/assets/js/d1b923aa.da892cde.js +1 -0
  36. data/tools/staticdocs/assets/js/d66bf9c0.80a50660.js +1 -0
  37. data/tools/staticdocs/assets/js/{d8ca4191.f5da7c6d.js → d8ca4191.8df86c99.js} +1 -1
  38. data/tools/staticdocs/assets/js/d9b92eba.5db8667e.js +1 -0
  39. data/tools/staticdocs/assets/js/db8fa1d0.f1eed806.js +1 -0
  40. data/tools/staticdocs/assets/js/main.a8e2c06c.js +36 -0
  41. data/tools/staticdocs/assets/js/runtime~main.7102cb65.js +1 -0
  42. data/tools/staticdocs/docs/configuration/accessors.html +4 -3
  43. data/tools/staticdocs/docs/configuration/command.html +1 -1
  44. data/tools/staticdocs/docs/configuration/format.html +1 -1
  45. data/tools/staticdocs/docs/configuration/interfaces.html +15 -4
  46. data/tools/staticdocs/docs/configuration/plugins.html +5 -5
  47. data/tools/staticdocs/docs/configuration/protocols.html +7 -6
  48. data/tools/staticdocs/docs/configuration/ssl-tls.html +115 -76
  49. data/tools/staticdocs/docs/configuration/table.html +1 -1
  50. data/tools/staticdocs/docs/configuration/target.html +1 -1
  51. data/tools/staticdocs/docs/configuration/telemetry-screens.html +5 -5
  52. data/tools/staticdocs/docs/configuration/telemetry.html +1 -1
  53. data/tools/staticdocs/docs/configuration.html +1 -1
  54. data/tools/staticdocs/docs/development/curl.html +4 -4
  55. data/tools/staticdocs/docs/development/developing.html +2 -2
  56. data/tools/staticdocs/docs/development/json-api.html +1 -1
  57. data/tools/staticdocs/docs/development/log-structure.html +1 -1
  58. data/tools/staticdocs/docs/development/roadmap.html +20 -29
  59. data/tools/staticdocs/docs/development/streaming-api.html +88 -2
  60. data/tools/staticdocs/docs/development/testing.html +5 -2
  61. data/tools/staticdocs/docs/development.html +1 -1
  62. data/tools/staticdocs/docs/getting-started/cli.html +47 -0
  63. data/tools/staticdocs/docs/getting-started/generators.html +3 -3
  64. data/tools/staticdocs/docs/getting-started/gettingstarted.html +2 -2
  65. data/tools/staticdocs/docs/getting-started/installation.html +3 -3
  66. data/tools/staticdocs/docs/getting-started/{key_concepts.html → key-concepts.html} +10 -6
  67. data/tools/staticdocs/docs/getting-started/podman.html +2 -2
  68. data/tools/staticdocs/docs/getting-started/requirements.html +2 -2
  69. data/tools/staticdocs/docs/getting-started/upgrading.html +3 -3
  70. data/tools/staticdocs/docs/getting-started.html +1 -1
  71. data/tools/staticdocs/docs/guides/bridges.html +1 -1
  72. data/tools/staticdocs/docs/guides/cfs.html +12 -12
  73. data/tools/staticdocs/docs/guides/custom-widgets.html +2 -2
  74. data/tools/staticdocs/docs/guides/dynamic-packets.html +17 -0
  75. data/tools/staticdocs/docs/guides/{exposing_microservices.html → exposing-microservices.html} +5 -5
  76. data/tools/staticdocs/docs/guides/little-endian-bitfields.html +2 -2
  77. data/tools/staticdocs/docs/guides/local-mode.html +1 -1
  78. data/tools/staticdocs/docs/guides/logging.html +1 -1
  79. data/tools/staticdocs/docs/guides/monitoring.html +1 -1
  80. data/tools/staticdocs/docs/guides/performance.html +6 -6
  81. data/tools/staticdocs/docs/guides/raspberrypi.html +1 -1
  82. data/tools/staticdocs/docs/guides/script-writing.html +1 -1
  83. data/tools/staticdocs/docs/guides/scripting-api.html +86 -17
  84. data/tools/staticdocs/docs/guides.html +1 -1
  85. data/tools/staticdocs/docs/meta/contributing.html +1 -1
  86. data/tools/staticdocs/docs/meta/licenses.html +8 -8
  87. data/tools/staticdocs/docs/meta/philosophy.html +2 -2
  88. data/tools/staticdocs/docs/meta/xtce.html +1 -1
  89. data/tools/staticdocs/docs/meta.html +1 -1
  90. data/tools/staticdocs/docs/privacy.html +1 -1
  91. data/tools/staticdocs/docs/tools/admin.html +1 -1
  92. data/tools/staticdocs/docs/tools/autonomic.html +1 -1
  93. data/tools/staticdocs/docs/tools/bucket-explorer.html +2 -2
  94. data/tools/staticdocs/docs/tools/calendar.html +1 -1
  95. data/tools/staticdocs/docs/tools/cmd-sender.html +1 -1
  96. data/tools/staticdocs/docs/tools/cmd-tlm-server.html +1 -1
  97. data/tools/staticdocs/docs/tools/command_history.html +1 -1
  98. data/tools/staticdocs/docs/tools/data-extractor.html +1 -1
  99. data/tools/staticdocs/docs/tools/data-viewer.html +1 -1
  100. data/tools/staticdocs/docs/tools/handbooks.html +1 -1
  101. data/tools/staticdocs/docs/tools/limits-monitor.html +1 -1
  102. data/tools/staticdocs/docs/tools/packet-viewer.html +1 -1
  103. data/tools/staticdocs/docs/tools/script-runner.html +1 -1
  104. data/tools/staticdocs/docs/tools/table-manager.html +1 -1
  105. data/tools/staticdocs/docs/tools/tlm-grapher.html +1 -1
  106. data/tools/staticdocs/docs/tools/tlm-viewer.html +1 -1
  107. data/tools/staticdocs/docs/tools.html +1 -1
  108. data/tools/staticdocs/docs.html +1 -1
  109. data/tools/staticdocs/img/cosmos-containers.png +0 -0
  110. data/tools/staticdocs/img/cosmos-images.png +0 -0
  111. data/tools/staticdocs/img/telemetry_viewer/widgets/horizontalbox.png +0 -0
  112. data/tools/staticdocs/img/telemetry_viewer/widgets/verticalbox.png +0 -0
  113. data/tools/staticdocs/index.html +1 -1
  114. data/tools/staticdocs/lunr-index-1746647301890.json +1 -0
  115. data/tools/staticdocs/lunr-index.json +1 -1
  116. data/tools/staticdocs/markdown-page.html +1 -1
  117. data/tools/staticdocs/search-doc-1746647301890.json +1 -0
  118. data/tools/staticdocs/search-doc.json +1 -1
  119. data/tools/staticdocs/sitemap.xml +1 -1
  120. metadata +50 -45
  121. data/tools/staticdocs/assets/images/horizontalbox-ddf82f64de700286a742a71e0c1adebbc7e9822a0dff41139f41bc476e4fc4ce.png +0 -0
  122. data/tools/staticdocs/assets/images/verticalbox-28fdba6f2c051a499b7f08a1be97edf0297ac9a9ce0dba44f02a7fe1c2616d91.png +0 -0
  123. data/tools/staticdocs/assets/js/1e02e6a3.f477eca7.js +0 -1
  124. data/tools/staticdocs/assets/js/2bb7bf90.4051cf46.js +0 -1
  125. data/tools/staticdocs/assets/js/31436304.a6b2eb4a.js +0 -1
  126. data/tools/staticdocs/assets/js/411898ad.f7fc4d80.js +0 -1
  127. data/tools/staticdocs/assets/js/5b233ba7.2ea0179c.js +0 -1
  128. data/tools/staticdocs/assets/js/5bc719f6.b84c55e3.js +0 -1
  129. data/tools/staticdocs/assets/js/5c6ce5ec.67d1d92e.js +0 -1
  130. data/tools/staticdocs/assets/js/6831b732.0a867cbc.js +0 -1
  131. data/tools/staticdocs/assets/js/696b4199.2a7ff897.js +0 -1
  132. data/tools/staticdocs/assets/js/6b210247.ef28d4e5.js +0 -1
  133. data/tools/staticdocs/assets/js/6f92e431.d2ce2753.js +0 -1
  134. data/tools/staticdocs/assets/js/75e64983.81988bef.js +0 -1
  135. data/tools/staticdocs/assets/js/867640d5.2c0fa6d9.js +0 -1
  136. data/tools/staticdocs/assets/js/89e76475.a76d0072.js +0 -1
  137. data/tools/staticdocs/assets/js/97535711.78660098.js +0 -1
  138. data/tools/staticdocs/assets/js/99581c43.5e55992d.js +0 -1
  139. data/tools/staticdocs/assets/js/9d6e81d0.44e2d544.js +0 -1
  140. data/tools/staticdocs/assets/js/a677c089.18f98b70.js +0 -1
  141. data/tools/staticdocs/assets/js/a9987364.81e9c91d.js +0 -1
  142. data/tools/staticdocs/assets/js/aa6b6c1b.08f58887.js +0 -1
  143. data/tools/staticdocs/assets/js/b6d70f94.7813125e.js +0 -1
  144. data/tools/staticdocs/assets/js/c24eae19.aaae7796.js +0 -1
  145. data/tools/staticdocs/assets/js/ce89ef36.1d76e86a.js +0 -1
  146. data/tools/staticdocs/assets/js/d1b923aa.a73e7e79.js +0 -1
  147. data/tools/staticdocs/assets/js/d66bf9c0.842d2efa.js +0 -1
  148. data/tools/staticdocs/assets/js/d9b92eba.34e63ba6.js +0 -1
  149. data/tools/staticdocs/assets/js/db8fa1d0.94b76b52.js +0 -1
  150. data/tools/staticdocs/assets/js/ebec1ccb.f938ebaa.js +0 -1
  151. data/tools/staticdocs/assets/js/main.485b7747.js +0 -36
  152. data/tools/staticdocs/assets/js/runtime~main.61a578da.js +0 -1
  153. data/tools/staticdocs/lunr-index-1741317069195.json +0 -1
  154. data/tools/staticdocs/search-doc-1741317069195.json +0 -1
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["3649"],{4016:function(e,n,t){t.r(n),t.d(n,{default:()=>h,frontMatter:()=>c,metadata:()=>i,assets:()=>a,toc:()=>l,contentTitle:()=>r});var i=JSON.parse('{"id":"guides/cfs","title":"COSMOS and NASA cFS","description":"Tutorial for integrating with NASA cFS","source":"@site/docs/guides/cfs.md","sourceDirName":"guides","slug":"/guides/cfs","permalink":"/tools/staticdocs/docs/guides/cfs","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/guides/cfs.md","tags":[],"version":"current","frontMatter":{"title":"COSMOS and NASA cFS","description":"Tutorial for integrating with NASA cFS","sidebar_custom_props":{"myEmoji":"\uD83D\uDE80"}},"sidebar":"defaultSidebar","previous":{"title":"Bridges","permalink":"/tools/staticdocs/docs/guides/bridges"},"next":{"title":"Custom Widgets","permalink":"/tools/staticdocs/docs/guides/custom-widgets"}}'),s=t("2322"),o=t("2840");let c={title:"COSMOS and NASA cFS",description:"Tutorial for integrating with NASA cFS",sidebar_custom_props:{myEmoji:"\uD83D\uDE80"}},r=void 0,a={},l=[{value:"Working configuration",id:"working-configuration",level:2},{value:"Setting up COSMOS",id:"setting-up-cosmos",level:2},{value:"Configuring COSMOS",id:"configuring-cosmos",level:3},{value:"Setting up cFS",id:"setting-up-cfs",level:2},{value:"Clone cFS",id:"clone-cfs",level:3},{value:"Create Dockerfile in cFS dir",id:"create-dockerfile-in-cfs-dir",level:3},{value:"Build and run cFS",id:"build-and-run-cfs",level:3},{value:"Creating a COSMOS plugin for TM/TC interface with cFS",id:"creating-a-cosmos-plugin-for-tmtc-interface-with-cfs",level:2},{value:"Creating TM/TC definitions",id:"creating-tmtc-definitions",level:2},{value:"Uploading the plugin",id:"uploading-the-plugin",level:2}];function d(e){let n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",ul:"ul",...(0,o.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h2,{id:"working-configuration",children:"Working configuration"}),"\n",(0,s.jsx)(n.p,{children:"This tutorial has been tested using the following components:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["COSMOS v5 release ",(0,s.jsx)(n.a,{href:"https://github.com/OpenC3/cosmos/releases/tag/v5.0.6",children:"5.0.6"})]}),"\n",(0,s.jsx)(n.li,{children:"cFS master-branch commit: 561b128 (June 1, 2022)"}),"\n",(0,s.jsx)(n.li,{children:"Docker Desktop 4.9.0 on Windows"}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["Replace all ",(0,s.jsx)(n.code,{children:"<xxxxxx>"})," with your matching paths and names. Example: ",(0,s.jsx)(n.code,{children:"<USERNAME>"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"setting-up-cosmos",children:"Setting up COSMOS"}),"\n",(0,s.jsxs)(n.p,{children:["Install COSMOS according to the official ",(0,s.jsx)(n.a,{href:"/tools/staticdocs/docs/getting-started/installation",children:"installation"})," instructions."]}),"\n",(0,s.jsx)(n.h3,{id:"configuring-cosmos",children:"Configuring COSMOS"}),"\n",(0,s.jsxs)(n.p,{children:["Change the Docker configuration for the interoperability with NASA cFS. For\nsubscribing to the telemetry, you have to append a port binding in the file\n",(0,s.jsx)(n.code,{children:"compose.yaml"})," under the section ",(0,s.jsx)(n.code,{children:"openc3-operator"}),". The port number has to\nmatch with the port number cFS is sending the telemetry on."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-yaml",children:'openc3-operator:\n ports:\n - "1235:1235/udp"\n'})}),"\n",(0,s.jsx)(n.p,{children:"Run COSMOS, the first run takes a while (~15 min)."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"openc3.sh start\n"})}),"\n",(0,s.jsxs)(n.p,{children:["When started, connect with a browser to ",(0,s.jsx)(n.a,{href:"http://localhost:2900",children:"http://localhost:2900"}),"."]}),"\n",(0,s.jsx)(n.p,{children:"For shutting down COSMOS:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"openc3.sh stop\n"})}),"\n",(0,s.jsx)(n.h2,{id:"setting-up-cfs",children:"Setting up cFS"}),"\n",(0,s.jsxs)(n.p,{children:["To run ",(0,s.jsx)(n.a,{href:"https://github.com/nasa/cFS",children:"NASA cFS"})," as a Docker container do the following:"]}),"\n",(0,s.jsx)(n.h3,{id:"clone-cfs",children:"Clone cFS"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"git clone --recurse-submodules https://github.com/nasa/cFS.git\n"})}),"\n",(0,s.jsx)(n.h3,{id:"create-dockerfile-in-cfs-dir",children:"Create Dockerfile in cFS dir"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-docker",children:'FROM ubuntu:22.10 AS builder\n\nARG DEBIAN_FRONTEND=noninteractive\nARG SIMULATION=native\nENV SIMULATION=${SIMULATION}\nARG BUILDTYPE=debug\nENV BUILDTYPE=${BUILDTYPE}\nARG OMIT_DEPRECATED=true\nENV OMIT_DEPRECATED=${OMIT_DEPRECATED}\n\nRUN \\\n apt-get update && \\\n apt-get -y upgrade && \\\n apt-get install -y build-essential git cmake && \\\n rm -rf /var/lib/apt/lists/*\n\nWORKDIR /cFS\nCOPY . .\n\nRUN git submodule init \\\n && git submodule update \\\n && cp cfe/cmake/Makefile.sample Makefile \\\n && cp -r cfe/cmake/sample_defs .\n\nRUN make prep\nRUN make\nRUN make install\n\nFROM ubuntu:22.10\nCOPY --from=builder /cFS/build /cFS/build\nWORKDIR /cFS/build/exe/cpu1\nENTRYPOINT [ "./core-cpu1" ]\n'})}),"\n",(0,s.jsx)(n.h3,{id:"build-and-run-cfs",children:"Build and run cFS"}),"\n",(0,s.jsxs)(n.p,{children:["Note we're connecting to the COSMOS network (",(0,s.jsx)(n.code,{children:"docker network ls"}),") and exposing the cFS ports."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"docker build -t cfs .\ndocker run --cap-add CAP_SYS_RESOURCE --net=openc3-cosmos-network --name cfs -p1234:1234/udp -p1235:1235 cfs\n"})}),"\n",(0,s.jsx)(n.h2,{id:"creating-a-cosmos-plugin-for-tmtc-interface-with-cfs",children:"Creating a COSMOS plugin for TM/TC interface with cFS"}),"\n",(0,s.jsxs)(n.p,{children:["The detailed instructions how to create a plugin, can be found\n",(0,s.jsx)(n.a,{href:"/tools/staticdocs/docs/getting-started/gettingstarted",children:"here"}),', in the chapter "Interfacing with Your Hardware".']}),"\n",(0,s.jsxs)(n.p,{children:["Create a new plugin with the name ",(0,s.jsx)(n.code,{children:"CFS"}),". ",(0,s.jsx)(n.code,{children:"CFS"})," is the name of the plugin and\nmust be in capital letters according to the COSMOS documentation. This command\nshould create the plugin structure. Then cd into the plugin to create the target."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"# cd .. to the location of the cfs dir\n$PATH_TO_OPENC3/openc3.sh cli generate plugin CFS\ncd openc3-cosmos-cfs\n$PATH_TO_OPENC3/openc3.sh cli generate target CFS\n"})}),"\n",(0,s.jsxs)(n.p,{children:["In this newly created plugin, change the ",(0,s.jsx)(n.code,{children:"plugin.txt"})," file, so that the\ncommunication happens over UDP. ",(0,s.jsx)(n.code,{children:"port_tm"})," is the port number on which cFS\nsends the telemetry messages. ",(0,s.jsx)(n.code,{children:"port_tc"})," indicates the port on which cFS listens to the\ntelecommands."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:"VARIABLE ip 127.0.0.1\nVARIABLE port_tm 1235\nVARIABLE port_tc 1234\nVARIABLE cfs_target_name CFS\n\nTARGET CFS <%= cfs_target_name %>\n# hostname write_dest_port read_port write_src_port interface_address ttl write_timeout read_timeout bind_address\nINTERFACE <%= cfs_target_name %>_INT udp_interface.rb <%= ip %> <%= port_tc %> <%= port_tm %> nil nil 128 nil nil\n MAP_TARGET <%= cfs_target_name %>\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Note that the two arguments to the ",(0,s.jsx)(n.code,{children:"TARGET"})," parameter are:"]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["the physical target name that should match the name of the plugin, i.e. ",(0,s.jsx)(n.code,{children:"CFS"}),".\nThis name must match the folder name in the ",(0,s.jsx)(n.code,{children:"targets"})," folder. Example: for the\n",(0,s.jsx)(n.code,{children:"CFS"})," plugin, the target specifications must be under\n",(0,s.jsx)(n.code,{children:"openc3-cfs/targets/CFS"}),". If you don't follow this\nconvention, the server will refuse to install your plugin at the following steps."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"the name of your target and how it is shown in the user interface."}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["In this example, we keep both names to be ",(0,s.jsx)(n.code,{children:"CFS"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"creating-tmtc-definitions",children:"Creating TM/TC definitions"}),"\n",(0,s.jsx)(n.p,{children:"Change to the target folder and remove the existing files and create own files."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"cd openc3-cfs/targets/CFS/cmd_tlm\nrm *\ntouch cfs_cmds.txt\ntouch cfs_tlm.txt\ntouch to_lab_cmds.txt\n"})}),"\n",(0,s.jsx)(n.p,{children:"Open these newly created files in a text editor and fill them with following\ncontent."}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.code,{children:"to_lab_cmds.txt"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'COMMAND CFS TO_LAB_ENABLE BIG_ENDIAN "Enable telemetry"\n # NAME BITS TYPE min VAL max VAL init VAL DESCRIPTION\n APPEND_ID_PARAMETER STREAM_ID 16 UINT 0x1880 0x1880 0x1880 "Stream ID"\n FORMAT_STRING "0x%04X"\n APPEND_PARAMETER SEQUENCE 16 UINT 0xC000 MAX_UINT16 0xC000 ""\n FORMAT_STRING "0x%04X"\n APPEND_PARAMETER PKT_LEN 16 UINT 0x0001 0xFFFF 0x0012 "length of the packet"\n APPEND_PARAMETER CMD_ID 8 UINT 6 6 6 ""\n APPEND_PARAMETER CHECKSUM 8 UINT MIN_UINT8 MAX_UINT8 0x98 ""\n FORMAT_STRING "0x%2X"\n APPEND_PARAMETER DEST_IP 144 STRING "127.0.0.1" "Destination IP, i.e. 172.16.9.112, pc-57"\n'})}),"\n",(0,s.jsx)(n.admonition,{title:"Enabling Telemetry",type:"info",children:(0,s.jsxs)(n.p,{children:["The command ",(0,s.jsx)(n.code,{children:"0x1880"})," is needed to enable telemetry. When the cFS receives\nthis command, it starts sending telemetry to the IP address provided via the\n",(0,s.jsx)(n.code,{children:"DEST_IP"})," field."]})}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.code,{children:"cfs_cmds.txt"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'COMMAND CFS NOOP BIG_ENDIAN "NOOP Command"\n # cFS primary header\n APPEND_ID_PARAMETER STREAM_ID 16 UINT 0x1882 0x1882 0x1882 "Packet Identification"\n FORMAT_STRING "0x%04X"\n APPEND_PARAMETER SEQUENCE 16 UINT MIN_UINT16 MAX_UINT16 0xC000 ""\n FORMAT_STRING "0x%04X"\n APPEND_PARAMETER PKT_LEN 16 UINT 0x0001 0x0001 0x0001 "Packet length"\n # cFS CMD secondary header\n APPEND_PARAMETER CMD_ID 8 UINT 0 0 0 ""\n APPEND_PARAMETER CHECKSUM 8 UINT MIN_UINT8 MAX_UINT8 MIN_UINT8 ""\n\nCOMMAND CFS RESET BIG_ENDIAN "Reset Counters Command"\n APPEND_ID_PARAMETER STREAM_ID 16 UINT 0x1882 0x1882 0x1882 "Packet Identification"\n FORMAT_STRING "0x%04X"\n APPEND_PARAMETER SEQUENCE 16 UINT MIN_UINT16 MAX_UINT16 0xC000 ""\n FORMAT_STRING "0x%04X"\n APPEND_PARAMETER PKT_LEN 16 UINT 0x0001 0x0001 0x0001 "Packet length"\n APPEND_PARAMETER CMD_ID 8 UINT 1 1 1 ""\n APPEND_PARAMETER CHECKSUM 8 UINT MIN_UINT8 MAX_UINT8 MIN_UINT8 ""\n\nCOMMAND CFS PROCESS BIG_ENDIAN "Process Command"\n APPEND_ID_PARAMETER STREAM_ID 16 UINT 0x1882 0x1882 0x1882 "Packet Identification"\n FORMAT_STRING "0x%04X"\n APPEND_PARAMETER SEQUENCE 16 UINT MIN_UINT16 MAX_UINT16 0xC000 ""\n FORMAT_STRING "0x%04X"\n APPEND_PARAMETER PKT_LEN 16 UINT 0x0001 0x0001 0x0001 "Packet length"\n APPEND_PARAMETER CMD_ID 8 UINT 2 2 2 ""\n APPEND_PARAMETER CHECKSUM 8 UINT MIN_UINT8 MAX_UINT8 MIN_UINT8 ""\n'})}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.code,{children:"cfs_tlm.txt"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'TELEMETRY CFS HK BIG_ENDIAN "housekeeping telemetry"\n # NAME BITS TYPE ID DESCRIPTION\n APPEND_ID_ITEM STREAM_ID 16 UINT 0x0883 "Stream ID"\n FORMAT_STRING "0x%04X"\n APPEND_ITEM SEQUENCE 16 UINT "Packet Sequence"\n FORMAT_STRING "0x%04X"\n APPEND_ITEM PKT_LEN 16 UINT "Length of the packet"\n # telemetry secondary header\n APPEND_ITEM SECONDS 32 UINT ""\n UNITS Seconds sec\n APPEND_ITEM SUBSECS 16 UINT ""\n UNITS Milliseconds ms\n # some bytes not known for what\n APPEND_ITEM SPARE2ALIGN 32 UINT "Spares"\n # payload\n APPEND_ITEM CMD_ERRS 8 UINT "Command Error Counter"\n APPEND_ITEM CMD_CNT 8 UINT "Command Counter"\n # spare / alignment\n APPEND_ITEM SPARE 16 UINT "Spares"\n'})}),"\n",(0,s.jsx)(n.p,{children:"Build the plugin from the base of your plugin folder:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"# cd openc3-cfs\n$PATH_TO_OPENC3/openc3.sh cli rake build VERSION=1.0.0\n"})}),"\n",(0,s.jsx)(n.admonition,{title:"Plugin versioning",type:"info",children:(0,s.jsx)(n.p,{children:"Do not forget to change the version number with every build if you want to\nbetter distinguish between the versions of the plugin. When the version is\nseen in the plugin's .gem file name, it is easier to visualize the existing\nversions and the newly uploaded versions."})}),"\n",(0,s.jsx)(n.admonition,{title:"Plugin parameters",type:"info",children:(0,s.jsxs)(n.p,{children:["Multiple parameters are available for the plugin configuration. See the ",(0,s.jsx)(n.a,{href:"/tools/staticdocs/docs/configuration/plugins",children:"plugin"})," page."]})}),"\n",(0,s.jsx)(n.h2,{id:"uploading-the-plugin",children:"Uploading the plugin"}),"\n",(0,s.jsx)(n.p,{children:"After the plugin has been built, you can import the plugin in the admin area of\nthe page."}),"\n",(0,s.jsxs)(n.p,{children:["Connect with a browser to\n",(0,s.jsx)(n.a,{href:"http://localhost:2900/tools/admin",children:"http://localhost:2900/tools/admin"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["Click on the clip icon and navigate to where your plugin is stored and select\nthe ",(0,s.jsx)(n.code,{children:"openc3-cosmos-cfs-1.0.0.gem"})," file. Right of the selection line click on ",(0,s.jsx)(n.code,{children:"UPLOAD"}),"."]}),"\n",(0,s.jsx)(n.p,{children:"Determine the IP address the cFS container and COSMOS operator container are running at:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:'docker network ls\nNETWORK ID NAME DRIVER SCOPE\nd842f813f1c7 openc3-cosmos-network bridge local\n\ndocker network inspect openc3-cosmos-network\n[\n {\n "Name": "openc3-cosmos-network",\n ...\n "Containers": {\n "03cb6bf1b27c631fad1366e9342aeaa5b80f458a437195e4a95e674bb5f5983d": {\n "Name": "cfs",\n "IPv4Address": "172.20.0.9/16",\n },\n "ceb9ea99b00849fd8867dcd1646838fef3471f7d64b69014703dbedbcc8147fc": {\n "Name": "openc3_openc3-operator_1",\n "IPv4Address": "172.20.0.8/16",\n }\n }\n ...\n }\n]\n'})}),"\n",(0,s.jsxs)(n.p,{children:["When using this plugin, make sure to change the ",(0,s.jsx)(n.code,{children:"ip"})," variable during uploading\nto match where cFS is running. In the example above you would set it to 172.20.0.9.\n",(0,s.jsx)(n.code,{children:"port_tm"})," is the port number on which cFS is sending the telemetry messages.\n",(0,s.jsx)(n.code,{children:"port_tc"})," indicates the port on cFS is listening for telecommands."]}),"\n",(0,s.jsxs)(n.p,{children:["Under ",(0,s.jsx)(n.code,{children:"cfs_target_name"})," you can change the target name of this plugin. This\nstep is optional as long as you are fine with your plugin showing up as ",(0,s.jsx)(n.code,{children:"CFS"}),"."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Plugin Variable Settings",src:t(3191).Z+"",width:"1183",height:"270"})}),"\n",(0,s.jsx)(n.admonition,{title:"Port subscription",type:"warning",children:(0,s.jsx)(n.p,{children:"The last uploaded plugin on COSMOS will subscribe to TM on port 1235.\nOther plugins will not receive any TM anymore."})}),"\n",(0,s.jsx)(n.admonition,{title:"Typo errors",type:"info",children:(0,s.jsx)(n.p,{children:"Presence of typos in one of the plugin files can cause problems when uploading and installing\nthe plugin's .gem file. Make sure your configuration is typo-free."})}),"\n",(0,s.jsxs)(n.p,{children:["In the example above, the operator image is running at 172.20.0.8. To enable telemetry, go to the browser and connect to\n",(0,s.jsx)(n.a,{href:"http://localhost:2900/tools/cmdsender/CFS/TO_LAB_ENABLE",children:"http://localhost:2900/tools/cmdsender/CFS/TO_LAB_ENABLE"}),". Change the ",(0,s.jsx)(n.code,{children:"DEST_IP"})," to the IP address of the operator image (172.20.0.8) and send the command."]}),"\n",(0,s.jsxs)(n.p,{children:["Under ",(0,s.jsx)(n.a,{href:"http://localhost:2900/tools/cmdtlmserver/tlm-packets",children:"http://localhost:2900/tools/cmdtlmserver/tlm-packets"}),", you should see the incoming packets. Note in the CmdTlmServer you will also see CFS_INT UNKNOWN packets because we did not define the full cFS packet set. That exercise is left to the reader."]})]})}function h(e={}){let{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},3191:function(e,n,t){t.d(n,{Z:function(){return i}});let i=t.p+"assets/images/plugin_variables-6904e1d9003a6c8c530bd1f738f7966217beca7d3064b40670e7a4ab7e200927.png"},2840:function(e,n,t){t.d(n,{Z:function(){return r},a:function(){return c}});var i=t(2784);let s={},o=i.createContext(s);function c(e){let n=i.useContext(o);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:c(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["4456"],{9779:function(e,t,o){o.r(t),o.d(t,{default:()=>u,frontMatter:()=>l,metadata:()=>n,assets:()=>c,toc:()=>a,contentTitle:()=>r});var n=JSON.parse('{"id":"tools/bucket-explorer","title":"Bucket Explorer","description":"File browser to the COSMOS backend bucket storage system","source":"@site/docs/tools/bucket-explorer.md","sourceDirName":"tools","slug":"/tools/bucket-explorer","permalink":"/tools/staticdocs/docs/tools/bucket-explorer","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/tools/bucket-explorer.md","tags":[],"version":"current","frontMatter":{"title":"Bucket Explorer","description":"File browser to the COSMOS backend bucket storage system","sidebar_custom_props":{"myEmoji":"\uD83D\uDEE0\uFE0F"}},"sidebar":"defaultSidebar","previous":{"title":"Autonomic (Enterprise)","permalink":"/tools/staticdocs/docs/tools/autonomic"},"next":{"title":"Calendar (Enterprise)","permalink":"/tools/staticdocs/docs/tools/calendar"}}'),s=o("2322"),i=o("2840");let l={title:"Bucket Explorer",description:"File browser to the COSMOS backend bucket storage system",sidebar_custom_props:{myEmoji:"\uD83D\uDEE0\uFE0F"}},r=void 0,c={},a=[{value:"Introduction",id:"introduction",level:2},{value:"Browsing Files",id:"browsing-files",level:2},{value:"Upload",id:"upload",level:3},{value:"Download",id:"download",level:3},{value:"Delete",id:"delete",level:3}];function d(e){let t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",p:"p",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h2,{id:"introduction",children:"Introduction"}),"\n",(0,s.jsx)(t.p,{children:"Bucket Explorer is a file browser to the COSMOS backend bucket storage system. It allows you to view files in an intuitive file browser hierarchy and download them. Bucket Explorer works both with local installations of COSMOS as well as cloud deployments which utilize cloud storage such as AWS S3 and GCP Cloud Storage."}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{alt:"Bucket Explorer",src:o(909).Z+"",width:"1271",height:"543"})}),"\n",(0,s.jsx)(t.h2,{id:"browsing-files",children:"Browsing Files"}),"\n",(0,s.jsxs)(t.p,{children:["At the top are the three standard COSMOS buckets: ",(0,s.jsx)(t.code,{children:"config"}),", ",(0,s.jsx)(t.code,{children:"logs"}),", and ",(0,s.jsx)(t.code,{children:"tools"}),". Each bucket contains top level folders named after the scope. In the Open Source edition the only scope is ",(0,s.jsx)(t.code,{children:"DEFAULT"}),". The ",(0,s.jsx)(t.code,{children:"config"})," bucket holds the COSMOS configuration which is populated as plugins are installed. The ",(0,s.jsx)(t.code,{children:"logs"})," bucket holds the COSMOS logs which are generated by the various COSMOS microservices (See ",(0,s.jsx)(t.a,{href:"/tools/staticdocs/docs/guides/logging",children:"Logging"})," for more info). These logs are gzipped to save storage space. The ",(0,s.jsx)(t.code,{children:"tools"})," bucket holds the source code for the built-in COSMOS tools as well as user created tools installed as plugins. Note that the search box only searches the current screen worth of files, e.g. it does not search the entire bucket."]}),"\n",(0,s.jsx)(t.admonition,{title:"Tools as Static Website",type:"note",children:(0,s.jsx)(t.p,{children:"Using bucket storage allows COSMOS to directly serve the tools as a static website and thus it must be a public bucket in cloud technology like S3"})}),"\n",(0,s.jsx)(t.h3,{id:"upload",children:"Upload"}),"\n",(0,s.jsxs)(t.p,{children:["Click the Upload icon to bring up a file browser to select a file to upload into the current bucket and path. Note that in ",(0,s.jsx)(t.a,{href:"https://openc3.com/enterprise",children:"COSMOS Enterprise"})," you can only upload files to the config/DEFAULT/targets_modified folder unless you're an Admin."]}),"\n",(0,s.jsx)(t.h3,{id:"download",children:"Download"}),"\n",(0,s.jsx)(t.p,{children:"Click the Download icon to download any of the individual files from any bucket and path."}),"\n",(0,s.jsx)(t.h3,{id:"delete",children:"Delete"}),"\n",(0,s.jsxs)(t.p,{children:["Click the Trash icon to delete an individual file. Note that in ",(0,s.jsx)(t.a,{href:"https://openc3.com/enterprise",children:"COSMOS Enterprise"})," you can only delete files in the config/DEFAULT/targets_modified folder unless you're an Admin."]})]})}function u(e={}){let{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},909:function(e,t,o){o.d(t,{Z:function(){return n}});let n=o.p+"assets/images/bucket_explorer-ba88a20121198c3441a6af5302ab1a6ad62a171661037e9e3bfd312ca8bdb5ef.png"},2840:function(e,t,o){o.d(t,{Z:function(){return r},a:function(){return l}});var n=o(2784);let s={},i=n.createContext(s);function l(e){let t=n.useContext(i);return n.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:l(e.components),n.createElement(i.Provider,{value:t},e.children)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["3824"],{7284:function(e,n,s){s.r(n),s.d(n,{default:()=>h,frontMatter:()=>r,metadata:()=>t,assets:()=>c,toc:()=>a,contentTitle:()=>l});var t=JSON.parse('{"id":"development/testing","title":"Testing COSMOS","description":"Running the Playwright integration tests and unit tests","source":"@site/docs/development/testing.md","sourceDirName":"development","slug":"/development/testing","permalink":"/tools/staticdocs/docs/development/testing","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/development/testing.md","tags":[],"version":"current","frontMatter":{"title":"Testing COSMOS","description":"Running the Playwright integration tests and unit tests","sidebar_custom_props":{"myEmoji":"\uD83D\uDCCB"}},"sidebar":"defaultSidebar","previous":{"title":"Streaming API","permalink":"/tools/staticdocs/docs/development/streaming-api"},"next":{"title":"Meta","permalink":"/tools/staticdocs/docs/meta"}}'),i=s("2322"),o=s("2840");let r={title:"Testing COSMOS",description:"Running the Playwright integration tests and unit tests",sidebar_custom_props:{myEmoji:"\uD83D\uDCCB"}},l=void 0,c={},a=[{value:"Playwright",id:"playwright",level:2},{value:"Prerequesits",id:"prerequesits",level:3},{value:"Playwright Testing",id:"playwright-testing",level:3},{value:"Ruby Unit Tests",id:"ruby-unit-tests",level:2},{value:"Python Unit Tests",id:"python-unit-tests",level:2}];function d(e){let n={code:"code",em:"em",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,o.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h2,{id:"playwright",children:"Playwright"}),"\n",(0,i.jsx)(n.h3,{id:"prerequesits",children:"Prerequesits"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Install Yarn"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"npm install --global yarn\n"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Clone the COSMOS Playwright repo"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"git clone https://github.com/OpenC3/cosmos-playwright\n"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Install Playwright and dependencies"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"cosmos-playwright % yarn install\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"playwright-testing",children:"Playwright Testing"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Start COSMOS"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"cosmos % openc3.sh start\n"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:'Open COSMOS in your browser. At the login screen, set the password to "password".'}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Run tests (Note the --headed option visually displays tests, leave it off to run in the background)"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"cosmos-playwright % yarn playwright test --project=chromium --headed\n"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.em,{children:"[Optional]"})," Fix istanbul/nyc coverage source lookups (use ",(0,i.jsx)(n.code,{children:"fixwindows"})," if not on Linux)."]}),"\n",(0,i.jsx)(n.p,{children:"Tests will run successfully without this step and you will get coverage statistics, but line-by-line coverage won't work."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"cosmos-playwright % yarn fixlinux\n"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Generate code coverage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"cosmos-playwright % yarn coverage\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["Code coverage reports can be viewed at ",(0,i.jsx)(n.code,{children:"openc3-playwright/coverage/index.html"})]}),"\n",(0,i.jsx)(n.h2,{id:"ruby-unit-tests",children:"Ruby Unit Tests"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Navigate to ",(0,i.jsx)(n.strong,{children:"cosmos/openc3"})," folder. Run the command:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"cosmos/openc3 % rake build\ncosmos/openc3 % bundle exec rspec\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["Code coverage reports can be found at ",(0,i.jsx)(n.code,{children:"cosmos/openc3/coverage/index.html"})]}),"\n",(0,i.jsx)(n.h2,{id:"python-unit-tests",children:"Python Unit Tests"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Navigate to ",(0,i.jsx)(n.strong,{children:"cosmos/openc3/python"})," folder. Run the command:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"cosmos/openc3/python % python -m pip install poetry\ncosmos/openc3/python % poetry install\ncosmos/openc3/python % poetry run coverage run -m pytest\ncosmos/openc3/python % poetry run coverage html\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["Code coverage reports can be found at ",(0,i.jsx)(n.code,{children:"cosmos/openc3/python/coverage/index.html"})]})]})}function h(e={}){let{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},2840:function(e,n,s){s.d(n,{Z:function(){return l},a:function(){return r}});var t=s(2784);let i={},o=t.createContext(i);function r(e){let n=t.useContext(o);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),t.createElement(o.Provider,{value:n},e.children)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["1615"],{3027:function(e,t,i){i.r(t),i.d(t,{default:()=>u,frontMatter:()=>l,metadata:()=>s,assets:()=>d,toc:()=>r,contentTitle:()=>c});var s=JSON.parse('{"id":"guides/custom-widgets","title":"Custom Widgets","description":"How to build custom widgets for use in Telemetry Viewer","source":"@site/docs/guides/custom-widgets.md","sourceDirName":"guides","slug":"/guides/custom-widgets","permalink":"/tools/staticdocs/docs/guides/custom-widgets","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/guides/custom-widgets.md","tags":[],"version":"current","frontMatter":{"title":"Custom Widgets","description":"How to build custom widgets for use in Telemetry Viewer","sidebar_custom_props":{"myEmoji":"\uD83D\uDD28"}},"sidebar":"defaultSidebar","previous":{"title":"COSMOS and NASA cFS","permalink":"/tools/staticdocs/docs/guides/cfs"},"next":{"title":"Exposing Microservices","permalink":"/tools/staticdocs/docs/guides/exposing_microservices"}}'),o=i("2322"),n=i("2840");let l={title:"Custom Widgets",description:"How to build custom widgets for use in Telemetry Viewer",sidebar_custom_props:{myEmoji:"\uD83D\uDD28"}},c=void 0,d={},r=[{value:"Custom Widgets",id:"custom-widgets",level:2},{value:"Helloworld Widget",id:"helloworld-widget",level:3}];function a(e){let t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",p:"p",pre:"pre",...(0,n.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(t.p,{children:["COSMOS allows you to build custom widgets which can be deployed with your ",(0,o.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/plugins",children:"plugin"})," and used in ",(0,o.jsx)(t.a,{href:"/tools/staticdocs/docs/tools/tlm-viewer",children:"Telemetry Viewer"}),". Building custom widgets can utilize any javascript frameworks but since COSMOS is written with Vue.js, we will use that framework in this tutorial. Please see the ",(0,o.jsx)(t.a,{href:"../getting-started/generators#widget-generator",children:"Widget Generator"})," guide for information about generating the scaffolding for a custom widget."]}),"\n",(0,o.jsx)(t.h2,{id:"custom-widgets",children:"Custom Widgets"}),"\n",(0,o.jsxs)(t.p,{children:["We're basically going to follow the COSMOS ",(0,o.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/tree/main/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo",children:"Demo"})," and explain how that custom widget was created."]}),"\n",(0,o.jsxs)(t.p,{children:["If you look at the bottom of the Demo's ",(0,o.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/plugin.txt",children:"plugin.txt"})," file you'll see we declare the widgets:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-ruby",children:"WIDGET BIG\nWIDGET HELLOWORLD\n"})}),"\n",(0,o.jsxs)(t.p,{children:["When the plugin is deployed this causes COSMOS to look for the as-built widgets. For the BIG widget it will look for the widget at ",(0,o.jsx)(t.code,{children:"tools/widgets/BigWidget/BigWidget.umd.min.js"}),". Similarly it looks for HELLOWORLD at ",(0,o.jsx)(t.code,{children:"tools/widgets/HelloworldWidget/HelloworldWidget.umd.min.js"}),". These directories and file names may seem mysterious but it's all about how the widgets get built."]}),"\n",(0,o.jsx)(t.h3,{id:"helloworld-widget",children:"Helloworld Widget"}),"\n",(0,o.jsxs)(t.p,{children:["The Helloworld Widget source code is found in the plugin's src directory and is called ",(0,o.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/src/HelloworldWidget.vue",children:"HelloworldWidget.vue"}),". The basic structure is as follows:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-vue",children:'<template>\n \x3c!-- Implement widget here --\x3e\n</template>\n\n<script>\nimport { Widget } from "@openc3/vue-common/widgets";\nexport default {\n mixins: [Widget],\n data() {\n return {\n // Reactive data items\n };\n },\n};\n<\/script>\n<style scoped>\n/* widget specific style */\n</style>\n'})}),"\n",(0,o.jsx)(t.admonition,{title:"Vue & Vuetify",type:"info",children:(0,o.jsxs)(t.p,{children:["For more information about how the COSMOS frontend is built (including all the Widgets) please check out ",(0,o.jsx)(t.a,{href:"https://vuejs.org",children:"Vue.js"})," and ",(0,o.jsx)(t.a,{href:"https://vuetifyjs.com",children:"Vuetify"}),"."]})}),"\n",(0,o.jsxs)(t.p,{children:["To build this custom widget we changed the Demo ",(0,o.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/Rakefile",children:"Rakefile"})," to call ",(0,o.jsx)(t.code,{children:"yarn run build"})," when the plugin is built. ",(0,o.jsx)(t.code,{children:"yarn run XXX"})," looks for 'scripts' to run in the ",(0,o.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/package.json",children:"package.json"})," file. If we open package.json we find the following:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-json",children:' "scripts": {\n "build": "vue-cli-service build --target lib --dest tools/widgets/HelloworldWidget --formats umd-min src/HelloworldWidget.vue --name HelloworldWidget && vue-cli-service build --target lib --dest tools/widgets/BigWidget --formats umd-min src/BigWidget.vue --name BigWidget"\n },\n'})}),"\n",(0,o.jsxs)(t.p,{children:["This uses the ",(0,o.jsx)(t.code,{children:"vue-cli-service"})," to build the code found at ",(0,o.jsx)(t.code,{children:"src/HelloworldWidget.vue"})," and formats as ",(0,o.jsx)(t.code,{children:"umd-min"})," and puts it in the ",(0,o.jsx)(t.code,{children:"tools/widgets/HelloworldWidget"})," directory. So this is why the plugin looks for the plugin at ",(0,o.jsx)(t.code,{children:"tools/widgets/HelloworldWidget/HelloworldWidget.umd.min.js"}),". Click ",(0,o.jsx)(t.a,{href:"https://cli.vuejs.org/guide/cli-service.html#vue-cli-service-build",children:"here"})," for the ",(0,o.jsx)(t.code,{children:"vue-cli-service build"})," documentation."]}),"\n",(0,o.jsxs)(t.p,{children:["If you look at the Demo plugin's ",(0,o.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/targets/INST/screens/simple.txt",children:"simple.txt"})," screen you'll see we're using the widgets:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-ruby",children:"SCREEN AUTO AUTO 0.5\nLABELVALUE <%= target_name %> HEALTH_STATUS CCSDSSEQCNT\nHELLOWORLD\nBIG <%= target_name %> HEALTH_STATUS TEMP1\n"})}),"\n",(0,o.jsx)(t.p,{children:"Opening this screen in Telemetry Viewer results in the following:"}),"\n",(0,o.jsx)(t.p,{children:(0,o.jsx)(t.img,{alt:"Simple Screen",src:i(6584).Z+"",width:"681",height:"210"})}),"\n",(0,o.jsx)(t.p,{children:"While this is a simple example the possibilities with custom widgets are limitless!"})]})}function u(e={}){let{wrapper:t}={...(0,n.a)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(a,{...e})}):a(e)}},6584:function(e,t,i){i.d(t,{Z:function(){return s}});let s=i.p+"assets/images/simple_screen-e3de1ad836c0661d73a0ba970f991c64df8ecc7e23f9e944b6508a9a43fbc33c.png"},2840:function(e,t,i){i.d(t,{Z:function(){return c},a:function(){return l}});var s=i(2784);let o={},n=s.createContext(o);function l(e){let t=s.useContext(n);return s.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:l(e.components),s.createElement(n.Provider,{value:t},e.children)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["2278"],{2723:function(e,t,n){n.r(t),n.d(t,{default:()=>u});var a=n("2322");n("2784");var r=n("7239"),s=n("8943"),i=n("9221"),c=n("2427");let o=[{title:"Easy to Configure",description:(0,a.jsx)(a.Fragment,{children:"OpenC3 COSMOS was designed from the ground up to be easy to configure. Simply define the messages needed to talk to your hardware (commands and telemetry), and you are ready to go!"})},{title:"Modern Architecture",description:(0,a.jsx)(a.Fragment,{children:"Built with a modern design, cloud native, and ready to scale. OpenC3 COSMOS has a microservice architecture built to scale, and with fully maintained and up-to-date dependencies."})},{title:"Pick Your Favorite Language",description:(0,a.jsx)(a.Fragment,{children:"OpenC3 COSMOS supports both Ruby and Python for scripting and connecting to targets. Frontend applications can be written in Vue, React, Angular, or Svelte. Whatever languages your team knows, we support."})}];function l(e){let{title:t,description:n}=e;return(0,a.jsx)("div",{className:(0,r.Z)("col col--4"),children:(0,a.jsxs)("div",{className:"text--center padding-horiz--md",children:[(0,a.jsx)("h3",{children:t}),(0,a.jsx)("p",{children:n})]})})}function d(){return(0,a.jsx)("section",{className:"features_t9lD",children:(0,a.jsx)("div",{className:"container",children:(0,a.jsx)("div",{className:"row",children:o.map((e,t)=>(0,a.jsx)(l,{...e},t))})})})}function h(){let{siteConfig:e}=(0,i.Z)();return(0,a.jsx)("header",{className:(0,r.Z)("hero hero--primary","heroBanner_qdFl"),children:(0,a.jsxs)("div",{className:"container",children:[(0,a.jsx)("img",{src:`${e.baseUrl}img/black_logo.svg`,width:"400px",alt:"OpenC3"}),(0,a.jsx)("h1",{className:"hero__title",children:e.title}),(0,a.jsx)("p",{className:"hero__subtitle",children:e.tagline}),(0,a.jsx)("div",{className:"buttons_AeoN",children:(0,a.jsx)(s.Z,{className:"button button--secondary button--lg",to:"/docs/getting-started",children:"Get Started"})})]})})}function u(){let{siteConfig:e}=(0,i.Z)();return(0,a.jsxs)(c.Z,{title:`Hello from ${e.title}`,description:"Description will go into a meta tag in <head />",children:[(0,a.jsx)(h,{}),(0,a.jsx)("main",{children:(0,a.jsx)(d,{})})]})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["8519"],{6515:function(e,t,n){n.r(t),n.d(t,{default:()=>h,frontMatter:()=>c,metadata:()=>r,assets:()=>o,toc:()=>l,contentTitle:()=>d});var r=JSON.parse('{"id":"configuration/interfaces","title":"Interfaces","description":"Built-in COSMOS interfaces including how to create one","source":"@site/docs/configuration/interfaces.md","sourceDirName":"configuration","slug":"/configuration/interfaces","permalink":"/tools/staticdocs/docs/configuration/interfaces","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/configuration/interfaces.md","tags":[],"version":"current","sidebarPosition":6,"frontMatter":{"sidebar_position":6,"title":"Interfaces","description":"Built-in COSMOS interfaces including how to create one","sidebar_custom_props":{"myEmoji":"\uD83D\uDCA1"}},"sidebar":"defaultSidebar","previous":{"title":"Telemetry","permalink":"/tools/staticdocs/docs/configuration/telemetry"},"next":{"title":"Protocols","permalink":"/tools/staticdocs/docs/configuration/protocols"}}'),i=n("2322"),s=n("2840");let c={sidebar_position:6,title:"Interfaces",description:"Built-in COSMOS interfaces including how to create one",sidebar_custom_props:{myEmoji:"\uD83D\uDCA1"}},d=void 0,o={},l=[{value:"Overview",id:"overview",level:2},{value:"Protocols",id:"protocols",level:3},{value:"Accessors",id:"accessors",level:3},{value:"Provided Interfaces",id:"provided-interfaces",level:2},{value:"All Interface Options",id:"all-interface-options",level:4},{value:"TCPIP Client Interface",id:"tcpip-client-interface",level:3},{value:"TCPIP Server Interface",id:"tcpip-server-interface",level:3},{value:"Interface Options",id:"interface-options",level:4},{value:"UDP Interface",id:"udp-interface",level:3},{value:"HTTP Client Interface",id:"http-client-interface",level:3},{value:"HTTP Server Interface",id:"http-server-interface",level:3},{value:"Interface Options",id:"interface-options-1",level:4},{value:"MQTT Interface",id:"mqtt-interface",level:3},{value:"Interface Options",id:"interface-options-2",level:4},{value:"Packet Definitions",id:"packet-definitions",level:4},{value:"MQTT Streaming Interface",id:"mqtt-streaming-interface",level:3},{value:"Interface Options",id:"interface-options-3",level:4},{value:"Packet Definitions",id:"packet-definitions-1",level:4},{value:"Serial Interface",id:"serial-interface",level:3},{value:"Interface Options",id:"interface-options-4",level:4},{value:"SNMP Interface (Enterprise)",id:"snmp-interface-enterprise",level:3},{value:"Interface Options",id:"interface-options-5",level:4},{value:"SNMP Trap Interface (Enterprise)",id:"snmp-trap-interface-enterprise",level:3},{value:"Interface Options",id:"interface-options-6",level:4},{value:"gRPC Interface (Enterprise)",id:"grpc-interface-enterprise",level:3},{value:"Commands",id:"commands",level:4},{value:"Custom Interfaces",id:"custom-interfaces",level:2}];function a(e){let t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h2,{id:"overview",children:"Overview"}),"\n",(0,i.jsxs)(t.p,{children:["Interfaces are the connection to the external embedded systems called ",(0,i.jsx)(t.a,{href:"target",children:"targets"}),". Interfaces are defined by the top level ",(0,i.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/plugins#interface-1",children:"INTERFACE"})," keyword in the plugin.txt file."]}),"\n",(0,i.jsxs)(t.p,{children:["Interface classes provide the code that COSMOS uses to receive real-time telemetry from targets and to send commands to targets. The interface that a target uses could be anything (TCP/IP, serial, MQTT, SNMP, etc.), therefore it is important that this is a customizable portion of any reusable Command and Telemetry System. Fortunately the most common form of interfaces are over TCP/IP sockets, and COSMOS provides interface solutions for these. This guide will discuss how to use these interface classes, and how to create your own. Note that in most cases you can extend interfaces with ",(0,i.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/protocols",children:"Protocols"})," rather than implementing a new interface."]}),"\n",(0,i.jsx)(t.admonition,{title:"Interface and Routers Are Very Similar",type:"info",children:(0,i.jsx)(t.p,{children:"Note that Interfaces and Routers are very similar and share the same configuration parameters. Routers are simply Interfaces which route an existing Interface's telemetry data out to the connected target and routes the connected target's commands back to the original Interface's target."})}),"\n",(0,i.jsx)(t.h3,{id:"protocols",children:"Protocols"}),"\n",(0,i.jsxs)(t.p,{children:["Protocols define the behaviour of an Interface, including differentiating packet boundaries and modifying data as necessary. See ",(0,i.jsx)(t.a,{href:"protocols",children:"Protocols"})," for more information."]}),"\n",(0,i.jsx)(t.h3,{id:"accessors",children:"Accessors"}),"\n",(0,i.jsxs)(t.p,{children:["Accessors are responsible for reading and writing the buffer which is transmitted by the interface to the target. See ",(0,i.jsx)(t.a,{href:"accessors",children:"Accessors"})," for more information."]}),"\n",(0,i.jsxs)(t.p,{children:["For more information about how Interfaces fit with Protocols and Accessors see ",(0,i.jsx)(t.a,{href:"https://www.openc3.com/news/interoperability-without-standards",children:"Interoperability Without Standards"}),"."]}),"\n",(0,i.jsx)(t.h2,{id:"provided-interfaces",children:"Provided Interfaces"}),"\n",(0,i.jsxs)(t.p,{children:["COSMOS provides the following interfaces: TCPIP Client, TCPIP Server, UDP, HTTP Client, HTTP Server, MQTT and Serial. The interface to use is defined by the ",(0,i.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/plugins#interface",children:"INTERFACE"})," and ",(0,i.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/plugins#router",children:"ROUTER"})," keywords. See ",(0,i.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/plugins#interface-modifiers",children:"Interface Modifiers"})," for a description of the keywords which can follow the INTERFACE keyword."]}),"\n",(0,i.jsx)(t.p,{children:"COSMOS Enterprise provides the following interfaces: SNMP, SNMP Trap, GEMS, InfluxDB."}),"\n",(0,i.jsx)(t.h4,{id:"all-interface-options",children:"All Interface Options"}),"\n",(0,i.jsx)(t.p,{children:"The following options apply to all interfaces. Options are added directly beneath the interface definition as shown in the example."}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Option"}),(0,i.jsx)(t.th,{children:"Description"})]})}),(0,i.jsx)(t.tbody,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"PERIODIC_CMD"}),(0,i.jsx)(t.td,{children:"Command to send at periodic intervals. Takes 3 parameters: LOG/DONT_LOG, the interval in seconds, and the actual command to send as a string."})]})})]}),"\n",(0,i.jsx)(t.p,{children:"Examples:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:"INTERFACE INTERFACE_NAME tcpip_client_interface.rb host.docker.internal 8080 8080 10.0 10.0\n # Send the 'INST ABORT' command every 5s and don't log in the CmdTlmServer messages\n # Note that all commands are logged in the binary logs\n OPTION PERIODIC_CMD DONT_LOG 5.0 \"INST ABORT\"\nINTERFACE INTERFACE_NAME openc3/interfaces/tcpip_client_interface.py host.docker.internal 8080 8080 10.0 10.0\n # Send the 'INST2 COLLECT with TYPE NORMAL' command every 10s and output to the CmdTlmServer messages\n OPTION PERIODIC_CMD LOG 10.0 \"INST2 COLLECT with TYPE NORMAL\"\n"})}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Option"}),(0,i.jsx)(t.th,{children:"Description"})]})}),(0,i.jsx)(t.tbody,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"CONNECT_CMD"}),(0,i.jsx)(t.td,{children:"Command to send when the interface connects. Takes 2 parameters: LOG/DONT_LOG and the actual command to send as a string."})]})})]}),"\n",(0,i.jsx)(t.p,{children:"Examples:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:"INTERFACE INTERFACE_NAME tcpip_client_interface.rb host.docker.internal 8080 8080 10.0 10.0\n # Send the 'INST ABORT' command on connection and don't log in the CmdTlmServer messages\n # Note that all commands are logged in the binary logs\n OPTION CONNECT_CMD DONT_LOG \"INST ABORT\"\nINTERFACE INTERFACE_NAME openc3/interfaces/tcpip_client_interface.py host.docker.internal 8080 8080 10.0 10.0\n # Send the 'INST2 COLLECT with TYPE NORMAL' on connection and output to the CmdTlmServer messages\n OPTION CONNECT_CMD LOG \"INST2 COLLECT with TYPE NORMAL\"\n"})}),"\n",(0,i.jsx)(t.h3,{id:"tcpip-client-interface",children:"TCPIP Client Interface"}),"\n",(0,i.jsx)(t.p,{children:"The TCPIP client interface connects to a TCPIP socket to send commands and receive telemetry. This interface is used for targets which open a socket and wait for a connection. This is the most common type of interface."}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Parameter"}),(0,i.jsx)(t.th,{children:"Description"}),(0,i.jsx)(t.th,{children:"Required"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Host"}),(0,i.jsx)(t.td,{children:"Machine name to connect to"}),(0,i.jsx)(t.td,{children:"Yes"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Write Port"}),(0,i.jsx)(t.td,{children:"Port to write commands to (can be the same as read port). Pass nil / None to make the interface read only."}),(0,i.jsx)(t.td,{children:"Yes"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Read Port"}),(0,i.jsx)(t.td,{children:"Port to read telemetry from (can be the same as write port). Pass nil / None to make the interface write only."}),(0,i.jsx)(t.td,{children:"Yes"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Write Timeout"}),(0,i.jsx)(t.td,{children:"Number of seconds to wait before aborting the write"}),(0,i.jsx)(t.td,{children:"Yes"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Read Timeout"}),(0,i.jsx)(t.td,{children:"Number of seconds to wait before aborting the read. Pass nil / None to block on read."}),(0,i.jsx)(t.td,{children:"Yes"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Protocol Type"}),(0,i.jsx)(t.td,{children:"See Protocols."}),(0,i.jsx)(t.td,{children:"No"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Protocol Arguments"}),(0,i.jsx)(t.td,{children:"See Protocols for the arguments each stream protocol takes."}),(0,i.jsx)(t.td,{children:"No"})]})]})]}),"\n",(0,i.jsx)(t.p,{children:"plugin.txt Ruby Examples:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:"INTERFACE INTERFACE_NAME tcpip_client_interface.rb host.docker.internal 8080 8081 10.0 nil LENGTH 0 16 0 1 BIG_ENDIAN 4 0xBA5EBA11\nINTERFACE INTERFACE_NAME tcpip_client_interface.rb host.docker.internal 8080 8080 10.0 nil BURST 4 0xDEADBEEF\nINTERFACE INTERFACE_NAME tcpip_client_interface.rb host.docker.internal 8080 8080 10.0 nil FIXED 6 0 nil true\nINTERFACE INTERFACE_NAME tcpip_client_interface.rb host.docker.internal 8080 8080 10.0 10.0 TERMINATED 0x0D0A 0x0D0A true 0 0xF005BA11\nINTERFACE INTERFACE_NAME tcpip_client_interface.rb host.docker.internal 8080 8080 10.0 10.0 TEMPLATE 0xA 0xA\nINTERFACE INTERFACE_NAME tcpip_client_interface.rb host.docker.internal 8080 8080 10.0 nil PREIDENTIFIED 0xCAFEBABE\nINTERFACE INTERFACE_NAME tcpip_client_interface.rb host.docker.internal 8080 8080 10.0 10.0 # no built-in protocol\n"})}),"\n",(0,i.jsx)(t.p,{children:"plugin.txt Python Examples:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:"INTERFACE INTERFACE_NAME openc3/interfaces/tcpip_client_interface.py host.docker.internal 8080 8081 10.0 None LENGTH 0 16 0 1 BIG_ENDIAN 4 0xBA5EBA11\nINTERFACE INTERFACE_NAME openc3/interfaces/tcpip_client_interface.py host.docker.internal 8080 8080 10.0 None BURST 4 0xDEADBEEF\nINTERFACE INTERFACE_NAME openc3/interfaces/tcpip_client_interface.py host.docker.internal 8080 8080 10.0 None FIXED 6 0 None true\nINTERFACE INTERFACE_NAME openc3/interfaces/tcpip_client_interface.py host.docker.internal 8080 8080 10.0 10.0 TERMINATED 0x0D0A 0x0D0A true 0 0xF005BA11\nINTERFACE INTERFACE_NAME openc3/interfaces/tcpip_client_interface.py host.docker.internal 8080 8080 10.0 10.0 TEMPLATE 0xA 0xA\nINTERFACE INTERFACE_NAME openc3/interfaces/tcpip_client_interface.py host.docker.internal 8080 8080 10.0 None PREIDENTIFIED 0xCAFEBABE\nINTERFACE INTERFACE_NAME openc3/interfaces/tcpip_client_interface.py host.docker.internal 8080 8080 10.0 10.0 # no built-in protocol\n"})}),"\n",(0,i.jsx)(t.h3,{id:"tcpip-server-interface",children:"TCPIP Server Interface"}),"\n",(0,i.jsx)(t.p,{children:"The TCPIP server interface creates a TCPIP server which listens for incoming connections and dynamically creates sockets which communicate with the target. This interface is used for targets which open a socket and try to connect to a server."}),"\n",(0,i.jsx)(t.p,{children:"NOTE: To receive connections from outside the internal docker network you need to expose the TCP port in the compose.yaml file. For example, to allow connections on port 8080 find the openc3-operator section and modify like the following example:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-yaml",children:'openc3-operator:\n ports:\n - "127.0.0.1:8080:8080" # Open tcp port 8080\n'})}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Parameter"}),(0,i.jsx)(t.th,{children:"Description"}),(0,i.jsx)(t.th,{children:"Required"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Write Port"}),(0,i.jsx)(t.td,{children:"Port to write commands to (can be the same as read port)"}),(0,i.jsx)(t.td,{children:"Yes"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Read Port"}),(0,i.jsx)(t.td,{children:"Port to read telemetry from (can be the same as write port)"}),(0,i.jsx)(t.td,{children:"Yes"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Write Timeout"}),(0,i.jsx)(t.td,{children:"Number of seconds to wait before aborting the write"}),(0,i.jsx)(t.td,{children:"Yes"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Read Timeout"}),(0,i.jsx)(t.td,{children:"Number of seconds to wait before aborting the read. Pass nil / None to block on read."}),(0,i.jsx)(t.td,{children:"Yes"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Protocol Type"}),(0,i.jsx)(t.td,{children:"See Protocols."}),(0,i.jsx)(t.td,{children:"No"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Protocol Arguments"}),(0,i.jsx)(t.td,{children:"See Protocols for the arguments each stream protocol takes."}),(0,i.jsx)(t.td,{children:"No"})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"interface-options",children:"Interface Options"}),"\n",(0,i.jsx)(t.p,{children:"Options are added directly beneath the interface definition as shown in the example."}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Option"}),(0,i.jsx)(t.th,{children:"Description"}),(0,i.jsx)(t.th,{children:"Default"})]})}),(0,i.jsx)(t.tbody,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"LISTEN_ADDRESS"}),(0,i.jsx)(t.td,{children:"IP address to accept connections on"}),(0,i.jsx)(t.td,{children:"0.0.0.0"})]})})]}),"\n",(0,i.jsx)(t.p,{children:"plugin.txt Ruby Examples:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:"INTERFACE INTERFACE_NAME tcpip_server_interface.rb 8080 8081 10.0 nil LENGTH 0 16 0 1 BIG_ENDIAN 4 0xBA5EBA11\nINTERFACE INTERFACE_NAME tcpip_server_interface.rb 8080 8080 10.0 nil BURST 4 0xDEADBEEF\nINTERFACE INTERFACE_NAME tcpip_server_interface.rb 8080 8080 10.0 nil FIXED 6 0 nil true\nINTERFACE INTERFACE_NAME tcpip_server_interface.rb 8080 8080 10.0 10.0 TERMINATED 0x0D0A 0x0D0A true 0 0xF005BA11\nINTERFACE INTERFACE_NAME tcpip_server_interface.rb 8080 8080 10.0 10.0 TEMPLATE 0xA 0xA\nINTERFACE INTERFACE_NAME tcpip_server_interface.rb 8080 8080 10.0 nil PREIDENTIFIED 0xCAFEBABE\nINTERFACE INTERFACE_NAME tcpip_server_interface.rb 8080 8080 10.0 10.0 # no built-in protocol\n OPTION LISTEN_ADDRESS 127.0.0.1\n"})}),"\n",(0,i.jsx)(t.p,{children:"plugin.txt Python Examples:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:"INTERFACE INTERFACE_NAME openc3/interfaces/tcpip_server_interface.py 8080 8081 10.0 None LENGTH 0 16 0 1 BIG_ENDIAN 4 0xBA5EBA11\nINTERFACE INTERFACE_NAME openc3/interfaces/tcpip_server_interface.py 8080 8080 10.0 None BURST 4 0xDEADBEEF\nINTERFACE INTERFACE_NAME openc3/interfaces/tcpip_server_interface.py 8080 8080 10.0 None FIXED 6 0 None true\nINTERFACE INTERFACE_NAME openc3/interfaces/tcpip_server_interface.py 8080 8080 10.0 10.0 TERMINATED 0x0D0A 0x0D0A true 0 0xF005BA11\nINTERFACE INTERFACE_NAME openc3/interfaces/tcpip_server_interface.py 8080 8080 10.0 10.0 TEMPLATE 0xA 0xA\nINTERFACE INTERFACE_NAME openc3/interfaces/tcpip_server_interface.py 8080 8080 10.0 None PREIDENTIFIED 0xCAFEBABE\nINTERFACE INTERFACE_NAME openc3/interfaces/tcpip_server_interface.py 8080 8080 10.0 10.0 # no built-in protocol\n"})}),"\n",(0,i.jsx)(t.h3,{id:"udp-interface",children:"UDP Interface"}),"\n",(0,i.jsx)(t.p,{children:"The UDP interface uses UDP packets to send and receive telemetry from the target."}),"\n",(0,i.jsx)(t.p,{children:"NOTE: To receive UDP packets from outside the internal docker network you need to expose the UDP port in the compose.yaml file. For example, to allow UDP packets on port 8081 find the openc3-operator section and modify like the following example:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-yaml",children:'openc3-operator:\n ports:\n - "127.0.0.1:8081:8081/udp" # Open udp port 8081\n'})}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Parameter"}),(0,i.jsx)(t.th,{children:"Description"}),(0,i.jsx)(t.th,{children:"Required"}),(0,i.jsx)(t.th,{children:"Default"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Host"}),(0,i.jsx)(t.td,{children:"Host name or IP address of the machine to send and receive data with"}),(0,i.jsx)(t.td,{children:"Yes"}),(0,i.jsx)(t.td,{})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Write Dest Port"}),(0,i.jsx)(t.td,{children:"Port on the remote machine to send commands to"}),(0,i.jsx)(t.td,{children:"Yes"}),(0,i.jsx)(t.td,{})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Read Port"}),(0,i.jsx)(t.td,{children:"Port on the remote machine to read telemetry from"}),(0,i.jsx)(t.td,{children:"Yes"}),(0,i.jsx)(t.td,{})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Write Source Port"}),(0,i.jsx)(t.td,{children:"Port on the local machine to send commands from"}),(0,i.jsx)(t.td,{children:"No"}),(0,i.jsx)(t.td,{children:"nil (socket is not bound to an outgoing port)"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Interface Address"}),(0,i.jsx)(t.td,{children:"If the remote machine supports multicast the interface address is used to configure the outgoing multicast address"}),(0,i.jsx)(t.td,{children:"No"}),(0,i.jsx)(t.td,{children:"nil (not used)"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"TTL"}),(0,i.jsx)(t.td,{children:"Time to Live. The number of intermediate routers allowed before dropping the packet."}),(0,i.jsx)(t.td,{children:"No"}),(0,i.jsx)(t.td,{children:"128 (Windows)"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Write Timeout"}),(0,i.jsx)(t.td,{children:"Number of seconds to wait before aborting the write"}),(0,i.jsx)(t.td,{children:"No"}),(0,i.jsx)(t.td,{children:"10.0"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Read Timeout"}),(0,i.jsx)(t.td,{children:"Number of seconds to wait before aborting the read"}),(0,i.jsx)(t.td,{children:"No"}),(0,i.jsx)(t.td,{children:"nil (block on read)"})]})]})]}),"\n",(0,i.jsx)(t.p,{children:"plugin.txt Ruby Example:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:"INTERFACE INTERFACE_NAME udp_interface.rb host.docker.internal 8080 8081 8082 nil 128 10.0 nil\n"})}),"\n",(0,i.jsx)(t.p,{children:"plugin.txt Python Example:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:"INTERFACE INTERFACE_NAME openc3/interfaces/udp_interface.py host.docker.internal 8080 8081 8082 None 128 10.0 None\n"})}),"\n",(0,i.jsx)(t.h3,{id:"http-client-interface",children:"HTTP Client Interface"}),"\n",(0,i.jsxs)(t.p,{children:["The HTTP client interface connects to a HTTP server to send commands and receive telemetry. This interface is commonly used with the ",(0,i.jsx)(t.a,{href:"accessors#http-accessor",children:"HttpAccessor"})," and ",(0,i.jsx)(t.a,{href:"accessors#json-accessor",children:"JsonAccessor"}),". See the ",(0,i.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/tree/main/examples/openc3-cosmos-http-example",children:"openc3-cosmos-http-example"})," for more information."]}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Parameter"}),(0,i.jsx)(t.th,{children:"Description"}),(0,i.jsx)(t.th,{children:"Required"}),(0,i.jsx)(t.th,{children:"Default"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Host"}),(0,i.jsx)(t.td,{children:"Machine name to connect to"}),(0,i.jsx)(t.td,{children:"Yes"}),(0,i.jsx)(t.td,{})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Port"}),(0,i.jsx)(t.td,{children:"Port to write commands to and read telemetry from"}),(0,i.jsx)(t.td,{children:"No"}),(0,i.jsx)(t.td,{children:"80"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Protocol"}),(0,i.jsx)(t.td,{children:"HTTP or HTTPS protocol"}),(0,i.jsx)(t.td,{children:"No"}),(0,i.jsx)(t.td,{children:"HTTP"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Write Timeout"}),(0,i.jsx)(t.td,{children:"Number of seconds to wait before aborting the write. Pass nil / None to block on write."}),(0,i.jsx)(t.td,{children:"No"}),(0,i.jsx)(t.td,{children:"5"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Read Timeout"}),(0,i.jsx)(t.td,{children:"Number of seconds to wait before aborting the read. Pass nil / None to block on read."}),(0,i.jsx)(t.td,{children:"No"}),(0,i.jsx)(t.td,{children:"nil / None"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Connect Timeout"}),(0,i.jsx)(t.td,{children:"Number of seconds to wait before aborting the connection"}),(0,i.jsx)(t.td,{children:"No"}),(0,i.jsx)(t.td,{children:"5"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Include Request In Response"}),(0,i.jsx)(t.td,{children:"Whether to include the request in the extra data"}),(0,i.jsx)(t.td,{children:"No"}),(0,i.jsx)(t.td,{children:"false"})]})]})]}),"\n",(0,i.jsx)(t.p,{children:"plugin.txt Ruby Examples:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:"INTERFACE INTERFACE_NAME http_client_interface.rb myserver.com 80\n"})}),"\n",(0,i.jsx)(t.p,{children:"plugin.txt Python Examples:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:"INTERFACE INTERFACE_NAME openc3/interfaces/http_client_interface.py mysecure.com 443 HTTPS\n"})}),"\n",(0,i.jsx)(t.h3,{id:"http-server-interface",children:"HTTP Server Interface"}),"\n",(0,i.jsxs)(t.p,{children:["The HTTP server interface creates a simple unencrypted, unauthenticated HTTP server. This interface is commonly used with the ",(0,i.jsx)(t.a,{href:"accessors#http-accessor",children:"HttpAccessor"})," and ",(0,i.jsx)(t.a,{href:"accessors#json-accessor",children:"JsonAccessor"}),". See the ",(0,i.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/tree/main/examples/openc3-cosmos-http-example",children:"openc3-cosmos-http-example"})," for more information."]}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Parameter"}),(0,i.jsx)(t.th,{children:"Description"}),(0,i.jsx)(t.th,{children:"Required"}),(0,i.jsx)(t.th,{children:"Default"})]})}),(0,i.jsx)(t.tbody,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Port"}),(0,i.jsx)(t.td,{children:"Port to write commands to and read telemetry from"}),(0,i.jsx)(t.td,{children:"No"}),(0,i.jsx)(t.td,{children:"80"})]})})]}),"\n",(0,i.jsx)(t.h4,{id:"interface-options-1",children:"Interface Options"}),"\n",(0,i.jsx)(t.p,{children:"Options are added directly beneath the interface definition as shown in the example."}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Option"}),(0,i.jsx)(t.th,{children:"Description"}),(0,i.jsx)(t.th,{children:"Default"})]})}),(0,i.jsx)(t.tbody,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"LISTEN_ADDRESS"}),(0,i.jsx)(t.td,{children:"IP address to accept connections on"}),(0,i.jsx)(t.td,{children:"0.0.0.0"})]})})]}),"\n",(0,i.jsx)(t.p,{children:"plugin.txt Ruby Examples:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:"INTERFACE INTERFACE_NAME http_server_interface.rb\n LISTEN_ADDRESS 127.0.0.1\n"})}),"\n",(0,i.jsx)(t.p,{children:"plugin.txt Python Examples:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:"INTERFACE INTERFACE_NAME openc3/interfaces/http_server_interface.py 88\n"})}),"\n",(0,i.jsx)(t.h3,{id:"mqtt-interface",children:"MQTT Interface"}),"\n",(0,i.jsxs)(t.p,{children:["The MQTT interface is typically used for connecting to Internet of Things (IoT) devices. The COSMOS MQTT interface is a client that can both publish and receive messages (commands and telemetry). It has built in support for SSL certificates as well as authentication. It differs from the MQTT Streaming Interface in that the commands and telemetry are transmitted over topics given by ",(0,i.jsx)(t.code,{children:"META TOPIC"})," in the command and telemetry definitions."]}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Parameter"}),(0,i.jsx)(t.th,{children:"Description"}),(0,i.jsx)(t.th,{children:"Required"}),(0,i.jsx)(t.th,{children:"Default"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Host"}),(0,i.jsx)(t.td,{children:"Host name or IP address of the MQTT broker"}),(0,i.jsx)(t.td,{children:"Yes"}),(0,i.jsx)(t.td,{})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Port"}),(0,i.jsx)(t.td,{children:"Port on the MQTT broker to connect to. Keep in mind whether you're using SSL or not."}),(0,i.jsx)(t.td,{children:"No"}),(0,i.jsx)(t.td,{children:"1883"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"SSL"}),(0,i.jsx)(t.td,{children:"Whether to use SSL to connect"}),(0,i.jsx)(t.td,{children:"No"}),(0,i.jsx)(t.td,{children:"false"})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"interface-options-2",children:"Interface Options"}),"\n",(0,i.jsx)(t.p,{children:"Options are added directly beneath the interface definition as shown in the example."}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Option"}),(0,i.jsx)(t.th,{children:"Description"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"ACK_TIMEOUT"}),(0,i.jsx)(t.td,{children:"Time to wait when connecting to the MQTT broker"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"USERNAME"}),(0,i.jsx)(t.td,{children:"Username for authentication with the MQTT broker"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"PASSWORD"}),(0,i.jsx)(t.td,{children:"Password for authentication with the MQTT broker"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"CERT"}),(0,i.jsx)(t.td,{children:"PEM encoded client certificate filename used with KEY for client TLS based authentication"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"KEY"}),(0,i.jsx)(t.td,{children:"PEM encoded client private keys filename"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"KEYFILE_PASSWORD"}),(0,i.jsx)(t.td,{children:"Password to decrypt the CERT and KEY files (Python only)"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"CA_FILE"}),(0,i.jsx)(t.td,{children:"Certificate Authority certificate filename that is to be treated as trusted by this client"})]})]})]}),"\n",(0,i.jsx)(t.p,{children:"plugin.txt Ruby Example:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:"INTERFACE MQTT_INT mqtt_interface.rb test.mosquitto.org 1883\n"})}),"\n",(0,i.jsxs)(t.p,{children:["plugin.txt Python Example (Note: This example uses the ",(0,i.jsx)(t.a,{href:"plugins#secret",children:"SECRET"})," keyword to set the PASSWORD option in the Interface):"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:"INTERFACE MQTT_INT openc3/interfaces/mqtt_interface.py test.mosquitto.org 8884\n OPTION USERNAME rw\n # Create an env variable called MQTT_PASSWORD with the secret named PASSWORD\n # and set an OPTION called PASSWORD with the secret value\n # For more information about secrets see the Admin Tool page\n SECRET ENV PASSWORD MQTT_PASSWORD PASSWORD\n"})}),"\n",(0,i.jsx)(t.h4,{id:"packet-definitions",children:"Packet Definitions"}),"\n",(0,i.jsx)(t.p,{children:"The MQTT Interface utilizes 'META TOPIC <topic name>' in the command and telemetry definition files to determine which topics to publish and receive messages from. Thus to send to the topic 'TEST' you would create a command like the following (Note: The command name 'TEST' does NOT have to match the topic name):"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:"COMMAND MQTT TEST BIG_ENDIAN \"Test\"\n META TOPIC TEST # <- The topic name is 'TEST'\n APPEND_PARAMETER DATA 0 BLOCK '' \"MQTT Data\"\n"})}),"\n",(0,i.jsx)(t.p,{children:"Similarly to receive from the topic 'TEST' you would create a telemetry packet like the following (Note: The telemetry name 'TEST' does NOT have to match the topic name):"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:'TELEMETRY MQTT TEST BIG_ENDIAN "Test"\n META TOPIC TEST # <- The topic name is \'TEST\'\n APPEND_ITEM DATA 0 BLOCK "MQTT Data"\n'})}),"\n",(0,i.jsxs)(t.p,{children:["For a full example, please see the ",(0,i.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/tree/main/openc3-cosmos-init/plugins/packages/openc3-cosmos-mqtt-test",children:"openc3-cosmos-mqtt-test"})," in the COSMOS source."]}),"\n",(0,i.jsx)(t.h3,{id:"mqtt-streaming-interface",children:"MQTT Streaming Interface"}),"\n",(0,i.jsx)(t.p,{children:"The MQTT streaming interface is typically used for connecting to Internet of Things (IoT) devices. The COSMOS MQTT streaming interface is a client that can both publish and receive messages (commands and telemetry). It has built in support for SSL certificates as well as authentication. It differs from the MQTT Interface in that all the commands are transmitted on a single topic and all telemetry is received on a single topic."}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Parameter"}),(0,i.jsx)(t.th,{children:"Description"}),(0,i.jsx)(t.th,{children:"Required"}),(0,i.jsx)(t.th,{children:"Default"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Host"}),(0,i.jsx)(t.td,{children:"Host name or IP address of the MQTT broker"}),(0,i.jsx)(t.td,{children:"Yes"}),(0,i.jsx)(t.td,{})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Port"}),(0,i.jsx)(t.td,{children:"Port on the MQTT broker to connect to. Keep in mind whether you're using SSL or not."}),(0,i.jsx)(t.td,{children:"No"}),(0,i.jsx)(t.td,{children:"1883"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"SSL"}),(0,i.jsx)(t.td,{children:"Whether to use SSL to connect"}),(0,i.jsx)(t.td,{children:"No"}),(0,i.jsx)(t.td,{children:"false"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Write Topic"}),(0,i.jsx)(t.td,{children:"Name of the write topic for all commands. Pass nil / None to make interface read only."}),(0,i.jsx)(t.td,{children:"No"}),(0,i.jsx)(t.td,{children:"nil / None"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Read Topic"}),(0,i.jsx)(t.td,{children:"Name of the read topic for all telemetry. Pass nil / None to make interface write only."}),(0,i.jsx)(t.td,{children:"No"}),(0,i.jsx)(t.td,{children:"nil / None"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Protocol Type"}),(0,i.jsx)(t.td,{children:"See Protocols."}),(0,i.jsx)(t.td,{children:"No"}),(0,i.jsx)(t.td,{})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Protocol Arguments"}),(0,i.jsx)(t.td,{children:"See Protocols for the arguments each stream protocol takes."}),(0,i.jsx)(t.td,{children:"No"}),(0,i.jsx)(t.td,{})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"interface-options-3",children:"Interface Options"}),"\n",(0,i.jsx)(t.p,{children:"Options are added directly beneath the interface definition as shown in the example."}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Option"}),(0,i.jsx)(t.th,{children:"Description"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"ACK_TIMEOUT"}),(0,i.jsx)(t.td,{children:"Time to wait when connecting to the MQTT broker"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"USERNAME"}),(0,i.jsx)(t.td,{children:"Username for authentication with the MQTT broker"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"PASSWORD"}),(0,i.jsx)(t.td,{children:"Password for authentication with the MQTT broker"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"CERT"}),(0,i.jsx)(t.td,{children:"PEM encoded client certificate filename used with KEY for client TLS based authentication"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"KEY"}),(0,i.jsx)(t.td,{children:"PEM encoded client private keys filename"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"KEYFILE_PASSWORD"}),(0,i.jsx)(t.td,{children:"Password to decrypt the CERT and KEY files (Python only)"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"CA_FILE"}),(0,i.jsx)(t.td,{children:"Certificate Authority certificate filename that is to be treated as trusted by this client"})]})]})]}),"\n",(0,i.jsx)(t.p,{children:"plugin.txt Ruby Example:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:"INTERFACE MQTT_INT mqtt_stream_interface.rb test.mosquitto.org 1883 false write read\n"})}),"\n",(0,i.jsxs)(t.p,{children:["plugin.txt Python Example (Note: This example uses the ",(0,i.jsx)(t.a,{href:"plugins#secret",children:"SECRET"})," keyword to set the PASSWORD option in the Interface):"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:"INTERFACE MQTT_INT openc3/interfaces/mqtt_stream_interface.py test.mosquitto.org 8884 False write read\n OPTION USERNAME rw\n # Create an env variable called MQTT_PASSWORD with the secret named PASSWORD\n # and set an OPTION called PASSWORD with the secret value\n # For more information about secrets see the Admin Tool page\n SECRET ENV PASSWORD MQTT_PASSWORD PASSWORD\n"})}),"\n",(0,i.jsx)(t.h4,{id:"packet-definitions-1",children:"Packet Definitions"}),"\n",(0,i.jsx)(t.p,{children:"The MQTT Streaming Interface utilizes the topic names passed to the interface so no additional information is necessary in the definition."}),"\n",(0,i.jsxs)(t.p,{children:["For a full example, please see the ",(0,i.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/tree/main/openc3-cosmos-init/plugins/packages/openc3-cosmos-mqtt-test",children:"openc3-cosmos-mqtt-test"})," in the COSMOS source."]}),"\n",(0,i.jsx)(t.h3,{id:"serial-interface",children:"Serial Interface"}),"\n",(0,i.jsx)(t.p,{children:"The serial interface connects to a target over a serial port. COSMOS provides drivers for both Windows and POSIX drivers for UNIX based systems. The Serial Interface is currently only implemented in Ruby."}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Parameter"}),(0,i.jsx)(t.th,{children:"Description"}),(0,i.jsx)(t.th,{children:"Required"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Write Port"}),(0,i.jsx)(t.td,{children:"Name of the serial port to write, e.g. 'COM1' or '/dev/ttyS0'. Pass nil / None to disable writing."}),(0,i.jsx)(t.td,{children:"Yes"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Read Port"}),(0,i.jsx)(t.td,{children:"Name of the serial port to read, e.g. 'COM1' or '/dev/ttyS0'. Pass nil / None to disable reading."}),(0,i.jsx)(t.td,{children:"Yes"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Baud Rate"}),(0,i.jsx)(t.td,{children:"Baud rate to read and write"}),(0,i.jsx)(t.td,{children:"Yes"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Parity"}),(0,i.jsx)(t.td,{children:"Serial port parity. Must be 'NONE', 'EVEN', or 'ODD'."}),(0,i.jsx)(t.td,{children:"Yes"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Stop Bits"}),(0,i.jsx)(t.td,{children:"Number of stop bits, e.g. 1."}),(0,i.jsx)(t.td,{children:"Yes"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Write Timeout"}),(0,i.jsx)(t.td,{children:"Number of seconds to wait before aborting the write"}),(0,i.jsx)(t.td,{children:"Yes"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Read Timeout"}),(0,i.jsx)(t.td,{children:"Number of seconds to wait before aborting the read. Pass nil / None to block on read."}),(0,i.jsx)(t.td,{children:"Yes"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Protocol Type"}),(0,i.jsx)(t.td,{children:"See Protocols."}),(0,i.jsx)(t.td,{children:"No"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Protocol Arguments"}),(0,i.jsx)(t.td,{children:"See Protocols for the arguments each stream protocol takes."}),(0,i.jsx)(t.td,{children:"No"})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"interface-options-4",children:"Interface Options"}),"\n",(0,i.jsx)(t.p,{children:"Options are added directly beneath the interface definition as shown in the example."}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Option"}),(0,i.jsx)(t.th,{children:"Description"}),(0,i.jsx)(t.th,{children:"Default"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"FLOW_CONTROL"}),(0,i.jsx)(t.td,{children:"Serial port flow control. Must be one of NONE or RTSCTS."}),(0,i.jsx)(t.td,{children:"NONE"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"DATA_BITS"}),(0,i.jsx)(t.td,{children:"Number of data bits."}),(0,i.jsx)(t.td,{children:"8"})]})]})]}),"\n",(0,i.jsx)(t.p,{children:"plugin.txt Ruby Examples:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:"INTERFACE INTERFACE_NAME serial_interface.rb COM1 COM1 9600 NONE 1 10.0 nil LENGTH 0 16 0 1 BIG_ENDIAN 4 0xBA5EBA11\nINTERFACE INTERFACE_NAME serial_interface.rb /dev/ttyS1 /dev/ttyS1 38400 ODD 1 10.0 nil BURST 4 0xDEADBEEF\nINTERFACE INTERFACE_NAME serial_interface.rb COM2 COM2 19200 EVEN 1 10.0 nil FIXED 6 0 nil true\nINTERFACE INTERFACE_NAME serial_interface.rb COM4 COM4 115200 NONE 1 10.0 10.0 TERMINATED 0x0D0A 0x0D0A true 0 0xF005BA11\nINTERFACE INTERFACE_NAME serial_interface.rb COM4 COM4 115200 NONE 1 10.0 10.0 TEMPLATE 0xA 0xA\nINTERFACE INTERFACE_NAME serial_interface.rb /dev/ttyS0 /dev/ttyS0 57600 NONE 1 10.0 nil PREIDENTIFIED 0xCAFEBABE\nINTERFACE INTERFACE_NAME serial_interface.rb COM4 COM4 115200 NONE 1 10.0 10.0 # no built-in protocol\n OPTION FLOW_CONTROL RTSCTS\n OPTION DATA_BITS 7\n"})}),"\n",(0,i.jsx)(t.h3,{id:"snmp-interface-enterprise",children:"SNMP Interface (Enterprise)"}),"\n",(0,i.jsx)(t.p,{children:"The SNMP Interface is for connecting to Simple Network Management Protocol devices. The SNMP Interface is currently only implemented in Ruby."}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Parameter"}),(0,i.jsx)(t.th,{children:"Description"}),(0,i.jsx)(t.th,{children:"Required"}),(0,i.jsx)(t.th,{children:"Default"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Host"}),(0,i.jsx)(t.td,{children:"Host name of the SNMP device"}),(0,i.jsx)(t.td,{children:"Yes"}),(0,i.jsx)(t.td,{})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Port"}),(0,i.jsx)(t.td,{children:"Port on the SNMP device"}),(0,i.jsx)(t.td,{children:"No"}),(0,i.jsx)(t.td,{children:"161"})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"interface-options-5",children:"Interface Options"}),"\n",(0,i.jsx)(t.p,{children:"Options are added directly beneath the interface definition as shown in the example."}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Option"}),(0,i.jsx)(t.th,{children:"Description"}),(0,i.jsx)(t.th,{children:"Default"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"VERSION"}),(0,i.jsx)(t.td,{children:"SNMP Version: 1, 2, or 3"}),(0,i.jsx)(t.td,{children:"1"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"COMMUNITY"}),(0,i.jsx)(t.td,{children:"Password or user ID that allows access to a device"}),(0,i.jsx)(t.td,{children:"private"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"USERNAME"}),(0,i.jsx)(t.td,{children:"Username"}),(0,i.jsx)(t.td,{children:"N/A"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"RETRIES"}),(0,i.jsx)(t.td,{children:"Retries when sending requests"}),(0,i.jsx)(t.td,{children:"N/A"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"TIMEOUT"}),(0,i.jsx)(t.td,{children:"Timeout waiting for a response from an agent"}),(0,i.jsx)(t.td,{children:"N/A"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"CONTEXT"}),(0,i.jsx)(t.td,{children:"SNMP context"}),(0,i.jsx)(t.td,{children:"N/A"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"SECURITY_LEVEL"}),(0,i.jsx)(t.td,{children:"Must be one of NO_AUTH, AUTH_PRIV, or AUTH_NO_PRIV"}),(0,i.jsx)(t.td,{children:"N/A"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"AUTH_PROTOCOL"}),(0,i.jsx)(t.td,{children:"Must be one of MD5, SHA, or SHA256"}),(0,i.jsx)(t.td,{children:"N/A"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"PRIV_PROTOCOL"}),(0,i.jsx)(t.td,{children:"Must be one of DES or AES"}),(0,i.jsx)(t.td,{children:"N/A"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"AUTH_PASSWORD"}),(0,i.jsx)(t.td,{children:"Auth password"}),(0,i.jsx)(t.td,{children:"N/A"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"PRIV_PASSWORD"}),(0,i.jsx)(t.td,{children:"Priv password"}),(0,i.jsx)(t.td,{children:"N/A"})]})]})]}),"\n",(0,i.jsx)(t.p,{children:"plugin.txt Ruby Examples:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:"INTERFACE SNMP_INT snmp_interface.rb 192.168.1.249 161\n OPTION VERSION 1\n"})}),"\n",(0,i.jsxs)(t.p,{children:["For a full example, please see the ",(0,i.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-enterprise-plugins/tree/main/openc3-cosmos-apc-switched-pdu",children:"openc3-cosmos-apc-switched-pdu"})," in the COSMOS Enterprise Plugins."]}),"\n",(0,i.jsx)(t.h3,{id:"snmp-trap-interface-enterprise",children:"SNMP Trap Interface (Enterprise)"}),"\n",(0,i.jsx)(t.p,{children:"The SNMP Trap Interface is for receiving Simple Network Management Protocol traps. The SNMP Trap Interface is currently only implemented in Ruby."}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Parameter"}),(0,i.jsx)(t.th,{children:"Description"}),(0,i.jsx)(t.th,{children:"Required"}),(0,i.jsx)(t.th,{children:"Default"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Read Port"}),(0,i.jsx)(t.td,{children:"Port to read from"}),(0,i.jsx)(t.td,{children:"No"}),(0,i.jsx)(t.td,{children:"162"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Read Timeout"}),(0,i.jsx)(t.td,{children:"Read timeout"}),(0,i.jsx)(t.td,{children:"No"}),(0,i.jsx)(t.td,{children:"nil"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Bind Address"}),(0,i.jsx)(t.td,{children:"Address to bind UDP port to"}),(0,i.jsx)(t.td,{children:"Yes"}),(0,i.jsx)(t.td,{children:"0.0.0.0"})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"interface-options-6",children:"Interface Options"}),"\n",(0,i.jsx)(t.p,{children:"Options are added directly beneath the interface definition as shown in the example."}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Option"}),(0,i.jsx)(t.th,{children:"Description"}),(0,i.jsx)(t.th,{children:"Default"})]})}),(0,i.jsx)(t.tbody,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"VERSION"}),(0,i.jsx)(t.td,{children:"SNMP Version: 1, 2, or 3"}),(0,i.jsx)(t.td,{children:"1"})]})})]}),"\n",(0,i.jsx)(t.p,{children:"plugin.txt Ruby Examples:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:"INTERFACE SNMP_INT snmp_trap_interface.rb 162\n OPTION VERSION 1\n"})}),"\n",(0,i.jsxs)(t.p,{children:["For a full example, please see the ",(0,i.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-enterprise-plugins/tree/main/openc3-cosmos-apc-switched-pdu",children:"openc3-cosmos-apc-switched-pdu"})," in the COSMOS Enterprise Plugins."]}),"\n",(0,i.jsx)(t.h3,{id:"grpc-interface-enterprise",children:"gRPC Interface (Enterprise)"}),"\n",(0,i.jsxs)(t.p,{children:["The gRPC Interface is for interacting with ",(0,i.jsx)(t.a,{href:"https://grpc.io/",children:"gRPC"}),". The gRPC Interface is currently only implemented in Ruby."]}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Parameter"}),(0,i.jsx)(t.th,{children:"Description"}),(0,i.jsx)(t.th,{children:"Required"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Hostname"}),(0,i.jsx)(t.td,{children:"gRPC server"}),(0,i.jsx)(t.td,{children:"Yes"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Port"}),(0,i.jsx)(t.td,{children:"gRPC port"}),(0,i.jsx)(t.td,{children:"Yes"})]})]})]}),"\n",(0,i.jsx)(t.p,{children:"plugin.txt Ruby Examples:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:"INTERFACE GRPC_INT grpc_interface.rb my.grpc.org 8080\n"})}),"\n",(0,i.jsx)(t.h4,{id:"commands",children:"Commands"}),"\n",(0,i.jsxs)(t.p,{children:["Using the GrpcInterface for ",(0,i.jsx)(t.a,{href:"command",children:"command definitions"})," requires the use of ",(0,i.jsx)(t.a,{href:"command#meta",children:"META"})," to define a GRPC_METHOD to use for each command."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ruby",children:"COMMAND PROTO GET_USER BIG_ENDIAN 'Get a User'\n META GRPC_METHOD /example.photoservice.ExamplePhotoService/GetUser\n"})}),"\n",(0,i.jsxs)(t.p,{children:["For a full example, please see the ",(0,i.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-enterprise-plugins/tree/main/openc3-cosmos-proto-target",children:"openc3-cosmos-proto-target"})," in the COSMOS Enterprise Plugins."]}),"\n",(0,i.jsx)(t.h2,{id:"custom-interfaces",children:"Custom Interfaces"}),"\n",(0,i.jsx)(t.p,{children:"Interfaces have the following methods that must be implemented:"}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"connect"})," - Open the socket or port or somehow establish the connection to the target. Note: This method may not block indefinitely. Be sure to call super() in your implementation."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"connected?"})," - Return true or false depending on the connection state. Note: This method should return immediately."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"disconnect"})," - Close the socket or port of somehow disconnect from the target. Note: This method may not block indefinitely. Be sure to call super() in your implementation."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"read_interface"})," - Lowest level read of data on the interface. Note: This method should block until data is available or the interface disconnects. On a clean disconnect it should return nil."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"write_interface"})," - Lowest level write of data on the interface. Note: This method may not block indefinitely."]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"Interfaces also have the following methods that exist and have default implementations. They can be overridden if necessary but be sure to call super() to allow the default implementation to be executed."}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"read_interface_base"})," - This method should always be called from read_interface(). It updates interface specific variables that are displayed by CmdTLmServer including the bytes read count, the most recent raw data read, and it handles raw logging if enabled."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"write_interface_base"})," - This method should always be called from write_interface(). It updates interface specific variables that are displayed by CmdTLmServer including the bytes written count, the most recent raw data written, and it handles raw logging if enabled."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"read"})," - Read the next packet from the interface. COSMOS implements this method to allow the Protocol system to operate on the data and the packet before it is returned."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"write"})," - Send a packet to the interface. COSMOS implements this method to allow the Protocol system to operate on the packet and the data before it is sent."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"write_raw"})," - Send a raw binary string of data to the target. COSMOS implements this method by basically calling write_interface with the raw data."]}),"\n"]}),"\n",(0,i.jsx)(t.admonition,{title:"Naming Conventions",type:"warning",children:(0,i.jsx)(t.p,{children:'When creating your own interfaces, in most cases they will be subclasses of one of the built-in interfaces described below. It is important to know that both the filename and class name of the interface files must match with correct capitalization or you will receive "class not found" errors when trying to load your new interface. For example, an interface file called labview_interface.rb must contain the class LabviewInterface. If the class was named, LabVIEWInterface, for example, COSMOS would not be able to find the class because of the unexpected capitalization.'})})]})}function h(e={}){let{wrapper:t}={...(0,s.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},2840:function(e,t,n){n.d(t,{Z:function(){return d},a:function(){return c}});var r=n(2784);let i={},s=r.createContext(i);function c(e){let t=r.useContext(s);return r.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:c(e.components),r.createElement(s.Provider,{value:t},e.children)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["1364"],{269:function(e,t,n){n.r(t),n.d(t,{default:()=>h,frontMatter:()=>s,metadata:()=>i,assets:()=>l,toc:()=>c,contentTitle:()=>r});var i=JSON.parse('{"id":"getting-started/gettingstarted","title":"Getting Started","description":"Getting starting with COSMOS","source":"@site/docs/getting-started/gettingstarted.md","sourceDirName":"getting-started","slug":"/getting-started/gettingstarted","permalink":"/tools/staticdocs/docs/getting-started/gettingstarted","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/getting-started/gettingstarted.md","tags":[],"version":"current","sidebarPosition":2,"frontMatter":{"sidebar_position":2,"title":"Getting Started","description":"Getting starting with COSMOS","sidebar_custom_props":{"myEmoji":"\uD83E\uDDD1\u200D\uD83D\uDCBB"}},"sidebar":"defaultSidebar","previous":{"title":"Installation","permalink":"/tools/staticdocs/docs/getting-started/installation"},"next":{"title":"Code Generators","permalink":"/tools/staticdocs/docs/getting-started/generators"}}'),a=n("2322"),o=n("2840");let s={sidebar_position:2,title:"Getting Started",description:"Getting starting with COSMOS",sidebar_custom_props:{myEmoji:"\uD83E\uDDD1\u200D\uD83D\uDCBB"}},r=void 0,l={},c=[{value:"Interfacing with Your Hardware",id:"interfacing-with-your-hardware",level:2},{value:"Building Your Plugin",id:"building-your-plugin",level:2}];function d(e){let t={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",ul:"ul",...(0,o.a)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.p,{children:"Welcome to the OpenC3 COSMOS system... Let's get started! This guide is a high level overview that will help with setting up your first COSMOS project."}),"\n",(0,a.jsxs)(t.ol,{children:["\n",(0,a.jsxs)(t.li,{children:["Get COSMOS Installed onto your computer by following the ",(0,a.jsx)(t.a,{href:"installation",children:"Installation Guide"}),".","\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsx)(t.li,{children:"You should now have COSMOS installed and a Demo project available that we can make changes to."}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["Browse to ",(0,a.jsx)(t.a,{href:"http://localhost:2900",children:"http://localhost:2900"}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsx)(t.li,{children:'The COSMOS Command and Telemetry Server will appear. This tool provides real-time information about each "target" in the system. Targets are external systems that receive commands and generate telemetry, often over ethernet or serial connections.'}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["Experiment with other COSMOS tools. This is a DEMO environment so you can't break anything. Some things to try:","\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsx)(t.li,{children:"Use Command Sender to send individual commands."}),"\n",(0,a.jsx)(t.li,{children:"Use Limits Monitor to watch for telemetry limits violations"}),"\n",(0,a.jsx)(t.li,{children:"Run some of the example scripts in Script Runner and Test Runner"}),"\n",(0,a.jsx)(t.li,{children:"View individual Telemetry packets in Packet Viewer"}),"\n",(0,a.jsx)(t.li,{children:"View detailed telemetry displays in Telemetry Viewer"}),"\n",(0,a.jsx)(t.li,{children:"Graph some data in Telemetry Grapher"}),"\n",(0,a.jsx)(t.li,{children:"View log type data in Data Viewer"}),"\n",(0,a.jsx)(t.li,{children:"Process log data with Data Extractor"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(t.admonition,{title:"Browser Version Issue",type:"info",children:[(0,a.jsxs)(t.p,{children:["When you try to load the page and it fails to load, check with the built-in web development tools / DevTools. We have seen some strange things with version of browsers. You can build to a version of browser if you need to by reading about the ",(0,a.jsx)(t.a,{href:"https://github.com/browserslist/browserslist",children:"browserslist"}),". A typical failure results in:"]}),(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{children:"unexpected token ||=\n"})}),(0,a.jsxs)(t.p,{children:["To fix this make sure your browsers is compliant with the current settings in the ",(0,a.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3-cosmos-init/plugins/openc3-tool-base/.browserslistrc",children:".browserlistrc"})," file. You can change this and rebuild the image. Note: This can cause build speeds to increase or decrease."]})]}),"\n",(0,a.jsx)(t.h2,{id:"interfacing-with-your-hardware",children:"Interfacing with Your Hardware"}),"\n",(0,a.jsx)(t.p,{children:"Playing with the COSMOS Demo is fun and all, but now you want to talk to your own real hardware? Let's do it!"}),"\n",(0,a.jsx)(t.admonition,{title:"Install and Platform",type:"info",children:(0,a.jsx)(t.p,{children:"This guide assumes we're on Windows and COSMOS is installed in C:\\COSMOS. On Mac or Linux, change openc3.bat to openc3.sh and adjust paths as necessary to match your installation directory."})}),"\n",(0,a.jsxs)(t.ol,{children:["\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:"Before creating your own configuration you should uninstall the COSMOS Demo so you're working with a clean COSMOS system. Click the Admin button and the PLUGINS tab. Then click the Trash can icon next to openc3-cosmos-demo to delete it. When you go back to the Command and Telemetry Server you should have a blank table with no interfaces."}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsxs)(t.p,{children:["If you followed the ",(0,a.jsx)(t.a,{href:"installation",children:"Installation Guide"})," you should already be inside a cloned ",(0,a.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-project",children:"openc3-project"})," which is in your PATH (necessary for openc3.bat / openc3.sh to be resolved). Inside this project it's recommended to edit the README.md (",(0,a.jsx)(t.a,{href:"https://www.markdownguide.org/",children:"Markdown"}),") to describe your program / project."]}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:"Now we need to create a plugin. Plugins are how we add targets and microservices to COSMOS. Our plugin will contain a single target which contains all the information defining the packets (command and telemetry) that are needed to communicate with the target. Use the COSMOS plugin generator to create the correct structure."}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(t.admonition,{title:"Python vs Ruby",type:"info",children:(0,a.jsxs)(t.p,{children:["Each CLI command requires the use of ",(0,a.jsx)(t.code,{children:"--python"})," or ",(0,a.jsx)(t.code,{children:"--ruby"})," unless you se the OPENC3_LANGUAGE environment variable to 'python' or 'ruby'."]})}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-batch",children:"C:\\openc3-project> openc3.bat cli generate plugin BOB --python\nPlugin openc3-cosmos-bob successfully generated!\n"})}),"\n",(0,a.jsxs)(t.p,{children:['This should create a new directory called "openc3-cosmos-bob" with a bunch of files in it. The full description of all the files is explained by the ',(0,a.jsx)(t.a,{href:"generators#plugin-generator",children:"Plugin Generator"})," page."]}),"\n",(0,a.jsx)(t.admonition,{title:"Run as the Root user",type:"info",children:(0,a.jsxs)(t.p,{children:["The cli runs as the default COSMOS container user which is the recommended practice. If you're having issues running as that user you can run as the root user (effectively ",(0,a.jsx)(t.code,{children:"docker run --user=root"})," ) by running ",(0,a.jsx)(t.code,{children:"cliroot"})," instead of ",(0,a.jsx)(t.code,{children:"cli"})," in any of the examples."]})}),"\n",(0,a.jsxs)(t.ol,{children:["\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsxs)(t.p,{children:["Starting with ",(0,a.jsx)(t.a,{href:"https://openc3.com/news/2023/02/23/openc3-cosmos-5-5-0-released/",children:"COSMOS v5.5.0"}),", the plugin generator creates just the plugin framework (previously it would also create a target). From within the newly created plugin directory, we generate a target."]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-batch",children:"C:\\openc3-project> cd openc3-cosmos-bob\nopenc3-cosmos-bob> openc3.bat cli generate target BOB --python\nTarget BOB successfully generated!\n"})}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(t.admonition,{title:"Generators",type:"info",children:(0,a.jsxs)(t.p,{children:["There are a number of generators available. Run ",(0,a.jsx)(t.code,{children:"openc3.bat cli generate"})," to see all the available options."]})}),"\n",(0,a.jsxs)(t.ol,{children:["\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:"The target generator creates a single target named BOB. Best practice is to create a single target per plugin to make it easier to share targets and upgrade them individually. Lets see what the target generator created for us. Open the openc3-cosmos-bob/targets/BOB/cmd_tlm/cmd.txt:"}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-ruby",children:'COMMAND BOB EXAMPLE BIG_ENDIAN "Packet description"\n # Keyword Name BitSize Type Min Max Default Description\n APPEND_ID_PARAMETER ID 16 INT 1 1 1 "Identifier"\n APPEND_PARAMETER VALUE 32 FLOAT 0 10.5 2.5 "Value"\n APPEND_PARAMETER BOOL 8 UINT MIN MAX 0 "Boolean"\n STATE FALSE 0\n STATE TRUE 1\n APPEND_PARAMETER LABEL 0 STRING "OpenC3" "The label to apply"\n'})}),"\n",(0,a.jsx)(t.p,{children:"What does this all mean?"}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsx)(t.li,{children:"We created a COMMAND for target BOB named EXAMPLE."}),"\n",(0,a.jsx)(t.li,{children:'The command is made up of BIG_ENDIAN parameters and is described by "Packet description". Here we are using the append flavor of defining parameters which stacks them back to back as it builds up the packet and you don\'t have to worry about defining the bit offset into the packet.'}),"\n",(0,a.jsx)(t.li,{children:'First we APPEND_ID_PARAMETER a parameter that is used to identify the packet called ID that is an 16-bit signed integer (INT) with a minimum value of 1, a maximum value of 1, and a default value of 1, that is described as the "Identifier".'}),"\n",(0,a.jsx)(t.li,{children:"Next we APPEND_PARAMETER a parameter called VALUE that is a 32-bit float (FLOAT) that has a minimum value of 0, a maximum value of 10.5, and a default value of 2.5."}),"\n",(0,a.jsx)(t.li,{children:"Then we APPEND_PARAMETER a third parameter called BOOL which is a 8-bit unsigned integer (UINT) with a minimum value of MIN (meaning the smallest value a UINT supports, e.g 0), a maximum value of MAX (largest value a UINT supports, e.g. 255), and a default value of 0. BOOL has two states which are just a fancy way of giving meaning to the integer values 0 and 1. The STATE FALSE has a value of 0 and the STATE TRUE has a value of 1."}),"\n",(0,a.jsx)(t.li,{children:"Finally we APPEND_PARAMETER called LABEL which is a 0-bit (meaning it takes up all the remaining space in the packet) string (STRING) with a default value of \"OpenC3\". Strings don't have minimum or maximum values as that doesn't make sense for STRING types."}),"\n"]}),"\n",(0,a.jsxs)(t.p,{children:["Check out the full ",(0,a.jsx)(t.a,{href:"../configuration/command",children:"Command"})," documentation for more."]}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:"Now open the openc3-cosmos-bob/targets/BOB/cmd_tlm/tlm.txt:"}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-ruby",children:'TELEMETRY BOB STATUS BIG_ENDIAN "Telemetry description"\n # Keyword Name BitSize Type ID Description\n APPEND_ID_ITEM ID 16 INT 1 "Identifier"\n APPEND_ITEM VALUE 32 FLOAT "Value"\n APPEND_ITEM BOOL 8 UINT "Boolean"\n STATE FALSE 0\n STATE TRUE 1\n APPEND_ITEM LABEL 0 STRING "The label to apply"\n'})}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsx)(t.li,{children:'This time we created a TELEMETRY packet for target BOB called STATUS that contains BIG_ENDIAN items and is described as "Telemetry description".'}),"\n",(0,a.jsx)(t.li,{children:'We start by defininig an ID_ITEM called ID that is a 16-bit signed integer (INT) with an id value of 1 and described as "Identifier". Id items are used to take unidentified blobs of bytes and determine which packet they are. In this case if a blob comes in with a value of 1, at bit offset 0 (since we APPEND this item first), interpreted as a 16-bit integer, then this packet will be "identified" as STATUS. Note the first packet defined without any ID_ITEMS is a "catch-all" packet that matches all incoming data (even if the data lengths don\'t match).'}),"\n",(0,a.jsx)(t.li,{children:"Next we define three items similar to the command definition above."}),"\n"]}),"\n",(0,a.jsxs)(t.p,{children:["Check out the full ",(0,a.jsx)(t.a,{href:"../configuration/telemetry",children:"Telemetry"})," documentation for more."]}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsxs)(t.p,{children:["COSMOS has defined an example command and telemetry packet for our target. Most targets will obviously have more than one command and telemetry packet. To add more simply create additional COMMAND and TELEMETRY lines in your text files. Actual packets should match the structure of your command and telemetry. Be sure to add at least one unique ",(0,a.jsx)(t.a,{href:"../configuration/command#id_parameter",children:"ID_PARAMETER"})," and ",(0,a.jsx)(t.a,{href:"../configuration/telemetry#id_item",children:"ID_ITEM"})," so your packets can be distinguished from each other."]}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:"Now we need to tell COSMOS how to connect to our BOB target. Open the openc3-cosmos-bob/plugin.txt file:"}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-ruby",children:"# Set VARIABLEs here to allow variation in your plugin\n# See [Plugins](../configuration/plugins) for more information\nVARIABLE bob_target_name BOB\n\n# Modify this according to your actual target connection\n# See [Interfaces](../configuration/interfaces) for more information\nTARGET BOB <%= bob_target_name %>\nINTERFACE <%= bob_target_name %>_INT openc3/interfaces/tcpip_client_interface.py host.docker.internal 8080 8081 10.0 None BURST\n MAP_TARGET <%= bob_target_name %>\n"})}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsx)(t.li,{children:'This configures the plugin with a VARIABLE called bob_target_name with a default of "BOB". When you install this plugin you will have the option to change the name of this target to something other than "BOB". This is useful to avoid name conflicts and allows you to have multiple copies of the BOB target in your COSMOS system.'}),"\n",(0,a.jsx)(t.li,{children:"The TARGET line declares the new BOB target using the name from the variable. The <%= %> syntax is called ERB (embedded Ruby) and allows us to put variables into our text files, in this case referencing our bob_target_name."}),"\n",(0,a.jsxs)(t.li,{children:["The last line declares a new INTERFACE called (by default) BOB_INT that will connect as a TCP/IP client using the code in tcpip_client_interface.py to address host.docker.internal (This adds an /etc/hosts entry to the correct IP address for the host's gateway) using port 8080 for writing and 8081 for reading. It also has a write timeout of 10 seconds and reads will never timeout (nil). The TCP/IP stream will be interpreted using the COSMOS ",(0,a.jsx)(t.a,{href:"../configuration/protocols#burst-protocol",children:"BURST"})," protocol which means it will read as much data as it can from the interface. For all the details on how to configure COSMOS interfaces please see the ",(0,a.jsx)(t.a,{href:"../configuration/interfaces",children:"Interface Guide"}),". The MAP_TARGET line tells COSMOS that it will receive telemetry from and send commands to the BOB target using the BOB_INT interface."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(t.admonition,{title:"Variables Support Reusability",type:"note",children:(0,a.jsx)(t.p,{children:"In a plugin that you plan to reuse you should make things like hostnames and ports variables"})}),"\n",(0,a.jsx)(t.h2,{id:"building-your-plugin",children:"Building Your Plugin"}),"\n",(0,a.jsxs)(t.ol,{children:["\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:"Now we need to build our plugin and upload it to COSMOS."}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-batch",children:"openc3-cosmos-bob> openc3.bat cli rake build VERSION=1.0.0\n Successfully built RubyGem\n Name: openc3-cosmos-bob\n Version: 1.0.0\n File: openc3-cosmos-bob-1.0.0.gem\n"})}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsxs)(t.li,{children:["Note that the VERSION is required to specify the version to build. We recommend ",(0,a.jsx)(t.a,{href:"https://semver.org/",children:"semantic versioning"})," when building your plugin so people using your plugin (including you) know when there are breaking changes."]}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:"Once our plugin is built we need to upload it to COSMOS. Go back to the Admin page and click the Plugins Tab. Click on \"Click to install plugin\" and select the openc3-cosmos-bob-1.0.0.gem file. Then click Upload. Go back to the CmdTlmServer and you should see the plugin being deployed at which point the BOB_INT interface should appear and try to connect. Go ahead and click 'Cancel' because unless you really have something listening on port 8080 this will never connect. At this point you can explore the other CmdTlmServer tabs and other tools to see your newly defined BOB target."}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:'Let\'s modify our BOB target and then update the copy in COSMOS. If you open Command Sender in COSMOS to BOB EXAMPLE you should see the VALUE parameter has value 2.5. Open the openc3-cosmos-bob/targets/BOB/cmd_tlm/cmd.txt and change the Default value for VALUE to 5 and the description to "New Value".'}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-ruby",children:'COMMAND BOB EXAMPLE BIG_ENDIAN "Packet description"\n # Keyword Name BitSize Type Min Max Default Description\n APPEND_ID_PARAMETER ID 16 INT 1 1 1 "Identifier"\n APPEND_PARAMETER VALUE 32 FLOAT 0 10.5 5 "New Value"\n APPEND_PARAMETER BOOL 8 UINT MIN MAX 0 "Boolean"\n STATE FALSE 0\n STATE TRUE 1\n APPEND_PARAMETER LABEL 0 STRING "OpenC3" "The label to apply"\n'})}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:"Rebuild the plugin with a new VERSION number. Since we didn't make any breaking changes we simply bump the patch release number:"}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-batch",children:"openc3-cosmos-bob> openc3.bat cli rake build VERSION=1.0.1\n Successfully built RubyGem\n Name: openc3-cosmos-bob\n Version: 1.0.1\n File: openc3-cosmos-bob-1.0.1.gem\n"})}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:'Go back to the Admin page and click the Plugins Tab. This time click the clock icon next to openc3-cosmos-bob-1.0.0 to Upgrade the plugin. Browse to the newly built plugin gem and select it. This will re-prompt for the plugin variables (bob_target_name) so don\'t change the name and just click OK. You should see a message about the plugin being installed at which point the plugins list will change to openc3-cosmos-bob-1.0.1.gem. Go back to Command Sender and you should see the new Default value for VALUE is 5 and the description is "New Value". We have upgraded our plugin!'}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsxs)(t.p,{children:["At this point you can create a new plugin named after your real target and start modifying the interface and command and telemetry definitions to enable COSMOS to connect to and drive your target. If you run into trouble look for solutions on our ",(0,a.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/issues",children:"Github Issues"})," page. If you would like to enquire about support contracts or professional COSMOS development please contact us at ",(0,a.jsx)(t.a,{href:"mailto:support@openc3.com",children:"support@openc3.com"}),"."]}),"\n"]}),"\n"]})]})}function h(e={}){let{wrapper:t}={...(0,o.a)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},2840:function(e,t,n){n.d(t,{Z:function(){return r},a:function(){return s}});var i=n(2784);let a={},o=i.createContext(a);function s(e){let t=i.useContext(o);return i.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:s(e.components),i.createElement(o.Provider,{value:t},e.children)}}}]);