Monitor Robo TXT via WIFI

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
KevinHunter
Beiträge: 4
Registriert: 02 Feb 2018, 22:36

Monitor Robo TXT via WIFI

Beitrag von KevinHunter » 02 Feb 2018, 23:01

Hi experts,

I have just received a factory simulator and I would like to monitor the inputs and outputs of all 5 Robo TXT's Is this possible?

I have configured the 3 master controllers to connect to my wifi router and I can send TCP/IP socket messages to all 3 . The problem is I dont know what messages to send and what will I receive.

I had a look at the C programming guide and source code and found some commands but when I send them I get a response that is empty :

I tried -

StartOnline = 0x163FF61D
ExchangeData = 0xCC3597BA
ExchangeDataCmpr = 0xFBC56F98

Does anyone know the sequence of commands I need to send and what the commands are ??

Thanks in advance
Kevin

Benutzeravatar
ski7777
Beiträge: 870
Registriert: 22 Feb 2014, 14:18
Wohnort: Saarwellingen

Re: Monitor Robo TXT via WIFI

Beitrag von ski7777 » 03 Feb 2018, 11:36

Hi,
welcome to our Forum.

Torsten has already written an Python library for the fischertechnik TXT controller.
You may have a look here: https://github.com/ftrobopy/ftrobopy
Sadly the documentation is available in German only, but the commands are in English so it should be easy to understand.
When connecting you can set the IP of the TXT.
Here is the code to start and stop a motor:

Code: Alles auswählen

from ftrobopy import ftrobopy
import time

txt = ftrobopy("192.168.1.2") #just enter your ip here
m1 = txt.motor(1)
m1.setSpeed(512)
time.sleep(1)
m1.setSpeed(0)
time.sleep(1)
m1.setSpeed(-512)
time.sleep(1)
m1.setSpeed(0)
If you have further questions, feel free to ask.

Raphael

KevinHunter
Beiträge: 4
Registriert: 02 Feb 2018, 22:36

Re: Monitor Robo TXT via WIFI

Beitrag von KevinHunter » 03 Feb 2018, 20:53

Hallo Raphael
Danke für Ihre Antwort.

Ich werde mal schauen.

Ich habe mir eine C # -Bibliothek angeschaut und das Beispiel versucht, aber es scheint nur im Online-Modus zu funktionieren, was ich nicht machen möchte.

Mein Szenario ist, dass ich die Standardprogramme, die mit dem Fabriksimulator geliefert werden, ausführen und mit einem Laptop überwachen soll. Wenn zum Beispiel ein Motor eingeschaltet ist, möchte ich auf dem Laptop anzeigen, dass der Motor läuft.

Also meine Frage ist das kann getan werden oder können Sie nur mit dem Robo TXT im Online-Modus kommunizieren?

Danke noch einmal
Kevin
--------------------------------------------------------------------------------------------------------------
Hi Raphael
Thank you for your reply.

I will take a look.

I did look at a C# library and tried the example but it only appears to work in online mode which is not what I want to do.

My scenario is that I want to execute the standard programs supplied with the factory simulator and monitor it using a laptop. For example when a motor is turned on I want to display on the laptop that the motor is running.

So my question is can that be done or can you only communicate with the Robo TXT in online mode?

Thanks again
Kevin

KevinHunter
Beiträge: 4
Registriert: 02 Feb 2018, 22:36

Re: Monitor Robo TXT via WIFI

Beitrag von KevinHunter » 03 Feb 2018, 22:33

Ich denke, dass die Anwendung, die ich verwendete, um die Verbindung zu testen, das Problem sein könnte! Ich habe einen anderen versucht und jetzt, wenn ich Befehle an den Controller sende, bekomme ich eine Antwort, aber die Antwort ist nicht, was ich erwartet habe :)

Zum Beispiel, wenn ich CC 35 97 BA (ExchangeData) sende, erhalte ich eine Antwort von c3 8c 35 e2 80 94 c2 ba, die nicht zu Anyting in der Dokumentation passt.

Kevin

-----------------------------------------------

I think the application that I was using to test the conection may be the problem ! I tried a different one and now when I send commands to the controller I get a response but the response isnt what I was expecting :)

For example when I send CC 35 97 BA (ExchangeData) I get a response of c3 8c 35 e2 80 94 c2 ba which doesnt match anyting in the documentation.

Kevin

richard.kunze
Administrator
Beiträge: 583
Registriert: 26 Dez 2015, 23:49
Wohnort: Rhein-Main-Gebiet

Re: Monitor Robo TXT via WIFI

Beitrag von richard.kunze » 04 Feb 2018, 10:57

Hi Kevin,
KevinHunter hat geschrieben:I did look at a C# library and tried the example but it only appears to work in online mode which is not what I want to do.
Yes, most published documentation/software for accessing a TXT from a PC only works in online mode.
KevinHunter hat geschrieben:My scenario is that I want to execute the standard programs supplied with the factory simulator and monitor it using a laptop. For example when a motor is turned on I want to display on the laptop that the motor is running.
I don't think this is possible without modifying the TXT, because monitoring a RoboPro program that runs on the TXT itself (i.e. not in online mode) is not supported by RoboPro.

However, there is a chance to get what you want due to the architecture of the TXT: The TXT consists of two processors: An ARM Cortex A8 main processor that runs the operating system of the TXT, and an ARM Cortex M3 micro controller controlling the actual I/O. Those two processors communicate via an (internal) serial connection (with a different, but similar protocol as the one used in online mode - an example implementation can be found in the ftrobopy sources as "direct mode").

So, for monitoring an offline TXT programm you would have to implement a program that intercepts the communication on this internal serial connection, interprets the "direct mode" protocol there, and sends the results to your PC. Should be doable, but requires some Linux knowledge and probably that you implement your monitoring program in a compiled language and cross-compile it for ARM (you could try to do it in a scripting language - e.g. Python, where we do have a working interpreter for the TXT - but I'm not sure if that would be fast enough to allow monitoring without affecting the monitored programs.

KevinHunter
Beiträge: 4
Registriert: 02 Feb 2018, 22:36

Re: Monitor Robo TXT via WIFI

Beitrag von KevinHunter » 04 Feb 2018, 21:59

I don't think this is possible without modifying the TXT, because monitoring a RoboPro program that runs on the TXT itself (i.e. not in online mode) is not supported by RoboPro.
:( Thats disappointing . Unfortunately the firmware on TXT has to stay standard and must run the of the shelf software that it arrives with.

Hmm I need to start thinking about plan B .

Thanks for the info, you have been really helpful.

Kevin

gnicolamola
Beiträge: 8
Registriert: 21 Mär 2018, 18:20

Re: Monitor Robo TXT via WIFI

Beitrag von gnicolamola » 22 Mär 2018, 23:21

Hey Kevin,
What did you end up doing for your plan b? I'm also looking for a way to monitor the TXT.

Cheers,
Giovanni

Antworten