TOP
SSV Software Systems Register  Register
Log in to check your private messages  Log in to check your private messages
Startseite FAQ Search Mitglieder Profile  Log in 
SSV Support-Forum
python im Autostart

 
Post new topic   Reply to topic    SSV-Forum Forum Index >>> IGW/936(-L)
<<< Previous topic - Next topic >>>  
Display posts from previous:   
Author Message
hne



Joined: 11 Jul 2008
Posts: 210
Location: Hannover

PostPosted: 04.06.2018, 14:44    Post subject: python im Autostart Reply with quote

Wie kann man Python im Autostart debuggen?

Die Meldungen vom Autostart werden nach null umgeleitet, deshalb kann man an der Konsole nichts sehen.

Es gibt eine Meldung im Syslog, wenn der Austostart gestartet wurde:
Code:
Jun  4 15:12:35 emblinux user.info S80autostart.sh: start 'script.py' with PID 869


Um Meldungen innerhalb des Python-Scrips zu erhalten, sollte man in dem Script die Funktion syslog benutzen, z.B.:
Code:
import syslog

syslog.openlog("script.py", syslog.LOG_PID + syslog.LOG_PERROR)
syslog.syslog('Processing started')


Im Syslog erscheint dann:
Code:
Jun  4 15:51:28 emblinux user.info syslog-example.py[3514]: Processing started

_________________
Henry Nestler


Last edited by hne on 04.06.2018, 15:07; edited 5 times in total
Back to top
View user's profile Send private message Visit poster's website
hne



Joined: 11 Jul 2008
Posts: 210
Location: Hannover

PostPosted: 04.06.2018, 14:49    Post subject: Python startet nicht im Autostart Reply with quote

Der Autostart eines Python-Scripts funktioniert im IGW/936 bis Version 3.6 leider nicht.
Hier ist ein Workaround:
  • Den Python Script "script.py" ins Verzeichnis /flash verschieben
  • Datei "script.sh" mit diesem Inhalt als Autostart hochladen:
    Code:
    #!/bin/sh
    exec /usr/bin/python /flash/script.py


_________________
Henry Nestler
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    SSV-Forum Forum Index >>> IGW/936(-L) All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

SSV Software Systems GmbH

Dünenweg 5
30419 Hannover

Fon: +49(0)511  ·  40 000-0
Fax: +49(0)511  ·  40 000-40

sales@ssv-embedded.de


Impressum    ·    Datenschutz    ·    AGB

© 2023 SSV SOFTWARE SYSTEMS GmbH. Alle Rechte vorbehalten.

ISO 9001:2015