User Tools

Site Tools


projects:bewaesserung:installation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
projects:bewaesserung:installation [2021/03/29 12:36]
ferdi
projects:bewaesserung:installation [2021/03/31 12:09] (current)
ferdi
Line 88: Line 88:
   git clone https://gitlab.com/BorisFlit/bewaesserung-ip.git   git clone https://gitlab.com/BorisFlit/bewaesserung-ip.git
 Bei der Passworabfrage gebe ich meine G-mail Adresse und mein gitlab Passwort ein. Bei der Passworabfrage gebe ich meine G-mail Adresse und mein gitlab Passwort ein.
 +  cd bewaesserung-ip
 +  source bin/activate
 +   --> (django-vue) fablab@fablab-OptiPlex-7010:~/Documents/FME/IP15_Bewaesserung/bewaesserung-ip$
 +  WARNING: The script sqlformat is installed in '/home/fablab/.local/bin' which is not on PATH.
 +  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
 +  WARNING: The script django-admin is installed in '/home/fablab/.local/bin' which is not on PATH.
 +  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
 +  WARNING: The scripts isort and isort-identify-imports are installed in '/home/fablab/.local/bin' which is not on PATH.
 +  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
 +  WARNING: The script netatmo is installed in '/home/fablab/.local/bin' which is not on PATH.
 +  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
 +  WARNING: The scripts epylint, pylint, pyreverse and symilar are installed in '/home/fablab/.local/bin' which is not on PATH.
 +  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
 +ansonsten alles OK.
 +  python3 manage.py migrate
 +  Username (leave blank to use 'fablab'): 
 +  Email address: meier.ferdinand@gmail.com
 +  Password: "fabadmin password"
 +  Password (again): 
 +  Superuser created successfully.
 +  
 +  cd frontend/
 +  npm install
 +  Command 'npm' not found, but can be installed with:
 +  sudo apt install npm
 +  added 2012 packages from 1471 contributors and audited 2017 packages in 51.965s
 +  98 packages are looking for funding
 +  run `npm fund` for details
 +  found 1 low severity vulnerability
 +  run `npm audit fix` to fix them, or `npm audit` for details
 +  
 +  npm run serve
  
 +  cable cross sections
 +  DONE  Compiled successfully in 9375ms   
 +  App running at:
 +  Local:   http://localhost:8080/ 
 +  Network: http://192.168.1.70:8080/
  
 +installed gimp and inkscape\\
 +
 +open a new window:\\
 +{{:projects:bewaesserung:new_window.jpg?200|}}\\
 +Activate the virtual environment:
 +  source bin/activate
 +starte django webserver:
 +  python3 manage.py runserver localhost:8000
 +jetzt kann die Seite localhost:8000 im Browser geöffnet werden:\\
 +{{:projects:bewaesserung:django_01.jpg?400|}}\\
 +
 +Installiere Visual Studio Code:\\
 +  sudo snap install --classic code
 +
 +Habe in netatmofetch.py den usernamen und passwort eingetragen.
 +Beim ausführen von /graphspage/netatmo_db_import/netatmo_first_import.sh bekomme ich die folgende Meldung:
 +
 +  ./netatmo_first_import.sh 
 +  Timestamp Datei erzeugt und auf 0 gesetzt.
 +  error invalid_grant https://api.netatmo.com/oauth2/token
 +  None
 +  Traceback (most recent call last):
 +    File "csv_to_database.py", line 72, in <module>
 +      with open(csv_file_path, 'r', encoding='UTF-8') as file:
 +  FileNotFoundError: [Errno 2] No such file or directory: 'netatmo_station.csv'
 +
 +Habe jetzt den richtigen login für netatmo von Prof.Nebe und habe ihn in netatmofetch.py eingetragen.\\
 +Wenn ich jetzt netatmo_first_import.sh ausführe:
 +  ./netatmo_first_import.sh
 +bekomme ich folgende Meldung:
 +  Timestamp Datei erzeugt und auf 0 gesetzt.
 +  []
 +  Traceback (most recent call last):
 +    File "csv_to_database.py", line 72, in <module>
 +      with open(csv_file_path, 'r', encoding='UTF-8') as file:
 +  FileNotFoundError: [Errno 2] No such file or directory: 'netatmo_station.csv'
 +Ich habe die Datei netatmo_station.csv mit \\
 +  touch netatmo_station.csv 
 +erzeugt.\\
 +Jetzt bekomme ich
 +  Timestamp Datei erzeugt und auf 0 gesetzt.
 +  []
 +  Einträge werden in die Datenbank übertragen...
 +  
 +  0 Einträge Übertragen
 +
 +Bin noch einmal zurück in IP15_Bewaesserung/bewaesserung-ip um das virtual environment zu starten:
 +  ~/Documents/FME/IP15_Bewaesserung/bewaesserung-ip$ source bin/activate
 +  (django-vue) fablab@fablab-OptiPlex-7010:~/Documents/FME/IP15_Bewaesserung/bewaesserung-ip$ cd graphspage/netatmo_db_import/
 +  (django-vue) fablab@fablab-OptiPlex-7010:~/Documents/FME/IP15_Bewaesserung/bewaesserung-ip/graphspage/netatmo_db_import$ python3 csv_to_database.py -h
 +  usage: csv_to_database.py [-h] [-i] [-gt] [-w]
 +  optional arguments:
 +    -h, --help            show this help message and exit
 +    -i, --init            Bei Erstbenutzung bitte als erstes ausführen (oder wenn der Timestamp auf 0 gesetzt werden soll
 +    -gt, --get-timestamp  Holt den neusten Timestamp
 +    -w, --write           Writes the CSV data to the table
 +
 +Habe den cronjob gestartet:
 +  python3 manage.py crontab add
 +  no crontab for fablab
 +    adding cronjob: (73bb14f920c56753f62140cb4e1eee0b) -> ('*/15 * * * *', 'djangovue.cron.myjob')
 +
 +sensorda**t**a.py ausgeführt
 +
 +  python3 sensordata.py 
 +  Trying to connect to: eu.thethings.network:8883
 +  Connected with result code: 0
 +  Subscribed to topic: +/devices/+/up
 +
 +=== Mi. 31.03.2021 ===
 +Der chronjob scheint zu laufen:
 +  Schreibe Daten in die Datenbank...
 +  Daten erfolgreich in die Datenbank Geschrieben!
 +  TOPIC: hsrw_iotlab_lse01/devices/lse01_n007/up
 +  PAYLOAD: {'app_id': 'hsrw_iotlab_lse01', 'dev_id': 'lse01_n007', 'hardware_serial': 'A84041B2A18264AC', 'port': 2, 'counter': 9495, 'payload_raw': 'DR0AAAQjBussiAE=', 'payload_fields': {'battery_voltage': {'comment': 'LSE01 battery voltage', 'unit': 'V', 'value': 3.357}, 'extra_temperature_sensor': {'comment': 'Temperature from an extra DS18B20. Not connected by default.', 'unit': '°C', 'value': '0.00'}, 'soil_sensor': {'electrical_conductivity': {'comment': 'Soil electrical conductivity (EC)', 'unit': 'uS/cm', 'value': 11400}, 'moisture': {'comment': 'Volumetric soil water content', 'unit': '%vol', 'value': '10.59'}, 'temperature': {'comment': 'Soil temperature', 'unit': '°C', 'value': '17.71'}}, 'type': 'LSE01'}, 'metadata': {'time': '2021-03-31T11:27:09.90232232Z', 'frequency': 867.1, 'modulation': 'LORA', 'data_rate': 'SF7BW125', 'airtime': 61696000, 'coding_rate': '4/5', 'gateways': [{'gtw_id': 'eui-b827ebfffeeb09b2', 'timestamp': 2172751227, 'time': '2021-03-31T11:27:09.881996Z', 'channel': 3, 'rssi': -39, 'snr': 10.2, 'rf_chain': 0}]}}
 +  
 +Unter  http://localhost:8080/ ist jetzt auch der login screen sichtbar.\\
 +Leider habe ich das Passwort nicht.
 +
 +Habe mit\\
 +  python3 manage.py createsuperuser
 +einen superuser erstellt.\\
 +Jetzt klappt der Login:\\
 +{{:projects:bewaesserung:oasis_01.jpg?400|}}\\
 +{{:projects:bewaesserung:oasis_02.jpg?400|}}\\
  
  
projects/bewaesserung/installation.1617021396.txt.gz · Last modified: 2021/03/29 12:36 by ferdi