Thoughts on security, privacy, and building software.
import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(('192.168.88.1', 8728))
def scheduler_loop(): api = librouteros.connect(...) while True: now = datetime.datetime.now().time() if datetime.time(9,0) <= now <= datetime.time(9,5): set_bandwidth(api, 100, 20) # 100M/20M daytime elif datetime.time(18,0) <= now <= datetime.time(18,5): set_bandwidth(api, 10, 2) # 10M/2M night time.sleep(60) mikrotik api examples
pip install librouteros
: Run /ip/service set api disabled=no in the terminal. Default Ports : Standard API : Port 8728 (unencrypted) or 8729 (SSL/TLS). REST API : Typically uses standard HTTPS port 443 . import socket s = socket