- Jaroslav Huss
- Jan Vojáček
- Róbert Kuzma
- Lukáš Bříza
- Jiří Hejtmánek
- Alan Kováč
- Download the code from https://github.com/jaroslavhuss/uuiot/blob/master/weatherstation/sketch_feb24a/sketch_feb24a.ino and flash it on the Arduino
- It will require a library for DHT22 - just google it and upload it along with the code.
-
I am using RPi Ubuntu, u need to have nodejs installed
-
I recommend to intall everything in a root folder in order to avoid problem with paths
-
type
npm init -y
-
type
touch weatherimporter.js
-
type
npm install dontenv axios node-cron node-red
-
Into
weatherimporter.js
place a code from https://github.com/jaroslavhuss/uuiot/blob/master/gateway/weatherimporter.js
I forgot to mention - you need to also touch .env
and place credentials there as followed:
GW_USERNAME = Name of your GW (u have created this in cloud)
GW_PASSWORD = Password to the GW (u have created this as well)
- Open console on RPi and type
node-red
- this will start a local server. To access it you need to know your RPi IP address - mine runs on
http://10.0.1.29:1880/
- You have to import a json file into node-red UI from https://github.com/jaroslavhuss/uuiot/blob/master/gateway/node-red.json
- Do not forget to deploy changes done on node-red
The best way I found is described here: https://nodered.org/docs/faq/starting-node-red-on-boot
Basically you need to type just this:
- sudo npm install -g pm2
- navigate to the folder where you downloaded the project (
weatherimporter.js
) - Hit
pm2 start weatherimporter.js --node-args="--max-old-space-size=128" -- -v
- Update the list of tasks
pm2 save
- Lastyl hit
pm2 startup
- this will spill the command for @boot - Just take that fakin command and place it into console
- Hit
sudo reboot
and u are fakin done!