diff --git a/mirte_telemetrix/config/mirte_pcb06_config.yaml b/mirte_telemetrix/config/mirte_pcb06_config.yaml index fa59b1a..ac4a7f1 100644 --- a/mirte_telemetrix/config/mirte_pcb06_config.yaml +++ b/mirte_telemetrix/config/mirte_pcb06_config.yaml @@ -35,21 +35,23 @@ oled: name: left device: mirte connector: I2C2 + show_ip: true right: name: right device: mirte connector: I2C1 -# Servo on GP2 doens't work with the v0.6 pcb, next version this should be fixed -# left: -# name: left -# device: mirte -# connector: Servo1 - right: - name: right - device: mirte - connector: Servo2 -# These servo's have the same pins as the ObjectDetectors. So as -# soon as they are implemented, these should be commented out + show_ip: true +# servo: # These two servos don't work with the v0.6 pcb, next version this should be fixed +# left: +# name: left +# device: mirte +# connector: Servo3 +# servo: +# right: +# name: right +# device: mirte +# connector: Servo4 +servo: gripper: name: gripper device: mirte diff --git a/mirte_telemetrix/config/mirte_user_config.yaml b/mirte_telemetrix/config/mirte_user_config.yaml index a712470..8f6ec10 100644 --- a/mirte_telemetrix/config/mirte_user_config.yaml +++ b/mirte_telemetrix/config/mirte_user_config.yaml @@ -40,19 +40,23 @@ intensity: pins: analog: GP27 digital: GP17 -#oled: -# left: -# name: left -# device: mirte -# pins: -# sda: GP4 -# scl: GP5 -# right: -# name: right -# device: mirte -# pins: -# sda: GP10 -# scl: GP11 +oled: + left: + name: left + device: mirte + pins: + sda: GP4 + scl: GP5 + show_ip: true + + right: + name: right + device: mirte + pins: + sda: GP10 + scl: GP11 + show_ip: true + servo: # Servo on GP2 doens't work with the v0.6 pcb, next version this should be fixed # left: diff --git a/mirte_telemetrix/scripts/ROS_telemetrix_aio_api.py b/mirte_telemetrix/scripts/ROS_telemetrix_aio_api.py index 4187f84..41e468e 100755 --- a/mirte_telemetrix/scripts/ROS_telemetrix_aio_api.py +++ b/mirte_telemetrix/scripts/ROS_telemetrix_aio_api.py @@ -12,6 +12,7 @@ import io from inspect import signature from tmx_pico_aio import tmx_pico_aio from telemetrix_aio import telemetrix_aio +import socket nest_asyncio.apply() @@ -598,7 +599,7 @@ class Oled(_SSD1306): SetOLEDImage, self.set_oled_image_service, ) - + for ev in self.init_awaits: await ev for cmd in self.write_commands: @@ -609,6 +610,11 @@ class Oled(_SSD1306): print("write failed start", self.oled_obj["name"]) self.failed = True return + if("show_ip" in self.oled_obj and self.oled_obj["show_ip"]): + hostname=socket.gethostname() + stream = os.popen('hostname -I') + ips = " ".join(list(filter(lambda ip:"." in ip, stream.read().split()))) + self.set_oled_image_service(SetOLEDImageRequest("text", f"{hostname}\n{ips}")) async def set_oled_image_service_async(self, req): if req.type == "text":