Seite 1 von 2
Exploring TXT 4.0
Verfasst: 31 Dez 2021, 17:51
von Rei Vilo
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 (15.55 KiB) 9859 mal betrachtet
- TXT-40-2.jpeg (53.22 KiB) 9859 mal betrachtet
- TXT-40-3.jpeg (51.46 KiB) 9859 mal betrachtet
- TXT-40-4.jpeg (70.76 KiB) 9859 mal betrachtet
References
Remote development with Visual Studio Code
The excellent Visual Studio Code offers Python remote development against the TXT 4.0.
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
- Capture.png (199.52 KiB) 10025 mal betrachtet
References
Re: Exploring TXT 4.0
Verfasst: 01 Jan 2022, 11:27
von ModeratorRalf
Auf Wunsch habe ich das Thema hierher verschoben.
----------
By request, I have moved the topic to here.
Kind regards, Moderator Ralf
Re: Exploring TXT 4.0
Verfasst: 01 Jan 2022, 11:38
von ModeratorRalf
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
Re: Exploring TXT 4.0
Verfasst: 01 Jan 2022, 14:08
von Rei Vilo
@ModeratorRalf
Sure, I have update the initial post with separate pictures.
Re: Exploring TXT 4.0
Verfasst: 01 Jan 2022, 17:18
von ModeratorRalf
Rei Vilo, thanks a lot.
Re: Exploring TXT 4.0
Verfasst: 02 Jan 2022, 18:34
von vleeuwen
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
Re: Exploring TXT 4.0
Verfasst: 03 Jan 2022, 12:29
von chehr
Thanks for the above info,
nice thinks like weather app with TXT4.0 is easily feasible, see
- Wetter app
- Wetter app.jpg (81.85 KiB) 9555 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....
Re: Exploring TXT 4.0
Verfasst: 03 Jan 2022, 13:49
von Bjoern
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
Re: Exploring TXT 4.0
Verfasst: 03 Jan 2022, 16:03
von Rei Vilo
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.
Re: Exploring TXT 4.0
Verfasst: 03 Jan 2022, 16:33
von Bjoern
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.
Re: Exploring TXT 4.0
Verfasst: 03 Jan 2022, 16:50
von chehr
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".
Re: Exploring TXT 4.0
Verfasst: 03 Jan 2022, 17:20
von Rei Vilo
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.
Re: Exploring TXT 4.0
Verfasst: 03 Jan 2022, 17:49
von Bjoern
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
Re: Exploring TXT 4.0
Verfasst: 03 Jan 2022, 18:59
von Rei Vilo
@chehr
Please find a first implementation of a weather station writing to the micro-SD card.
On my controller, the path is
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.png (463.94 KiB) 9403 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.
Re: Exploring TXT 4.0
Verfasst: 04 Jan 2022, 10:46
von Rei Vilo
A simpler version leveraging the lists.
- Weather - Version 2.0
- Test_File_List.jpg (134.6 KiB) 9281 mal betrachtet
Re: Exploring TXT 4.0
Verfasst: 04 Jan 2022, 11:22
von KarlKarlson
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 (38.7 KiB) 9268 mal betrachtet
If you have trouble setting things up, feel free to ask.
Best Regards
KarlKarlson
Re: Exploring TXT 4.0
Verfasst: 04 Jan 2022, 15:15
von Rei Vilo
Thanks for the tip, the project is available now.
- Capture 2022-01-04 à 13.28.35.png (112.58 KiB) 9206 mal betrachtet
Re: Exploring TXT 4.0
Verfasst: 05 Jan 2022, 16:58
von chehr
Ist nun Node-RED die beworbene REST Schnittstelle, oder wo ist sie?
Re: Exploring TXT 4.0
Verfasst: 05 Jan 2022, 17:22
von vleeuwen
Re: Exploring TXT 4.0
Verfasst: 06 Jan 2022, 16:07
von Rei Vilo
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.