Linking Raspberry PI with our device through IBM Bluemix

Post on 21-Jan-2018

2,079 views 0 download

transcript

www.azilen.com

Linking Raspberry PI with our device through

IBM Bluemix

www.azilen.com 01

1. To link the Raspberry PI with your virtual device in IBM Bluemix, first of

all you need to IoT service running in Raspberry pi. Run the below

command to stop it.

sudo service iot stop

2. Type the below command to device configuration file.

sudo nano /etc/iotsample-raspberrypi/device.cfg

www.azilen.com 02

3. Copy and paste the device information to device.cfg file. You have received this

information while getting registered with IBM Bluemix.

#Device configuration file

org = p29vg0

type = RaspberryPI3

id = PiBrain

auth-method = token

auth-token = 3*)DPXWa+NFQl&Zgjs

#End of Configuration file

www.azilen.com 02

4. The newer version of Raspberry PI has already come up with Node-RED and

Watson IoT. If you are using the newer version, run following command to update

Raspberry PI

sudo apt-get update

sudo apt-get dist-upgrade

5. Type below command to start Node-RED.

node-red

www.azilen.com 03

6. Once your node-red server has started, you can see it from below url.

www.azilen.com 04

7. IBM offers set of nodes that we can use potentially. Open below url and

copy JSON from it.

https://raw.githubusercontent.com/ibm-messaging/iot-device-

samples/master/node-red/device-sample/quickstart.json

www.azilen.com 05

8. In Node-RED editor go to Menu >> Import >> Clipboard

www.azilen.com 06

9. Paste JSON value to import nodes

www.azilen.com 07

10. Double click on Event node

www.azilen.com 08

11. A pop-up will appear, select “Registered” radio button and click on edit button.

www.azilen.com 09

12. Add the data which have configured in our device.cfg file.

www.azilen.com 10

13. Click on “Add” button to save the data which help to connect toIBM Bluemix.14. Click on “Deploy” button to connect your device with IBM.

www.azilen.com 11

15. Now your device is connected.

www.azilen.com 12

You can conform the connection status through device listing