Robo Pro & I^2C & MQTT

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
ullich
Beiträge: 3
Registriert: 28 Okt 2020, 21:23

Robo Pro & I^2C & MQTT

Beitrag von ullich » 28 Okt 2020, 23:24

Hallo liebe Forengemeinde,

ich bin neu in der Fischertechnik Welt und kompletter Frischling im C/C++ Programmieren. Ich habe die Lernfabrik 4.0 9V zur Verfügung gestellt bekommen und möchte damit ein wenig Experimentieren. Der Einfachheit halber versuche ich derzeit die einzelnen Programme in Robo Pro zu "übersetzen". Allerdings merke ich auch hier schnell, dass ich an die Grenze meiner Kompetenzen gelange.
Ich habe im Moment folgende für mich große Probleme:

1. Wie kann ich Daten zwischen zwei TXT's Senden und Empfangen lassen? (Stichwort Shared Library/MQTT)

2. Wie bekomme ich die Daten des RFID Lesers PN532 V3 der per I^2C am EXT Anschluss verbunden ist in Robo Pro ausgelesen? (dafür gibt es leider keinen Treiber in der Robo Pro Bibliothek)

Ich freue mich auf eure Antworten und entschuldige mich für meine eventuelle Unfähigkeit falls es bereits einen ähnlichen Thread gibt.

Uli

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

Re: Robo Pro & I^2C & MQTT

Beitrag von vleeuwen » 29 Okt 2020, 09:04

I write this only in English because the documentation of the socket's, CIvetWeb and Mosquitto MQTT is also in English.
The same for most of the C/C++ examples and documentation.
You can use Google translate if you like.

There exist several way to have communication between the TXT's over IP:
*) Berkely socket
*) Websocket
both has less overhead and are fast.
Embedded CivetWeb is offering a lot of functionalities for Websocket communication, integrated database (SQL) functionality and LUA support.
With a more abstract protocol like MQTT but this has more overhead.

All three can be used in RoboPro SLI extensions, but for that you will need to develop your own SLI extensions in C/C++

For I2C you need to develop your own interface software directly in RoboPro or as RoboPRo SLI extension in SLI.

For a complete set of C/C++ examples about the TXT trainings factory.
This includes the use of Mosquitto MQTT.

Programming for the TXT is really having fun.

ullich
Beiträge: 3
Registriert: 28 Okt 2020, 21:23

Re: Robo Pro & I^2C & MQTT

Beitrag von ullich » 29 Okt 2020, 20:58

Thank you for the quick response.
I will try to figure out what the things are that you have mentioned above.
As I already said: all these vocabularies are very new to me:)
The fun starts, I think, when things are working out. Until then its a bit frustrating ;)

ullich
Beiträge: 3
Registriert: 28 Okt 2020, 21:23

Re: Robo Pro & I^2C & MQTT

Beitrag von ullich » 29 Okt 2020, 21:15

Where can i find the adress the PN532 has in the learning factory to communicate over I2C. Documentation wasn't very helpful...

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

Re: Robo Pro & I^2C & MQTT

Beitrag von vleeuwen » 29 Okt 2020, 21:52

NXP data sheet contains all the information about the I2C communication that you will need.
https://www.nxp.com/docs/en/nxp/data-sh ... 532_C1.pdf
https://stackoverflow.com/questions/586 ... elica-tags
You need probably modify the Adafruit library a little bit:
https://github.com/adafruit/Adafruit-PN532

If you don't have a good basic experiences and skills with C/C++ programming in general and also for the TXT, then it could be advisable to start with the basics in:
https://github.com/fischertechnik/txt_demo_c_download
https://github.com/fischertechnik/txt_demo_ROBOPro_SLI
See also for reverse engineering
https://github.com/fischertechnik/txt_t ... Device.cpp

Is the learning factory the same as the trainingsfactory?
https://www.fischertechnik.de/en/servic ... rnfabrik-4

Antworten