Cool stuff for Raspberry Pi, Arduino and all electronics hobby projects
Notifications
Clear all

[Solved / Archived] MEGA4: Preferred way to control ports (web service, CLI?)

2 Posts
2 Users
0 Likes
382 Views
 noox
(@uugear-com_s)
Posts: 1
New Member Customer
Topic starter
 

What is the preferred way to automatically control the ports via software? For my smart home I have a script which restart or powers down services or devices if there is an issue for some time. So I'd also like to switch off the MEGA4 ports and on again after some time.

It seems like the Mega4 web interface works with sockets. So I assume I cannot just power down a port with a simple web request?

Should we just use uhubctl directly?

A web interface would be a nice feature in my case as the restart script runs on another PI.

 
Posted : 22/02/2024 6:42 pm
(@admin)
Posts: 486
Member Admin
 

The web interface for MEGA4 (UWI) is a wrapper of MEGA4's software (written in BASH), and MEGA4's software is a wrapper of uhubctl. So you will eventually call uhubctl.

MEGA4's software is open-sourced, so is UWI.

UWI runs a simple web server, but it doesn't accept your custom web request. You can change that but you will need to work on the source code and make modifications.

 
Posted : 23/02/2024 9:06 am
Join Waitlist We will inform you when the product arrives in stock. Please leave your valid email address below.