DOWNLOAD
n.A. till 01.01.2022
(UPDATe)
loopControl
loopControl Arduino
soon in our shop: preset control set
General
LoopControl is an opensource software for makers developed by our company for DIY control projects. The software enables a fully automated control of small to medium size facilities. The core of the device is a Raspberry Pi running a Node.js server. The control interface is utilizing standard web technologies including HTML5, CSS3, and JavasSript (ES6). It features Google’s material design and no-ui-slider. The Pi communicates to one or more Arduino devices via a serial connection. Sensors send their measurements to their connected Arduino, which forwards them to the Pi for further processing and storage. Based on the incoming sensor data and conditions, the computer can send commands to connected Arduinos to activate actuators. The web interface enables the user to control under which conditions the device should, e.g., pump fertilizer into the water, activate the heater, or water the plants.
Features
- Monitoring agricultural facilities and reading sensor data
- Definition of optimal, acceptable, and critical ranges for each individual sensor value
- Parameter adjustment through algorthim-based actuator control to keep climate parameters in optimal range
- Measurement-based control of actuators
- Time-based control of actautors
- Manual control of actuators
- Automatic storage of sensor data for future analysis
- Smoothing function for precise sensor readings
- Fine-grained control of storage and smoothing functionality
- Data logging over USB into csv file
- Data logger setting-upload via USB
MIT License
Copyright (c) 2020
Plant Space UG Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
SETUP EMBEDDED LINUX
Install [node.js](https://nodejs.org/en/download/package-manager/)
Or via the command line: sh
curl -sL https://deb.nodesource.com/setup_8.x
sudo -E bash –
sudo apt-get install -y nodejs
For USB Support run: sudo apt-get install libudev-dev
Install required node packages via: npm install
For a first test run node OLDServer.js and open `localhost` in the browser.
Additional information
enable WiFi on raspberry via SD card source: https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md
sh
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
add:
network={
ssid=”testing”
psk=”testingPassword”
}
For USB support:
– Linux: sh
sudo apt-get install build-essential libudev-dev
npm install –unsafe-perm usb
– Windows:
install http://zadig.akeo.ie/ USB drivers
npm install usb
Update all node.js modules: sh
npm update –unsafe-perm=true –allow-root
Use PM2 to automatically run the application on startup: sh
npm install pm2 -g
pm2 startup systemd
pm2 start app.js –watch
pm2 stop app.js
pm2 save
Run the service without sudo: sh
sudo apt-get install authbind
sudo touch /etc/authbind/byport/80
sudo chown yourusername /etc/authbind/byport/80
sudo chmod 755 /etc/authbind/byport/80
authbind –deep pm2 update
And then use authbind –deep pm2 instead of pm2
How to get out of kiosk mode: ctrl + W alt + F4 //closes kiosk ctrl + alt + T //opens terminal sudo raspi-config //open configuration
FLASH MICROPROCESSOR
Connect ARDUINO over USB is at /dev/ttyACM0 or /dev/ttyACM1
Setup Arduino IDE commands for terminal
Option 1: [arduino-cli](https://arduino.github.io/arduino-cli)
Find the correct release for your system here: https://github.com/arduino/arduino-cli/releases\
Replace the name of the file to download in the following commands (e.g. ARMv6 for Raspberry Pi)
wget https://github.com/arduino/arduino-cli/releases/download/0.10.0/arduinocli_0.10.0_Linux_ARMv6.tar.gz
sudo tar -xvf arduino-cli_0.10.0_Linux_ARMv6.tar.gz
rm arduino-cli_0.10.0_Linux_ARMv6.tar.gz
sudo mv arduino-cli /usr/local/bin/arduino-cli
arduino-cli core update-index
arduino-cli core install arduino:avr
The sketch .ino must be located in /home/pi/…/projectname and the .ino file must have the same name as the folder (e.g. projectname.ino)
Arduino Mega: sh
arduino-cli compile –fqbn arduino:avr:mega /home/pi/projectname
arduino-cli upload -p /dev/ttyACM0 –fqbn arduino:avr:mega /home/pi/projectname
Install libraries: sh
arduino-cli lib search onewire
arduino-cli lib install “OneWire” “DallasTemperature” “DHT_sensor_library”
Option 2: [inotool](http://inotool.org/)
sh
sudo apt-get install arduino
sudo apt-get install picocom
git clone git://github.com/amperka/ino.git
cd ino
sudo make install
cd ..
sudo rm -rf ino
pip install congifobj jinja2 glob2 serial
Upload the project to Arduino using mega2560
ino build
ino upload
ino serial
ctrl A + ctrl X
– using a nano328
ino build -m mega2560
ino upload -m mega2560 -p /dev/ttyACM1
ino serial -p /dev/ttyACM1
Enable the Serial Port on Arduino: sudo chmod 666 /dev/ttyACM0`\
if working on Windows Linux Subsystem, COM5 is mapped to ttyS5:\ sudo chmod 666 /dev/ttyS5
Possibly necessary changes to make it work
Configuration for the Arduino serial connection:
sh
sudo stty -F /dev/ttyACM0 cs8 9600 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts
sudo usermod -a -G dialout www-data
Serial monitor on terminal
Check that no other software is communicating on the channel: sudo lsof /dev/ttyS0
– Screen
sudo apt-get install screen
screen /dev/ttyACM0
Exit via: Ctrl + A, :, type ‘quit’, Enter
– Picocom
picocom -b 115200 -r -l /dev/ttyUSB0
Exit via Ctrl + A, Ctrl + X
avrdude: stk500_recv(): programmer is not responding
make sure that no device is communicating with the Arduino, so stop the server on the Raspberry before uploading a sketch to Arduino https://learn.sparkfun.com/tutorials/how-to-install-ftdi-drivers/windows—quick-and-easy
Sensor libraries: Temperature sensor DHT22,
Temperature sensor DS18B20
download libraries:
– https://github.com/adafruit/Adafruit_Sensor
– https://github.com/adafruit/DHT-sensor-library
– https://github.com/milesburton/Arduino-Temperature-Control-Library
– http://www.pjrc.com/teensy/arduino_libraries/OneWire.zip
When using arduino-cli for SIMD cores, and GLIBC is outdated
sh
sudo apt-get install dirmngr
sudo apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –recv-keys 04EE7237B7D453EC
sudo apt-get update && sudo apt-get upgrade libc6
sudo apt autoremove