|Software apps and online services:|
Although I’ve seen several weather station projects around the web for a while, I can’t say that I’ve seen one completely wireless that can be spread in different rooms in a house or in different offices inside a company, without dealing with network wires or AC cables.
After seeing for the first time the Texas Instruments CC2650STK sensor, the idea of building this project went from a thought to a perfect reality. I will tell you from the beginning that there are no cables involved, nor soldering, it’s more like a project built by a software developer (this is what I am :-)).
Due to the fact that I’m a .net software developer, my first thought was to build this project using the Windows 10 Core IoT OS and Universal Windows 10 SDK but after doing a bit of a research I stumbled upon two things that I didn’t liked:
- the current Windows 10 Core IoT insider preview version doesn’t support the on-board wireless and Bluetooth adapters that come with Raspberry PI 3;
- in order to connect to a Bluetooth device using the Universal Windows 10 SDK you should manually pair it first, otherwise, though the device is discoverable from code, the app cannot connect to it (there are many issues open on Stack Overflow and other specific sites) – and my intention was from the beginning to offer a solution that can add multiple sensors without any interaction.
So, after evaluating what options do I have, I took the decision of installing Raspbian OS and write the app in node.js, because I’ve seen that I have all that I need from the support libraries point of view.
In order to be easy for everyone who reads this project tutorial to implement it, I will take it step by step but if you think that any of this step doesn’t apply to you, you can skip it (I will put a special mark near the ones that are mandatory*).
Step 1. Install Raspbian and Update It
Take the easy track and use Noobs to install Raspbian on your Raspberry PI 3 – you can download it from here: https://www.raspberrypi.org/downloads/noobs/ where you can also find the necessary instructions.
After you finish with the installation and you are able to connect to your Raspberry using any SSH client (I’m using putty), it’s a good idea to start updating the OS to the latest available libraries:
pi@raspberrypi3:~ $ sudo apt-get update pi@raspberrypi3:~ $ sudo apt-get upgrade
Step 2. Update node.js to 4.X Version
Most probably, if you use the default Noobs installation for Raspbian, you will see that the node.js installed version is pretty old (something like 0.10.XXX) and we need something newer than this.
First, in order to check the installed node.js version use the following command:
[email protected]:~ $ node -v
If the displayed version is less than 4.X, then is time to update it – there are many ways to do this but from all of them, this is what I found to be the easiest one:
pi@raspberrypi3:~ $ curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - pi@raspberrypi3:~ $ sudo apt-get install -y nodejs
(all the instructions were taken from here: http://askubuntu.com/questions/672994/how-to-install-nodejs-4-on-ubuntu-15-04-64-bit-edition)
Sometimes, in order to be sure that everything is set correctly, is a good idea to restart the raspberry:
pi@raspberrypi3:~ $ sudo shutdown -r now
After this, check the installed version one more time with the node -v command to be sure that everything was set correctly.
Step 3. Install node.js Package Manager (npm)
In order to be able to install the required node.js dependencies (libraries) we need to have the node.js package manager (the so called npm) installed, so you have to run the following command:
pi@raspberrypi3:~ $ sudo apt-get install npm
Step 4. Install Dependencies
The main dependency that we need to implement this project is called sensortag (you can find info here https://www.npmjs.com/package/sensortag) and it has been implemented by Sandeep Mistry (thank you – you did a great job!).
Accordingly to the above specified page, first we need to install some other libraries, so we have to run the following commands:
pi@raspberrypi3:~ $ sudo npm install -g node-gyp pi@raspberrypi3:~ $ sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev pi@raspberrypi3:~ $ npm install noble pi@raspberrypi3:~ $ npm install sensortag
Step 5. First Look at the Sensor and Connectivity Check
Though a lot can be said about the Texas Instruments CC2650 sensor that I choose for this project, I can only tell you the following things: a sensor that have a battery that can last for almost an year, connects to Raspberry PI 3 through BLE (Blueetooth Low Energy) protocol to up to 50 meters, easy to setup by only pressing a button and a very nice looking piece of hardware.
What is important to notice for now, is that this device has 2 buttons – one on the right side and one on the left side – in order to differentiate them easily, the one that we care for now is the smallest one (it has the power-on icon on it).
Read More: Complete wireless weather station