Hacker News new | past | comments | ask | show | jobs | submit login
Daily Automated Testing for Milk-V Duo S RISC-V SBC (IKEA Tretakt, Apache NuttX) (codeberg.page)
36 points by lupyuen 6 months ago | hide | past | favorite | 11 comments



This kind of low level testing can be such a pain. Its fortunate this hardware has netboot. This is the "easy" path for low level testing, I've worked with other stuff where the only option is virtual SD card devices and ... damn its a pain... you end up with devices like this https://hackaday.com/2014/06/08/the-in-circuit-sd-card-switc... or when you're lucky and have more budget, devices like the SDWire ( https://badgerd.nl/sdwirec/ or https://shop.3mdeb.com/shop/open-source-hardware/sdwire/ which are both based on an older Tizen dev team design)


> But IKEA doesn’t provide a Public API for their gadgets!

But it's using ZigBee; you just need a USB/ZigBee bridge to run it locally.


For turning on daily, perhaps use a 220V programmable timer? You can program the times of day when to turn the switch on and off. Costs less than $10, no wifi, no zigbee, no messing with APIs.


+1! Even though we have a full-on smart home network, we still use these mechanical timers sometimes since they are totally foolproof.


As others said, it's quite wasteful and unnecessarily fragile to introduce Google Assistant (and the Internet itself) in the critical path, although this is just driving an automated test rather than a nuclear reactor, so, sure, ok.

But even the suggestion to bypass Google Assistant still look so unnecessarily complex, especially if you didn't already happen to have a Home Assistant and a Zigbee adapter at hand.

This Milk-V duo seems to have a reset button (sadly not exposed on the GPIO pins, but that's not the end of the world). Find how it works (drive a certain line high or low, just see if one side is permanently 0V or 3.3V), wire it to your USB-UART adapter's DTR or CTS one, and toggle it when you need a reboot.

Done.

It does require soldering 1 wire, and not every USB-UART adapter has a DTR or CTS line (but a majority do), but it's so beautifully simple compared to this.

(Speaking as someone who _does_ have a suitable homeassistant (with zigbee2mqtt and slae.sh's excellent CC2652 stick, deserves a plug on HN: https://slae.sh/projects/cc2652/ ))


I think it’s useful to see how this is possible using only consumer products and software!

An alternative solution that’s less roundabout could be to use a uhubctl (https://github.com/mvp/uhubctl) compatible USB hub and directly switch the power of the usb port.


A TP Link or Belkin smart plug could be controlled locally via REST, removing multiple cloud dependencies.


There's a Python library that has been quite reliable for me for local control.

  $ python3
  Python 3.12.4 (main, Jun  6 2024, 18:26:44) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import pywemo
  >>> d = pywemo.discover_devices()
  >>> d
  [<WeMo Switch "Guest">, <WeMo Switch "Fireplace">, <WeMo Switch "Bedroom Dresser">]
  >>> d[0].model
  'Belkin Plugin Socket 1.0'
  >>> d[0].toggle()
  >>>


I kinda do this at my work using lab power supplies. Most support some kind of remote control. I guess it's a trade-off on time and jank vs upfront cost for a decent lab supply.


If you use Home Assistant you just need a cheap zigbee adapter instead of the ikea thing. If not use something like zigbee2mqtt which provides you an api.


Philips Hue has local API access for this sort of thing. Works with non-Hue Zigbee accessories too.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: