Viewing posts by zgyarmati

Drive a SSD1306 display with STM32F4 Discovery board and Micropython via SPI

It wasn't trivial to set it up (at least for me), probably it worth to document it, so here is how you can connect and drive an SSD1306 display from Micropython running on an STM32F4 Discovery board:

Announcing manini

Here is small program i wrote: manini []. It's for manipulating INI config files from shell scripts. I used to use crudini [], but it's Python, which is not always avalible on embedded systems (like OpenWrt, Buildroot) or i don't want to install it only for this. The other way would be to parse/edit the ini file directly from shell with awk and/or sed, but it's rather error prone, so i decided to roll a command line utility for this in C, based on the library minini [].

Libmosquitto client with external poll()

I had some problem lately with implementing a libmosquitto [ ] client where i also needed to handle an other file descriptot (namely: a serial port) next to the libmosquitto client socket. Unfortunately the libmosquitto documentation is  somewhat laconic on this, so i needed some experimenting and some hints from the  [mosquitto-dev] mailing list. As  I couldn't find a full example for this online, I think it's worth to publish it here.

Find the device mounted as / on Linux

When /dev/root (which is mostly a symlink to the actual block device mounted as root) is not available, instead of parsing /proc/cmdline (which is not guaranteed to contain the root= paramater), better to use the 'findmnt' tool as:

Disable SSH host key check for local network

If one has an odd setup with SSH hosts regularly changing SSH host keys on a local network (like in my case regularly re-flashed embedded devices which generates SSH host keys at each first boot), it might be handy to disable the host key checking for these hosts, just add this to your ~/.ssh/config: