Difference between revisions of "PicorderOS"
Directive0 (Talk | contribs) (→Variants) |
Directive0 (Talk | contribs) |
||
(23 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
===Variants=== | ===Variants=== | ||
− | {| | + | PicorderOS is written to support two specific variants of Picorder, though modification and customization is definitely possible and it is a goal that any sensor supported by PicorderOS can be used on any variant of Picorder. |
+ | |||
+ | {|class="wikitable" style="text-align: center;" | ||
+ | |[[Picorder|TR-108]] | ||
+ | |[[Picorder 2|TR-109]] | ||
+ | |- | ||
|[[File:Tr108.png|80px]] | |[[File:Tr108.png|80px]] | ||
|[[File:Tr109.png|60px]] | |[[File:Tr109.png|60px]] | ||
− | |||
|- | |- | ||
− | |The TR-108 uses a | + | |The TR-108 by default uses a Sensehat module and pygame to draw elements to screen using the composite or HDMI video connection. It is easily constructed of mostly off-the-shelf components. |
− | |The TR-109 | + | |The TR-109 is designed to use a number of optional sensors and uses the SPI bus to address a small TFT LCD screen. It is almost entirely custom built and requires a 3D printer. |
|} | |} | ||
Line 29: | Line 33: | ||
==Notes== | ==Notes== | ||
− | + | Things I'd like to add: | |
− | * | + | |
− | + | * A real database module. Data analysis is a big part of the idea of a Tricorder. I haven't had a chance to learn it yet. | |
==Download== | ==Download== | ||
Line 42: | Line 46: | ||
PicorderOS uses a number of modules to operate, specifically: | PicorderOS uses a number of modules to operate, specifically: | ||
− | * Pygame - Handles screen drawing and Luma.LCD emulation | + | * [https://www.pygame.org/news Pygame] - Handles screen drawing and Luma.LCD emulation |
− | * Luma.LCD - Supports a number of displays. | + | * [https://pypi.org/project/luma.lcd/ Luma.LCD] - Supports a number of displays. |
− | * Sensehat - For the TR-108 or any Picorder using a Sensehat | + | * [https://pythonhosted.org/sense-hat/ Sensehat] - For the TR-108 or any Picorder using a Sensehat |
− | * RPi.GPIO - General IO | + | * [https://github.com/adafruit/Adafruit_CircuitPython_AMG88xx amg8833] - Supports the AMG8833 8x8 Pixel Thermal Camera |
+ | * [https://github.com/pimoroni/bme680-python BME680] - Supports the BME680 Environmental Sensor IC | ||
+ | * [https://pypi.org/project/RPi.GPIO/ RPi.GPIO] - General IO | ||
* sys | * sys | ||
* time | * time | ||
Line 68: | Line 74: | ||
==Operation== | ==Operation== | ||
PicorderOS is run from main.py. | PicorderOS is run from main.py. | ||
+ | |||
+ | ==Installation== | ||
+ | PicorderOS depends on a number of python modules to function. Before the main loop can be run we need to install the dependencies. | ||
+ | |||
+ | Below is an experimental list of commands that are used to prepare a asRpberry Pi OS install. | ||
+ | |||
+ | <code> | ||
+ | sudo apt-get update | ||
+ | |||
+ | sudo apt-get upgrade | ||
+ | |||
+ | pip3 install --upgrade psutil numpy luma.lcd luma.emulator adafruit-circuitpython-bme680 pandas colour adafruit-circuitpython-mpr121 | ||
+ | |||
+ | sudo apt-get install libatlas-base-dev libsdl2-dev libopenjp2-7-de libtiff5 | ||
+ | </code> |
Latest revision as of 07:02, 8 December 2023
PicorderOS is a Python based set of modules that provides a quick and easy way to use a Raspberry Pi as a handheld sensing device. The real goal of PicorderOS is not just to operate my various Picorder projects as a monolithic entity but to work as a set of modules that the user can enable and disable at will.
By design it will support a wide range of arbitrary selected sensors, displays and form factors. Development is proceeding simultaneously on all elements.
Contents
Variants
PicorderOS is written to support two specific variants of Picorder, though modification and customization is definitely possible and it is a goal that any sensor supported by PicorderOS can be used on any variant of Picorder.
TR-108 | TR-109 |
The TR-108 by default uses a Sensehat module and pygame to draw elements to screen using the composite or HDMI video connection. It is easily constructed of mostly off-the-shelf components. | The TR-109 is designed to use a number of optional sensors and uses the SPI bus to address a small TFT LCD screen. It is almost entirely custom built and requires a 3D printer. |
Basic Structure
Objects
The Objects module contains some basic functions that are shared by many elements of the program. Most importantly it contains the "configuration" object that holds settings for the program. The user can edit this file to change settings quickly.
Main
PicorderOS's basic functional structure starts with the Main module. Main creates and directs all the elements necessary for a picorder session and directs the flow of information to and from each element.
Sensor
The sensor object is different depending on the physical sensors present. While the means of pulling sensor data may be different between different sensor types the purpose of the sensor object is to pull each value from the sensor and prepare it into a *sensor fragment*. Sensor fragments are lists (sort of like arrays) that contain the most recent sensor value and information for the program to put that value in context like the upper and lower possible ranges of the senor, the unit, symbol, and the name of the item itself. Many parts of the program will need to access this information so it is important for these elements to be available. Any sensor data can be accessed by PicorderOS so long as it follows these standards.
Notes
Things I'd like to add:
- A real database module. Data analysis is a big part of the idea of a Tricorder. I haven't had a chance to learn it yet.
Download
https://github.com/directive0/picorder2
Installation
PicorderOS requires quite a few python libraries to work.
Requirements:
PicorderOS uses a number of modules to operate, specifically:
- Pygame - Handles screen drawing and Luma.LCD emulation
- Luma.LCD - Supports a number of displays.
- Sensehat - For the TR-108 or any Picorder using a Sensehat
- amg8833 - Supports the AMG8833 8x8 Pixel Thermal Camera
- BME680 - Supports the BME680 Environmental Sensor IC
- RPi.GPIO - General IO
- sys
- time
- math
- os
- psutil -for PC stats
Be sure you have these modules installed before attempting to run the main module.
Open a terminal and follow the next instructions:
- We must first enable SPI and I2C for sensor and display communications.
- Open Raspi Config
sudo raspi-config
- Select "Interfacing Options" (Item 5)
- Scroll down to SPI and when prompted enable it following the onscreen dialogue
- Do the same for I2C
- Open Raspi Config
- Ensure you have Python3 and Pip3 installed (should already be there on Raspbian)
sudo apt-get install python3-pip python3-dev
- Install Sensor Libraries
- If using the BME680 I recommend the Pimoroni bme680 module, install it using pip3
sudo pip3 install bme680
- If using the BME680 I recommend the Pimoroni bme680 module, install it using pip3
- Install luma.lcd for the displays
sudo pip3 install luma.lcd
Operation
PicorderOS is run from main.py.
Installation
PicorderOS depends on a number of python modules to function. Before the main loop can be run we need to install the dependencies.
Below is an experimental list of commands that are used to prepare a asRpberry Pi OS install.
sudo apt-get update
sudo apt-get upgrade
pip3 install --upgrade psutil numpy luma.lcd luma.emulator adafruit-circuitpython-bme680 pandas colour adafruit-circuitpython-mpr121
sudo apt-get install libatlas-base-dev libsdl2-dev libopenjp2-7-de libtiff5