Browse Source

pi2server

master
test2 5 years ago
parent
commit
fc7f700fd8
  1. 20
      IoT/SensorNode2Server.adoc

20
IoT/SensorNode2Server.adoc

@ -417,7 +417,7 @@ composer require guzzlehttp/guzzle
== IoT Server == IoT Swarm Server
.Imaging a swarm .Imaging a swarm
image:./Swarming2.png[alt="Swarm"] image:./Swarming2.png[alt="Swarm"]
@ -426,16 +426,16 @@ image:./Swarming2.png[alt="Swarm"]
.Architecture of swarm communication .Architecture of swarm communication
image:./swarmlabn-1.png[alt="Swarm Gateway"] image:./swarmlabn-1.png[alt="Swarm Gateway"]
- Red Note: Sensor Node and Gateway Role - Red Node: Sensor Node and Gateway Role
- Black and Red Note: Sensor Node - Client - Black and Red Node: Sensor Node - Client
=== NodeJS === NodeJS
==== Gateway ==== 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] [source,c]
---- ----
// Setup basic express server // Setup basic express server
@ -503,11 +503,15 @@ app.listen(9089, function () {
==== Server - Broadcast ==== Server - Broadcast
Broadcast data to swarm clients Broadcast data to swarm clients
The server receives data from its client and echoes its back. 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 .NodeJS code in Raspberry Pi - Server broadcast
[source,c] [source,c]
---- ----
@ -562,7 +566,7 @@ io.on('connection', (socket) => {
Swarm client recieves data Swarm client recieves data
.NodeJS code in Raspberry Pi - Client .NodeJS code in Raspberry Pi - Client Role
[source,c] [source,c]
---- ----
// Setup basic express server // Setup basic express server
@ -597,6 +601,8 @@ io.on('connection', (socket) => {
==== Client Connection - Web Server ==== Client Connection - Web Server
.Javascript code .Javascript code
[source,c] [source,c]
---- ----

Loading…
Cancel
Save