Read the statement by Michael Teeuw here.
Python in to the magic mirror.
-
Hello @Sean,
Again thank you for the help. As I say after your help it was possible for me to “print” a string variable on the magic mirror module through python.
But is was not able to put my P2000 alarm from the fire department on my screen. I noticed that it was a problem in the python script of the alarm.
I used the stdout.write function again. like you told me. but I needed to add the flush function as wel.
so now it issys.stdout.write("hallo ik ben Paul") sys.stdout.flush()
And then it was working !
so thank you and here the result: -
@sean
Hello Sean,
like I posted yesterday the app is running now. And it is showing wat I need to display. So im very happy.But…
After a time ( more after a couple of runs ) the magic mirror app is crashed and freezed. So noting is updating any more.My feeling is telling that the buffer were I put in the string value is filling up.
wenn i run the python script without the mirror it is running fine.
Please can you give me a help?
-
@paulvanderheijden90
I have no idea about Python. I think you’d better reboot once or twice per daily to maintain RPI to be stable. You can do it withcron
automatically.
The better approach would be implementing your job as native nodeJS MagicMirror module instead external python script. -
@paulvanderheijden90 can u put your project on github and tell me where it is… I will look at it later today (us time)
-
@sdetweil
Hallo Thank you for you’re ReplayI managed to upload the project on git hub ( new experience for me )
I uploaded the magic mirror Module ( P2000) I made and the node helper.And I added the Python project.
The python project works fine on it self. But wenn I call ( spawn ) the python. The magic mirror application stops and freezes.
I think the flush/write fills the buffer and wenn it is it full the application is stoped.
https://github.com/paulvanderheijden90/MMM-P2000-python-connect
Here is the link
-
sorry, the is no PUBLIC repo there
-
@sean
Hello Sean,
The problem is not the python project. But I think the buffer is filling up ore something.At this point all the massages are displayed on the mirror and after 15 min the mirror is freeze.
So im looking in to it.
-
@sdetweil fixed sorry
-
@paulvanderheijden90 i don’t see the python module
you can add it to the directory and repo temporarily, then remove it later
-
@paulvanderheijden90 so far I don’t see the same crash error…
I did have to make some minor changes…
Module name to match the git repo name
path to a python script
and change the display handling…
rule is ONLY content change location is getDom()…
other routines should store data and call updateDom(0 to signal that there ARE changes to displayI’m gonna let it run for a while…