Posts

Controlling servo with RPi3B+

Image
Hello, I’m a 14-year-old kid from the Czech Republic interested in programming JavaScript and technology with my dad. We wanted to try driving a servo motor using hardware PWM from my Raspberry Pi 3B + together with Node JS library node-rpio. I will explain here, how I have done it because there is no good summary for me on this topic now on the internet. The hardware and software used Raspberry PI3b+ Servo 6g TBD.... Debian TBD Nodejs TBD node-rpio library https://www.npmjs.com/package/rpio Theory https://www.js4iot.com/2021/05/30/HardwarePWM-RPIO.html there is explained the theory of PWM( Pulse With Modulation).  Nice description how the servos work can be found here: https://www.jameco.com/Jameco/workshop/Howitworks/how-servo-motors-work.html The Servo motor works on pwm signals long 20ms/50Hz. You must set up your pwm in the Raspberry Pi with the rpio library. The hardware pwm module has 2 modes balanced mode - spreads the up and down signasls across the whole cycle Rt uniform...

Turris Omnia and Home Assistant in LXC Container

Turris Omnia hosting Homeassistant in LXC Container In the Turris Omnia I have installed the AEOTEC ZWave Dongle, in the front USB port. This is largely inspired by [1] and [2] and all credits belog to the author. Assume we have the containers stored in /srv/lxc and the container is called homeassistant. Install the kernel module  # opkg update && opkg install kmod-usb-acm   or  # opkg update && opkg install kmod-usb-uhci   Now I don't remember :( Expose the USB to the LXC container  Edit the /srv/lxc/homeassistant/config file and put there: # Give an access to the USB with the Aeotec dongle lxc.mount.entry = /dev/bus/usb dev/bus/usb none bind,optional,create=dir 0 0   lxc.mount.entry = /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file 0 0 Setup the host system to expose the ttyACM0 device Modify the device permission access using the hotplug system. Just create the following script: # cat /etc/hotplug.d/usb/10-zwav...

Turris Omnia Minidlna

  Turris Omnia: Setting up LXC container with minidlna Turris Omnia comes with preinstalled minidlna service. However I have encountered an issue that the service did not do automatic reindex. Workarounds such as remove the db, and restart service were not acceptable. It is pretty simple to configure the minidlna service in LXC container where a functional version can be ran. Configure the LXC container OS I have done this via the turris luci UI. Alpine linux 3.1 was chosen, but most will do. Attach to the newly created container (I will use name minidlna) and do: # echo "minidlna" > /etc/hostname # apk add minidlna Prepare the directory with the media files. The disk is going to be mounted from the host, and provided to the conainer # mkdir /nas Increase number of the inodes # vim /etc/sysctl.conf by making sure this line is added fs.inotify.max_user_watches=32768 Configure the minidlna At minimum you want to configure where the media files are located. For exapmle: $ vim...