Sign in   |  Join   |  Help

Python program to monitor ML and BL network traffic

rated by 0 users
This post has 0 Replies | 0 Followers

L Spad
Top 500 Contributor
Brighton
Posts 240
OFFLINE
Bronze Member
L Spad Posted: Thu, Nov 25 2021 7:35 PM

Dear all,

I'm in the process of forking the amazing HomeAssistant integration that Giachello produced for the Indigo Home Automation Software. He did a really incredible job and has been really kind with advice - to be really clear all the clever stuff is his work. In the process of doing so I've had to reprogram it because Indigo only recognises Python 2.7. As a stepping stone I produced a simple reporting tool before I embed it into the HA system and I thought others might be interested. I should have the Indigo plugin sorted in a month or so.

I've coded a very basic logging program that will provide a nicely formatted read out of any traffic on the basic MasterLink network, the MLGW protocol and the Bang and Olufsen Home Automation protocol (trust B&O to make it overly complex). It borrows information from each protocol to make the packet readout more informative where possible (e.g. if a currently playing radio station is in your favourites list the software will recognise that and report the name).

The software requires either an MLGW or BLGW to run. It probably works with a Believing intelligence, but I don't have one of those to test it with. It will require a basic knowledge of python to run: The main requirement to set it up is to edit the main.py file to include the correct host address and password for your gateway, as well as the ports assigned to the various protocols if you've changed them from the defaults.

I've uploaded the code to Github here: https://github.com/LukeSpad/BeoGateway

An example readout below for a masterlink telegram when I turn on my radio:

INFO:root:

-------------------------------------------------------------------------------------------------------------------------------------

ML command line interface: <--Data-received!-<< on 25/11/21 at 19:10:45

-------------------------------------------------------------------------------------------------------------------------------------

Header: [192, 193, 1, 20, 0, 0, 0, 130, 9]

Payload: [1, 4, 111, 2, 2, 0, 0, 1, 255, 255]

============================================================================

    from_device: AUDIO MASTER 

    from_source: NONE 

    to_device: VIDEO MASTER 

    to_source: NONE 

    type: RESPONSE 

    payload_type: TRACK_INFO_LONG 

    payload_len: 10 

    State_Update: 

        nowPlaying: BBC Radio 2 

        nowPlayingDetails: 

            type: AUDIO 

            channel_track: 2

 

        sourceName: RADIO 

        source: RADIO 

        sourceID: 111 

        state: Play

 

It's quite fun to see things like the 'conversations' that occur when a masterlink network powers up!

Page 1 of 1 (1 items) | RSS
Beoworld Security Certificate

SSL