-
1Step 1
1. For each site you wish to interconnect, you will need a computer running Linux. If you want to use IoT gear on the site, you will also need a SerialGateway as well, plus the sensors/actuators you wish to control and acquire.
-
2Step 2
2. On those Linux machines, follow these 2 guides.
https://cdn.hackaday.io/files/12985555550240/Linux Tor Service configuration.txt - This sets your machine up to provide Tor Hidden Services.
https://cdn.hackaday.io/files/12985555550240/Linux DNS Resolver for Onions.txt - This allows your Linux machine to resolve [hash].onion domain names so that any program can use them.
-
3Step 3
3. Install Node-Red as per here: http://nodered.org/docs/getting-started/installation.html
When Node-Red installs, I HIGHLY suggest immediately setting up security here: http://nodered.org/docs/security . By default, Node-Red installs with no security. Anyone who knows your [hash].onion:1880 address can control your node.
Do note, you can change the port for Node-Red in the configuration. You will have to change the appropriate port in your Tor config file if you do ( /etc/tor/torrc ).
-
4Step 4
4. For each local network you wish to acquire data from sensors and do stuff with actuators, you will need to buy the equipment listed in this project space. You will need
[1 Arduino Nano and 1 nRF24L01+, with 47uF capacitor] for each gateway to your local IoT infrastructure. If you have 3 places (home, work, hackerspace), and you have sensors/actuators at each, you will need 3 of these.
https://cdn.hackaday.io/files/12985555550240/Arduino Nano MySensors Gateway.fzz
-
5Step 5
5. To make each actuator, you will make more of the same above Serial Gateways, but include the appropriate extra motors, solenoids, or sensors (switches, potentiometers, DHT11 and other semiconductor logic, and others).
To start off as a no-code project, copy one of the designs for the sensors/actuators from here: https://www.mysensors.org/build/ - You will also find the code as examples in the Arduino IDE with the MySensors project.
If you want to combine multiple sensor types, you will have to do programming in the Arduino IDE.
-
6Step 6
Now. install the Arduino IDE (if you don't already have it on your machine). Also, download and install the MySensors library in the Arduino IDE.
Plug in your completed Serial Gateway (the one with no sensors/actuators). Go in the IDE and find MySensors>"SerialGateway" and select it. Now, compile and send it to your Arduino Nano.
For each sensor/actuator, find the appropriate example in the MySensors examples, and load it. Plug in the appropriate arduino and send the code to it.
-
7Step 7
Now, log into your Node-Red instance ( http://localhost:1880 )
Now we want to download the flows I have made available here: https://cdn.hackaday.io/files/12985555550240/Node Red flows.zip
Decompress them somewhere easy to open. Then you want to load the scripts in to your own Node-Red by copying the text (json files are text files) and pasting in Node-Red by [3 horiz. lines]>Import>Clipboard and pasting the code here. Then you click somewhere on the main scratch area in the center and put it down.
Once the code is as you want it, press the red DEPLOY button.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.