Skip to content

Commit

Permalink
deploy: 48a1e7b
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallets committed Nov 12, 2024
1 parent a7c834e commit e207b21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/getting-started/first-app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}gtag("js",new Date),gtag("config","G-PBD6MS51QL")</script><script type=application/ld+json>{"@context":"http://schema.org","@type":"BlogPosting","mainEntityOfPage":{"@type":"WebPage","@id":""},"articleSection":"docs","name":"Your first Zenoh app","headline":"Your first Zenoh app","datePublished":"0001-01-01 00:00:00 \u002b0000 UTC","dateModified":"0001-01-01 00:00:00 \u002b0000 UTC","url":"\/docs\/getting-started\/first-app\/","inLanguage":"en-US","author":"","creator":"","publisher":"","accountablePerson":"","copyrightHolder":"","copyrightYear":"1011","wordCount":"489","keywords":[],"description":"Let us take a step-by-step approach in putting together your first Zenoh application in Python. As the first step, let us see how we get some data from a temperature sensor in our kitchen. Then we see how we can route this data to store and perform some analytics.\nBefore cranking some code, let\u0026rsquo;s define some terminology.\nZenoh deals with keys\/values where each key is a path and is associated to a value."}</script></header><div class="container-fluid ato-docs"><div class="row flex-xl-nowrap"><div class="col-12 col-md-3 col-xl-2 ato-sidebar"><div class="ato-search d-flex justify-content-end"><button class="btn btn-link ato-search-docs-toggle d-md-none p-0 ml-3" type=button data-toggle=collapse data-target=#ato-docs-nav aria-controls=ato-docs-nav aria-expanded=false aria-label="Toggle docs navigation"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" width="30" height="30" focusable="false"><title>Menu</title><path stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-miterlimit="10" d="M4 7h22M4 15h22M4 23h22"/></svg></button></div><nav class="ato-links collapse" id=ato-docs-nav><div class=ato-toc-item><a class=ato-toc-link href=../../../docs/overview/what-is-zenoh/>Overview</a><ul class="nav ato-sidenav"><li><a href=../../../docs/overview/what-is-zenoh/>What is Zenoh?</a></li><li><a href=../../../docs/overview/zenoh-in-action/>Zenoh in action</a></li></ul></div><div class="ato-toc-item active"><a class=ato-toc-link href=../../../docs/getting-started/first-app/>Getting started</a><ul class="nav ato-sidenav"><li><a href=../../../docs/getting-started/first-app/ class=active>Your first Zenoh app</a></li><li><a href=../../../docs/getting-started/installation/>Installation</a></li><li><a href=../../../docs/getting-started/deployment/>Deployment</a></li><li><a href=../../../docs/getting-started/quick-test/>For a quick test using Docker</a></li><li><a href=../../../docs/getting-started/troubleshooting/>Troubleshooting</a></li></ul></div><div class=ato-toc-item><a class=ato-toc-link href=../../../docs/manual/abstractions/>Reference manual</a><ul class="nav ato-sidenav"><li><a href=../../../docs/manual/abstractions/>Abstractions</a></li><li><a href=../../../docs/manual/configuration/>Configuration</a></li><li><a href=../../../docs/manual/plugins/>Zenoh plugins</a></li><li><a href=../../../docs/manual/plugin-http/>REST plugin</a></li><li><a href=../../../docs/manual/plugin-storage-manager/>Storage manager plugin</a></li><li><a href=../../../docs/manual/tls/>TLS authentication</a></li><li><a href=../../../docs/manual/quic/>QUIC transport</a></li><li><a href=../../../docs/manual/user-password/>User-Password authentication</a></li><li><a href=../../../docs/manual/access-control/>Access Control</a></li></ul></div><div class=ato-toc-item><a class=ato-toc-link href=../../../docs/apis/rust/>API</a><ul class="nav ato-sidenav"><li><a href=../../../docs/apis/rust/>Rust API</a></li><li><a href=../../../docs/apis/c/>C API</a></li><li><a href=../../../docs/apis/cpp/>C++ API</a></li><li><a href=../../../docs/apis/python/>Python API</a></li><li><a href=../../../docs/apis/rest/>REST API</a></li><li><a href=../../../docs/apis/kotlin/>Kotlin API</a></li></ul></div><div class=ato-toc-item><a class=ato-toc-link href=../../../docs/migration_0.5_to_0.6/migrationguide-v0.5.x-v0.6.x/>Migration guides v0.5.x → v0.6.x</a><ul class="nav ato-sidenav"><li><a href=../../../docs/migration_0.5_to_0.6/migrationguide-v0.5.x-v0.6.x/>Migrating from Zenoh v0.5.x to Zenoh v0.6.x</a></li><li><a href=../../../docs/migration_0.5_to_0.6/migrationguide-rust-v0.5.x-v0.6.x/>Migrating from Zenoh v0.5.x Rust API to Zenoh v0.6.x Rust API</a></li><li><a href=../../../docs/migration_0.5_to_0.6/migrationguide-c-v0.5.x-v0.6.x/>Migrating from Zenoh-C v0.5.x zenoh-net API to Zenoh-C v0.6.x zenoh API</a></li><li><a href=../../../docs/migration_0.5_to_0.6/migrationguide-python-v0.5.x-v0.6.x/>Migrating from Zenoh v0.5.x Python API to Zenoh v0.6.x Python API</a></li><li><a href=../../../docs/migration_0.5_to_0.6/migrationguide-pico-v0.5.x-v0.6.x/>Migrating from Zenoh-Pico v0.5.x to Zenoh-Pico v0.6.x</a></li><li><a href=../../../docs/migration_0.5_to_0.6/migrationguide-zenohc-zenohpico/>Migrating from Zenoh-C to Zenoh-Pico (and vice-versa)</a></li></ul></div><div class=ato-toc-item><a class=ato-toc-link href=../../../docs/migration_1.0/concepts/>Migration guides v0.11 → v1.0</a><ul class="nav ato-sidenav"><li><a href=../../../docs/migration_1.0/concepts/>Concepts</a></li><li><a href=../../../docs/migration_1.0/rust/>Rust</a></li><li><a href=../../../docs/migration_1.0/c++/>C++</a></li><li><a href=../../../docs/migration_1.0/c_pico/>C / Pico</a></li><li><a href=../../../docs/migration_1.0/python/>Python</a></li><li><a href=../../../docs/migration_1.0/java/>Java</a></li><li><a href=../../../docs/migration_1.0/kotlin/>Kotlin</a></li></ul></div></nav></div><div class="d-none d-xl-block col-xl-2 ato-toc"><div class=section-nav><nav id=TableOfContents><ul><li><a href=#pubsub-in-zenoh>Pub/sub in Zenoh</a></li><li><a href=#store-and-query-in-zenoh>Store and Query in Zenoh</a></li><li><a href=#other-examples>Other examples</a></li></ul></nav></div></div><main class="col-12 col-md-9 col-xl-8 py-md-3 pl-md-5 ato-content ato-docs"><h1 class=ato-title>Your first Zenoh app</h1><div class=github-edit><a class="fa fa-github" href=https://github.com/atolab/zenoh-web/tree/master/content/docs/getting-started/first-app.md>Edit on GitHub</a></div><p>Let us take a step-by-step approach in putting together your first Zenoh application in Python.
As the first step, let us see how we get some data from a temperature sensor in our kitchen.
Then we see how we can route this data to store and perform some analytics.</p><p>Before cranking some code, let&rsquo;s define some terminology.</p><p>Zenoh deals with keys/values where each key is a path and is associated to a value. A key looks like just a Unix file system path, such as <code>myhome/kitchen/temp</code>. The value can be defined with different
encodings (string, JSON, raw bytes buffer&mldr;).</p><p>Let&rsquo;s get started!</p><h2 id=pubsub-in-zenoh>Pub/sub in Zenoh</h2><p>First thing first, we need to install the <a href=https://github.com/eclipse-zenoh/zenoh-python>zenoh Python library</a>.</p><div class=highlight><pre tabindex=0 style=background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-bash data-lang=bash><span style=display:flex><span>pip install eclipse-zenoh<span style=color:#555>==</span>1.0.0rc1
encodings (string, JSON, raw bytes buffer&mldr;).</p><p>Let&rsquo;s get started!</p><h2 id=pubsub-in-zenoh>Pub/sub in Zenoh</h2><p>First thing first, we need to install the <a href=https://github.com/eclipse-zenoh/zenoh-python>zenoh Python library</a>.</p><div class=highlight><pre tabindex=0 style=background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-bash data-lang=bash><span style=display:flex><span>pip install eclipse-zenoh
</span></span></code></pre></div><p><em>The examples are updated to use the 1.0 version currently in rc, which is why version must be specified in the installation command. You can find more information about the 1.0 changes in the <a href=https://zenoh.io/docs/migration_1.0/concepts/>migration guides</a>.</em></p><p>Then, let&rsquo;s write an application, <code>z_sensor.py</code> that will produce temperature measurements at each second:</p><div class=highlight><pre tabindex=0 style=background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-python data-lang=python><span style=display:flex><span><span style=color:#069;font-weight:700>import</span> <span style=color:#0cf;font-weight:700>zenoh</span><span style=color:#555>,</span> <span style=color:#0cf;font-weight:700>random</span><span style=color:#555>,</span> <span style=color:#0cf;font-weight:700>time</span>
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span>random<span style=color:#555>.</span>seed()
Expand Down

0 comments on commit e207b21

Please sign in to comment.