diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2023-07-15 19:31:17 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2023-07-15 19:31:17 +0200 |
| commit | 831c3999b48613c61e15094bf0581cb38e1c3467 (patch) | |
| tree | c9cd739ed6cc3d6a98fbadfa0cbda6f7ce3bdbc9 | |
| parent | b63811848fd58d0c0478244ca19a938ad88a4257 (diff) | |
Minor changes
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | Makefile | 13 | ||||
| -rw-r--r-- | README.md | 20 | ||||
| -rw-r--r-- | src/logger.c | 3 | ||||
| -rw-r--r-- | src/publisher.c | 4 | ||||
| -rw-r--r-- | src/subscriber.c (renamed from src/client.c) | 3 |
6 files changed, 22 insertions, 23 deletions
@@ -1,7 +1,7 @@ # Binary /logger /publisher -/client +/subscriber # Caches /logs @@ -3,21 +3,24 @@ include $(CONF) CC="gcc" CFLAGS= -all: publisher client logger +all: publisher subscriber logger publisher: src/publisher.c src/utils.c $(CC) -lzmq $^ -o $@ -client: src/client.c src/utils.c +subscriber: src/subscriber.c src/utils.c $(CC) -lzmq $^ -o $@ logger: src/logger.c src/utils.c $(CC) $^ -o $@ -start: publisher client +publish: publisher logger + $(error "Not yet implemented") + +subscribe: subscriber $(error "Not yet implemented") clean: - rm -f logger client publisher + rm -f logger subscriber publisher -.PHONY: clean publisher client logger start +.PHONY: clean publish subscribe @@ -3,16 +3,22 @@ A ZeroMQ-based power monitoring publisher for the ina260 chip. This repository provides: - `logger`: that collects (as fast as possible) power measurements from the ina260 using the dedicated driver -- `publisher`: that continuously publish through the pub/sub communication pattern of ZeroMQ -- `client`: a sub client example that you can use for testing +- `publisher`: that continuously publish using the ZeroMQ pub/sub communication pattern +- `subscriber`: a client that collect the measurements from the publishers (broker, frontend etc...) *Note: Nothing is stored locally! Everything that is published by the publisher is either receive by a subscriber or lost.* ### Compilation -The only dependency is [ZeroMQ](https://zeromq.org/). -First, you need to setup the environment by editing `config.mk` according to your needs. Then, executing `make` is sufficient to generate *logger*, *publisher* and *client*. +The only dependency is [ZeroMQ](https://zeromq.org/). After installing the ZeroMQ library, the following will generate all the executables: -### Execution -Running `make start` will start the *logger* and *publisher* according to the settings you provided in `config.mk`. + $ make -Then, to access to the power measurements, simply execute the client on a machine where the publisher is reachable with `./client`.
\ No newline at end of file +### Deployment +1. Update `config.mk` according to you needs +2. On the nodes equiped with the ina260 chips: + + $ make publish + +3. One the node that collect the measurements (broker, frontend etc..): + + $ make subscribe
\ No newline at end of file diff --git a/src/logger.c b/src/logger.c index 8798db4..0a3278e 100644 --- a/src/logger.c +++ b/src/logger.c @@ -1,6 +1,3 @@ -// Weather update client -// Connects SUB socket to tcp://localhost:5556 -// Collects weather updates and finds avg temp in zipcode #include <zmq.h> #include <assert.h> #include <time.h> diff --git a/src/publisher.c b/src/publisher.c index 8b0906a..e216232 100644 --- a/src/publisher.c +++ b/src/publisher.c @@ -1,7 +1,3 @@ -// Weather update server -// Binds PUB socket to tcp://*:5556 -// Publishes random weather updates - #include <zmq.h> #include <assert.h> #include <time.h> diff --git a/src/client.c b/src/subscriber.c index 32172fd..932a82d 100644 --- a/src/client.c +++ b/src/subscriber.c @@ -1,6 +1,3 @@ -// Weather update client -// Connects SUB socket to tcp://localhost:5556 -// Collects weather updates and finds avg temp in zipcode #include <zmq.h> #include <assert.h> #include <time.h> |
