lukasznowarkiewicz / iss_proj

0 stars 1 forks source link

Prepare environment on Raspberry PI 2 #4

Open lukasznowarkiewicz opened 1 year ago

lukasznowarkiewicz commented 1 year ago

Subject of this task is prepare environment to run python program in target device. Tasks included:

lukasznowarkiewicz commented 1 year ago

OS from: https://www.raspberrypi.com/software/

lukasznowarkiewicz commented 1 year ago

Terrible attempt: https://stackoverflow.com/questions/62830862/how-to-install-python3-8-on-debian-10 Took almost 2 hours to build it on that arm 2x800mhz cpu

lukasznowarkiewicz commented 1 year ago

Python installed as described in: https://projects.raspberrypi.org/en/projects/generic-python-install-python3 sudo apt update sudo apt install python3 idle3

lukasznowarkiewicz commented 1 year ago

Useful document on interacting with GPIO on raspberry pi: https://forbot.pl/blog/kurs-raspberry-pi-podstawy-pythona-gpio-id26099

lukasznowarkiewicz commented 1 year ago

Installed libraries: pip3 install ...

lukasznowarkiewicz commented 1 year ago

Useful script for pulling repo from GitHub: https://gist.github.com/sunitparekh/fd056741bbe7a43cc4f0

lukasznowarkiewicz commented 1 year ago

Instruction how autostart application on raspbian OS: https://www.dexterindustries.com/howto/run-a-program-on-your-raspberry-pi-at-startup/ (second method)

lukasznowarkiewicz commented 1 year ago

All libraries used by this point: time serial plotly dash collections pandas as pd

lukasznowarkiewicz commented 1 year ago

Install command: pip3 install pyserial plotly dash pandas

lukasznowarkiewicz commented 1 year ago

Simple script for pulling from repo newest version of the software, opening chromium in kiosk mode and running main.py script `#!/bin/bash

Navigacja do lokalizacji, gdzie jest repozytorium

cd ~/repo/python_desktop_app

Pobieranie aktualizacji z repozytorium GitHub

git pull

Otwieranie przeglądarki Chromium w trybie kiosku

Opcje --noerrdialogs, --disable-infobars i --check-for-update-interval=31536000

służą do wyłączenia dialogów błędów, pasków informacyjnych i aktualizacji

chromium-browser --kiosk 'http://your.url.here' --noerrdialogs --disable-infobars --check-for-update-interval=31536000 &

Uruchomienie aplikacji main.py

python3 main.py & `

lukasznowarkiewicz commented 1 year ago

Raspberry pi access over ssh: ssh user@192.168.8.134 password: user

lukasznowarkiewicz commented 1 year ago

updated repo and upgraded packages

lukasznowarkiewicz commented 1 year ago

disabled screensaver as: https://pimylifeup.com/raspberry-pi-disable-screen-blanking/

lukasznowarkiewicz commented 1 year ago

added shell script for pulling from repo and running web server 8ddf7ca6e910355767c52e4eea5311db7187b3f4

lukasznowarkiewicz commented 1 year ago

installing git: sudo apt install git

lukasznowarkiewicz commented 1 year ago

Installing pandas failed: building 'pandas._libs.interval' extension gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DNPY_NO_DEPRECATED_API=0 -I./pandas/_libs/tslibs -Ipandas/_libs/src/klib -I/tmp/pip-build-env-f7eke2li/overlay/lib/python3.8/site-packages/numpy/core/include -I/usr/local/include/python3.8 -c pandas/_libs/interval.c -o build/temp.linux-armv7l-cpython-38/pandas/_libs/interval.o gcc -pthread -shared build/temp.linux-armv7l-cpython-38/pandas/_libs/interval.o -o build/lib.linux-armv7l-cpython-38/pandas/_libs/interval.cpython-38-arm-linux-gnueabihf.so building 'pandas._libs.join' extension gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DNPY_NO_DEPRECATED_API=0 -Ipandas/_libs/src/klib -I/tmp/pip-build-env-f7eke2li/overlay/lib/python3.8/site-packages/numpy/core/include -I/tmp/pip-build-env-f7eke2li/overlay/lib/python3.8/site-packages/numpy/core/include -I/tmp/pip-build-env-f7eke2li/overlay/lib/python3.8/site-packages/numpy/core/include -I/tmp/pip-build-env-f7eke2li/overlay/lib/python3.8/site-packages/numpy/core/include -I/tmp/pip-build-env-f7eke2li/overlay/lib/python3.8/site-packages/numpy/core/include -I/tmp/pip-build-env-f7eke2li/overlay/lib/python3.8/site-packages/numpy/core/include -I/tmp/pip-build-env-f7eke2li/overlay/lib/python3.8/site-packages/numpy/core/include -I/usr/local/include/python3.8 -c pandas/_libs/join.c -o build/temp.linux-armv7l-cpython-38/pandas/_libs/join.o gcc: fatal error: Killed signal terminated program cc1 compilation terminated. /tmp/pip-build-env-f7eke2li/overlay/lib/python3.8/site-packages/setuptools/command/build_py.py:201: _Warning: Package 'pandas.tests.io.data.pickle' is absent from thepackagesconfiguration. !!

lukasznowarkiewicz commented 1 year ago

Cannot install pandas - need to write code without this library, as it can be replaced