OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • Development and Code Review (Moderator: fabian) »
  • APU LEDs Plugin
« previous next »
  • Print
Pages: [1] 2 3

Author Topic: APU LEDs Plugin  (Read 24003 times)

juliocbc

  • Sr. Member
  • ****
  • Posts: 336
  • Karma: 12
    • View Profile
    • Cloudfence
APU LEDs Plugin
« on: November 08, 2018, 03:16:10 am »
Hello!

I made a simple plugin to get APUs boxes more shiny!

https://github.com/cloudfence/dev-packages (plugin package)

https://github.com/cloudfence/apuled (plugin source code)

I've compiled the LED's module from this source code: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=189772

I know that isn't a good idea to put a binary (compiled) in a plugin package, but I don't know exactly how put this module with the plugin yet... maybe build a custom port and put it as plugin dependence... Anyway ideas are very welcome!

This initial version is not very useful yet... but it's a begining!
Logged
Cloudfence Open Source Team

evbevz

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Re: APU LEDs Plugin
« Reply #1 on: November 08, 2018, 07:43:49 am »
https://github.com/opnsense/core/issues/2114
https://github.com/opnsense/plugins/pull/920
Logged

juliocbc

  • Sr. Member
  • ****
  • Posts: 336
  • Karma: 12
    • View Profile
    • Cloudfence
Re: APU LEDs Plugin
« Reply #2 on: November 08, 2018, 10:49:46 am »
Good to know!

Is there any plans to make a WebUI page?

Logged
Cloudfence Open Source Team

Ricardo

  • Full Member
  • ***
  • Posts: 233
  • Karma: 12
    • View Profile
Re: APU LEDs Plugin
« Reply #3 on: February 04, 2019, 11:48:45 am »
I am also very interested, eagerly waiting for this feature to be shipped since 18.1.

Is there any description what is possible / what has been implemented as part of "APU LED" ?

LED sequence During startup phase / LED sequence normal working phase / LED sequence during shutdown phase? 
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 17703
  • Karma: 1616
    • View Profile
Re: APU LEDs Plugin
« Reply #4 on: February 04, 2019, 11:51:43 am »
The driver is there now by default and can be used, but the plugin path needs to be evaluated still... it's a bit heavy for my taste with a C++ daemon required.


Cheers,
Franco
Logged

Ricardo

  • Full Member
  • ***
  • Posts: 233
  • Karma: 12
    • View Profile
Re: APU LEDs Plugin
« Reply #5 on: February 04, 2019, 12:40:11 pm »
Quote from: franco on February 04, 2019, 11:51:43 am
The driver is there now by default and can be used, but the plugin path needs to be evaluated still... it's a bit heavy for my taste with a C++ daemon required.


Cheers,
Franco

At least can it be tested via CLI, how?
Logged

juliocbc

  • Sr. Member
  • ****
  • Posts: 336
  • Karma: 12
    • View Profile
    • Cloudfence
Re: APU LEDs Plugin
« Reply #6 on: February 04, 2019, 05:14:53 pm »
After the module loaded, you can run the echo command direct to the device:

https://www.freebsd.org/cgi/man.cgi?query=led&sektion=4

power on the first LED:

Code: [Select]
echo 1 > /dev/led/led1

power off :

Code: [Select]
echo 0 > /dev/led/led1
Logged
Cloudfence Open Source Team

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 17703
  • Karma: 1616
    • View Profile
Re: APU LEDs Plugin
« Reply #7 on: February 05, 2019, 09:43:36 am »
The module is loaded via:

# kldload apuled

But I haven't used it yet so I cannot say.

Here's the daemon that was written by Smart Soft with a bit of documentation...

https://github.com/alexpro/apuledctld/tree/master/apuledctld
Logged

juliocbc

  • Sr. Member
  • ****
  • Posts: 336
  • Karma: 12
    • View Profile
    • Cloudfence
Re: APU LEDs Plugin
« Reply #8 on: February 05, 2019, 02:11:00 pm »
@Franco

I tested today the APU's led module on OPNsense 19.1 and works fine!

Just to avoid to have a duplicate effort... the plan is to use the plugin from Smart Soft as the official plugin?

We're planning to make an updated version from our plugin to control the LEDs using just shell (not a binary version).

What you think about it?

Logged
Cloudfence Open Source Team

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 17703
  • Karma: 1616
    • View Profile
Re: APU LEDs Plugin
« Reply #9 on: February 05, 2019, 03:34:36 pm »
I would prefer a script to keep it simple, yes.


Cheers,
Franco
Logged

Ricardo

  • Full Member
  • ***
  • Posts: 233
  • Karma: 12
    • View Profile
Re: APU LEDs Plugin
« Reply #10 on: February 07, 2019, 07:53:04 pm »
Quote from: franco on February 05, 2019, 03:34:36 pm
I would prefer a script to keep it simple, yes.


Cheers,
Franco

Some hints:
-  WAN UP/DOWN trigger LED-changes
- system load over x / load below y trigger LED-changes
- WAN interface traffic in the past minute above X bps / below Y bps trigger LED-changes (or define 10 ranges: 1) at max. 10% bandwidth utilization 1 blink/sec, 2) at max  20% bw util 2 blinks/sec, etc. and finally over 90% bw util, 9 blinks/sec)
- free disk space is low trigger LED-changes

My idea is to have the scripts selected from the above list, 1 script
assigned to each LED device, max of 3 scripts active at any time.
Logged

fabian

  • Moderator
  • Hero Member
  • *****
  • Posts: 2769
  • Karma: 200
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: APU LEDs Plugin
« Reply #11 on: February 07, 2019, 09:55:08 pm »
@franco: this is a C daemon as it does not look like it is using any C++ features but needs to be compiled anyway.

The C code needs some improvements in my opinion anyway (for example bad variable naming practice).
Logged

juliocbc

  • Sr. Member
  • ****
  • Posts: 336
  • Karma: 12
    • View Profile
    • Cloudfence
Re: APU LEDs Plugin
« Reply #12 on: March 18, 2019, 07:14:35 pm »
@franco

I finished the initial release.

https://github.com/cloudfence/dev-packages/blob/master/os-apuled-1.0.txz


Details and Readme:
https://github.com/cloudfence/apuled
Logged
Cloudfence Open Source Team

rcmcronny

  • Newbie
  • *
  • Posts: 28
  • Karma: 0
    • View Profile
Re: APU LEDs Plugin
« Reply #13 on: March 18, 2019, 09:08:39 pm »
sorry for my clueless, but how to try it on a normal OPNsense 19.1 ?

Ronny
Logged

juliocbc

  • Sr. Member
  • ****
  • Posts: 336
  • Karma: 12
    • View Profile
    • Cloudfence
Re: APU LEDs Plugin
« Reply #14 on: March 19, 2019, 07:26:36 pm »
Hi Ronny, my bad!

The download and installation process, please see this video: https://youtu.be/OR6hg-WOTB0


Logged
Cloudfence Open Source Team

  • Print
Pages: [1] 2 3
« previous next »
  • OPNsense Forum »
  • English Forums »
  • Development and Code Review (Moderator: fabian) »
  • APU LEDs Plugin
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2