http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/air_quality_sensor/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/air_quality_sensor/index.html b/develop/os/tutorials/air_quality_sensor/index.html index ac8024f..98d9b4a 100644 --- a/develop/os/tutorials/air_quality_sensor/index.html +++ b/develop/os/tutorials/air_quality_sensor/index.html @@ -10,7 +10,7 @@ <link rel="canonical" href="http://mynewt.apache.org/os/tutorials/air_quality_sensor/"> --> <link rel="shortcut icon" href="../../../img/favicon.ico"> - <title>Air-quality Sensor project - Apache Mynewt</title> + <title>Basic Air Quality Sensor - Apache Mynewt</title> <link href="../../../css/bootstrap-3.0.3.min.css" rel="stylesheet"> <link rel="stylesheet" href="../../../css/highlight.css"> @@ -41,7 +41,7 @@ </head> - <body class="Air-quality Sensor project"> + <body class="Basic Air Quality Sensor"> <div class="container"> @@ -278,8 +278,33 @@ + + + <li><a href=" + ./ +">Air-quality Sensor project</a> + + + <ul> + + + <li class="active"> - <a href="./">Air-quality Sensor project</a> + <a href="./">Basic Air Quality Sensor</a> + </li> + + + + + + <li > + <a href="../air_quality_ble/">Bluetooth-enabled Air Quality Sensor</a> + </li> + + + + </ul> + </li> @@ -438,15 +463,15 @@ - <li>» <a href="../../introduction/">Mynewt Documentation</a></li> + <li>» <a href="../tutorials/">Tutorials</a></li> - <li>» <a href="../tutorials/">Tutorials</a></li> + <li>» Air-quality Sensor project</li> - <li>» Air-quality Sensor project</li> + <li>» Basic Air Quality Sensor</li> @@ -463,15 +488,17 @@ </pre></div> -<p>Let's say you are using STM32F3discovery board as the platform. You know you need the board support package for that hardware. You can look up its location, add it your project, and fetch that along with the core OS components.</p> -<p>To make this happen, you'll need to modify the project.yml in your project's root directory.</p> +<p>Let's say you are using Arduino Primo -- which is based on the Nordic Semi NRF52 chip -- as the platform. +You know you need the board support package for that hardware. You can look up its location, add it your +project, and fetch that along with the core OS components. Luckily, the Arduino Primo is supported in the +Mynewt Core, so there's nothing much to do here. </p> +<p>Your project.yml file should look like this:</p> <div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"> [user@IsMyLaptop:~/src/air_quality]$ emacs project.yml & [user@IsMyLaptop:~/src/air_quality]$ cat project.yml project.name: "air_quality" project.repositories: - apache-mynewt-core - - mynewt_stm32f3 # Use github's distribution mechanism for core ASF libraries. # This provides mirroring automatically for us. @@ -482,78 +509,74 @@ user: apache repo: incubator-mynewt-core - repository.mynewt_stm32f3: - type: github - vers: 0-latest - user: runtimeinc - repo: mynewt_stm32f3 [user@IsMyLaptop:~/src/air_quality]$ newt install apache-mynewt-core - mynewt_stm32f3 [user@IsMyLaptop:~/src/air_quality]$ ls repos/ - apache-mynewt-core mynewt_stm32f3 + apache-mynewt-core </pre></div> -<p>Good. You want to make sure you have all the needed bits for supporting your board; so you decide to build the blinky project for the platform first.</p> -<p>Now create a target for it and build it. Easiest way to proceed is to copy the existing target for blinky, and modify it to build for STM32F3Discovery board.</p> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">[user@IsMyLaptop:~/src/air_quality]$ newt target copy my_blinky_sim blink_f3 -Target successfully copied; targets/my_blinky_sim --> targets/blink_f3 -[user@IsMyLaptop:~/src/air_quality]$ newt target set blink_f3 bsp=@mynewt_stm32f3/hw/bsp/stm32f3discovery -Target targets/blink_f3 successfully set target.bsp to @mynewt_stm32f3/hw/bsp/stm32f3discovery -[user@IsMyLaptop:~/src/air_quality]$ newt build blink_f3 +<p>Good. You want to make sure you have all the needed bits for supporting your board; +so you decide to build the blinky project for the platform first.</p> +<p>Now create a target for it and build it. Easiest way to proceed is to copy the existing target for blinky, and modify it to build for Arduino Primo board.</p> +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">[user@IsMyLaptop:~/src/air_quality]$ newt target copy my_blinky_sim blink_primo +Target successfully copied; targets/my_blinky_sim --> targets/blink_primo +[user@IsMyLaptop:~/src/air_quality]$ newt target set blink_primo bsp=@apache-mynewt-core/hw/bsp/arduino_primo_nrf52 +Target targets/blink_nrf successfully set target.bsp to @apache-mynewt-core/hw/bsp/arduino_primo_nrf52 +[user@IsMyLaptop:~/src/air_quality]$ newt build blink_primo Compiling hal_bsp.c ... Linking blinky.elf -App successfully built: /Users/user/src/air_quality/bin/blink_f3/apps/blinky/blinky.elf +App successfully built: /Users/user/src/air_quality/bin/blink_primo/apps/blinky/blinky.elf </pre></div> <p>Good.</p> <p>You know that this platform uses bootloader, which means you have to create a target for that too.</p> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">[user@IsMyLaptop:~/src/air_quality]$ newt target create boot_f3 -Target targets/boot_f3 successfully created +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">[user@IsMyLaptop:~/src/air_quality]$ newt target create boot_primo +Target targets/boot_nrf successfully created [user@IsMyLaptop:~/src/air_quality]$ newt target show @apache-mynewt-core/targets/unittest bsp=hw/bsp/native build_profile=debug compiler=compiler/sim -targets/blink_f3 +targets/blink_primo app=apps/blinky - bsp=@mynewt_stm32f3/hw/bsp/stm32f3discovery + bsp=@apache-mynewt-core/hw/bsp/arduino_primo_nrf52 build_profile=debug -targets/boot_f3 +targets/boot_primo targets/my_blinky_sim app=apps/blinky bsp=@apache-mynewt-core/hw/bsp/native build_profile=debug -[user@IsMyLaptop:~/src/air_quality]$ newt target set boot_f3 bsp=@mynewt_stm32f3/hw/bsp/stm32f3discovery -Target targets/boot_f3 successfully set target.bsp to @mynewt_stm32f3/hw/bsp/stm32f3discovery -[user@IsMyLaptop:~/src/air_quality]$ newt target set boot_f3 app=@apache-mynewt-core/apps/boot -Target targets/boot_f3 successfully set target.app to @apache-mynewt-core/apps/boot -[user@IsMyLaptop:~/src/air_quality]$ newt target set boot_f3 build_profile=optimized -Target targets/boot_f3 successfully set target.build_profile to optimized +[user@IsMyLaptop:~/src/air_quality]$ newt target set boot_nrf bsp=@apache-mynewt-core/hw/bsp/arduino_primo_nrf52 +Target targets/boot_nrf successfully set target.bsp to @apache-mynewt-core/hw/bsp/arduino_primo_nrf52 +[user@IsMyLaptop:~/src/air_quality]$ newt target set boot_nrf app=@apache-mynewt-core/apps/boot +Target targets/boot_nrf successfully set target.app to @apache-mynewt-core/apps/boot +[user@IsMyLaptop:~/src/air_quality]$ newt target set boot_nrf build_profile=optimized +Target targets/boot_nrf successfully set target.build_profile to optimized </pre></div> <p>And then build it, and load it onto the board.</p> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">newt build boot_f3 +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">newt build boot_primo .... Linking boot.elf -App successfully built: /Users/user/src/air_quality/bin/boot_f3/apps/boot/boot.elf +App successfully built: /Users/user/src/air_quality/bin/boot_primo/apps/boot/boot.elf [user@IsMyLaptop:~/src/air_quality] -$ newt load boot_f3 +$ newt load boot_primo </pre></div> -<p>Next you must download the targets to board, and see that the LED actually blinks. You plug in the STM32F3 discovery board to your laptop, and say:</p> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">[user@IsMyLaptop:~/src/air_quality]$ newt load blink_f3 -Downloading /Users/user/src/air_quality/bin/blink_f3/apps/blinky/blinky.img to 0x08009000 -Open On-Chip Debugger 0.9.0 (2015-05-28-12:05) -.... -xPSR: 0x01000000 pc: 0x0800026c msp: 0x10002000 -auto erase enabled -Error: couldn't open /Users/user/src/air_quality/bin/blink_f3/apps/blinky/blinky.img +<p>At this point, you may (or may not) see a bunch of error messages about not being able to connect to +your board, not being able to load the image, etc. If that's the case, and you haven't already, you +should most definitely go worth through the <a href="../blinky_primo/">blinky_primo</a> tutorial so that you +can properly communicate with your board.</p> +<p>Next you must download the targets to board, and see that the LED actually blinks. You plug in the +Arduino Primo board to your laptop, and say:</p> +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">[user@IsMyLaptop:~/src/air_quality]$ newt load blink_primo +Loading app image into slot 1 +Error: couldn't open /Users/user/src/air_quality/bin/blink_primo/apps/blinky/blinky.img Error: exit status 1 @@ -576,67 +599,86 @@ exit status 1 </pre></div> -<p>Ah. Forgot to create an image out of the blinky binary. Note that every time you want to build and load a new firmware image to target board, you need to run 'create-image' on it.</p> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">[user@IsMyLaptop:~/src/air_quality]$ newt create-image blink_f3 0.0.1 -App image successfully generated: /Users/user/src/air_quality/bin/blink_f3/apps/blinky/blinky.img -Build manifest: /Users/user/src/air_quality/bin/blink_f3/apps/blinky/manifest.json -[user@IsMyLaptop:~/src/air_quality]$ newt load blink_f3 0.0.1 +<p>Ah. Forgot to create an image out of the blinky binary. Note that every time you want to build and +load a new firmware image to a target board, you need to run 'create-image' on it.</p> +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">[user@IsMyLaptop:~/src/air_quality]$ newt create-image blink_primo 0.0.1 +App image successfully generated: /Users/user/src/air_quality/bin/blink_primo/apps/blinky/blinky.img +Build manifest: /Users/user/src/air_quality/bin/blink_nrf/apps/blinky/manifest.json +[user@IsMyLaptop:~/src/air_quality]$ newt load blink_primo </pre></div> <p>And it's blinking.</p> -<p>Shortcut for doing build/create-image/load/debug steps all in one is 'newt run' command. Check out the usage from command line help.</p> +<p>Shortcut for doing build/create-image/load/debug steps all in one is 'newt run' command. Check +out the usage from command line help.</p> <h3 id="create-test-project">Create test project</h3> <p>Now that you have your system setup, you can start creating your own stuff. -First you want to create a project for yourself - you can start by getting project template from blinky, as it pretty much has what you want.</p> +First you want to create a project for yourself - you could start by using blinky as a project +template, but since we're going to want to be able to access the data via Bluetooth, let's +use the <code>bleprph</code> Bluetooth Peripheral project instead.</p> <div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"> [user@IsMyLaptop:~/src/air_quality]$ mkdir apps/air_quality - [user@IsMyLaptop:~/src/air_quality]$ cp repos/apache-mynewt-core/apps/blinky/pkg.yml apps/air_quality/ - [user@IsMyLaptop:~/src/air_quality]$ mkdir apps/air_quality/src - [user@IsMyLaptop:~/src/air_quality]$ cp repos/apache-mynewt-core/apps/blinky/src/main.c apps/air_quality/src/ + [user@IsMyLaptop:~/src/air_quality]$ cp repos/apache-mynewt-core/apps/bleprph/pkg.yml apps/air_quality/ + [user@IsMyLaptop:~/src/air_quality]$ cp -Rp repos/apache-mynewt-core/apps/bleprph/src apps/air_quality/ </pre></div> <p>Then you modify the apps/air_quality/pkg.yml for air_quality in order to change the <em>pkg.name</em> to be <em>apps/air_quality</em>. -You also need to point the package dependencies to point to packages in apache-mynewt-core repository. -STM32F3discovery board has limited amount of memory, so you must also switch your libc to be baselibc, instead of the standard one.</p> +You'll need to add the <code>@apache-mynewt-core/</code> path to all the package dependencies, since the app no longer +resides within the apache-mynewt-core repository.</p> +<p>The Arduino Primo board has a limited amount of memory, so you must also switch your libc to be baselibc, instead of the standard one.</p> <div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">[user@IsMyLaptop:~/src/air_quality]$ cat apps/air_quality/pkg.yml pkg.name: apps/air_quality pkg.type: app -pkg.description: Air quality sensor test +pkg.description: BLE Air Quality application. +pkg.author: "Apache Mynewt <[email protected]>" +pkg.homepage: "http://mynewt.apache.org/" pkg.keywords: pkg.deps: - - "@apache-mynewt-core/libs/console/full" - - "@apache-mynewt-core/libs/newtmgr" - - "@apache-mynewt-core/libs/os" - - "@apache-mynewt-core/libs/shell" - - "@apache-mynewt-core/sys/config" + - "@apache-mynewt-core/kernel/os" - "@apache-mynewt-core/sys/log" - - "@apache-mynewt-core/sys/stats" - - "@apache-mynewt-core/libs/baselibc" + - "@apache-mynewt-core/mgmt/newtmgr" + - "@apache-mynewt-core/mgmt/newtmgr/transport/ble" + - "@apache-mynewt-core/net/nimble/controller" + - "@apache-mynewt-core/net/nimble/host" + - "@apache-mynewt-core/net/nimble/host/services/ans" + - "@apache-mynewt-core/net/nimble/host/services/gap" + - "@apache-mynewt-core/net/nimble/host/services/gatt" + - "@apache-mynewt-core/net/nimble/host/store/ram" + - "@apache-mynewt-core/net/nimble/transport/ram" + - "@apache-mynewt-core/sys/console/full" + - "@apache-mynewt-core/libc/baselibc" + - "@apache-mynewt-core/sys/sysinit" + - "@apache-mynewt-core/sys/id" </pre></div> <p>And create a target for it:</p> <div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">[user@IsMyLaptop:~/src/air_quality]$ newt target create air_q Target targets/air_q successfully created -[user@IsMyLaptop:~/src/air_quality]$ newt target set air_q bsp=@mynewt_stm32f3/hw/bsp/stm32f3discovery -Target targets/air_q successfully set target.bsp to @mynewt_stm32f3/hw/bsp/stm32f3discovery +[user@IsMyLaptop:~/src/air_quality]$ newt target set air_q bsp=@apache-mynewt-core/hw/bsp/arduino_primo_nrf52 +Target targets/air_q successfully set target.bsp to @apache-mynewt-core/hw/bsp/arduino_primo_nrf52 [user@IsMyLaptop:~/src/air_quality]$ newt target set air_q app=apps/air_quality Target targets/air_q successfully set target.app to apps/air_quality [user@IsMyLaptop:~/src/air_quality]$ newt target set air_q build_profile=debug Target targets/air_q successfully set target.build_profile to debug [user@IsMyLaptop:~/src/air_quality]$ newt build air_q .... -Linking air_quality.elf -App successfully built: /Users/user/src/air_quality/bin/air_q/apps/air_quality/air_quality.elf +Linking /Users/dsimmons/dev/myproj/bin/targets/air_q/app/apps/air_quality/air_quality.elf +Target successfully built: targets/air_q </pre></div> <h3 id="create-packages-for-drivers">Create packages for drivers</h3> -<p>One of the sensors you want to enable is SenseAir K30, which will connect to the board over serial port. +<p>One of the sensors you want to enable is SenseAir K30, which will connect to the board over a serial port. To start development of the driver, you first need to create a package description for it, and add stubs for sources.</p> -<p>So you add few files. pkg.yml to describe the driver, and then header stub followed by source stub.</p> +<p>The first thing to do is to create the directory structure for your driver:</p> +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">[user@IsMyLaptop:~/src/air_quality]$ mkdir -p libs/my_drivers/senseair/include/senseair +[user@IsMyLaptop:~/src/air_quality]$ mkdir -p libs/my_drivers/senseair/src +</pre></div> + + +<p>Now you can add the files you need. You'll need a pkg.yml to describe the driver, and then header stub followed by source stub.</p> <div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">[user@IsMyLaptop:~/src/air_quality]$ cat libs/my_drivers/senseair/pkg.yml </pre></div> @@ -726,8 +768,8 @@ To start development of the driver, you first need to create a package descripti </pre></div> -<p>And add dependency to this package in my project yml file.</p> -<p>Here's from apps/air_quality/pkg.yml</p> +<p>And add dependency to this package in your project yml file.</p> +<p>Here's the listing from apps/air_quality/pkg.yml</p> <div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">pkg.name: apps/air_quality pkg.type: app pkg.description: Air quality sensor test @@ -756,6 +798,51 @@ pkg.deps: </pre></div> +<p>The ble_prph app runs everything in one task handler. For this project, we're going to add a second +task handler to respond to the shell, and then handle communicating with the senseair sensor for us.</p> +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #177500">/** shell task settings. */</span> +<span style="color: #633820">#define SHELL_TASK_PRIO 2</span> +<span style="color: #633820">#define SHELL_STACK_SIZE (OS_STACK_ALIGN(336))</span> + +<span style="color: #A90D91">struct</span> <span style="color: #000000">os_eventq</span> <span style="color: #000000">shell_evq</span>; +<span style="color: #A90D91">struct</span> <span style="color: #000000">os_task</span> <span style="color: #000000">shell_task</span>; +<span style="color: #A90D91">bssnz_t</span> <span style="color: #A90D91">os_stack_t</span> <span style="color: #000000">shell_stack</span>[<span style="color: #000000">SHELL_STACK_SIZE</span>]; +</pre></div> + + +<p>That defines the task, now we need to initialize it, add a task handler, and we're going to +use this task as our default task handler.</p> +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #177500">/**</span> +<span style="color: #177500"> * Event loop for the main shell task.</span> +<span style="color: #177500"> */</span> +<span style="color: #A90D91">static</span> <span style="color: #A90D91">void</span> +<span style="color: #000000">shell_task_handler</span>(<span style="color: #A90D91">void</span> <span style="color: #000000">*unused</span>) +{ + <span style="color: #A90D91">while</span> (<span style="color: #1C01CE">1</span>) { + <span style="color: #000000">os_eventq_run</span>(<span style="color: #000000">&shell_evq</span>); + } +} +</pre></div> + + +<p>And in your <code>main()</code> add:</p> +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"> <span style="color: #177500">/* Initialize shell eventq */</span> + <span style="color: #000000">os_eventq_init</span>(<span style="color: #000000">&shell_evq</span>); + + <span style="color: #177500">/* Create the shell task. </span> +<span style="color: #177500"> * All shell operations are performed in this task.</span> +<span style="color: #177500"> */</span> + <span style="color: #000000">os_task_init</span>(<span style="color: #000000">&shell_task</span>, <span style="color: #C41A16">"shell"</span>, <span style="color: #000000">shell_task_handler</span>, + <span style="color: #A90D91">NULL</span>, <span style="color: #000000">SHELL_TASK_PRIO</span>, <span style="color: #000000">OS_WAIT_FOREVER</span>, + <span style="color: #000000">shell_stack</span>, <span style="color: #000000">SHELL_STACK_SIZE</span>); +</pre></div> + + +<p>Don't forget to change your default task handler!</p> +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"> <span style="color: #000000">os_eventq_dflt_set</span>(<span style="color: #000000">&shell_evq</span>); +</pre></div> + + <p>And then build it to make sure all goes well.</p> <div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">[user@IsMyLaptop:~/src/air_quality]$ newt build air_q Compiling senseair.c @@ -767,23 +854,25 @@ App successfully built: /Users/user/src/air_quality/bin/air_q/apps/air_quality/a <p>All looks good.</p> <h3 id="add-cli-commands-for-testing-drivers">Add CLI commands for testing drivers</h3> -<p>While developing the driver, you want to issue operations from console asking it to do stuff. The way to do this is to register your command handler with shell. Whenever your custom command is issued, you can respond to it.</p> -<p>The way you do this is first adding a dependency to shell package for your senseair driver. So you change libs/my_drivers/senseair/pkg.yml to have the following:</p> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">pkg.name: libs/my_drivers/senseair -pkg.deps: - - "@apache-mynewt-core/hw/hal" - - "@apache-mynewt-core/libs/shell" -</pre></div> - - -<p>And then register your shell command in <em>senseair_init()</em>.</p> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">[user@IsMyLaptop:~/src/air_quality]$ cat libs/my_drivers/senseair/src/senseair.c - .... +<p>While developing the driver, you want to issue operations from console asking it to do stuff. We'll assume that you've already worked through the tutorial +on how to <a href="../add_shell/">enable the CLI</a>, so all we'll need to do is add the propper values to the project's <code>syscfg.yml</code> file:</p> +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">[user@IsMyLaptop:~/src/air_quality]$ cat targets/air_q/syscfg.yml +syscfg.vals: + # Set as per blinky_primo + OPENOCD_DEBUG: 1 + # Enable the shell task. + SHELL_TASK: 1 + STATS_CLI: 1 + CONSOLE_TICKS: 1 + CONSOLE_PROMPT: 1 </pre></div> +<p>Then register your senseair command with the shell by adding the following to <code>libs/my_drivers/senseair/src/senseair.c</code></p> <div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #633820">#include <shell/shell.h></span> <span style="color: #633820">#include <console/console.h></span> +<span style="color: #633820">#include <assert.h></span> + <span style="color: #A90D91">static</span> <span style="color: #A90D91">int</span> <span style="color: #000000">senseair_shell_func</span>(<span style="color: #A90D91">int</span> <span style="color: #000000">argc</span>, <span style="color: #A90D91">char</span> <span style="color: #000000">**argv</span>); <span style="color: #A90D91">static</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">shell_cmd</span> <span style="color: #000000">senseair_cmd</span> <span style="color: #000000">=</span> { @@ -805,12 +894,14 @@ pkg.deps: { <span style="color: #000000">console_printf</span>(<span style="color: #C41A16">"Yay! Somebody called!\n"</span>); <span style="color: #A90D91">return</span> <span style="color: #1C01CE">0</span>; + } </pre></div> -<p>Then you build this, download to target, and start minicom on your console port.</p> -<p>You'll need to wire up your Board to a Serial converter first. On the STM32F3-Discovery Board pin PA9 is TX and pin PA10 is RX so wire PA9 to RX on your serial board, and PA10 to TX on your serial board.</p> +<p>Now you can you build this, download to target, and start minicom on your console port. If you haven't already, familiarize yourself with +the tutorial on how to connect a serial port to your board <a href="../../get_started/serial_access/">here</a>.</p> +<p>You'll need to wire up your Board to a Serial converter first. On the Arduino Primo Board pin 1 is TX and pin 0 is RX so wire 1 to RX on your serial board, and 0 to TX on your serial board.</p> <div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"> [user@IsMyLaptop:~]$ minicom -D /dev/tty.usbserial-AH02MIE2 @@ -823,76 +914,39 @@ pkg.deps: Press CTRL-X Z for help on special keys ? - 141964:Unknown command ? - ? - 143804:config log echo ? tasks mempools - 143806:stat senseair - senseair - 150644:Yay! Somebody called! + 419: > ? + Commands: + 641: stat echo ? prompt ticks tasks + 643: mempools date senseair + 644: > senseair + Yay! Somebody called! + 1125: > + 53611: > tasks + Tasks: + 54047: task pri tid runtime csw stksz stkuse lcheck ncheck flg + 54057: idle 255 0 54048 66890 64 30 0 0 0 + 54068: ble_ll 0 1 9 64986 80 58 0 0 0 + 54079: bleprph 1 2 0 1 336 32 0 0 0 + 54090: shell 2 3 0 2077 336 262 0 0 0 + 54101: > </pre></div> -<p>Now that's great. You can connect the hardware to board and start developing code for the driver itself.</p> +<p>That's great. Your shell task is running, and is responding appropriately! +You can connect the hardware to your board and start developing code for the driver itself.</p> <h3 id="use-of-hal-for-drivers">Use of HAL for drivers</h3> -<p>The sensor has a serial port connection, and that's how you are going to connect to it. Your original BSP, hw/bsp/stm32f3discovery, has only one UART set up (as specified in src/hal_bsp.c, include/hal/bsp.h). Therefore, you need to create your own bsp which has configuration for this added hardware.</p> -<p>So in the shell you make a copy of the original BSP, and then change the package file a little.</p> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">[user@IsMyLaptop:~/src/air_quality]$ mkdir hw -[user@IsMyLaptop:~/src/air_quality]$ mkdir hw/bsp - -[user@IsMyLaptop:~/src/air_quality]$ cp -R repos/mynewt_stm32f3/hw/bsp/stm32f3discovery hw/bsp/stm32f3discovery_with_senseair -</pre></div> - - -<p>Then you modify the pkg.yml in the copied BSP to assign name for this package. And modify the dependency for MCU package to point to mynewt_stm32f3 repository.</p> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"> [user@IsMyLaptop:~/src/air_quality]$ grep pkg.name hw/bsp/stm32f3discovery_with_senseair/pkg.yml - pkg.name: "hw/bsp/stm32f3discovery_with_senseair" - [user@IsMyLaptop:~/src/air_quality]$ tail -2 hw/bsp/stm32f3discovery_with_senseair/pkg.yml -pkg.deps: - - "@mynewt_stm32f3/hw/mcu/stm/stm32f3xx" -</pre></div> - - -<p>And you want to use this BSP with my target. So you change the BSP in the target definition.</p> -<p>Here's your new target.</p> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">[user@IsMyLaptop:~/src/air_quality]$ newt target show air_q -targets/air_q - app=apps/air_quality - bsp=hw/bsp/stm32f3discovery_with_senseair - build_profile=debug +<p>The sensor has a serial port connection, and that's how you are going to connect to it. Your original BSP, hw/bsp/arduino_primo_nrf52, has two UARTs set up. +We're using one for our shell/console. It also has a second UART set up as a 'bit-bang' UART but since the SenseAir only needs to +communicate at 9600 baud, this bit-banged uart is plenty fast enough.</p> +<p>You'll have to make a small change to the <code>syscfg.yml</code> file in your project's target directory to chang the pin definitions +for this second UART. Those changes are as follows:</p> +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"> UART_0_PIN_TX: 23 + UART_0_PIN_RX: 24 </pre></div> -<p>You add the 2nd serial port to my new BSP. Go to hw/bsp/stm32f3discovery_with_senseair directory to do this.</p> -<p>Modify the include/hal/bsp.h to increase UART_CNT to 2, and add a definition of the 2nd logical UART. You will use this in your sensor driver.</p> -<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">static</span> <span style="color: #A90D91">const</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">stm32f3_uart_cfg</span> <span style="color: #000000">uart_cfg</span>[<span style="color: #000000">UART_CNT</span>] <span style="color: #000000">=</span> { - [<span style="color: #1C01CE">0</span>] <span style="color: #000000">=</span> { - .<span style="color: #000000">suc_uart</span> <span style="color: #000000">=</span> <span style="color: #000000">USART1</span>, - .<span style="color: #000000">suc_rcc_cmd</span> <span style="color: #000000">=</span> <span style="color: #000000">RCC_APB2PeriphClockCmd</span>, - .<span style="color: #000000">suc_rcc_dev</span> <span style="color: #000000">=</span> <span style="color: #000000">RCC_APB2Periph_USART1</span>, - .<span style="color: #000000">suc_pin_tx</span> <span style="color: #000000">=</span> <span style="color: #1C01CE">9</span>, - .<span style="color: #000000">suc_pin_rx</span> <span style="color: #000000">=</span> <span style="color: #1C01CE">10</span>, - .<span style="color: #000000">suc_pin_rts</span> <span style="color: #000000">=</span> <span style="color: #1C01CE">12</span>, - .<span style="color: #000000">suc_pin_cts</span> <span style="color: #000000">=</span> <span style="color: #1C01CE">11</span>, - .<span style="color: #000000">suc_pin_af</span> <span style="color: #000000">=</span> <span style="color: #000000">GPIO_AF_7</span>, - .<span style="color: #000000">suc_irqn</span> <span style="color: #000000">=</span> <span style="color: #000000">USART1_IRQn</span> - }, - [<span style="color: #1C01CE">1</span>] <span style="color: #000000">=</span> { - .<span style="color: #000000">suc_uart</span> <span style="color: #000000">=</span> <span style="color: #000000">USART2</span>, - .<span style="color: #000000">suc_rcc_cmd</span> <span style="color: #000000">=</span> <span style="color: #000000">RCC_APB1PeriphClockCmd</span>, - .<span style="color: #000000">suc_rcc_dev</span> <span style="color: #000000">=</span> <span style="color: #000000">RCC_APB1Periph_USART2</span>, - .<span style="color: #000000">suc_pin_tx</span> <span style="color: #000000">=</span> <span style="color: #1C01CE">19</span>, <span style="color: #177500">/* PB3 */</span> - .<span style="color: #000000">suc_pin_rx</span> <span style="color: #000000">=</span> <span style="color: #1C01CE">20</span>, <span style="color: #177500">/* PB4 */</span> - .<span style="color: #000000">suc_pin_rts</span> <span style="color: #000000">=</span> <span style="color: #1C01CE">1</span>, - .<span style="color: #000000">suc_pin_cts</span> <span style="color: #000000">=</span> <span style="color: #1C01CE">0</span>, - .<span style="color: #000000">suc_pin_af</span> <span style="color: #000000">=</span> <span style="color: #000000">GPIO_AF_7</span>, - .<span style="color: #000000">suc_irqn</span> <span style="color: #000000">=</span> <span style="color: #000000">USART2_IRQn</span> - } -}; -</pre></div> - - -<p>With this in place, you can refer to serial port where your SenseAir sensor is by a logical number. This makes the code more platform independent - you could connect this sensor to another board, like Olimex. You will also use the HAL UART abstraction to do the UART port setup and data transfer. That way you don't need to have any platform dependent pieces within your little driver.</p> -<p>You will now see what the driver code ends up looking like. Here's the header file, filled in from stub you created earlier.</p> +<p>With this in place, you can refer to serial port where your SenseAir sensor by a logical number. This makes the code more platform independent - you could connect this sensor to another board, like Olimex. You will also use the HAL UART abstraction to do the UART port setup and data transfer. That way you don't need to have any platform dependent pieces within your little driver.</p> +<p>You will now see what the driver code ends up looking like. Here's the header file, filled in from the stub you created earlier.</p> <div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #177500">/*</span> <span style="color: #177500"> * Licensed to the Apache Software Foundation (ASF) under one</span> <span style="color: #177500"> * or more contributor license agreements. See the NOTICE file</span> @@ -916,8 +970,6 @@ targets/air_q <span style="color: #A90D91">enum</span> <span style="color: #000000">senseair_read_type</span> { <span style="color: #000000">SENSEAIR_CO2</span>, - <span style="color: #000000">SENSEAIR_TEMPERATURE</span>, - <span style="color: #000000">SENSEAIR_HUMIDITY</span> }; <span style="color: #A90D91">int</span> <span style="color: #000000">senseair_init</span>(<span style="color: #A90D91">int</span> <span style="color: #000000">uartno</span>); @@ -928,7 +980,8 @@ targets/air_q </pre></div> -<p>As you can see, logical UART number has been added to the init routine. A 'read' function has been added, which is a blocking read. If you were making a commercial product, you would probably have a callback for reporting the results.</p> +<p>As you can see, logical UART number has been added to the init routine. A 'read' function has been added, +which is a blocking read. If you were making a commercial product, you would probably have a callback for reporting the results.</p> <p>And here is the source for the driver.</p> <div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #177500">/**</span> <span style="color: #177500"> * Licensed to the Apache Software Foundation (ASF) under one</span> @@ -961,12 +1014,6 @@ targets/air_q <span style="color: #A90D91">static</span> <span style="color: #A90D91">const</span> <span style="color: #A90D91">uint8_t</span> <span style="color: #000000">cmd_read_co2</span>[] <span style="color: #000000">=</span> { <span style="color: #1C01CE">0xFE</span>, <span style="color: #1C01CE">0</span><span style="color: #000000">X44</span>, <span style="color: #1C01CE">0</span><span style="color: #000000">X00</span>, <span style="color: #1C01CE">0</span><span style="color: #000000">X08</span>, <span style="color: #1C01CE">0</span><span style="color: #000000">X02</span>, <span style="color: #1C01CE">0</span><span style="color: #000000">X9F</span>, <span style="color: #1C01CE">0</span><span style="color: #000000">X25</span> }; -<span style="color: #A90D91">static</span> <span style="color: #A90D91">const</span> <span style="color: #A90D91">uint8_t</span> <span style="color: #000000">cmd_read_temp</span>[] <span style="color: #000000">=</span> { - <span style="color: #1C01CE">0xFE</span>, <span style="color: #1C01CE">0</span><span style="color: #000000">X44</span>, <span style="color: #1C01CE">0</span><span style="color: #000000">X00</span>, <span style="color: #1C01CE">0</span><span style="color: #000000">X12</span>, <span style="color: #1C01CE">0</span><span style="color: #000000">X02</span>, <span style="color: #1C01CE">0</span><span style="color: #000000">X94</span>, <span style="color: #1C01CE">0</span><span style="color: #000000">X45</span> -}; -<span style="color: #A90D91">static</span> <span style="color: #A90D91">const</span> <span style="color: #A90D91">uint8_t</span> <span style="color: #000000">cmd_read_humidity</span>[] <span style="color: #000000">=</span> { - <span style="color: #1C01CE">0xFE</span>, <span style="color: #1C01CE">0x44</span>, <span style="color: #1C01CE">0x00</span>, <span style="color: #1C01CE">0x14</span>, <span style="color: #1C01CE">0x02</span>, <span style="color: #1C01CE">0x97</span>, <span style="color: #1C01CE">0xE5</span> -}; <span style="color: #A90D91">static</span> <span style="color: #A90D91">int</span> <span style="color: #000000">senseair_shell_func</span>(<span style="color: #A90D91">int</span> <span style="color: #000000">argc</span>, <span style="color: #A90D91">char</span> <span style="color: #000000">**argv</span>); <span style="color: #A90D91">static</span> <span style="color: #A90D91">struct</span> <span style="color: #000000">shell_cmd</span> <span style="color: #000000">senseair_cmd</span> <span style="color: #000000">=</span> { @@ -1093,14 +1140,6 @@ targets/air_q <span style="color: #000000">cmd</span> <span style="color: #000000">=</span> <span style="color: #000000">cmd_read_co2</span>; <span style="color: #000000">cmd_len</span> <span style="color: #000000">=</span> <span style="color: #A90D91">sizeof</span>(<span style="color: #000000">cmd_read_co2</span>); <span style="color: #A90D91">break</span>; - <span style="color: #A90D91">case</span> <span style="color: #000000">SENSEAIR_TEMPERATURE</span>: - <span style="color: #000000">cmd</span> <span style="color: #000000">=</span> <span style="color: #000000">cmd_read_temp</span>; - <span style="color: #000000">cmd_len</span> <span style="color: #000000">=</span> <span style="color: #A90D91">sizeof</span>(<span style="color: #000000">cmd_read_temp</span>); - <span style="color: #A90D91">break</span>; - <span style="color: #A90D91">case</span> <span style="color: #000000">SENSEAIR_HUMIDITY</span>: - <span style="color: #000000">cmd</span> <span style="color: #000000">=</span> <span style="color: #000000">cmd_read_humidity</span>; - <span style="color: #000000">cmd_len</span> <span style="color: #000000">=</span> <span style="color: #A90D91">sizeof</span>(<span style="color: #000000">cmd_read_humidity</span>); - <span style="color: #A90D91">break</span>; <span style="color: #A90D91">default</span><span style="color: #000000">:</span> <span style="color: #A90D91">return</span> <span style="color: #000000">-</span><span style="color: #1C01CE">1</span>; } @@ -1123,39 +1162,11 @@ targets/air_q <span style="color: #A90D91">if</span> (<span style="color: #000000">argc</span> <span style="color: #000000"><</span> <span style="color: #1C01CE">2</span>) { <span style="color: #000000">usage</span>: - <span style="color: #000000">console_printf</span>(<span style="color: #C41A16">"%s <co2|temp|humidity>\n"</span>, <span style="color: #000000">argv</span>[<span style="color: #1C01CE">0</span>]); - <span style="color: #A90D91">return</span> <span style="color: #1C01CE">0</span>; - } - <span style="color: #A90D91">if</span> (<span style="color: #000000">!strcmp</span>(<span style="color: #000000">argv</span>[<span style="color: #1C01CE">1</span>], <span style="color: #C41A16">"co2"</span>)) { - <span style="color: #000000">type</span> <span style="color: #000000">=</span> <span style="color: #000000">SENSEAIR_CO2</span>; - } <span style="color: #A90D91">else</span> <span style="color: #A90D91">if</span> (<span style="color: #000000">!strcmp</span>(<span style="color: #000000">argv</span>[<span style="color: #1C01CE">1</span>], <span style="color: #C41A16">"temp"</span>)) { - <span style="color: #000000">type</span> <span style="color: #000000">=</span> <span style="color: #000000">SENSEAIR_TEMPERATURE</span>; - } <span style="color: #A90D91">else</span> <span style="color: #A90D91">if</span> (<span style="color: #000000">!strcmp</span>(<span style="color: #000000">argv</span>[<span style="color: #1C01CE">1</span>], <span style="color: #C41A16">"humidity"</span>)) { - <span style="color: #177500">/*</span> -<span style="color: #177500"> * timeout</span> -<span style="color: #177500"> */</span> - <span style="color: #A90D91">return</span> <span style="color: #000000">-</span><span style="color: #1C01CE">2</span>; - } - <span style="color: #A90D91">return</span> <span style="color: #000000">s->value</span>; -} - -<span style="color: #A90D91">static</span> <span style="color: #A90D91">int</span> -<span style="color: #000000">senseair_shell_func</span>(<span style="color: #A90D91">int</span> <span style="color: #000000">argc</span>, <span style="color: #A90D91">char</span> <span style="color: #000000">**argv</span>) -{ - <span style="color: #A90D91">int</span> <span style="color: #000000">value</span>; - <span style="color: #A90D91">enum</span> <span style="color: #000000">senseair_read_type</span> <span style="color: #000000">type</span>; - - <span style="color: #A90D91">if</span> (<span style="color: #000000">argc</span> <span style="color: #000000"><</span> <span style="color: #1C01CE">2</span>) { -<span style="color: #000000">usage</span>: - <span style="color: #000000">console_printf</span>(<span style="color: #C41A16">"%s <co2|temp|humidity>\n"</span>, <span style="color: #000000">argv</span>[<span style="color: #1C01CE">0</span>]); + <span style="color: #000000">console_printf</span>(<span style="color: #C41A16">"%s co2\n"</span>, <span style="color: #000000">argv</span>[<span style="color: #1C01CE">0</span>]); <span style="color: #A90D91">return</span> <span style="color: #1C01CE">0</span>; } <span style="color: #A90D91">if</span> (<span style="color: #000000">!strcmp</span>(<span style="color: #000000">argv</span>[<span style="color: #1C01CE">1</span>], <span style="color: #C41A16">"co2"</span>)) { <span style="color: #000000">type</span> <span style="color: #000000">=</span> <span style="color: #000000">SENSEAIR_CO2</span>; - } <span style="color: #A90D91">else</span> <span style="color: #A90D91">if</span> (<span style="color: #000000">!strcmp</span>(<span style="color: #000000">argv</span>[<span style="color: #1C01CE">1</span>], <span style="color: #C41A16">"temp"</span>)) { - <span style="color: #000000">type</span> <span style="color: #000000">=</span> <span style="color: #000000">SENSEAIR_TEMPERATURE</span>; - } <span style="color: #A90D91">else</span> <span style="color: #A90D91">if</span> (<span style="color: #000000">!strcmp</span>(<span style="color: #000000">argv</span>[<span style="color: #1C01CE">1</span>], <span style="color: #C41A16">"humidity"</span>)) { - <span style="color: #000000">type</span> <span style="color: #000000">=</span> <span style="color: #000000">SENSEAIR_HUMIDITY</span>; } <span style="color: #A90D91">else</span> { <span style="color: #A90D91">goto</span> <span style="color: #000000">usage</span>; } @@ -1200,18 +1211,73 @@ targets/air_q </pre></div> -<p>And you modified your main() for senseair driver init.</p> +<p>And your modified your main() for senseair driver init.</p> <div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%"><span style="color: #A90D91">int</span> <span style="color: #000000">main</span>(<span style="color: #A90D91">int</span> <span style="color: #000000">argc</span>, <span style="color: #A90D91">char</span> <span style="color: #000000">**argv</span>) { .... - <span style="color: #000000">senseair_init</span>(<span style="color: #1C01CE">1</span>); + <span style="color: #000000">senseair_init</span>(<span style="color: #1C01CE">0</span>); .... } </pre></div> -<p>You can see from the code that you are using the HAL interface to open a UART port, and using OS semaphore as a way of blocking the task when waiting for read response to come back from the sensor.</p> +<p>You can see from the code that you are using the HAL interface to open a UART port, and using OS +semaphore as a way of blocking the task when waiting for read response to come back from the sensor.</p> +<p>Now comes the fun part: Hooking up the sensor! It's fun because a) hooking up a sensor is always +fun and b) the SenseAir sensor's PCB is entirely unlabeled, so you'll have to trust us on how to hook it up. </p> +<p>So here we go. </p> +<p>You'll have to do a little soldering. I soldered some header pins to the SenseAir K30 board to +make connecting wires easier using standard jumper wires, but you can also just solder wires +straight to the board if you prefer.</p> +<p>Here's what your SenseAir board should look like once it's wired up:</p> +<p><img alt="SenseAir Wiring" src="../pics/Senseair1.png" /></p> +<p>Now that you have that wired up, let's get the Arduino Primo wired up. A couple of things to note:</p> +<ul> +<li>The Arduino Primo's 'console' UART is actually UART1. The secondary (bit-banged) UART is +UART0, so that's where we'll have to hook up the SenseAir.</li> +</ul> +<p>Here's what your Arduino Primo should now look like with everything wired in:</p> +<p><img alt="SenseAir and Arduino Primo Wiring" src="../pics/Senseair2.png" /></p> +<p>Everything is wired and you're ready to go! Build and load your new app:</p> +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">$ newt build air_q +Building target targets/air_q +Compiling apps/air_quality/src/main.c +Archiving apps_air_quality.a +Linking myproj/bin/targets/air_q/app/apps/air_quality/air_quality.elf +Target successfully built: targets/air_q +$ newt create-image air_q 1.0.0 +App image succesfully generated: myproj/bin/targets/air_q/app/apps/air_quality/air_quality.img +$ newt load air_q +Loading app image into slot 1 +</pre></div> + + +<p>Now, you should be able to connect to your serial port and read values:</p> +<div class="codehilite" style="background: #ffffff"><pre style="line-height: 125%">user@IsMyLaptop:~]$ minicom -D /dev/tty.usbserial-AH02MIE2 + + + Welcome to minicom 2.7 + + OPTIONS: + Compiled on Oct 12 2015, 07:48:30. + Port /dev/tty.usbserial-AH02MIE2, 13:44:40 + + Press CTRL-X Z for help on special keys + + 1185: > ? + Commands: + 1382: stat echo ? prompt ticks tasks + 1390: mempools date senseair + 1395: > senseair + senseair co2 + 2143: > senseair co2 + Got 973 +</pre></div> + + +<p>And you're getting valid readings! Congratulations!</p> +<p>Next we'll hook this all up via Bluetooth so that you can read those values remotely. </p> <div class="row"> @@ -1229,8 +1295,8 @@ targets/air_q </li> <li class="pull-right"> - <a href=../event_queue/> - Next: Add task to manage multiple events + <a href=../air_quality_ble/> + Next: Bluetooth-enabled Air Quality Sensor <span class="fa fa-arrow-right"></span> </a>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/arduino_zero/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/arduino_zero/index.html b/develop/os/tutorials/arduino_zero/index.html index f9c7b93..e8e3e2b 100644 --- a/develop/os/tutorials/arduino_zero/index.html +++ b/develop/os/tutorials/arduino_zero/index.html @@ -341,8 +341,13 @@ - <li > - <a href="../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/blehci_project/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/blehci_project/index.html b/develop/os/tutorials/blehci_project/index.html index 157eb37..c32b604 100644 --- a/develop/os/tutorials/blehci_project/index.html +++ b/develop/os/tutorials/blehci_project/index.html @@ -278,8 +278,13 @@ - <li > - <a href="../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/bleprph/bleprph-adv/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/bleprph/bleprph-adv/index.html b/develop/os/tutorials/bleprph/bleprph-adv/index.html index 34a17b7..251a702 100644 --- a/develop/os/tutorials/bleprph/bleprph-adv/index.html +++ b/develop/os/tutorials/bleprph/bleprph-adv/index.html @@ -278,8 +278,13 @@ - <li > - <a href="../../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/bleprph/bleprph-app/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/bleprph/bleprph-app/index.html b/develop/os/tutorials/bleprph/bleprph-app/index.html index f2eff6f..e7527ec 100644 --- a/develop/os/tutorials/bleprph/bleprph-app/index.html +++ b/develop/os/tutorials/bleprph/bleprph-app/index.html @@ -278,8 +278,13 @@ - <li > - <a href="../../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/bleprph/bleprph-chr-access/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/bleprph/bleprph-chr-access/index.html b/develop/os/tutorials/bleprph/bleprph-chr-access/index.html index 0788a99..3507a7e 100644 --- a/develop/os/tutorials/bleprph/bleprph-chr-access/index.html +++ b/develop/os/tutorials/bleprph/bleprph-chr-access/index.html @@ -278,8 +278,13 @@ - <li > - <a href="../../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/bleprph/bleprph-gap-event/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/bleprph/bleprph-gap-event/index.html b/develop/os/tutorials/bleprph/bleprph-gap-event/index.html index 432ff0f..8f546ec 100644 --- a/develop/os/tutorials/bleprph/bleprph-gap-event/index.html +++ b/develop/os/tutorials/bleprph/bleprph-gap-event/index.html @@ -278,8 +278,13 @@ - <li > - <a href="../../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/bleprph/bleprph-intro/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/bleprph/bleprph-intro/index.html b/develop/os/tutorials/bleprph/bleprph-intro/index.html index bc794be..4221849 100644 --- a/develop/os/tutorials/bleprph/bleprph-intro/index.html +++ b/develop/os/tutorials/bleprph/bleprph-intro/index.html @@ -278,8 +278,13 @@ - <li > - <a href="../../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/bleprph/bleprph-svc-reg/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/bleprph/bleprph-svc-reg/index.html b/develop/os/tutorials/bleprph/bleprph-svc-reg/index.html index f45de3e..6d57ffe 100644 --- a/develop/os/tutorials/bleprph/bleprph-svc-reg/index.html +++ b/develop/os/tutorials/bleprph/bleprph-svc-reg/index.html @@ -278,8 +278,13 @@ - <li > - <a href="../../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/bletiny_project/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/bletiny_project/index.html b/develop/os/tutorials/bletiny_project/index.html index 50066da..f1f9e59 100644 --- a/develop/os/tutorials/bletiny_project/index.html +++ b/develop/os/tutorials/bletiny_project/index.html @@ -278,8 +278,13 @@ - <li > - <a href="../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/blinky_console/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/blinky_console/index.html b/develop/os/tutorials/blinky_console/index.html index 1a1308a..3cfe425 100644 --- a/develop/os/tutorials/blinky_console/index.html +++ b/develop/os/tutorials/blinky_console/index.html @@ -341,8 +341,13 @@ - <li > - <a href="../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/blinky_primo/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/blinky_primo/index.html b/develop/os/tutorials/blinky_primo/index.html index 50b9c99..cb8c6b0 100644 --- a/develop/os/tutorials/blinky_primo/index.html +++ b/develop/os/tutorials/blinky_primo/index.html @@ -341,8 +341,13 @@ - <li > - <a href="../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/blinky_sram_olimex/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/blinky_sram_olimex/index.html b/develop/os/tutorials/blinky_sram_olimex/index.html index 6b5b0dc..cbbd13e 100644 --- a/develop/os/tutorials/blinky_sram_olimex/index.html +++ b/develop/os/tutorials/blinky_sram_olimex/index.html @@ -341,8 +341,13 @@ - <li > - <a href="../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/event_queue/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/event_queue/index.html b/develop/os/tutorials/event_queue/index.html index 07a5633..d7e9ce5 100644 --- a/develop/os/tutorials/event_queue/index.html +++ b/develop/os/tutorials/event_queue/index.html @@ -278,8 +278,13 @@ - <li > - <a href="../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> @@ -773,9 +778,9 @@ pkg.deps: <ul class="nav nav-pills" style="margin-bottom: 10px"> <li> - <a href=../air_quality_sensor/> + <a href=../air_quality_ble/> <span class="fa fa-arrow-left"></span> - Previous: Air-quality Sensor project + Previous: Bluetooth-enabled Air Quality Sensor </a> </li> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/ibeacon/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/ibeacon/index.html b/develop/os/tutorials/ibeacon/index.html index c7dbead..a6b3061 100644 --- a/develop/os/tutorials/ibeacon/index.html +++ b/develop/os/tutorials/ibeacon/index.html @@ -278,8 +278,13 @@ - <li > - <a href="../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/nRF52/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/nRF52/index.html b/develop/os/tutorials/nRF52/index.html index 37c2c69..c1a7c0d 100644 --- a/develop/os/tutorials/nRF52/index.html +++ b/develop/os/tutorials/nRF52/index.html @@ -341,8 +341,13 @@ - <li > - <a href="../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/olimex/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/olimex/index.html b/develop/os/tutorials/olimex/index.html index 8bb4ba0..dcb69ac 100644 --- a/develop/os/tutorials/olimex/index.html +++ b/develop/os/tutorials/olimex/index.html @@ -341,8 +341,13 @@ - <li > - <a href="../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/pics/MyNewtSensorReader.jpg ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/pics/MyNewtSensorReader.jpg b/develop/os/tutorials/pics/MyNewtSensorReader.jpg new file mode 100644 index 0000000..997a359 Binary files /dev/null and b/develop/os/tutorials/pics/MyNewtSensorReader.jpg differ http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/pics/Senseair1.png ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/pics/Senseair1.png b/develop/os/tutorials/pics/Senseair1.png new file mode 100644 index 0000000..9b469b3 Binary files /dev/null and b/develop/os/tutorials/pics/Senseair1.png differ http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/pics/Senseair2.png ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/pics/Senseair2.png b/develop/os/tutorials/pics/Senseair2.png new file mode 100644 index 0000000..38be672 Binary files /dev/null and b/develop/os/tutorials/pics/Senseair2.png differ http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/pin-wheel-mods/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/pin-wheel-mods/index.html b/develop/os/tutorials/pin-wheel-mods/index.html index cd46533..ed9100a 100644 --- a/develop/os/tutorials/pin-wheel-mods/index.html +++ b/develop/os/tutorials/pin-wheel-mods/index.html @@ -355,8 +355,13 @@ - <li > - <a href="../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/project-slinky/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/project-slinky/index.html b/develop/os/tutorials/project-slinky/index.html index 0711053..e8b4197 100644 --- a/develop/os/tutorials/project-slinky/index.html +++ b/develop/os/tutorials/project-slinky/index.html @@ -278,8 +278,13 @@ - <li > - <a href="../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/project-target-slinky/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/project-target-slinky/index.html b/develop/os/tutorials/project-target-slinky/index.html index fb17d81..facb592 100644 --- a/develop/os/tutorials/project-target-slinky/index.html +++ b/develop/os/tutorials/project-target-slinky/index.html @@ -278,8 +278,13 @@ - <li > - <a href="../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/repo/add_repos/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/repo/add_repos/index.html b/develop/os/tutorials/repo/add_repos/index.html index f6417c6..afd3577 100644 --- a/develop/os/tutorials/repo/add_repos/index.html +++ b/develop/os/tutorials/repo/add_repos/index.html @@ -300,8 +300,13 @@ - <li > - <a href="../../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/repo/create_repo/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/repo/create_repo/index.html b/develop/os/tutorials/repo/create_repo/index.html index 70c981d..f61cdf8 100644 --- a/develop/os/tutorials/repo/create_repo/index.html +++ b/develop/os/tutorials/repo/create_repo/index.html @@ -300,8 +300,13 @@ - <li > - <a href="../../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/repo/upgrade_repo/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/repo/upgrade_repo/index.html b/develop/os/tutorials/repo/upgrade_repo/index.html index 22deea5..3c86c1f 100644 --- a/develop/os/tutorials/repo/upgrade_repo/index.html +++ b/develop/os/tutorials/repo/upgrade_repo/index.html @@ -300,8 +300,13 @@ - <li > - <a href="../../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/tasks_lesson/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/tasks_lesson/index.html b/develop/os/tutorials/tasks_lesson/index.html index e047c9f..0f9fad8 100644 --- a/develop/os/tutorials/tasks_lesson/index.html +++ b/develop/os/tutorials/tasks_lesson/index.html @@ -278,8 +278,13 @@ - <li > - <a href="../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/tutorials/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/tutorials/index.html b/develop/os/tutorials/tutorials/index.html index 9cd2730..a1a44ca 100644 --- a/develop/os/tutorials/tutorials/index.html +++ b/develop/os/tutorials/tutorials/index.html @@ -278,8 +278,13 @@ - <li > - <a href="../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/unit_test/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/unit_test/index.html b/develop/os/tutorials/unit_test/index.html index d815736..b846512 100644 --- a/develop/os/tutorials/unit_test/index.html +++ b/develop/os/tutorials/unit_test/index.html @@ -278,8 +278,13 @@ - <li > - <a href="../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> @@ -641,7 +646,7 @@ the message shown below.</p> <li class="pull-right"> <a href=../air_quality_sensor/> - Next: Air-quality Sensor project + Next: Basic Air Quality Sensor <span class="fa fa-arrow-right"></span> </a> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/os/tutorials/wi-fi_on_arduino/index.html ---------------------------------------------------------------------- diff --git a/develop/os/tutorials/wi-fi_on_arduino/index.html b/develop/os/tutorials/wi-fi_on_arduino/index.html index 9de175b..35239a3 100644 --- a/develop/os/tutorials/wi-fi_on_arduino/index.html +++ b/develop/os/tutorials/wi-fi_on_arduino/index.html @@ -278,8 +278,13 @@ - <li > - <a href="../air_quality_sensor/">Air-quality Sensor project</a> + + + <li><a href=" + ../air_quality_sensor/ +">Air-quality Sensor project</a> + + </li> http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/170decb3/develop/sitemap.xml ---------------------------------------------------------------------- diff --git a/develop/sitemap.xml b/develop/sitemap.xml index f74161b..ca5ad51 100644 --- a/develop/sitemap.xml +++ b/develop/sitemap.xml @@ -4,7 +4,7 @@ <url> <loc>http://mynewt.apache.org/</loc> - <lastmod>2017-01-11</lastmod> + <lastmod>2017-01-19</lastmod> <changefreq>daily</changefreq> </url> @@ -13,7 +13,7 @@ <url> <loc>http://mynewt.apache.org/pages/ble/</loc> - <lastmod>2017-01-11</lastmod> + <lastmod>2017-01-19</lastmod> <changefreq>daily</changefreq> </url> @@ -22,7 +22,7 @@ <url> <loc>http://mynewt.apache.org/quick-start/</loc> - <lastmod>2017-01-11</lastmod> + <lastmod>2017-01-19</lastmod> <changefreq>daily</changefreq> </url> @@ -30,7 +30,7 @@ <url> <loc>http://mynewt.apache.org/about/</loc> - <lastmod>2017-01-11</lastmod> + <lastmod>2017-01-19</lastmod> <changefreq>daily</changefreq> </url> @@ -38,7 +38,7 @@ <url> <loc>http://mynewt.apache.org/talks/</loc> - <lastmod>2017-01-11</lastmod> + <lastmod>2017-01-19</lastmod> <changefreq>daily</changefreq> </url> @@ -46,7 +46,7 @@ <url> <loc>http://mynewt.apache.org/download/</loc> - <lastmod>2017-01-11</lastmod> + <lastmod>2017-01-19</lastmod> <changefreq>daily</changefreq> </url> @@ -54,7 +54,7 @@ <url> <loc>http://mynewt.apache.org/community/</loc> - <lastmod>2017-01-11</lastmod> + <lastmod>2017-01-19</lastmod> <changefreq>daily</changefreq> </url> @@ -62,7 +62,7 @@ <url> <loc>http://mynewt.apache.org/events/</loc> - <lastmod>2017-01-11</lastmod> + <lastmod>2017-01-19</lastmod> <changefreq>daily</changefreq> </url> @@ -71,7 +71,7 @@ <url> <loc>http://mynewt.apache.org/os/introduction/</loc> - <lastmod>2017-01-11</lastmod> + <lastmod>2017-01-19</lastmod> <changefreq>daily</changefreq> </url> @@ -83,7 +83,7 @@ <url> <loc>http://mynewt.apache.org/os/get_started/vocabulary/</loc> - <lastmod>2017-01-11</lastmod> + <lastmod>2017-01-19</lastmod> <changefreq>daily</changefreq> </url> @@ -123,13 +123,13 @@ <url> <loc>http://mynewt.apache.org/faq/how_to_edit_docs/</loc> - <lastmod>2017-01-11</lastmod> + <lastmod>2017-01-19</lastmod> <changefreq>daily</changefreq> </url> <url> <loc>http://mynewt.apache.org/faq/answers/</loc> - <lastmod>2017-01-11</lastmod> + <lastmod>2017-01-19</lastmod> <changefreq>daily</changefreq> </url>
