Raspberry PI - Service and tunnel status notifications

Discussion in '3CX Phone System - General' started by 4site, Mar 2, 2017.

Thread Status:
Not open for further replies.
  1. 4site

    Joined:
    Sep 18, 2014
    Messages:
    4
    Likes Received:
    3
    Hello,

    Has anyone tried to use the GPIO pins on a Raspberry Pi to identify whether the 3CX service is a.) Running b.) tunnel connected OK. By way of LED

    It would be great to be able to use something like https://shop.pimoroni.com/products/blinkt as a cheap and simple way of having customers able to confirm the status of the device!

    Of course showing up in the 3CX Dashboard/bridge status would be really helpful too!

    Any one?
     
  2. craigreilly

    craigreilly Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    2,970
    Likes Received:
    182
    Great idea... Guessing it is possible with some scripting/jobs running on the Pi.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. 4site

    Joined:
    Sep 18, 2014
    Messages:
    4
    Likes Received:
    3
    I'm getting somewhere.

    I have manged to write a Python script to check for the status of the 3CXSBC service and look for an 'Established' TCP/UDP connection on port 5090 and return an on screen 'Print' with colour coding.

    See screenshot!
    [​IMG]


    Now just waiting for my Blinkt to try and add LED output instead of onscreen. I'll keep you posted
     
  4. 4site

    Joined:
    Sep 18, 2014
    Messages:
    4
    Likes Received:
    3
    Huzzah!

    Blinkt arrived today and with a little modification I have managed to get my script to do as desired.

    The 1st 4 LEDs are for the Service Status
    2nd 4 are for Tunnel Status

    LED's are a little bright but on the lowest setting they are acceptable. I guess I could have just used 2 LEDs rather than a bank of 4.


    Service running but with Ethernet unplugged the Tunnel is obviously not

    [​IMG]
    With Ethernet connected the 2nd bank go green when the tunnel is up.
    [​IMG]

    Also tested Tunnel status by entering incorrect tunnel address and restarting SBC service.

    Script set to execute on startup.

    ~20 seconds for Pi to boot and script to run (all RED)
    +~10 Seconds for Service to start, (half green)
    +~1(or less) second for tunnel to connect (all Green)

    I haven't had time yet to fully test but so far I am quite pleased!
     
    MRM, YiannisH_3CX and agp like this.
Thread Status:
Not open for further replies.