Bedienfeld(-Funktion) unter ROBO Pro Coding (für TXT 4.0)

Alles rund um TX(T) und RoboPro, mit ft-Hard- und Software
Computing using original ft hard- and software
Forumsregeln
Bitte beachte die Forumsregeln!
Antworten
Benutzeravatar
MINT-Matthias
Beiträge: 7
Registriert: 16 Apr 2022, 23:55
Wohnort: Oberursel
Kontaktdaten:

Bedienfeld(-Funktion) unter ROBO Pro Coding (für TXT 4.0)

Beitrag von MINT-Matthias » 21 Apr 2022, 08:50

Ein fröhliches Hallo in die ftcommunity,

seit ein paar Wochen beschäftige ich mit dem TXT 4.0 und der "ROBO Pro Coding" App (hauptsächlich auf Windows PC).
Vorher habe ich lange mit TX-/TXT-Controllern und der "alten" Software "Robo Pro" gearbeitet.
Wie viele von Euch bereits berichtet haben, finde ich bei "ROBO Pro Coding" einiges gut (z.B. Blocky-Programmierung)
aber auch einiges weniger gut (z.B. die "knappe" Dokumentation zur Python-Programmierung).
Danke auch für alle wertvollen, hilfreichen Tipps zum TXT 4.0 und der "ROBO Pro Coding" App in diesem Forum.

Eine Funktionalität aus der "alten Robo Pro" Software vermisse ich jedoch stark, nämlich das sogenannte Bedienfeld:
Dies ist neben dem eigentlichen Controller-Display quasi eine zweite, selbst-konfigurierbare Anzeige in der "alten Robo Pro" App
(also auf dem PC), mit der man während der Ausführung von hochgeladenen Programmen beispielsweise Sensor-Ergebnisse auf dem PC
betrachten kann (u.a. auch den kompletten Video-Stream der Kamera) und/oder über Taster/Schalter/Eingabefenstern mit dem Controller
(und dem laufenden Programm) kommunizieren kann. Besonders wertvoll ist das Bedienfeld auf dem PC bei Rover-Anwendungen, weil man
dann die Rover-Fahrt und die Aktionen am PC verfolgen kann und nicht immer hinter dem Rover herlaufen muss,
um das Controller-Display zu betrachten bzw. dort Eingaben zu tätigen.

In der "ROBO Pro Coding" App habe ich solch eine "Bedienfeld-Funktion" o.ä. (noch) nicht entdeckt.
Zwar kann man sich Sensorwerte oder andere Ergebnisse auf der Konsole ausgeben oder Werte in der "Ausdruck"-Tabelle anzeigen lassen,
aber ein gleichwertiger Ersatz für das "alte Bedienfeld" ist dies nicht. Mir ist es bislang auch nicht gelungen, über das Konsolen-Fenster
in der "ROBO Pro Coding" App eine (Tastatur-)Eingabe zu realisieren (beispielsweise über den input-Befehl von Python o.ä.).

Hätte jemand von Euch hierfür eine Lösung?
Vielleicht mit GUI-Bibliotheken wie tkinter o.ä.? Ich bin hier noch nicht sehr weit gekommen.

Vielen Dank für Eure Rückmeldungen.

Gruß, Matthias.

vleeuwen
Beiträge: 1560
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: Bedienfeld(-Funktion) unter ROBO Pro Coding (für TXT 4.0)

Beitrag von vleeuwen » 21 Apr 2022, 20:52

Node-Red or web socket + MQTT for remote
and for locale :
Display.JPG
Display.JPG (70.13 KiB) 1379 mal betrachtet
However for remote their are no Blocklies available, only with Python.
=====Google translate for what it is==========================
Node-Red oder Web-Socket + MQTT für Remote
und für Gebietsschema:
Display.JPG
Display.JPG (70.13 KiB) 1379 mal betrachtet
Für Remote sind jedoch keine Blocklies verfügbar, nur mit Python.
software enigineer/teacher/advisor
Google translate
http://tescaweb.nl/Carel/?p=713

Benutzeravatar
MINT-Matthias
Beiträge: 7
Registriert: 16 Apr 2022, 23:55
Wohnort: Oberursel
Kontaktdaten:

Re: Bedienfeld(-Funktion) unter ROBO Pro Coding (für TXT 4.0)

Beitrag von MINT-Matthias » 21 Apr 2022, 23:06

Thanks for your kind answer.
The "standard method" (display configurator in the ROBO Pro Coding app) to communicate with the TXT via its "internal display"
(by Blocky and/or Python language) is well described in the app documentation.
Thanks for your great hint (and the examples on your web page!) for "remote access" via web socket + MQTT. I will try this soon.
However, it would be nice having such a remote access functionality integrated into a future version of ROBO Pro Coding.
Regards, Matthias.

vleeuwen
Beiträge: 1560
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: Bedienfeld(-Funktion) unter ROBO Pro Coding (für TXT 4.0)

Beitrag von vleeuwen » 22 Apr 2022, 09:52

Thanks,
I agreed with you
The available MQTT Blocklies and event handlers can be more generic and also target local network usage and not just the cloud.
Everything is available at Python level.
The Blocklies ultimately only provide a limited sub-set of what is possible with Python. Blocklies are not a real replacement for the original RoboPro; this gave a higher level of abstraction in terms of programming.
There is also a lack of ability to integrate Python bits into Blockly. At the moment that is quite limited, tricks are needed to achieve something. This can be seen in my blog.

With Robopro I also was able to integrate MQTT into it and into the RoboPro elements for the factory(9V).
viewtopic.php?f=8&t=7391
software enigineer/teacher/advisor
Google translate
http://tescaweb.nl/Carel/?p=713

Benutzeravatar
MINT-Matthias
Beiträge: 7
Registriert: 16 Apr 2022, 23:55
Wohnort: Oberursel
Kontaktdaten:

Re: Bedienfeld(-Funktion) unter ROBO Pro Coding (für TXT 4.0)

Beitrag von MINT-Matthias » 22 Apr 2022, 11:12

Thanks for your kind and detailed answer.
I am trying to follow your excellent ideas, examples and methods, but unfortunately I am not as "fit" in MQTT and Node-Red as you.
However, please let me propose the following idea:
Would it be possible to create/program a kind of "individual" web server on the TXT4.0 (using Python, MQTT and/or Node-Red),
which "just automatically transfers" all (user-configured) inputs/outputs of the
display configuation page (from the ROBO Pro Coding App) into a regular website.
This "web GUI" could then be accessed just by entering the web-ip into any browser, like:
http://192.168.7.2:XXXX
where the ip and the port number "XXXX" have to be chosen correctly.
The result would be that anyone within the TXT40 WLAN could "look" at the internal TXT display from his PC or smart device
just by connecting to this ip-address via any internet browser.
I am sure that I won't achieve this on my own. But maybe you might find a solution?
Thanks for you kind reply and Regards, Matthias.

vleeuwen
Beiträge: 1560
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: Bedienfeld(-Funktion) unter ROBO Pro Coding (für TXT 4.0)

Beitrag von vleeuwen » 22 Apr 2022, 13:04

Most of what you ask is in principle possible. Both with the TXT and with the TXT4.0.
With the TXT I have already been able to realize all this during experiments.
With the TXT4.0 the core also already, see my web socket example: http://tescaweb.nl/Carel/?p=713.
But that web socket can of course also realize other communication
A Node-Red service is running on the TXT4.0 and it can communicate with that web socket. Unfortunately; however a good and direct Node-Red interface to the TXT4.0 sensors and actuators is missing.
MQTT-subscribe and MQTT-publish are also quite easy to implement in Python.
Another possibility is to use the TXT4.0 C++ interface to create an embedded CivetWeb service(http, web socket, LUA, SQLIte). That also produces beautiful things.
Unfortunately, the extended Apache web server, which is present on the TXT4.0, cannot be configured because unfortunately that configuration is behind the "root" account.

You name the TXT IP address for the USB connection. It will also work through the other IP addresses on the TXT4.0 (USB, BT, WIFI-AP or WIFI-client).
I myself prefer to place the TXT/TXT4.0 all in the same local network (as IP clients) with fixed IP addresses via DHCP and also my laptop and my Raspberry Pie's. For that I use an extra router with a sub network in my local network.
This gives the possibility to communicate with devices and also to be able to take them for a demonstration.
software enigineer/teacher/advisor
Google translate
http://tescaweb.nl/Carel/?p=713

Antworten