Python auf der Standard Firmware
Forumsregeln
Bitte beachte die Forumsregeln!
Bitte beachte die Forumsregeln!
-
- Beiträge: 4
- Registriert: 19 Dez 2020, 12:35
Python auf der Standard Firmware
Hallo,
seit der Offiziellen Firmware Version 4.6.6 (https://github.com/fischertechnik/FT-TXT/releases) ist ein Python Launcher im TXT integriert. Kann man diesen irgendwie benutzen um Python Dateien ohne die Community Firmware laufen zu lassen? Und wenn ja, kann man irgendwie Python-Bibliotheken, die nicht standardmäßig mit Python kommen und mit PIP installiert werden müssten, benutzen?
Danke im Voraus,
LG. Chuaat
seit der Offiziellen Firmware Version 4.6.6 (https://github.com/fischertechnik/FT-TXT/releases) ist ein Python Launcher im TXT integriert. Kann man diesen irgendwie benutzen um Python Dateien ohne die Community Firmware laufen zu lassen? Und wenn ja, kann man irgendwie Python-Bibliotheken, die nicht standardmäßig mit Python kommen und mit PIP installiert werden müssten, benutzen?
Danke im Voraus,
LG. Chuaat
Re: Python auf der Standard Firmware
Hallo Chuaat,
Viele Gruesse
Torsten
[1] https://github.com/ftrobopy
Da auch die Python-Library ftrobopy[1] bei der 4.6.6 Firmware vorinstalliert ist, kannst Du damit und mit dem Python Launcher die Ein- und Ausgaenge des TXT direkt in Python ansteuern (im Online- und Offline-Modus).Chuaat3.Versuch hat geschrieben: ↑19 Dez 2020, 13:09seit der Offiziellen Firmware Version 4.6.6 (https://github.com/fischertechnik/FT-TXT/releases) ist ein Python Launcher im TXT integriert. Kann man diesen irgendwie benutzen um Python Dateien ohne die Community Firmware laufen zu lassen?
Solange die Python-Bibliotheken, die Du installieren moechtest, rein in Python geschrieben sind, geht das normalerweise. Sobald andere Sprachen beteiligt sind, die einen Compiler erfordern (z.B. C/C++), ist es nicht mehr ganz so einfach, da der TXT ohne vorinstallierten C/C++ Compiler kommt. Mit etwas mehr Aufwand ist aber auch das moeglich.Chuaat3.Versuch hat geschrieben: ↑19 Dez 2020, 13:09Und wenn ja, kann man irgendwie Python-Bibliotheken, die nicht standardmäßig mit Python kommen und mit PIP installiert werden müssten, benutzen?
Viele Gruesse
Torsten
[1] https://github.com/ftrobopy
Re: Python auf der Standard Firmware
The basic idea behind the TXT (ARM Cortex A8 (ARM v7-A),embedded LINUX) is cross compiling from a windows or linux system.
A way to find a solution could be cross compiling for Python PIP's.
Maybe this can help you to find a solution for your problem: (search on the web: Python PIP cross compiling)
https://pypi.org/project/crossenv/
The basics about cross compiling for the TXT with Eclipse has been discussed on: https://github.com/fischertechnik/txt_demo_ROBOPro_SLI
Documentation is all in English.
(For translation, see Google translate)
===============================
Die Grundidee beim TXT (Embedded LINUX) ist das Cross-Compilieren von einem Windows- oder Linux-System.
Möglicherweise besteht eine Möglichkeit, eine Lösung zu finden, in der Cross-Kompilierung für Python-PIPs.
Vielleicht kann Ihnen dies helfen, eine Lösung für Ihr Problem zu finden:
https://pypi.org/project/crossenv/
A way to find a solution could be cross compiling for Python PIP's.
Maybe this can help you to find a solution for your problem: (search on the web: Python PIP cross compiling)
https://pypi.org/project/crossenv/
The basics about cross compiling for the TXT with Eclipse has been discussed on: https://github.com/fischertechnik/txt_demo_ROBOPro_SLI
Documentation is all in English.
(For translation, see Google translate)
===============================
Die Grundidee beim TXT (Embedded LINUX) ist das Cross-Compilieren von einem Windows- oder Linux-System.
Möglicherweise besteht eine Möglichkeit, eine Lösung zu finden, in der Cross-Kompilierung für Python-PIPs.
Vielleicht kann Ihnen dies helfen, eine Lösung für Ihr Problem zu finden:
https://pypi.org/project/crossenv/
-
- Beiträge: 4
- Registriert: 19 Dez 2020, 12:35
Re: Python auf der Standard Firmware
Danke für die Antworten!
Eine Frage habe ich noch:
Kann man das Python Programm nur vom PC aus laufen lassen, oder kann man es auch vom TXT direkt starten?
Wenn ja, wie würde man das Programm auf den TXT übertragen?
LG. Chuaat
Eine Frage habe ich noch:
Kann man das Python Programm nur vom PC aus laufen lassen, oder kann man es auch vom TXT direkt starten?
Wenn ja, wie würde man das Programm auf den TXT übertragen?
LG. Chuaat
Re: Python auf der Standard Firmware
With the TXT web interface you are able to upload /download / manage files to the use data area on the TXT.
Or with for example Filezilla.
You will need firmware 4.6.6 or 4.7.0
There is a Python runtime on the TXT available. So after uploading your py program you can run it from the command prompt (Putty).
See also the documentation of the FtRoboPy: https://github.com/ftrobopy/ftrobopy
The py programs can run remote or local.
It is even possible to use Python in a CGI script with CivetWeb on the TXT.
============== Google translate for what it is ===================================================================================
Mit der TXT-Weboberfläche können Sie Dateien in den Verwendungsdatenbereich des TXT hochladen / herunterladen / verwalten.
Oder zum Beispiel mit Filezilla.
Auf dem TXT ist eine Python-Laufzeit verfügbar. Nachdem Sie Ihr py-Programm hochgeladen haben, können Sie es an der Eingabeaufforderung (Putty) ausführen. Siehe auch die Dokumentation des FtRoboPy https://github.com/ftrobopy/ftrobopy
Die py-Programme können remote oder lokal ausgeführt werden.
Or with for example Filezilla.
You will need firmware 4.6.6 or 4.7.0
There is a Python runtime on the TXT available. So after uploading your py program you can run it from the command prompt (Putty).
See also the documentation of the FtRoboPy: https://github.com/ftrobopy/ftrobopy
The py programs can run remote or local.
It is even possible to use Python in a CGI script with CivetWeb on the TXT.
============== Google translate for what it is ===================================================================================
Mit der TXT-Weboberfläche können Sie Dateien in den Verwendungsdatenbereich des TXT hochladen / herunterladen / verwalten.
Oder zum Beispiel mit Filezilla.
Auf dem TXT ist eine Python-Laufzeit verfügbar. Nachdem Sie Ihr py-Programm hochgeladen haben, können Sie es an der Eingabeaufforderung (Putty) ausführen. Siehe auch die Dokumentation des FtRoboPy https://github.com/ftrobopy/ftrobopy
Die py-Programme können remote oder lokal ausgeführt werden.
Zuletzt geändert von vleeuwen am 21 Dez 2020, 15:08, insgesamt 1-mal geändert.
-
- Beiträge: 4
- Registriert: 19 Dez 2020, 12:35
Re: Python auf der Standard Firmware
Thanks for your answer!
Eine letzte Frage: Funktioniert die Anzeige auf dem TXT gleich wie in der Community Firmware, also mit TouchStyle und QT4, oder ist das gar nicht möglich.
Translation (deepl translate):
One last question: Does the display on the TXT work the same as in the community firmware, i.e. with TouchStyle and QT4, or is that not possible at all?
Eine letzte Frage: Funktioniert die Anzeige auf dem TXT gleich wie in der Community Firmware, also mit TouchStyle und QT4, oder ist das gar nicht möglich.
Translation (deepl translate):
One last question: Does the display on the TXT work the same as in the community firmware, i.e. with TouchStyle and QT4, or is that not possible at all?
Re: Python auf der Standard Firmware
Hi Carel,
Do you know - is there any special requirements for python script to start it from integrated LCD GUI? I can start my scripts via SSH, but no success via GUI.
==
ft-ninja
ft-ninja
Re: Python auf der Standard Firmware
@ft-ninja
Since firmware 4.6.6 there is a Python launcher available (Release Notes TXT Firmware 4.5.1 -> 4.6.6).
I tried and tested that a long time ago but the termination after the end of the script gave some minor problems but it is usable.
I did not tested this on 4.8.0 yet.
I also tested Civetweb CGI interface with Python and that was working fine; this with the use of FtRoboPy.
But the CGI interface with C/C++ was also working fine.
Because C/C++ is the native interface langage, I am using C/C++ most of the time.
For Civetweb on the TXT, see also some of my personal notes: http://tescaweb.nl/Carel/?p=407
@Chuaat3.Versuch
By my knowledge the TXT display is not accessible by the fischertechnik programming interface.
However it could be that I have miss something in the past.
Personal I am using embedded CivetWeb to have a Winsocket connection between my local application on the TXT and my control logic (web based).
I that case the TXT runs as access point and I can control that model with a normal browser (device Independent).
It is even possible to put the embedded Civetweb part in a RoboPro SLI element and create the application with RoboPro.
The TXT access point could also act a router for more client devices.
Use you fantasy.
Since firmware 4.6.6 there is a Python launcher available (Release Notes TXT Firmware 4.5.1 -> 4.6.6).
I tried and tested that a long time ago but the termination after the end of the script gave some minor problems but it is usable.
I did not tested this on 4.8.0 yet.
I also tested Civetweb CGI interface with Python and that was working fine; this with the use of FtRoboPy.
But the CGI interface with C/C++ was also working fine.
Because C/C++ is the native interface langage, I am using C/C++ most of the time.
For Civetweb on the TXT, see also some of my personal notes: http://tescaweb.nl/Carel/?p=407
@Chuaat3.Versuch
By my knowledge the TXT display is not accessible by the fischertechnik programming interface.
However it could be that I have miss something in the past.
Personal I am using embedded CivetWeb to have a Winsocket connection between my local application on the TXT and my control logic (web based).
I that case the TXT runs as access point and I can control that model with a normal browser (device Independent).
It is even possible to put the embedded Civetweb part in a RoboPro SLI element and create the application with RoboPro.
The TXT access point could also act a router for more client devices.
Use you fantasy.
Re: Python auf der Standard Firmware
Hallo Chuaat,
Man muss dazu im Verzeichnis /opt/knobloch auf dem TXT einen Ordner namens "Python" anlegen.
Entweder per ssh:
# ssh ROBOPro@192.168.7.2
# mkdir Python
Oder per Webbrower, der zuvor auf dem TXT gestartet worden sein muss (Einstellungen-->Sicherheit-->WEB Server), einen neuen Ordner anlegen.
In diesen Ordner sollte man nun die Python Programme kopieren (per scp oder auch per Webbrowser)
In der GUI des TXT erscheint dann unter "Datei" auch der Ordner Python und man kann die Python Scripte von dort per GUI laden und starten.
Damit das alles funktinoiert, benoetigt man noch die neueste Version von ftrobopy (1.93), die es auf github.com/ftrobopy gibt. Man kopiert einfach die beiden Datein ftrobopy.py und ftTA2py.so in den Python Ordner auf dem TXT.
In dem Python-Skript muss dann bei der Initialisierung von ftrobopy der sog. TransferAreaMode eingeschaltet werden:
Im Prinzip kann man auch auf den Bildschirm des TXT von Python aus zugreifen (ueber das TXT Framebuffer Device /dev/fb0). Da Python allerdings recht langsam ist, sollte man die Bildschirmroutinen besser in C/C++ implementieren. Dafuer kann man die SDL (Simple Display Library) verwenden, die auf dem TXT immer installiert ist.
Viele Gruesse
Torsten
Ja, man kann ab der Version 4.6.6 Python Programme auch lokal auf dem TXT laufen lassen.Chuaat3.Versuch hat geschrieben: ↑21 Dez 2020, 12:39Kann man das Python Programm nur vom PC aus laufen lassen, oder kann man es auch vom TXT direkt starten?
Wenn ja, wie würde man das Programm auf den TXT übertragen?
Man muss dazu im Verzeichnis /opt/knobloch auf dem TXT einen Ordner namens "Python" anlegen.
Entweder per ssh:
# ssh ROBOPro@192.168.7.2
# mkdir Python
Oder per Webbrower, der zuvor auf dem TXT gestartet worden sein muss (Einstellungen-->Sicherheit-->WEB Server), einen neuen Ordner anlegen.
In diesen Ordner sollte man nun die Python Programme kopieren (per scp oder auch per Webbrowser)
In der GUI des TXT erscheint dann unter "Datei" auch der Ordner Python und man kann die Python Scripte von dort per GUI laden und starten.
Damit das alles funktinoiert, benoetigt man noch die neueste Version von ftrobopy (1.93), die es auf github.com/ftrobopy gibt. Man kopiert einfach die beiden Datein ftrobopy.py und ftTA2py.so in den Python Ordner auf dem TXT.
In dem Python-Skript muss dann bei der Initialisierung von ftrobopy der sog. TransferAreaMode eingeschaltet werden:
Code: Alles auswählen
txt=ftrobopy.ftrobopy('auto', use_TransferAreaMode=True)
Viele Gruesse
Torsten
Re: Python auf der Standard Firmware
Thanks Torsten, very useful.
I was searching for the description of SDL and found only Simple DirectMedia Layer,
(http://www.sdltutorials.com/sdl-tutorial-basics or https://www.geeksforgeeks.org/sdl-libra ... -examples/)
Is that what mean? Or did I overlook something?
I was searching for the description of SDL and found only Simple DirectMedia Layer,
(http://www.sdltutorials.com/sdl-tutorial-basics or https://www.geeksforgeeks.org/sdl-libra ... -examples/)
Is that what mean? Or did I overlook something?
-
- Beiträge: 4
- Registriert: 19 Dez 2020, 12:35
Re: Python auf der Standard Firmware
Ok danke für die Antwort