Skip to content

centrofermi/wsc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This project aims to provide programs to perform temperature, humidity, and pressure measurements by means of a BME280 sensor connected to an Arduino Mega 2560.

It contains both Arduino sketch and GUI-based application for reading out data and putting into a text file on disk.

The code can be built and run on both Windows and Linux.

Developer's notes

To build the code you will need a set of developer tools as well as a suited operating system. The code builds and runs on both Microsoft Windows and Linux operating systems.

MS Windows build environment

In the following text %WSC% represents the folder where the WSC source repository is located.

Requirements

Operating system

A 64-bit MS Windows OS is required1. The procedure has been tested on Windows 7 Ultimate and Windows 10.

1 It is actually required to build VCPKG, that in turn is needed to build nana. If you find another easy way to do so, you may use your 32-bit MS Windows system.

Arduino

  1. Install Arduino IDE.
  2. In Arduino IDE go to "Tools->Library management".
  3. Install the following libraries:
  • Adafruit Unified Sensors
  • Adafruit BME280 Library
  • OneWire
  • DallasTemperature.

Visual Studio

  1. Install Visual Studio 2017 Community Edition, that is free to use and downloadable from Microsoft Website.
  2. Install at least the following components:
  • C++ Desktop Workload
  • Git for Windows

VCPKG

Install vcpkg and the nana library:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
bootstrap-vcpkg.bat
vcpkg.exe install nana:x86-windows
vcpkg.exe export nana --raw --output %WSC%\wsc-dependencies\

NSIS

Download NSIS from the official website and install it in the default folder.

Build

In a Developer Command Prompt for VS 2017:

cd %WSC%
mkdir build
cd build
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DVCPKG_TARGET_TRIPLET=x86-windows -DCMAKE_TOOLCHAIN_FILE="../wsc-dependencies/scripts/buildsystems/vcpkg.cmake" ..
nmake
REM the following is optional: to build the Windows install program
cpack

Linux build environment

In the following text $WSC represents the folder where the WSC source repository is located.

Requirements

  • a recent version of a Linux distibution (such as Ubuntu 18.04 or ArchLinux)
  • Arduino IDE
  • CMake v3.10 or newer
  • GNU Make
  • GNU Compiler Collection (gcc) 5 or newer
  • nana C++ library

Arduino

  1. Install Arduino IDE.
  2. In Arduino IDE go to "Tools->Library management".
  3. Install the following libraries:
  • Adafruit Unified Sensors
  • Adafruit BME280 Library
  • OneWire
  • DallasTemperature.

Other programs and libraries

Follow the general instructions provided by your Linux distribution and/or the specific for each component to install all the requirements listed above.

On a Ubuntu system, the following instructions should be sufficient:

sudo apt update
sudo apt install -y git cmake build-essential libx11-dev libxft-dev
git clone https://github.com/cnjinhao/nana.git
cd nana/
mkdir bb
cd bb/
cmake ../ -DCMAKE_BUILD_TYPE=Release
sudo make install -j

Build

In a shell:

cd $WSC
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ../
make
# the following is optional: to build selfextracting tar archive
cpack