Announcement

REXYGEN forum has been moved. This one is closed.
Head over to the new REXYGEN Community Forum at https://forum.rexygen.com.

Looking forward to meeting you there!
 

#1 2016-10-06 14:01:43

hendrik
Member
Registered: 2015-11-01
Posts: 49

EPC block - Tkinter

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?

Rex-Log_20161006-1454.png

Tkinter.png

epc-Tk.png

Offline

#2 2016-10-07 11:05:34

hendrik
Member
Registered: 2015-11-01
Posts: 49

Re: EPC block - Tkinter

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

#3 2016-10-07 11:41:52

tomáš čechura
Administrator
Registered: 2016-02-22
Posts: 371

Re: EPC block - Tkinter

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

#4 2016-10-07 13:57:13

hendrik
Member
Registered: 2015-11-01
Posts: 49

Re: EPC block - Tkinter

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.

tk-script.png

Offline

#5 2016-10-07 15:59:16

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: EPC block - Tkinter

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

Offline

#6 2016-10-07 16:56:04

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: EPC block - Tkinter

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

Offline

Board footer

Powered by FluxBB