learn2learn Geschrieben July 5, 2022 at 11:57 Geschrieben July 5, 2022 at 11:57 Hello everyone, I have a Raspberry Pi Model 4B on a Turtlebot3 Burger and I want to add a HAT brick on it. The idea is to have a modular robot on which I can easily change the sensors and so I chose to add a HAT brick with its 8 connectors. I bought the HAT Brick and installed it on my raspberry but I got some troubles with the sofware part. The problem is that I have a Ubuntu server 20.04 OS (with ROS) on my raspberry so I can't use the Brick Viewer because there is no display available. So I'm looking for an other way (without display, only terminal) to get this information. With this, I should be able to get sensors data with Python (If you have a Python example on how to get the sensor data I will also take it) Ps: brickd and brickv are installed Thank you for your help! Zitieren
Komet Geschrieben July 5, 2022 at 13:25 Geschrieben July 5, 2022 at 13:25 (bearbeitet) Hello, Which sensors do you want to use, there is really well made example code in the doc for python ? No idea how you can get the UID without brick viewer bearbeitet July 5, 2022 at 13:27 von Komet Zitieren
rtrbt Geschrieben July 5, 2022 at 13:27 Geschrieben July 5, 2022 at 13:27 You can enumerate all connected bricks and bricklets without knowing their UIDs: https://www.tinkerforge.com/de/doc/Software/IPConnection_Python.html#enumerate 2 Zitieren
learn2learn Geschrieben July 5, 2022 at 13:30 Autor Geschrieben July 5, 2022 at 13:30 (bearbeitet) @Komet I will add 2 Distance IR sensor (10-80cm and 4-30cm) and a display to start @rtrbt Thanks for your answer, I will try that! bearbeitet July 5, 2022 at 14:35 von learn2learn Zitieren
Backdraft007 Geschrieben July 5, 2022 at 14:42 Geschrieben July 5, 2022 at 14:42 You can use BrickViewer on your local PC and connect to Raspberry/HAT when it is in the same network. In BrickViewer type the ip address of the raspberry and then Connect. 1 Zitieren
learn2learn Geschrieben July 5, 2022 at 14:51 Autor Geschrieben July 5, 2022 at 14:51 @Backdraft007 Thank you for your answer! I tried that but when I launch brick viewer on my computer I got the following error message: The following error is fatal. Exiting now. Traceback (most recent call last): File "/usr/share/brickv/main.py", line 377, in main from brickv.mainwindow import MainWindow File "/usr/share/brickv/mainwindow.py", line 42, in <module> from brickv.plugin_system.plugin_manager import PluginManager File "/usr/share/brickv/plugin_system/plugin_manager.py", line 29, in <module> from brickv.plugin_system.plugins import device_classes File "/usr/share/brickv/plugin_system/plugins/__init__.py", line 109, in <module> from brickv.plugin_system.plugins.red import device_class as red File "/usr/share/brickv/plugin_system/plugins/red/__init__.py", line 24, in <module> from brickv.plugin_system.plugins.red.red import RED File "/usr/share/brickv/plugin_system/plugins/red/red.py", line 36, in <module> from brickv.plugin_system.plugins.red.ui_red import Ui_RED File "/usr/share/brickv/plugin_system/plugins/red/ui_red.py", line 74, in <module> from brickv.plugin_system.plugins.red.red_tab_console import REDTabConsole File "/usr/share/brickv/plugin_system/plugins/red/red_tab_console.py", line 33, in <module> from brickv.samba import get_serial_ports File "/usr/share/brickv/samba.py", line 30, in <module> import serial.tools.list_ports ModuleNotFoundError: No module named 'serial.tools' However I checked and the serial and pyserial librairies are installed on my python3 PS: the method gave by @rtrbt works perfectly I can know receive data from my sensors 😄 Zitieren
Backdraft007 Geschrieben July 6, 2022 at 06:34 Geschrieben July 6, 2022 at 06:34 Can you uninstall all serial modules. Only install pyserial and try it again. Zitieren
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.