From fc7f700fd89b0ad4f150d85f3bcf9c115ac0cde3 Mon Sep 17 00:00:00 2001 From: test2 Date: Sun, 24 Nov 2019 20:04:04 +0200 Subject: [PATCH] pi2server --- IoT/SensorNode2Server.adoc | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/IoT/SensorNode2Server.adoc b/IoT/SensorNode2Server.adoc index b56d5a5..60277d8 100644 --- a/IoT/SensorNode2Server.adoc +++ b/IoT/SensorNode2Server.adoc @@ -417,7 +417,7 @@ composer require guzzlehttp/guzzle -== IoT Server +== IoT Swarm Server .Imaging a swarm image:./Swarming2.png[alt="Swarm"] @@ -426,16 +426,16 @@ image:./Swarming2.png[alt="Swarm"] .Architecture of swarm communication image:./swarmlabn-1.png[alt="Swarm Gateway"] -- Red Note: Sensor Node and Gateway Role -- Black and Red Note: Sensor Node - Client +- Red Node: Sensor Node and Gateway Role +- Black and Red Node: Sensor Node - Client === NodeJS ==== Gateway -Gateway forwards ore Client Data to the correct application - Server +Gateway forwards our Client Data to the correct application - Server -.NodeJS code in Raspberry Pi - Server Gateway +.NodeJS code in Raspberry Pi - Gateway Role [source,c] ---- // Setup basic express server @@ -503,11 +503,15 @@ app.listen(9089, function () { ==== Server - Broadcast - Broadcast data to swarm clients The server receives data from its client and echoes its back. +[NOTE] +==== +The Server may be inside or outside the swarm +==== + .NodeJS code in Raspberry Pi - Server broadcast [source,c] ---- @@ -562,7 +566,7 @@ io.on('connection', (socket) => { Swarm client recieves data -.NodeJS code in Raspberry Pi - Client +.NodeJS code in Raspberry Pi - Client Role [source,c] ---- // Setup basic express server @@ -597,6 +601,8 @@ io.on('connection', (socket) => { ==== Client Connection - Web Server + + .Javascript code [source,c] ----