SMlight SMHUB OpenWrt support

[smlight@SMHUB]~$ nmcli device status
DEVICE  TYPE      STATE                   CONNECTION
usb0    ethernet  connected               usb0
lo      loopback  connected (externally)  lo
wlan0   wifi      disconnected            --
eth0    ethernet  unavailable             --

accessing ssh over USB

1 Like

Did you check, whether only a network interface shows up via USB, or does it also present other interfaces via USB? Like a serial device, maybe an audio or v4l device?

I will try to get these values tomorrow

Directory structure

8.1 USB Passthrough
https://smlight.tech/support/manuals/link/36#bkmrk-purpose%3A-enables-smh

Purpose: Enables SMHUB to act either as a USB host (powering connected peripherals) or as a USB device (connected to a PC or another host).

Logic:

Automatically decides whether to supply or draw power.
Prevents reverse powering through integrated FET switching.

Use Cases:

Attach Z-Wave or extra Zigbee dongles, printers, audio devices, storage etc.

Connect SMHUB to a PC for development/debugging.

Power downstream devices safely.

```

No hardware RTC

sudo date
hwclock: can't open '/dev/misc/rtc': No such file or directory

Mine arrived today. It has holes for screws, but in mine there were none. (Only) held together by some (stubborn) plastic clips. Definitely not as effortless to pull apart as the video would make it seem. (Probably that devs unit has already been opened several times, and his clips were not that rigid anymore).

A firmware update came out yesterday. It now has a dual-boot scheme, it would seem. Sudo to root is (still) available with the normal password of the smlight user. Flashing requires Windows (for now) to do it easily. I’m hoping to get command lines from them (will write an email), that will enable to write images via ttyGS0, or SSH.

The platform seems similar to the MilkyV DuoS, which somebody has already built Debian images for. Wifi and BT are Realtek. other interfaces are ethernet wired, and USB0 (NCM), and (maybe) bnep. Will check that again tomorrow.

I’ll start adding info to this thread tomorrow, when I’m back at the PC. AMA.

1 Like

did you check Z-Wave antenna? mine is both SMA male antenna and SMA male connector.

Both Antennas, that were in the box, screwed on normally. I only took the POE addon. There are 2 unused antenna connectors on the board, WLAN & BT. I don’t have Zwave devices, but I have BT devices, so I’ll try to add a external Antenna for bluetooth.

The firmware is very … alpha. But that was expected. The delivered firmware had entries for SDBoot in the env, but the newer one doesn’t afaict.
I'll try to run/port both Debian and Openwrt on it. If I run Openwrt on it, I’ll probably just ser2net the radio(uart)s to my main HomeAssistant machine, and create some little mqtt scripts to make the other devices “known” to HA.

1 Like

for z-wave radio the command is

socat tcp-listen:6639,reuseaddr,fork file:/dev/ttyS3,nonblock,cs8,b115200,cstopb=0,raw,echo=0

with openWrt I think it will be similar for CC and EFR radios.

I’ve had some headers soldered onto the 2x9 extension port that includes “DBG TX/RX”, and to the 2x3 holes. I’m hoping to be able to interrupt the boot-loader, and will attempt to fiddle with the boot-up settings so as to boot the vendor 5.10 kernel with Debian RiscV userspace/root-fs. Then I’ll attempt to patch up 6.17 with the remaining outstanding 2-4 patches for the DuoS, and boot that with the Debian RootFS.
Then I’ll probably wait until somebody does an initial OpenWrt 6.18 patch for any platform when it gets released, and try to do the same for the RiscV platform if somebody does not beat me to it.

1 Like

Bootloader serial output Pre-Uboot:

�C.SCS/0/0.WD.URPL.USBI.USBW/1000.USBL.BS/EMMC.EMI/25000000/12000000.PS.PE.BS.BE.J.
FSBL Jb2829:g:2025-09-09T19:30:00+00:00
st_on_reason=d0000
st_off_reason=0
P2S/0x1000/0xc00a400.
P2E.
DPS/0xa400/0x2000.
DPE.
cv181x DDR init.
ddr_param[0]=0x78075562.
pkg_type=1
D2_4_1
DDR3-4G-BGA
Data rate=1866.
DDR BIST PASS
PLLS.
PLLE.
C2S/0x0/0x0/0x0.
No C906L image.
MS/0xc400/0x80000000/0x1c800.
ME.
L2/0x28c00.
L2/0x414d3342/0xcafefa91/0x80200000/0x42a00/0x42a00
COMP/1.
sys_switch_all_to_pll...
DCP/0x80200020/0x1000000/0x81900020/0x42a00/1.
DCP/0x8da46/0.
Loader_2nd loaded.
Switch RTC mode to xtal32k
Jump to monitor at 0x80000000.

OpenSBI:

OPENSBI: next_addr=0x80200020 arg1=0x80080000
OpenSBI v0.9
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|

Platform Name             : Milk-V DuoS
Platform Features         : mfdeleg
Platform HART Count       : 1
Platform IPI Device       : clint
Platform Timer Device     : clint
Platform Console Device   : uart8250
Platform HSM Device       : ---
Platform SysReset Device  : ---
Platform Suspend Device   : cvi-suspend
Firmware Base             : 0x80000000
Firmware Size             : 140 KB
Runtime SBI Version       : 0.3

Domain0 Name              : root
Domain0 Boot HART         : 0
Domain0 HARTs             : 0*
Domain0 Region00          : 0x0000000074000000-0x000000007400ffff (I)
Domain0 Region01          : 0x0000000080000000-0x000000008003ffff ()
Domain0 Region02          : 0x0000000000000000-0xffffffffffffffff (R,W,X)
Domain0 Next Address      : 0x0000000080200020
Domain0 Next Arg1         : 0x0000000080080000
Domain0 Next Mode         : S-mode
Domain0 SysReset          : yes
Domain0 SysSuspend        : yes

Boot HART ID              : 0
Boot HART Domain          : root
Boot HART ISA             : rv64imafdcvsux
Boot HART Features        : scounteren,mcounteren,time
Boot HART PMP Count       : 16
Boot HART PMP Granularity : 4096
Boot HART PMP Address Bits: 38
Boot HART MHPM Count      : 8
Boot HART MHPM Count      : 8
Boot HART MIDELEG         : 0x0000000000000222
Boot HART MEDELEG         : 0x000000000000b109

Uboot:

U-Boot 2021.10 (Sep 09 2025 - 19:30:00 +0000) duos

DRAM:  510 MiB
gd->relocaddr=0x9fbae000. offset=0x1f9ae000
set_rtc_register_for_power
MMC:   cv-emmc@4300000: 0, cv-sd@4310000: 1, wifi-sd@4320000: 2
Loading Environment from MMC... OK
In:    serial
Out:   serial
Err:   serial
Net:   eth_designware ethernet@4070000: Can't get reset: -524
eth0: ethernet@4070000
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0(part 0) is current device
3750651 bytes read in 170 ms (21 MiB/s)
## Executing script at 81800000
sha1+ Searching for boot slots...
Found valid slot A, 2 attempts remaining
Saving Environment to MMC... Writing to MMC(0)... OK
Booting Kernel...
## Loading kernel from FIT Image at 81800000 ...
   Using 'config-milkv_duos' configuration
   Trying 'kernel-1' kernel subimage
     Description:  cvitek kernel
     Type:         Kernel Image
     Compression:  lzma compressed
     Data Start:   0x818000d8
     Data Size:    3724661 Bytes = 3.6 MiB
     Architecture: RISC-V
     OS:           Linux
     Load Address: 0x80200000
     Entry Point:  0x80200000
     Hash algo:    crc32
     Hash value:   37174e8e
   Verifying Hash Integrity ... crc32+ OK
## Loading fdt from FIT Image at 81800000 ...
   Using 'config-milkv_duos' configuration
   Trying 'fdt-milkv_duos' fdt subimage
     Description:  cvitek device tree - duos
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x81b8d748
     Data Size:    21412 Bytes = 20.9 KiB
     Architecture: RISC-V
     Hash algo:    sha256
     Hash value:   181bf9c93dff69f0e9e845a1dc21f6e00e2c33f19615f5fb384ac24e76103843
   Verifying Hash Integrity ... sha256+ OK
   Booting using the fdt blob at 0x81b8d748
   Uncompressing Kernel Image
   Decompressing 9037824 bytes used 1382ms
   Loading Device Tree to 000000009f21d000, end 000000009f2253a3 ... OK

Starting kernel ...

This line looks promising: Using 'config-milkv_duos' configuration, which would seem to indicate, that the HW is very similar to the DuoS from MilkV.

The device then boots up to a login prompt, where you can login with the same credentials as for SSH/Web.

1 Like

Uboot commands:

Hit any key to stop autoboot:  0
uhah# help
?         - alias for 'help'
base      - print or set address offset
bdinfo    - print Board Info structure
blkcache  - block cache diagnostics and control
boot      - boot default, i.e., run 'bootcmd'
bootd     - boot default, i.e., run 'bootcmd'
bootefi   - Boots an EFI payload from memory
bootelf   - Boot from an ELF image in memory
booti     - boot Linux kernel 'Image' format from memory
bootm     - boot application image from memory
bootp     - boot image via network using BOOTP/TFTP protocol
bootvx    - Boot vxWorks from an ELF image
cmp       - memory compare
cp        - memory copy
cpu       - display information about CPUs
cvi_update- cvi_update [eth, sd, usb]- check boot status and update if necessary

cvi_utask - bootloader control block command
dcache    - enable or disable data cache
dhcp      - boot image via network using DHCP/TFTP protocol
dm        - Driver model low level access
echo      - echo args to console
eeprom    - EEPROM sub-system
efuser    - Read efuse
efuser_dump- Read/Dump efuse
efusew    - Write efuse
efusew_word- Write word to efuse
env       - environment handling commands
erase     - erase FLASH memory
exit      - exit script
ext2load  - load binary file from a Ext2 filesystem
ext2ls    - list files in a directory (default /)
ext4load  - load binary file from a Ext4 filesystem
ext4ls    - list files in a directory (default /)
ext4size  - determine a file's size
false     - do nothing, unsuccessfully
fastboot  - run as a fastboot usb or udp device
fatinfo   - print information about filesystem
fatload   - load binary file from a dos filesystem
fatls     - list files in a directory (default /)
fatmkdir  - create a directory
fatrm     - delete a file
fatsize   - determine a file's size
fatwrite  - write file into a dos filesystem
fdt       - flattened device tree utility commands
flinfo    - print FLASH memory information
fstype    - Look up a filesystem type
fstypes   - List supported filesystem types
go        - start application at address 'addr'
gpio      - query and control gpio pins
gpt       - GUID Partition Table
help      - print command description/usage
i2c       - I2C sub-system
icache    - enable or disable instruction cache
iminfo    - print header information for application image
ln        - Create a symbolic link
load      - load binary file from a filesystem
loadb     - load binary file over serial line (kermit mode)
loadx     - load binary file over serial line (xmodem mode)
loady     - load binary file over serial line (ymodem mode)
loop      - infinite loop on address range
ls        - list files in a directory (default /)
md        - memory display
mdio      - MDIO utility commands
mii       - MII utility commands
mm        - memory modify (auto-incrementing address)
mmc       - MMC sub system
mmcinfo   - display MMC info
mw        - memory write (fill)
net       - NET sub-system
nfs       - boot image via network using NFS protocol
nm        - memory modify (constant address)
panic     - Panic with optional message
part      - disk partition related commands
ping      - send ICMP ECHO_REQUEST to network host
printenv  - print environment variables
protect   - enable or disable FLASH write protection
pxe       - commands to get and boot from pxe files
random    - fill memory with random pattern
reset     - Perform RESET of the CPU
run       - run commands in an environment variable
save      - save file to a filesystem
saveenv   - save environment variables to persistent storage
sbi       - display SBI information
setenv    - set environment variables
setexpr   - set environment variable as the result of eval expression
showvar   - print local hushshell variables
size      - determine a file's size
sleep     - delay execution for some time
source    - run script from memory
sysboot   - command to get and boot from syslinux files
test      - minimal test like /bin/sh
tftpboot  - boot image via network using TFTP protocol
true      - do nothing, successfully
version   - print monitor, compiler and linker version

Uboot ENV:

uhah# printenv     
BOOT_A_LEFT=3
BOOT_B_LEFT=3
BOOT_ORDER=A
active_boot_slot=0x1
arch=riscv
baudrate=115200
board=cv181x
board_name=cv181x
bootargs=console=ttyS0,115200 rootwait rw  root=PARTUUID=f5a6b7c8-d9e0-4f1a-2b3c-4d5e6f7a8b9c rauc.slot=A
bootcmd=cvi_update || run emmcboot
bootdelay=1
consoledev=ttyS0
cpu=generic
default_bootargs=console=ttyS0,115200 rootwait rw 
emmcboot=mmc dev 0 ;fatload mmc 0:${active_boot_slot} ${uImage_addr} boot.sd || setexpr 3-${active_boot_slot} && fatload mmc 0:${active_boot_slot} ${uImage_addr} boot.sd;source ${uImage_addr}:bootscript
ethaddr=5a:c6:a5:XX:XX:XX
fdt_name=milkv_duos
fdtcontroladdr=9f227830
fileaddr=81800000
filesize=393afb
gatewayip=192.168.0.11
ipaddr=192.168.0.3
kernel0_uuid=b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e
kernel1_uuid=c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f
netdev=eth0
netmask=255.255.255.0
rootfs0_uuid=f5a6b7c8-d9e0-4f1a-2b3c-4d5e6f7a8b9c
rootfs1_uuid=a6b7c8d9-e0f1-4a2b-3c4d-5e6f7a8b9c0d
serverip=192.168.56.101
stderr=serial
stdin=serial
stdout=serial
uImage_addr=0x81800000
update_addr=0x9fe00000
vendor=cvitek

Environment size: 1062/262140 bytes

Some device info:

uhah# i2c bus
Bus 1:  i2c@04010000
   50: eeprom@50, offset len 1, flags 0
Bus 4:  i2c@04040000
uhah# mmcinfo 
Device: cv-emmc@4300000
Manufacturer ID: 13
OEM: 14e
Name: Q2J55 
Bus Speed: 52000000
Mode: MMC High Speed (52MHz)
Rd Block Len: 512
MMC version 5.0
High Capacity: Yes
Capacity: 7.1 GiB
Bus Width: 4-bit
Erase Group Size: 512 KiB
HC WP Group Size: 8 MiB
User Capacity: 7.1 GiB WRREL
Boot Capacity: 2 MiB ENH
RPMB Capacity: 4 MiB ENH
Boot area 0 is not write protected
Boot area 1 is not write protected
uhah# sbi
SBI 0.3
OpenSBI
Extensions:
  sbi_set_timer
  sbi_console_putchar
  sbi_console_getchar
  sbi_clear_ipi
  sbi_send_ipi
  sbi_remote_fence_i
  sbi_remote_sfence_vma
  sbi_remote_sfence_vma_asid
  sbi_shutdown
  SBI Base Functionality
  Timer Extension
  IPI Extension
  RFENCE Extension
  Hart State Management Extension

Editt: Hrmpf, after updating it from 0.2.1c to 0.2.2, it is soft-bricked. Uboot ENV is nearly empty and bootcmd wants to get a file from TFTP.

@KOA Did yours update to 0.2.2 successfully?

1 Like

I am upgrading to 0.2.3 for past hour... From 0.2.2
@stragies usb flash it to fix it.

I have a USB flashable image for 0.2.1c, but not 0.2.2. Or do you know, if I can go from 0.2.1c to 0.2.3 directly?

I think you can go from 0.2.1c to 0.2.3 directly

I have now tried that a few times, it connects and reconnects a few time, writes some small pieces until “offset 166912”, but then stops with an error about device not found.

I’ll hook up the UART again, and check, if the behavior has changed.
Once your update to 0.2.3 has finished, can you check, whether the kernel is still 5.10? And could you check, if the uboot printenv with the newer version is different from 0.2.1c which I posted above?

smlight@SMHUB:~$ cat /proc/version
Linux version 5.10.4 (buildroot@buildroot) (riscv64-buildroot-linux-gnu-gcc.br_real (Buildroot -gc88f77ba76) 13.4.0, GNU ld (GNU Binutils) 2.42) #1 PREEMPT Tue Sep 9 19:30:00 UTC 2025
smlight@SMHUB:~$
 printenv
SHELL=/bin/bash
HOSTNAME=SMHUB
EDITOR=/bin/vi
PWD=/home/smlight
LOGNAME=smlight
HOME=/home/smlight
SSH_CONNECTION=192.168.18.xxx 61063 192.168.18.xxx 22
TERM=xterm-256color
USER=smlight
SHLVL=1
PS1=\[\e[01;32m\]\u@\h\[\e[00m\]:\[\e[01;34m\]\w\[\e[00m\]\$ 
SSH_CLIENT=192.168.18.xx61063 22
PATH=~/.local/bin:/opt/bin:/usr/bin:/usr/sbin
C_INCLUDE_PATH=/opt/include:
MAIL=/var/mail/smlight
SSH_TTY=/dev/pts/1
_=/usr/bin/printenv
1 Like

ah, from within UBoot it’s printenv, but from within SMHUB-OS, it is fw_printenv or something starting with fw

Password: 
BOOT_B_LEFT=3
BOOT_ORDER=A B
active_boot_slot=0x1
arch=riscv
baudrate=115200
board=cv181x
board_name=cv181x
bootargs=console=ttyS0,115200 rootwait rw  root=PARTUUID=xxxxxxxxx-xxxxxx-xxxxxx-2xxxxx-xxxxb9c rauc.slot=A
bootcmd=cvi_update || run emmcboot
bootdelay=1
consoledev=ttyS0
cpu=generic
default_bootargs=console=ttyS0,115200 rootwait rw 
emmcboot=mmc dev 0 ;fatload mmc 0:${active_boot_slot} ${uImage_addr} boot.sd || setexpr 3-${active_boot_slot} && fatload mmc 0:${active_boot_slot} ${uImage_addr} boot.sd;source ${uImage_addr}:bootscript
ethaddr=5a:xxxxxxxxxxxx
fdt_name=milkv_duos
fdtcontroladdr=xxxxxxx
fileaddr=8180xxxxxxxx
filesize=393afb
gatewayip=192.168.0.11
ipaddr=192.168.0.3
kernel0_uuid=xxxxxxxx-f5a6-4b7c-8d9e-xxxxx
kernel1_uuid=xxxxx-a6b7-4c8d-9e0f-xxxx
netdev=eth0
netmask=255.255.255.0
rootfs0_uuid=xxx-d9e0-4f1a-2b3c-xxxxx
rootfs1_uuid=xxxxxx-e0f1-4a2b-3c4d-xxxxxxxx
serverip=192.168.56.101
stderr=serial
stdin=serial
stdout=serial
uImage_addr=0x81800000
update_addr=0x9fe00000
vendor=cvitek
BOOT_A_LEFT=3
1 Like

OK, so nothing significantly changed in between 0.2.1c and 0.2.3 w.r.t U-Boot and kernel.

I restored my Uboot fdt* variables, and now the device boot again. But I now have a wierd mix of features, like it says Version 0.2.1c in the bottom left, but I have the webconsole from version 0.2.2 available. I’ll now attempt to update to 0.2.3, and (10 minutes later) that seems to have worked.

So, it looks like -in retrospect- that the update from 0.2.1c to 0.2.2 was partly successful (I got the webconsole), but somehow messed up somewhere along the way, and emptied my U-Boot env, so U-Boot fell back to defaults. After having restored enough of the variables in the Uboot env to their normal values, It now allowed me to fully boot up again.

this idea exist already