Exploring 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!
Rei Vilo
Beiträge: 94
Registriert: 19 Dez 2015, 15:39

Exploring TXT 4.0

Beitrag von Rei Vilo » 31 Dez 2021, 17:51

Answering the call from Bjoern, here are what I have discovered so far.

Built-in MQTT broker and Node-RED server
with 192.168.7.2 being adapted to the specific address.
TXT-40-1.jpeg
TXT-40-1.jpeg (15.55 KiB) 7556 mal betrachtet
TXT-40-2.jpeg
TXT-40-2.jpeg (53.22 KiB) 7556 mal betrachtet
TXT-40-3.jpeg
TXT-40-3.jpeg (51.46 KiB) 7556 mal betrachtet
TXT-40-4.jpeg
TXT-40-4.jpeg (70.76 KiB) 7556 mal betrachtet

References
Remote development with Visual Studio Code

The excellent Visual Studio Code offers Python remote development against the TXT 4.0.
  • ssh ft@192.168.7.2
with 192.168.7.2 being adapted to the specific address.

Connection is done with the ft:ft profile, while the owner for the projects and files generated by Robo Pro Coding is ftgui:ftgui. As a consequence, the projects and files generated by Robo Pro Coding can't be modified.

However, new projects can be created, debugged and run.
Remote debugging
Remote debugging
Capture.png (199.52 KiB) 7722 mal betrachtet

References
Zuletzt geändert von Rei Vilo am 01 Jan 2022, 14:08, insgesamt 3-mal geändert.

ModeratorRalf
Moderator
Beiträge: 162
Registriert: 13 Sep 2019, 21:00

Re: Exploring TXT 4.0

Beitrag von ModeratorRalf » 01 Jan 2022, 11:27

Auf Wunsch habe ich das Thema hierher verschoben.
----------
By request, I have moved the topic to here.

Kind regards, Moderator Ralf
Nordconvention am 20. April 2024 im Schulzentrum Mellendorf in 30900 Wedemark

ModeratorRalf
Moderator
Beiträge: 162
Registriert: 13 Sep 2019, 21:00

Re: Exploring TXT 4.0

Beitrag von ModeratorRalf » 01 Jan 2022, 11:38

Dear Rei Vilo,
is it possible that you make four normal pictures from the gif?
Then it is easier to view them and not as exhausting as with a gif which you cannot stop.

Kind regards, Moderator Ralf
Nordconvention am 20. April 2024 im Schulzentrum Mellendorf in 30900 Wedemark

Rei Vilo
Beiträge: 94
Registriert: 19 Dez 2015, 15:39

Re: Exploring TXT 4.0

Beitrag von Rei Vilo » 01 Jan 2022, 14:08

@ModeratorRalf

Sure, I have update the initial post with separate pictures.

ModeratorRalf
Moderator
Beiträge: 162
Registriert: 13 Sep 2019, 21:00

Re: Exploring TXT 4.0

Beitrag von ModeratorRalf » 01 Jan 2022, 17:18

Rei Vilo, thanks a lot.
:)
Nordconvention am 20. April 2024 im Schulzentrum Mellendorf in 30900 Wedemark

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

Re: Exploring TXT 4.0

Beitrag von vleeuwen » 02 Jan 2022, 18:34

Thanks for the suggestion to use MS-Visual coding to develop Python programs on the TXT4.0.
I was already using it for the Raspberry Py.
I did not realised myself that after connecting VSC with it LINUX device, It is able to discover the local installed compilers.

The syntax highlighting and the library help is helpful.
The run support is fine.

The code can later cut and past into the RoboPro coding blocklies.
See also my example about the websocket server.
viewtopic.php?f=8&t=7195
software enigineer/teacher/advisor
Google translate
http://tescaweb.nl/Carel/?p=713

chehr
Beiträge: 193
Registriert: 07 Apr 2015, 21:07
Wohnort: Friedrichshafen

Re: Exploring TXT 4.0

Beitrag von chehr » 03 Jan 2022, 12:29

Thanks for the above info,

nice thinks like weather app with TXT4.0 is easily feasible, see
Wetter app
Wetter app
Wetter app.jpg (81.85 KiB) 7252 mal betrachtet
The Weather data can be stored in a file on the TXT.
TXT4.0 recognise the SD-Card. How can the data be stored?
It might be on "/opt/ft/workspaces/ext_sd/mmcblk1" however it doesn`t work...

Next step would be to join the data with RoboPro....

Benutzeravatar
Bjoern
Beiträge: 630
Registriert: 04 Jan 2018, 12:34

Re: Exploring TXT 4.0

Beitrag von Bjoern » 03 Jan 2022, 13:49

Hi,

just a hopefully simple question. What about extending RBC with new I²C devices?

ft gave us the nice answer the the community will convert the RoboPro extensions to RPC. But is there a documentation available how this could be done?

Björn
https://gundermann-software.de/shop/
Der Shop für viele Community Projekte

Rei Vilo
Beiträge: 94
Registriert: 19 Dez 2015, 15:39

Re: Exploring TXT 4.0

Beitrag von Rei Vilo » 03 Jan 2022, 16:03

About MQTT

The TXT 4.0 uses the Paho MQTT Python Client, which is well documented. I have used this example.

I am using this MQTT monitor: MQTT-X.

Sharing an example is not easy, as it would need to include multiple projects: the Robo Pro Coding package and the Node-RED flow.

About I²C

The TXT 4.0 uses the smbus or smbus2 library. Both libraries are rather crude compared to those provided by C/C++.

I am still exploring smbus2 as I have two concerns: one about global variables and another about bus protection by mutex.

Benutzeravatar
Bjoern
Beiträge: 630
Registriert: 04 Jan 2018, 12:34

Re: Exploring TXT 4.0

Beitrag von Bjoern » 03 Jan 2022, 16:33

Hi Rei Vilo,

the question was not what it´s used in lower level. The question is how to add an extension to RPC that you can use it in your program. In this case I have to add some code behind component. Or however it´s called what you put together to a program with RPC.
https://gundermann-software.de/shop/
Der Shop für viele Community Projekte

chehr
Beiträge: 193
Registriert: 07 Apr 2015, 21:07
Wohnort: Friedrichshafen

Re: Exploring TXT 4.0

Beitrag von chehr » 03 Jan 2022, 16:50

Bjoern hat geschrieben:
03 Jan 2022, 13:49
just a hopefully simple question. What about extending RBC with new I²C devices?
This should work with Python code and I2C drivers which needs to be adapted. Currently I found pre-installed drivers like BNO055, APDS9960, BME680. I am not sure if all is available (I am afraid not as I can't find ie.micropython which is needed for the BNO055). In prinicipial it should be possible to copy available Python drivers of any I2C devices and adapt these to the TXT4.0, best would be to have a standard for the TXT which should come from the TXT4.0 Code supplier like RTSoft via fischer.
Bjoern hat geschrieben:
03 Jan 2022, 13:49
ft gave us the nice answer the the community will convert the RoboPro extensions to RPC. But is there a documentation available how this could be done?
Not yet, the most info is in this Forum i.e. TXT Login "ft" PW "fischertechnik".

Rei Vilo
Beiträge: 94
Registriert: 19 Dez 2015, 15:39

Re: Exploring TXT 4.0

Beitrag von Rei Vilo » 03 Jan 2022, 17:20

This topic is about exploring the TXT 4.0, and the last post was sharing what I've found today on MQTT and I²C.

Could you please elaborate what you mean by "RoboPro extensions"?

The many drivers for I²C devices I had developed for RoboPro, including stepper motors, IMU, displays to name a few, all rely on low level I²C commands.

The sensors designed by fischertechnik (IMU, weather and light/colour/gesture) came with either a Shared Library Interface (SLI) developed in C/C++ or a driver developed with RoboPro.

In any case for Robo Pro Coding, there is no magic: we must start by the beginning, ie. understanding how low level I²C works and how to interface it within Blockly. So my last post included answers to the question on "extending RBC with new I²C devices".

The TXT 4.0 provides the unique opportunity to play and learn many technologies, including Python, I²C, MQTT, Node-RED and possibly AI. Now, it would be very nice to have a bit more documentation on Robo Pro Coding, for example about this intriging Imports option on the block menu.

Benutzeravatar
Bjoern
Beiträge: 630
Registriert: 04 Jan 2018, 12:34

Re: Exploring TXT 4.0

Beitrag von Bjoern » 03 Jan 2022, 17:49

Hi,
In any case for Robo Pro Coding, there is no magic: we must start by the beginning, ie. understanding how low level I²C works and how to interface it within Blockly.
That gives me the answer. Or is there a documentation which describes how to interface it with Blockly?

The point is to convert a RoboPro Driver to Robo Pro Coding and if there´s any documentation avail or not.

Björn
https://gundermann-software.de/shop/
Der Shop für viele Community Projekte

Rei Vilo
Beiträge: 94
Registriert: 19 Dez 2015, 15:39

Re: Exploring TXT 4.0

Beitrag von Rei Vilo » 03 Jan 2022, 18:59

@chehr

Please find a first implementation of a weather station writing to the micro-SD card.

On my controller, the path is

Code: Alles auswählen

/opt/ft/workspaces/ext_sd/mmcblk1p1/weather.txt
and the content is

Code: Alles auswählen

2022-01-03 18:44:38     25.53   43.921  996.93
2022-01-03 18:44:42     25.54   43.915  996.92
2022-01-03 18:44:45     25.54   43.923  996.92
2022-01-03 18:44:48     25.54   43.917  996.93
2022-01-03 18:44:52     25.55   43.929  996.92
2022-01-03 18:44:55     25.54   43.921  996.91
2022-01-03 18:44:59     25.54   43.923  996.91
But I can't attache the code except as a picture.
Test_File
Test_File
Test_File.png (463.94 KiB) 7100 mal betrachtet
Some comments:
  • Local variables start with a .
  • Saving each field separately allows to generate the and .
  • Values are saved with a dot as decimal separator. You might need to change it for a comma.
  • The delay between two consecutive acquisitions is 3 seconds. You can adjust it easily.

Rei Vilo
Beiträge: 94
Registriert: 19 Dez 2015, 15:39

Re: Exploring TXT 4.0

Beitrag von Rei Vilo » 04 Jan 2022, 10:46

A simpler version leveraging the lists.
Weather - Version 2.0
Weather - Version 2.0
Test_File_List.jpg (134.6 KiB) 6978 mal betrachtet

Benutzeravatar
KarlKarlson
Beiträge: 10
Registriert: 29 Nov 2021, 17:22

Re: Exploring TXT 4.0

Beitrag von KarlKarlson » 04 Jan 2022, 11:22

Hello Rei,

I really like your project.

Since it is not possible to upload a RPC-Project here and you want to share the project, you could use the fischertechnik gitlab. Just upload your project there and set its visibility to public. Afterwards the project can be imported in RPC through its import function. Just search for a combination of your username/projectname (e.g. KarlKarlson/SharingExample).

Import.PNG
Import.PNG (38.7 KiB) 6965 mal betrachtet


If you have trouble setting things up, feel free to ask.

Best Regards
KarlKarlson

Rei Vilo
Beiträge: 94
Registriert: 19 Dez 2015, 15:39

Re: Exploring TXT 4.0

Beitrag von Rei Vilo » 04 Jan 2022, 15:15

Thanks for the tip, the project is available now.
Capture 2022-01-04 à 13.28.35.png
Capture 2022-01-04 à 13.28.35.png (112.58 KiB) 6903 mal betrachtet

chehr
Beiträge: 193
Registriert: 07 Apr 2015, 21:07
Wohnort: Friedrichshafen

Re: Exploring TXT 4.0

Beitrag von chehr » 05 Jan 2022, 16:58

Ist nun Node-RED die beworbene REST Schnittstelle, oder wo ist sie?

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

Re: Exploring TXT 4.0

Beitrag von vleeuwen » 05 Jan 2022, 17:22

software enigineer/teacher/advisor
Google translate
http://tescaweb.nl/Carel/?p=713

Rei Vilo
Beiträge: 94
Registriert: 19 Dez 2015, 15:39

Re: Exploring TXT 4.0

Beitrag von Rei Vilo » 06 Jan 2022, 16:07

chehr hat geschrieben:
05 Jan 2022, 16:58
Ist nun Node-RED die beworbene REST Schnittstelle, oder wo ist sie?
Sorry, I don't speak German and don't trust the automatic translators.

Antworten