doc:appunti:hardware:raspberrypi_air
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| doc:appunti:hardware:raspberrypi_air [2017/10/09 12:37] – [Other setup] niccolo | doc:appunti:hardware:raspberrypi_air [2020/08/14 10:17] (current) – [Rapsberry Pi Air Quality Station] niccolo | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== | + | ====== |
| This is my second approach to the **[[wp> | This is my second approach to the **[[wp> | ||
| Line 32: | Line 32: | ||
| {{.: | {{.: | ||
| {{.: | {{.: | ||
| + | |||
| + | ====== Software setup ====== | ||
| + | |||
| + | ===== Basic Raspbian Setup ===== | ||
| + | |||
| + | The base system is a **Raspbian GNU/Linux 9**, based on **Debian Stretch**. Some system configurations are accomplished using the **raspi-config** tool, we run at least: | ||
| + | |||
| + | * **Interfacing Options** | ||
| + | * **Enable SSH** to get remote login via SSH. | ||
| + | * **Enable I2C**, on this bus we have the BME280 sensor and the DS3231 clock. | ||
| + | * **Serial** | ||
| + | * **Disable Serial Login Shell**, our software will use the serial line instead. | ||
| + | * **Enable Serial Port**, we have the PMS5003 sensor attached to it. | ||
| + | * **Localisation Options** | ||
| + | * **Change Locale**, choose the locales you nedd (e.g. en_US.UTF-8). | ||
| + | * **Change Timezone**, set the proper timezone. Data timestamps will be stored in UTC time. | ||
| + | * **Change Wi-fi Country**, to use the proper frequencies, | ||
| + | * **Advanced Options** | ||
| + | * **Memory Split: 16**, we use only the text interface of the GPU. | ||
| + | * **Expand Filesystem** (no longer required: Raspbian Stretch does it automatically at first boot). | ||
| + | |||
| + | Be sure to have all the latest updates: | ||
| + | |||
| + | < | ||
| + | apt-get update && apt-get upgrade | ||
| + | </ | ||
| + | |||
| + | The scripts to run the AirPi station require several **Debian packages**; install them all: | ||
| + | |||
| + | < | ||
| + | apt-get install build-essential busybox-syslogd git i2c-tools \ | ||
| + | nginx php7.0-fpm php7.0-sqlite3 \ | ||
| + | python-dev python-requests python-smbus python-serial python-tz \ | ||
| + | rrdtool snmp snmp-mibs-downloader snmpd sqlite3 | ||
| + | </ | ||
| + | |||
| + | Because we installed **busybox-syslogd** to get system log facilities, we can remove rsyslog: | ||
| + | |||
| + | < | ||
| + | dpkg --purge rsyslog | ||
| + | </ | ||
| + | |||
| + | There are some packeges not strictly required by the AirPi station, but that I find very useful: | ||
| + | |||
| + | < | ||
| + | apt-get install dselect dump mc minicom nmap screen setserial sniffit tcpdump vim | ||
| + | </ | ||
| + | |||
| + | Edit **/ | ||
| + | ===== DS3231 RTC Clock ===== | ||
| + | |||
| + | If you instelled the Real-Time Clock module edit **/ | ||
| + | |||
| + | < | ||
| + | vi / | ||
| + | vi / | ||
| + | dpkg --purge fake-hwclock | ||
| + | </ | ||
| + | |||
| + | ===== Python Libraries ===== | ||
| + | |||
| + | The **Adafruit library for the GPIO** lines is required by the Adafruit BME280 library to access I2C bus. It is advisable to install also some packages **from the Raspbian distro**, otherwise the python setup will try to download and install a local version: | ||
| + | |||
| + | < | ||
| + | apt-get install python-dev python-setuptools python-spidev | ||
| + | </ | ||
| + | |||
| + | The Adafruit Python library is installed from the Git repository: | ||
| + | |||
| + | < | ||
| + | cd / | ||
| + | git clone https:// | ||
| + | cd Adafruit_Python_GPIO | ||
| + | python setup.py install | ||
| + | </ | ||
| + | |||
| + | The setup procedure will download and install also the **Adafruit_PureIO** library. Everything will be installed into the **/ | ||
| + | ===== Serial Line ===== | ||
| + | |||
| + | Setting the serial line via **raspi-config** as exposed above should suffice, for more info see **[[#More on Serial Line (Manual Setup)]]**. The kernel will expose the serial line at bootstrap using the device **/ | ||
| + | |||
| + | ===== AirPi software ===== | ||
| + | |||
| + | This software collection will bring you: | ||
| + | |||
| + | * The scripts to read sensors data (BME280 and PMS5003). | ||
| + | * The cronjobs to gather data periodically. | ||
| + | * The web interface to display sensors data. | ||
| + | * The configuration web interface. | ||
| + | |||
| + | Everything is stored into the **[[https:// | ||
| + | |||
| + | < | ||
| + | cd / | ||
| + | git clone https:// | ||
| + | cd AirPi | ||
| + | make install-lib | ||
| + | make install-config | ||
| + | make install-html | ||
| + | make install-webconfig | ||
| + | </ | ||
| + | |||
| + | Edit the **/ | ||
| + | |||
| + | < | ||
| + | vi / | ||
| + | / | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | FIXME Configuration using the web interface uses a custom framework, which is not yet released. Everything you change from the **%%http://< | ||
| + | |||
| + | ====== Hardware Setup and Test ====== | ||
| ===== DS3231 RTC Clock ===== | ===== DS3231 RTC Clock ===== | ||
| Line 148: | Line 261: | ||
| < | < | ||
| - | apt-get install build-essential python-dev python-smbus | + | apt-get install |
| cd / | cd / | ||
| git clone https:// | git clone https:// | ||
| Line 357: | Line 470: | ||
| ==== Export to DXF ==== | ==== Export to DXF ==== | ||
| - | In OpenSCAD we use the menu //Design// -> //Compile and Render | + | In OpenSCAD we use the menu //Design// -> //Render//. If the object is only bi-dimensional it will be rendered with a red outline and cyan filling. Only in this case we will be able to //File// -> //Export// -> //Export as DXF...//. |
| ==== Using Inkscape to add writings, logos and to layout the pieces ==== | ==== Using Inkscape to add writings, logos and to layout the pieces ==== | ||
| Line 377: | Line 490: | ||
| To lay out the shapes into a single project, you should follow the guidelines of the laser cutting services that you will to use. Generally they **provide some templates** (Inkscape is well supported), which shows you how big is the cutting area, and the stroke and the fill that you have to use. | To lay out the shapes into a single project, you should follow the guidelines of the laser cutting services that you will to use. Generally they **provide some templates** (Inkscape is well supported), which shows you how big is the cutting area, and the stroke and the fill that you have to use. | ||
| - | ====== Software | + | ===== More Software Setup ===== |
| - | + | ||
| - | ===== Basic Raspbian Setup ===== | + | |
| - | + | ||
| - | The base system is a **Raspbian GNU/Linux 9**, based on **Debian Stretch**. Some system configurations are accomplished using the **raspi-config** tool, we run at least: | + | |
| - | + | ||
| - | * **Interfacing Options** | + | |
| - | * **Enable SSH** to get remote login via SSH. | + | |
| - | * **Enable I2C**, on this bus we have the BME280 sensor and the DS3231 clock. | + | |
| - | * **Serial** | + | |
| - | * **Disable Serial Login Shell**, our software will use the serial line instead. | + | |
| - | * **Enable Serial Port**, we have the PMS5003 sensor attached to it. | + | |
| - | * **Localisation Options** | + | |
| - | * **Change Locale**, choose the locales you nedd (e.g. en_US.UTF-8). | + | |
| - | * **Change Timezone**, set the proper timezone. Data timestamps will be stored in UTC time. | + | |
| - | * **Change Wi-fi Country**, to use the proper frequencies, | + | |
| - | * **Advanced Options** | + | |
| - | * **Memory Split: 16**, we use only the text interface of the GPU. | + | |
| - | * **Expand Filesystem** (no longer required: Raspbian Stretch does it automatically at first boot). | + | |
| - | + | ||
| - | Be sure to have all the latest updates: | + | |
| - | + | ||
| - | < | + | |
| - | apt-get update && apt-get upgrade | + | |
| - | </ | + | |
| - | + | ||
| - | The scripts to run the AirPi station require several **Debian packages**; install them all: | + | |
| - | + | ||
| - | < | + | |
| - | apt-get install build-essential busybox-syslogd git i2c-tools \ | + | |
| - | nginx php7.0-fpm php7.0-sqlite3 \ | + | |
| - | python-dev python-requests python-smbus python-serial python-tz \ | + | |
| - | rrdtool snmp snmp-mibs-downloader snmpd sqlite3 | + | |
| - | </ | + | |
| - | + | ||
| - | Because we installed **busybox-syslogd** to get system log facilities, we can remove rsyslog: | + | |
| - | + | ||
| - | < | + | |
| - | dpkg --purge rsyslog | + | |
| - | </ | + | |
| - | + | ||
| - | There are some packeges not strictly required by the AirPi station, but that I find very useful: | + | |
| - | + | ||
| - | < | + | |
| - | apt-get install dselect dump mc minicom nmap screen setserial sniffit tcpdump vim | + | |
| - | </ | + | |
| - | + | ||
| - | Edit **/ | + | |
| - | + | ||
| - | ===== DS3231 RTC Clock ===== | + | |
| - | + | ||
| - | If you instelled the Real-Time Clock module edit **/ | + | |
| - | + | ||
| - | < | + | |
| - | vi / | + | |
| - | vi / | + | |
| - | dpkg --purge fake-hwclock | + | |
| - | </ | + | |
| - | + | ||
| - | ===== Python Libraries ===== | + | |
| - | + | ||
| - | The **Adafruit library for the GPIO** lines is required by the Adafruit BME280 library to access I2C bus: | + | |
| - | + | ||
| - | < | + | |
| - | cd / | + | |
| - | git clone https:// | + | |
| - | cd Adafruit_Python_GPIO | + | |
| - | python setup.py install | + | |
| - | </ | + | |
| - | + | ||
| - | ===== Serial Line ===== | + | |
| - | + | ||
| - | Setting the serial line via **raspi-config** as exposed above should suffice, for more info see **[[#More on Serial Line (Manual | + | |
| - | + | ||
| - | ===== AirPi software ===== | + | |
| - | + | ||
| - | This software collection will bring you: | + | |
| - | + | ||
| - | * The scripts to read sensors data (BME280 and PMS5003). | + | |
| - | * The cronjobs to gather data periodically. | + | |
| - | * The web interface to display sensors data. | + | |
| - | * The configuration web interface. | + | |
| - | + | ||
| - | Everything is stored into the **[[https:// | + | |
| - | + | ||
| - | < | + | |
| - | cd / | + | |
| - | git clone https:// | + | |
| - | cd AirPi | + | |
| - | make install-lib | + | |
| - | make install-config | + | |
| - | make install-html | + | |
| - | make install-webconfig | + | |
| - | </ | + | |
| - | + | ||
| - | Edit the **/ | + | |
| - | + | ||
| - | < | + | |
| - | vi / | + | |
| - | / | + | |
| - | / | + | |
| - | </ | + | |
| - | + | ||
| - | FIXME Configuration using the web interface uses a custom framework, which is not yet released. Everything you change from the **%%http://< | + | |
| - | + | ||
| - | ===== Other setup ===== | + | |
| === SNMP === | === SNMP === | ||
doc/appunti/hardware/raspberrypi_air.1507545469.txt.gz · Last modified: by niccolo
