You are not logged in.
Pages: 1
Topic closed
Hi,
I have created a few Tkinter scripts and I can call it with cmd (Unipi). I attempted to call it with the epc block but it does not work. According to the log the problem lies with the way I named the file?
Offline
I have renamed ofns to "epc_datain.txt" and that seems to have cleared the error messages but I still cannot call the Tkinter script or any other script.
Offline
Hi Hendrik,
please, can you provide the Tkinter script you are about to run by EPC function block? Or any other demo python script which doesn't work for you either.
Did you try to run EPC Email Notification example without any changes? Does it work for you?
Regards, Tomas
Offline
Hi Tomas,
The EPC email notification example did not work for me; I found that I had to change "headers = ["From: " + MAIL_USERNAME," to "headers = ["From: " + SMTP_USERNAME, "
as mentioned before I had to change ofns from "epc_dataout.txt to "epc_datain.txt". I am now able to sent emails, again, when using the EPC block, thanks.
See attached basic test script for Tkinter which does work when using cmd in terminal but not when using the EPC block.
Offline
Hi Hendrik,
thanks for reporting the error in email notification example. I have fixed that in our repository.
The EPC block is meant for running non-interactive scripts, which only take the input data, process it and generate output data. Running interactive scripts waiting for user input (confirmation of the alert) is not recommended. Anyways, the problem is that RexCore is running in the background as a service and therefore neither RexCore neither the script knows where to display the window/dialog.
I'm sorry I'm not able to give you more hints on this topic.
Jaroslav
Monarco HAT for Raspberry Pi - Lightweight I/O for monitoring, archiving and control.
Raspberry Pi in industrial automation!
Offline
Hi Hendrik,
I have set cmd to
su pi -c "export DISPLAY=:0.0 && python /rex/rexcore/alert_Tkinter.py"
and it works for me, the window appears on the HDMI screen. However, the RESET input of EPC does not work in this case.
Hope it helps somehow...
Jaroslav
Monarco HAT for Raspberry Pi - Lightweight I/O for monitoring, archiving and control.
Raspberry Pi in industrial automation!
Offline
Pages: 1
Topic closed