Close
0%
0%

hctrl

Yet another Ikea stand-up table controller.

Similar projects worth following
Back pain from sitting long hours in the computer led to the purchase of a stand-up desk, which in turn led to yet another project grown out of proportions.

It is based on a stm32 blue pill and programmed with platformIO.

The project is based on the STM32 blue pill board, running Arduino via platformio in vscode. (https://github.com/rikardonm/hctrl)

The initial objective of the project was to make a simple application to control the table height, with a hacked perf-board on simple 3D printed case.

It has since mutated to an overkill monster intending to fulfill 3 distinct goals:

  • Desk height controller (the original), with extended environment information (e.g. CO2 levels, temperature, etc)
  • Base example for an homebrew microcontroller application framework
  • PCB design with extra peripherals for use as a framework development board

  • It lives! ... but not for long

    rikardonm03/11/2022 at 11:00 0 comments

    https://codeql.github.comBefore the "go nuts and change everything" the LCD was actually working, so I knew that the driver was (mostly) a‑ok. Reviewing the code a few times didn't raise any suspicions, so down the logic analyzer route we went.

    After hooking up to the LCD's signals, it was clear that the CE line was not being driven properly and that there was no actual text payload being sent to the device! If I'd only hooked the the thing up earlier.

    Now, the investigation on why there was no data being sent was done with the platformio plugin in vscode, easily allowing debugging of the program with a chinesium st-linkv2 clone. As it turns out, I had screwed up my array implementation (that everybody says one should not do), and it was not storing the pushed data.

    Solving both the CE and the array issue, the LCD was again alive! Obviously that the first sign of life from it must be the azevem icon.

    Nightly LCD debugging session

    With that win under my belt, incentive to touch up other things and change even more stuff took over. Unfortunately, that work wasn't completed, being itself interrupted by another task: publishing the (broken) software written up to this point.

    As with every love story, the plan was to review the entire code, get the repo in a stable buildable state, add license headers to source files, standardize on a code style, the whole 9 yards. 

    But the "nah, that can be done never later, let's just go with the simplest and get it done" was taken. To be honest, I now think it was actually the better route anyway. The code lives in https://github.com/rikardonm/hctrl.

    While setting up the repo, I remembered one thing I saw a few months back and wanted to try: CodeQL (https://codeql.github.com). My current simplified version of it is: a tool that analyses code based on a set of rules, ranking its quality or compliance. I don't know much about the inner workings or options that CodeQL has, but I know that it can be powerful. This was actually a point for using github instead of gitlab, as for they offer really similar features (at least for me, now).

    As expected, the "publish the code" intermission, appended by the "let's try this new thing I saw" leaves us in the current state: https://github.com/rikardonm/hctrl/actions/runs/1968193857

    Broken code.

    But hey, we have now a free build test!

View project log

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates