Anpassungen für Ubuntu 16.04

This commit is contained in:
Christian Meyer 2023-05-24 18:59:30 +02:00
parent 8a28249a88
commit 3fcd2bd743
1 changed files with 69 additions and 24 deletions

View File

@ -2,33 +2,55 @@
[ThingSpeak](https://thingspeak.com) ist eine OpenSource "Internet of Things" Anwendung und API, mit der Daten von "Dingen" per HTTP über das Internet (oder LAN) empfangen und gespeichert werden können. Mit ThingSpeak, kann man verschiedene Anwendungen erstellen, die Sensor-Daten speichern, Standortdaten verwenden oder ein "soziales Netzwerk der Dinge" mit Status Updates versorgt.
Dieser Fork ist dazu gedacht, auf einem eigenen Debian 11 - Server installiert zu werden.
Die ThinkSpeak API empfängt und speichert numerische und alphanumerische Daten und erlaubt eine Datenverarbeitung (Zeitskalen, Duchschnittswerte, Median, Summen und runden). Jeder ThingSpeak Channel unterstützt bis zu 8 Datenfelder, Breitengrad, Längengrad, Höhe und Status. Zur Integration in weitere Anwendungen werden JSON, XML, und das CSV Format unterstützt.
In addition to storing and retrieving numeric and alphanumeric data, the ThingSpeak API allows for numeric data processing such as timescaling, averaging, median, summing, and rounding. Each ThingSpeak Channel supports data entries of up to 8 data fields, latitude, longitude, elevation, and status. The channel feeds support JSON, XML, and CSV formats for integration into applications.
Unterstützung für ThingSpeak gibt es bei der [ThingSpeak Community](http://community.thingspeak.com/), wo sich ein [Blog](http://community.thingspeak.com/), ein [Forum](http://community.thingspeak.com/forum/), [Dokumentation](https://thingspeak.com/docs), und [Tutorials](https://thingspeak.com/docs/tutorials/) finden.
The ThingSpeak application also features time zone management, read/write API key management and JavaScript-based charts from Highslide Software / Torstein Hønsi.
## Besonderheiten zur Installation
Support for ThingSpeak is available on the "ThingSpeak Community":http://community.thingspeak.com/ site which features a "Blog":http://community.thingspeak.com/, "Forum":http://community.thingspeak.com/forum/, "Documentation":https://thingspeak.com/docs, and "Tutorials":https://thingspeak.com/docs/tutorials/.
Dieser Fork ist dazu gedacht, auf einem eigenen Debian 12 Server installiert zu werden.
Leider ist das [IOBridge-Repository](https://github.com/iobridge/thingspeak) veraltet und nur für Ubuntu 12.04 LTS geeignet.
Hauptproblem sind die veralteten Programme und Bibliotheken, auf die ThingSpeak aufbaut. Namentlich ist das libssl1.0-dev, aber auch Ruby 2 und Rails 4.
### Before You Begin
Aktuell ist die Basis die [Installation auf Ubuntu 16.04](https://www.cnx-software.com/2016/12/07/how-to-install-thingspeak-in-ubuntu-16-04/)
Darüber hinaus gibt es auch weitere Ressoucen, die bei einem OS-Upgrade hilfreich sind:
1. Install Ruby 2, RubyGems, Rails 4, git, and a database like MySQL
2. Download the application using git: git clone git@github.com:iobridge/thingspeak.git
3. Change to the thingspeak directory and install the appropriate gems: sudo bundle install
Neben einer [Erfolgsmeldung für Debian 10](https://github.com/iobridge/thingspeak/issues/70) gibt es ein aktuelleres [Repository von ELR](https://github.com/EllenLouiseRipley/thingspeak), aber auch eine ausführlichere [Schritt-für-Schritt-Anleitung für Ubuntu 14.04 LTS](https://gist.github.com/MarconiLab/f9f49cc473fa78ecfa72).
Aber auch ein paar Hilfestellungen zum Umgang mit veränderten Datenbanken ([hier](https://stackoverflow.com/questions/37315546/uninitialized-constant-activerecordconnectionadaptersmysql2adapternative-d) und [dort](https://stackoverflow.com/questions/37315546/uninitialized-constant-activerecordconnectionadaptersmysql2adapternative-d)) bzw. [ActiveAdmin](https://github.com/iobridge/thingspeak/issues/43)
### Configuration
Das Problem mit openssl1.0-dev kann vermutlich mit den Quellen des veralteten Debian 9 (Stretch) umgangen werden:
```
deb http://archive.debian.org/debian stretch main
deb http://archive.debian.org/debian-security stretch/updates main
```
Die genauen in Stretch verfügbaren Programmversionen findet man heraus mit: ```apt cache show ruby```.
Danach installiert man diese mit:
```
??? apt install rails=2:4.2.7.1-1+deb9u5 ruby-rails=2:4.2.7.1-1+deb9u5 ruby=1:2.3.3
??? apt install ruby: mit stretch-Quellen und Version (wegen Abhängigkeit aus Bullseye)
??? apt install rails: nur mit stretch-Quellen (wegen Dependency-Chaos)
```
### Vorbereitungen
1. Installiere Ruby 2, RubyGems, Rails 4, git, und eine Datenbank wie MySQL / MariaDB
2. Lade die Anwendung mit git herunter: git clone https://rlp.schule/gitea/c_meyer/thingspeak.git
3. Wechsele in das Verzeichnis thingspeak und installiere die entsprechenden gems: sudo bundle install
### Konfiguration
1. Set your database configuration file at config/database.yml (see config/database.yml.example for an example)
2. Create the database: rake db:create
3. Create the database tables: rake db:schema:load
2. Erstelle die Datenbank: rake db:create
3. Erstelle die Datenbank-Tabellen: rake db:schema:load
### Run The Application
### Starte die Anwendung
1. Start the server: rails server
1. Starte den Server: rails server
Your application will now be running at ```http://localhost:3000/```
Danach ist die Anwendung erreichbar unter ```http://localhost:3000/```
## Changing Application Text
## Ändere den Text der Anwendung
Make changes to config/locales/en.yml
To avoid errors, please ensure your lines start with spaces, not tabs.
@ -45,20 +67,44 @@ Add the admin user: ```AdminUser.create!(email: 'YOUR_ADMIN_EMAIL@EXAMPLE.COM',
Exit the rails console: ```exit```
Login via the admin web interface at: "http://YOUR_DOMAIN.COM/admin"
# Installation on clean install of Ubuntu 12.04 LTS
# Installation auf Debian 11
Arbeiten als root:
```
command curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
command curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
curl -sSL https://get.rvm.io | bash -s stable --ruby
rvm install ruby-2.1.0
sudo apt update
sudo apt dist-upgrade
sudo apt purge ruby
sudo apt-get -y install build-essential mysql-server mysql-client libmysqlclient-dev libxml2-dev libxslt-dev git-core curl rubygems gnupg2
```
sudo apt-get upgrade
sudo apt-get -y install build-essential mysql-server mysql-client libmysqlclient-dev libxml2-dev libxslt-dev git-core curl rubygems
\curl -sSL https://get.rvm.io | bash -s stable
rvm install 2.1
git clone https://github.com/iobridge/thingspeak.git
Arbeiten als user:
```
gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm install ruby 2.1.0
git clone https://rlp.schule/gitea/c_meyer/thingspeak.git
cd thingspeak
gem install bundler
rvm --force rubygems 2.1.0
gem install bundler -v 1.17.3
gem install jquery-rails -v 3.0.4
gem install tzinfo -v 1.2.2
gem install 'activerecord-native_db_types_override'; für die Datenbank
bundle update mysql2
bundle install
cp config/database.yml.example config/database.yml
rake db:create
# mysql -u root -p
rake db:schema:load
rails server
rails server webrick
```
# Upgrading existing installations
@ -69,5 +115,4 @@ bundle install
rake db:migrate
```
If your server is active you can restart it by going to the active terminal, hitting Ctrl-c, and then typing:
```rails server```
```rails server```