remote_ssh_based_gui
Dies ist eine alte Version des Dokuments!
Inhaltsverzeichnis
GUI
Remote ssh based GUI
export DISPLAY=:0.0
Remote browser based GUI
plotl based HTML gui
Idea: creating images on pi and display these images as html files remotely
Use lighttpd as minimal webserver on pi
sudo apt-get install lighttpd sudo pip install plotly
Check status
sudo systemctl status lighttpd
Set access rights
sudo groupadd www-data sudo usermod -G www-data -a pi sudo chown -R www-data:www-data /var/www/html sudo chmod -R 775 /var/www/html
restart service
sudo service lighttpd force-reload
move html file to be displayed into /var/www/html/
remote browser access html file by:
http://192.168.1.xx/<filename>
Basic code
import plotly.graph_objects as go
import random
def nextvalue():
return (random.randint(10,104))
def displayserver():
while True:
fig = go.Figure(go.Indicator(
mode = "gauge+number",
value = nextvalue(),
domain = {'x': [0, 1], 'y': [0, 1]},
title = {'text': "Temperatur"}))
fig.write_html('/var/www/html/labor.html', auto_open=True)
#fig.show()
#
# Main
#
if __name__== '__main__':
try:
displayserver()
except KeyboardInterrupt:
exit()
remote_ssh_based_gui.1584950220.txt.gz · Zuletzt geändert: (Externe Bearbeitung)
