Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add download starter code link #711

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 43 additions & 93 deletions starters/IoT/start_iot.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,99 +105,49 @@ Configure the Node-RED device simulator. Use the device simulator to send MQTT d

8. Connect your sample IoT device to {{site.data.keyword.iot_short_notm}} to view device data.

## Creating cards in {{site.data.keyword.iot_short_notm}} to show live data
{: #createcards}
To create cards, perform the following tasks.

### Automatically generate data every 3 seconds
1. In the Node-RED tab, double-click the Send Data node
2. Set Repeat to Interval Every 3 seconds
3. Deploy

### Create new cards in the dashboard
1. Go to the {{site.data.keyword.iot_short_notm}} dashboard browser tab.
2. Select BOARDS.
3. Click Create New Board.
4. Give it a name like Home Environment.
5. Create.
6. Click Add New Card (for temperature).
1. Under Devices, select Realtime chart.
2. Card source data, check your Device "LivingRoomThermo1", then click Next.
3. Connect new data set.
- Name: Temperature
- Event: update
- Property: temp
- Type: Float
- Unit: °C
- Precision: 2
- Min: 0
- Max: 50
- Next
4. Card preview.
- Select L
- Next
5. Card information.
- Title: Temperature
6. Submit.
7. The temperature card appears on the dashboard and includes a graph of the live temperature data.
7. Click Add New Card (for humidity).
1. Under Devices, select Show more.
2. Select Gauge.
3. Card source data, check your Device, then click Next.
4. Connect new data set.
- Name: Humidity
- Event: update
- Property: humidity
- Type: Float
- Unit: "% relative humidity"
- Precision: 1
- Min: 10
- Max: 95
- Next
5. Card preview.
- Settings
- Lower threshold: 40 and fair
- Middle: good
- Upper threshold: 50% and fair
- Select M
- Next
6. Card information.
- Title: Humidity
7. Submit.
8. The humidity card appears on the dashboard and includes a gauge that shows the live humidity data.
8. Click Add New Card (for location).
1. Under Devices, select Show more.
2. Select Value.
3. Card source data, check your Device. "LivingRoomThermo1", then click Next.
4. Connect new data set.
- Name: Latitude
- Event: update
- Property: location.latitude
- Type: Float
- Unit: "°N"
- Precision: 2
- Min: -180
- Max: 180
5. Connect new data set.
- Name: Longitude
- Event: update
- Property: location.longitude
- Type: Float
- Unit: "°E"
- Precision: 2
- Min: -180
- Max: 180
- Next
6. Card preview.
- Select L
- Next
7. Card information.
- Title: Location
8. Submit.
9. Watch your new cards update in real time with the simulator data generated by the Node-RED flow.
**Note**: Node-RED continues to send data until you stop it.
10. In the Node-RED flow editor, update the Send Data node to Repeat: none.
11. Deploy.
# Deploying your app with the command line interface
{:shortdesc}
You can use the command line interface to deploy and modify applications and service instances.

{:prereq}
Before you begin, install the Cloud Foundry and {{site.data.keyword.Bluemix}} command line interfaces.

<p>
<a class="xref" href="https://github.com/cloudfoundry/cli/releases" target="_blank" title="(Opens in a new tab or window)"><img class="image" src="images/btn_cf_commandline.svg" alt="Download Cloud Foundry command line interface" /> </a>

<a class="xref" href="http://clis.ng.bluemix.net/ui/home.html" target="_blank" title="(Opens in a new tab or window)"><img class="image" src="images/btn_bx_commandline.svg" alt="Download {{site.data.keyword.Bluemix}} command line interface" /> </a> </p>

After the command line interfaces are installed, you can get started:

1. {: download} Download your starter code, and extract the package to a new directory to set up your development environment.

<a class="xref" href="http://bluemix.net" target="_blank" title="(Opens in a new tab or window)"><img class="image" src="images/btn_starter-code.svg" alt="Download starter code" /> </a>

2. Change to the directory where your code is located.

<pre class="pre">cd <var class="keyword varname">your_new_directory</var></pre>

3. Make changes to your app code as you see fit. We suggest making sure the app runs locally before you deploy it back to {{site.data.keyword.Bluemix}}.<br><br>One file you should take note of is the `manifest.yml` file. When deploying your app back to {{site.data.keyword.Bluemix}}, this file is used to determine your application’s URL, memory allocation, number of instances, and other crucial parameters. You can [read more about the manifest file](https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html){: new_window} in the Cloud Foundry documentation.

4. Connect to {{site.data.keyword.Bluemix}}.

<pre class="pre">bluemix api https://api.<span class="keyword" data-hd-keyref="DomainName">DomainName</span></pre>

5. Log in to {{site.data.keyword.Bluemix_notm}}.

<pre class="pre">bluemix login -u <var class="keyword varname" data-hd-keyref="user_ID">username</var> -o <var class="keyword varname" data-hd-keyref="org_name">org_name</var> -s <var class="keyword varname" data-hd-keyref="space_name">space_name</var></pre>

If you are using a federated ID, use the -sso option.

<pre class="pre">bluemix login -u <var class="keyword varname" data-hd-keyref="user_ID">username</var> -o "<var class="keyword varname" data-hd-keyref="org_name">org_name</var>" -s "<var class="keyword varname" data-hd-keyref="space_name">space_name</var>" -sso</pre>

6. Deploy your app to {{site.data.keyword.Bluemix_notm}}. For more information about the cf push command, see [Uploading your application](/docs/starters/upload_app.html).

<pre class="pre">cf push "<var class="keyword varname" data-hd-keyref="app_name">app_name</var>"</pre>

7. Access your app by entering the following URL into your browser:

<pre class="codeblock"><code><var class="keyword varname" data-hd-keyref="host">host</var>.<span class="keyword" data-hd-keyref="APPDomain">AppDomainName</span></code></pre>

## What's next?
{: #whatsnext}
Expand Down