Extcommand script limit?
Hi, i´ve 2 printers with remote power supply and light switching programmed and implemented via extcommand.xml calling a Python script...nothing special. Everything is going well and working.
I´ve been trying to implement another bigger Python script, trying to run Telegram via Python, but it aborts the script and it was all properly implemented.
Out of this my question. Is there a watchdog or some restriction on this implementation?
Anyway i´m starting to program a bot running in a docker on my server using the API to reduce the load on the RPi server.
Regards and thanks for some information on this.
I´ve been trying to implement another bigger Python script, trying to run Telegram via Python, but it aborts the script and it was all properly implemented.
Out of this my question. Is there a watchdog or some restriction on this implementation?
Anyway i´m starting to program a bot running in a docker on my server using the API to reduce the load on the RPi server.
Regards and thanks for some information on this.
Comments
sudo -u repetierserver command
then you also see feedback from errors e.g. permission problems.
The funny part is, if I run the script on the RPi it's working. Even if I add the code to the working script,which switches Relais, the hole script doesn't work again. No relais are switched anymore.
Both scripts run on Python 3. Any other suggestion?
Is there a possibility to debug external scripts or maybe use the Python log mechanisms?
I'm no python programmer so can't say much about what you can do in python. Can it be that your new script needs some environment it does not get? E.g. is the work directory important to the script which is not set here.
I have script 1 which switches via Python 3 a few relais. This one is working.
I´ve tried to add script 2. Also running via Python 3 to send messages via telegram. This one does nothing, when i try to run it via a button (extcommand - > sending only a fixed message). Even not with sudo -u. I don´t think it´s a user right problem. The script itself runs on the Raspberry, when i run it via ssh.
Now i´ve implemented the code to the script which switches the relais. If i try to switch a relais it is not working anymore. So, for me it seems to be a different topic than user rights.
If it doe snot run with sudo -u which is the same as server does it is a user problem. Not necessarily a permission problem. Maybe just a problem that user "repetierserver" is not allowed to send to your account because you perhaps just configured it for user pi in some config files stored in home directory and repetierserver home directory is /var/lib/Repetier-Server.
So, as i told you. I´ve added the code of the not working script to the working script. The script failed when i added the code.
I´ve run this 2 in 1 script also via the ssh. There it was working fine. When i deleted the code again and i had only the relais things in the script, everything was fine again. So, same file, same everything...only some different code...and it wasn´t working anymore.
It doesn´t look to me, that i have any user right issues.
Have a nice sunday...