learn2learn Posted July 5, 2022 at 11:57 AM Share Posted July 5, 2022 at 11:57 AM 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! Quote Link to comment Share on other sites More sharing options...
Komet Posted July 5, 2022 at 01:25 PM Share Posted July 5, 2022 at 01:25 PM (edited) 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 Edited July 5, 2022 at 01:27 PM by Komet Quote Link to comment Share on other sites More sharing options...
rtrbt Posted July 5, 2022 at 01:27 PM Share Posted July 5, 2022 at 01:27 PM You can enumerate all connected bricks and bricklets without knowing their UIDs: https://www.tinkerforge.com/de/doc/Software/IPConnection_Python.html#enumerate 2 Quote Link to comment Share on other sites More sharing options...
learn2learn Posted July 5, 2022 at 01:30 PM Author Share Posted July 5, 2022 at 01:30 PM (edited) @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! Edited July 5, 2022 at 02:35 PM by learn2learn Quote Link to comment Share on other sites More sharing options...
Backdraft007 Posted July 5, 2022 at 02:42 PM Share Posted July 5, 2022 at 02:42 PM 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 Quote Link to comment Share on other sites More sharing options...
learn2learn Posted July 5, 2022 at 02:51 PM Author Share Posted July 5, 2022 at 02:51 PM @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 😄 Quote Link to comment Share on other sites More sharing options...
Backdraft007 Posted July 6, 2022 at 06:34 AM Share Posted July 6, 2022 at 06:34 AM Can you uninstall all serial modules. Only install pyserial and try it again. Quote Link to comment Share on other sites More sharing options...
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.