Skip to content

Conversation

Kwiboo
Copy link
Contributor

@Kwiboo Kwiboo commented Sep 9, 2025

Description
LinkPi SmartHUB is a 12-port USB3.0 HUB utilizing four RTS5411 USB3.0 4-port HUB controllers, a FT232R USB UART IC and a STM32F103RB MCU for port power control. Maximum output power of each USB port is up to 15W.

Add a LinkPiSmartHUBPowerPort resource and a LinkPiSmartHUBPowerDriver with an accompanying linkpismarthub agent to support power on/off the ports of the LinkPi SmartHUB using a simple line-based protocol over a serial port.

Known commands:

  • onoff <port> <1|0> - switch port power on/off
  • state - get current power state of all ports
  • SetOWP <1|0> <1|0> ... - set the power-on state of all ports
  • GetOWP - get the power-on state of all ports

Responses are in JSON format, e.g.:

> onoff 5 1
< {"Cmd":"OnOffResp","SeqNum":1,"ret":0}
> state
< {"Cmd":"StateResp","SeqNum":2,"state":[0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0]}
> SetOWP 0 0 0 0 0 0 0 0 0 0 0 1
< {"Cmd":"SetOWPResp","SeqNum":3,"ret":0}
> GetOWP
< {"Cmd":"GetOWPResp","SeqNum":4,"owp":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]}

A version announcement is continuously sent every second:

< {"Cmd":"VerResp","ver":"SmartHUB_<ver>","uid":"<uid>"}

Please note that the port name printed on the hub does not match the internal port index used with the commands.

Links

Information on the LinkPi SmartHUB is hard to find, following links mention it:

Checklist

  • Documentation for the feature
  • Tests for the feature
  • The arguments and description in doc/configuration.rst have been updated
  • PR has been tested

Copy link

codecov bot commented Sep 9, 2025

Codecov Report

❌ Patch coverage is 86.86869% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.7%. Comparing base (e9e43aa) to head (d956ef3).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
labgrid/remote/exporter.py 0.0% 7 Missing ⚠️
labgrid/remote/client.py 0.0% 3 Missing ⚠️
labgrid/driver/powerdriver.py 97.4% 1 Missing ⚠️
labgrid/resource/suggest.py 0.0% 1 Missing ⚠️
labgrid/resource/udev.py 93.3% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1729     +/-   ##
========================================
+ Coverage    45.4%   45.7%   +0.3%     
========================================
  Files         172     173      +1     
  Lines       13500   13598     +98     
========================================
+ Hits         6130    6216     +86     
- Misses       7370    7382     +12     
Flag Coverage Δ
3.10 45.7% <86.8%> (+0.3%) ⬆️
3.11 45.7% <86.8%> (+0.3%) ⬆️
3.12 45.7% <86.8%> (+0.3%) ⬆️
3.13 45.6% <86.8%> (+0.3%) ⬆️
3.9 45.7% <86.8%> (+0.3%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Kwiboo Kwiboo force-pushed the linkpismarthub branch 2 times, most recently from 05910e8 to b741e89 Compare September 13, 2025 11:19
LinkPi SmartHUB is a 12-port USB3.0 HUB utilizing four RTS5411 USB3.0
4-port HUB controllers, a FT232R USB UART IC and a STM32F103RB MCU for
port power control.

Add a LinkPiSmartHUBPowerPort resource and a LinkPiSmartHUBPowerDriver
with an accompanying linkpismarthub agent to support power on/off the
ports of the LinkPi SmartHUB using a simple line-based protocol over a
serial port.

Signed-off-by: Jonas Karlman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant