markbirss / mtpoe_ctrl Goto Github PK
View Code? Open in Web Editor NEWThis project forked from adron-s/mtpoe_ctrl
Mikrotiks ATtiny based PoE managment/monitoring utility
This project forked from adron-s/mtpoe_ctrl
Mikrotiks ATtiny based PoE managment/monitoring utility
Program for manage the Mikrotiks PoE V2 based on a microcontroller ATtiny 461a Licence is GNU GPL V3 Examples of using: mtpoe_ctrl -dumpvars #shows the values of parameter variables mtpoe_ctrl #shows full information about PoE controller state/work mtpoe_ctrl --action=get_fw_ver #shows firmware version of the Attiny PoE microcontroller mtpoe_ctrl --action=get_voltage #shows the input voltage mtpoe_ctrl --action=get_temperature #shows the temperature mtpoe_ctrl --action=get_poe #shows the status of PoE for the ports. 0->ether2, 1..2, 3->ether5 mtpoe_ctrl --action=set_poe --port=0 --val=1 #force-on PoE for port ether2 mtpoe_ctrl --action=set_poe --port=1 --val=2 #auto-on PoE for port ether3 mtpoe_ctrl --action=set_poe --port=2 --val=1 #force-on PoE for port ether4 mtpoe_ctrl --action=set_poe --port=3 --val=0 #turn off PoE for port ether5 mtpoe_ctrl --action=load_poe_from_uci #load PoE port settings from uci->network->mtik_poe In /etc/config/network the mtik_poe section should be present: config mtik_poe option port0 '1' option port1 '0' option port2 '1' option port3 '0' Control is performed by sending commands via SPI bus. The mediator between userspace and kernel is spidev driver and as a consequence in mach-rb-*.c init file of the platform it is necessary to write about the following: /* RB 750-r2(HB) with POE v2 */ #define RB750R2_ATTINY_CS 12 #define RB750R2_ATTINY_RESET 14 static int rb750r2spi_cs_gpios[3] = { -ENOENT, /* NOR flash. CS is automatically controlled by the spi controller itself. */ RB750R2SSR_CS, /* 74x164 gpio extender */ RB750R2_ATTINY_CS, /* ATtiny PoE v2 */ }; static struct ath79_spi_platform_data rb750r2spi_data __initdata = { .bus_num = 0, .num_chipselect = 3, /* We have three CS */ .cs_gpios = rb750r2spi_cs_gpios, /* which CS */ }; static struct spi_board_info rb750r2spi_info[] = { ... .max_speed_hz = 10000000, .modalias = "74x164", .platform_data = &rb750r2ssr_data, }, { .bus_num = 0, .chip_select = 2, .max_speed_hz = 2000000, .modalias = "spidev", } } static void __init rb750r2_setup(void) { ... ath79_register_spi(&rb750r2spi_data, rb750r2spi_info, ARRAY_SIZE(rb750r2spi_info)); ... } or if you use DTS: &spi { spidev@2 { #address-cells = <1>; #size-cells = <1>; compatible = "linux,spidev"; reg = <2>; spi-max-frequency = <2200000>; }; };
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.