thundo/crows-iota
CRowdsourced Open Weather System (CROWS) for Hackster.io Contest "Machine Money with IOTA"
CROWS
CROWS is a Proof-of-Concept for a CRowdsourced Open Weather System. It is a submitted project for Hackster.IO's Machine Money: Empowering Devices with Wallets competition.
How does it run?
Server
- Clone the repository and prepare the dependencies
git clone https://github.com/thundo/crows-iota.git cd core yarn install cd ../server yarn install
- Generate a IOTA seed for your wallet. If you don't know how to do that, follow these instructions
- Create your
config/local.jsonfile which overrides the default configuration. It should be something likeThe{ "iota": { "seed": "P9LSRMEPXTBRFQTDVVVIRNEPCSJYNYAKWHZUIRLARWWLXMVOHHJZJOWPAKCVFRVCTWQGOCIBY9ZENDPUR" } }iota.seedshould be the IOTA seed generated at point 2 - (Optional) You can mess with the CROWS settings like payment interval, logging level or IOTA remote node and security. Just look at
config/default.jsonand override the relevant parts inconfig/local.json - Start the server with
yarn dev
- During startup please note the address generated from your IOTA seed which will be the address the stations sends their measurements to. The same can be seen in web interface hovering above the QR code. By default the web interface is reachable at
http://localhost:8080once the server is running.
Raspberry Setup (Weather Station with dht22)
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt install -y nodejs yarn gitClient
-
Still logged on the PI, clone the repository and prepare the dependencies
git clone https://github.com/thundo/crows-iota.git cd core yarn install cd ../client yarn install
-
Generate a IOTA seed for your wallet. If you don't know how to do that, follow these instructions
-
Create your
config/local.jsonfile which overrides the default configuration. It should be something like{ "id": "CROWS_STATION_0", "name": "Crows Weather Station 0", "latitude": 45, "longitude": 9, "altitude": 80, "iota": { "seed": "OEJDD9YRHZLIPHCMTVMLREPISX9CQERNEXNCIXQKMQOLILXPIBMRGZPWWYXVWNQBHOZOBVVFRGOSJXS9M", "serverAddress": "VTMPVYGXMIMJHYROFIHYBODLIXZYMAUTOWVEURKSDSLEHPENKSCWXVJJWIJPBHVAZNFHIDNVTUBIYMCB9" }, "crows": { "baseUrl": "http://192.168.0.1:8080", "sensor": { "pin": 4, "type": 22 } } }Let's review these settings:
id: an identifier for your station (string)name: a display name for your station (string)latitude,longitude,altitude: geolocation of the station (numeric)iota.seed: the IOTA seed generated at point 2 (string). It should be the one generated at point 2iota.serverAddress: the IOTA server address shown during server startup (string)crows.baseUrl: the web address of the CROWS Server. By default it listens on port 8080 - (string)crows.sensor.pin,crows.sensor.type: configuration for the DHT sensor. Pin specifies the DATA pin connected to the sensor, while type should be 22 (or 11) depending on the DHT sensor type (numeric)
-
(Optional) You can override additional settings like logging level or IOTA remote node and security. Just look at
config/default.jsonand override the relevant parts inconfig/local.json -
Start the client with
yarn devAfter a few moments the station should register and send measurements.
