Post by m3m0r3x on Nov 12, 2015 15:09:37 GMT
Hi guys,
I have some trouble with the Code. Yes, I don't have much knowledge about Python. I tried to create Some Custom Screens. So I tried to play a little with the template provided in the script:
I tried to make a new menue entry called "Netwok" with an Entry WAN which gives me Back the WAN-IP of the FrutyWiFi-Pi.
I tried different variations. when you do the following in a bash you get the WAN-IP
So I tried the folowing:
Every variation end ion the Bye-Message on the Display.
The other thing I want too get to work is to give some Values is Reltime until I push a button to go back to the menue.
For instance, I want to create a screen with the Name System. Thats not so hard :-)
There I want to place two Entrys that give back the aktuall value of the CPU- and memory-usage for this I fouind the following snipets:
You have to import psutils to get this running.
And one third question:
Is it possible to create somthing like folders or submenues
I found two Github Scripts for the Aydafruit PiPlate which perfectly match for the above questions but my knowledge about Python is too poor to get the things merged that I need :-)
github.com/sleeepyjack/RPi_AdafruitLCD_Menu
github.com/aufder/RaspberryPiLcdMenu
Perhaps some one can giv me some good starting Points to get this working. I think when I have an example of each of my questions I think I can then go on to get the rest by myself.
And by the way, I will learn Python by to get the rest working ^^
Thank you for every support!
Greetings m3m
I have some trouble with the Code. Yes, I don't have much knowledge about Python. I tried to create Some Custom Screens. So I tried to play a little with the template provided in the script:
newScreen = [
["empty",""],
["SUB-1","screenFunction(1)","SUB-1-COMMAND","-"],
["SUB-2","screenFunction(2)","SUB-2-COMMAND","-"]
]
display.addScreen(["SCREEN-NAME", newScreen])
I tried to make a new menue entry called "Netwok" with an Entry WAN which gives me Back the WAN-IP of the FrutyWiFi-Pi.
Row1: WAN-IP
Row2: [The IP]
I tried different variations. when you do the following in a bash you get the WAN-IP
curl 4.ifcfg.me
So I tried the folowing:
NetworkScreen = [
["empty",""],
["WAN-IP","curl 4.ifcfg.me","","-"],
["WANIP","","curl 4.ifcfg.me","-"],
["WAN_IP","curl 4.ifcfg.me","curl 4.ifcfg.me","-"]
]
display.addScreen(["Network", NetworkScreen])
Every variation end ion the Bye-Message on the Display.
The other thing I want too get to work is to give some Values is Reltime until I push a button to go back to the menue.
For instance, I want to create a screen with the Name System. Thats not so hard :-)
There I want to place two Entrys that give back the aktuall value of the CPU- and memory-usage for this I fouind the following snipets:
'str(str(psutil.phymem_usage()[3])+"% used")' --> CPU-usage
'str(str(psutil.phymem_usage()[3])+"% used")' --> memoryusage
You have to import psutils to get this running.
And one third question:
Is it possible to create somthing like folders or submenues
[System] cpu usage
[System] memory usage
[System] Network Signal
[System] [Boot] Reboot
[System] [Boot] Shutdown
I found two Github Scripts for the Aydafruit PiPlate which perfectly match for the above questions but my knowledge about Python is too poor to get the things merged that I need :-)
github.com/sleeepyjack/RPi_AdafruitLCD_Menu
github.com/aufder/RaspberryPiLcdMenu
Perhaps some one can giv me some good starting Points to get this working. I think when I have an example of each of my questions I think I can then go on to get the rest by myself.
And by the way, I will learn Python by to get the rest working ^^
Thank you for every support!
Greetings m3m