Direkt zum Hauptbereich

Posts

Project Sinos: The Self Learning Leveler

This article also refers to my series of earlier articles regarding  Project Sinos . Did you ever think about how you understand language? How do you manage to recognize the language from all the noises in the environment when someone speaks to you? Almost nobody thinks about it. But it becomes essential if you want to recognize speech electronically. Frameworks like CMU Sphinx may can take over the recognition of words and the formation of meaningful sentences. But permanently analyzing all noises of the environment brings miserable results. This is why smart speakers usually need to detect a Hot Word like "Alexa" or "Hey, Google". In case of cloud based smart speakers, they would also produce a huge amount of network traffic if sending permanently all noises to their decoding service. This shows the need for hot words. Well, how do you do that exactly? Hot Word Detection The simplest part is the detection of the Hot Word itself. You just need to detect the (alrea...

What's wrong with Java3D? Part I

In order to get some distance from my current smart home project, I dealt with Java3D . I wanted to find out if it was possible to develop a 3D game with it. In theory, it should be possible to make a game using a 3D API based on OpenGL, like Java3D is. However, Java3D has a not unimportant catch: its complexity. Perhaps this is also the reason why there are so many beginnings and advances on the internet by some courageous developers who received little or no feedback on their projects. Many questions remained unanswered - on stackoverflow.com . I know Java3D is old. But that is precisely why one would have to find countless answers and examples on the Internet - especially about 3D games. But that is not the case. So why? When I started to investigate whether and how it is possible to develop an FPS, I always found the same examples , but never a coherent project. The basics of three-dimensional computer graphics are difficult to understand at the beginning. In addition, Java3D c...

Project Sinos

In my previous post I mentioned Project Sinos. Now, there is a large step towards an installation script. Installation Script May Contain Errors Please note that the installation script is still in an experimental stage and can contain all kinds of errors !  To ensure that the script does not conflict with your own configuration of your Raspberry Pi 3, please check it before running. Installation Sources For Sinos The installation sources can be found on GitHub under the following link: (link not available yet) Download bot files. main.zip setup.sh For installation, both files (sinos.zip and setup.sh) must be downloaded and located in the same directory. Then a call to setup.sh with root rights is sufficient (you may need to make setup.sh executable by calling chmod +x setup.sh ). After this, the installation and configuration should run. Errors may occur during installation. These have to be considered and corrected in detail. There is no guarantee for the...

Project Sinos - Back To Open Source

After my previous smart home project with Snips.ai failed due to Sonos buying Snips, I was forced to find an alternative to offline speech recognition with Snips.ai. Project Sinos Unfortunately, there were no real open source alternatives. At least I couldn't find one. So I took matters into my own hands. Project Sinos was born. ("Sinos" is a pure artificial word, derived from the Latin Sinus.) CMU Sphinx - How To Listen Offline The first and apparently biggest problem was finding an open source software for offline speech recognition. To my astonishment, this was solved very quickly after I discovered CMU Sphinx . Developed by Carnegie Mellon University, it is the offline speech recognition tool. In addition, quite a few languages are supported (including German). It has little, very little competition. After the first quick successes, however, there were considerable problems in recognizing specific words in order to identify intents. I was able to f...

How To Set Up Snips.AI on Rock Pi S - Part 4: Back To Zero

Update Snips.ai has been acquired by Sonos ( see this message of Sonos ) and Snips Console will be discontinued at the end of January 2020 ( see this message of Snips ). Under this circumstances, it makes no sense to continue this project. 😔 Installing Snips.AI Well, you read until here, so I guess you really want to use Snips.ai on your Rock Pi S. So let's solve some new problems. The usual way to install Snips.ai is to use another computer in the same network and execute the following steps: sam connect <device> sam init sam ... But - this does no longer work. A Short Tale Of Workarounds Currently (2019-12-18), it is not possible to install Snips.ai agent on the previously prepared Rock Pi S with Debian Stretch, hence there are no binaries for  arm64-architecture  of stretch. Unfortunately, arm64 is the current architecture of the Rock Pi S' CPU. I've tried some things before I found a solution. This is the list of things that  did not ...

How To Set Up A Rock Pi S - Part 3: The Sound

After the 2nd part of the Rock Pi S setup , I was confident to get some sound out of the board after I made a little hardware hack and connected it to my speaker (with amplifier). Unfortunately, the command speaker-test -t wav -c 2 did not bring any sound out of the Rock Pi S. So there still was a problem left and I had to google it once more.  Thanks to DIYprojecz in Radxa Forum ... I was once more able to fix a problem. For details see  https://forum.radxa.com/t/audio-support-rock-pi-s/1686/28 . What needs to be done: sudo su route add default gw <your.gateway.ip.address> eth0 echo "deb http://apt.radxa.com/stretch-testing/ stretch main" | sudo tee /etc/apt/sources.list.d/apt-radxa-com.list wget -O -  apt.radxa.com/stretch-testing/public.key | sudo apt-key add - apt-get update apt-get upgrade apt-get install -y rockchip-overlay rockchip-fstab apt-get install -y linux-4.4-rockpis-latest rockpis-dtbo apt-get autoremove chmod a+r /etc/group The N...

How To Set Up A Rock Pi S - Part 2: The Network

After the successful initial set up of my Rock Pi S, I started going on with my project self made smart home assistant. Therefor, it is necessary to configure the network interface. SSH Does Not Mean Network Is Fine Though we already are able to connect to the Rock Pi S via SSH, we probably cannot yet ping servers outside our local network. A ping to google.com, for example, will result in no answer: Destination Host Unreachable The reason is, that there is no standard gateway set in the network configuration, which causes, that only local network hosts inside the same subnet can be reached. The gateway is like the door of your flat. If You don't know, where it is, You cannot even leave your flat and see the rest of the street. To find out your standard gateway, there are different approaches between Windows and Linux. Maybe You need to investigate this for your client operating system. On Windows, You open a command line and type: ipconfig The output loo...

How To Set Up A Rock Pi S - Part 1: Basics

Update / Warning: Until now, I was not able to get this project working. So if You are looking for a working solution, this is none. Maybe You do not need to read the following part of this project, because they were written, before I figured out, that this will not work. As it turned out, the Rock Pi S cannot run Snips.ai any more (after a Kernel update to get the sound working).  (Original Article Starts Here) With the progress of my smart home assistant project , I finally found an adequate hardware with the possibility to connect up to eight microphones: the Rock Pi S from Radxa . What sounded like a promising small device turned out to be a little bit tricky. Inspired by an interesting  article of the german IT publisher heise.de , I decided to order a Rock Pi S for my project. So I took the version with 512 MB RAM, Bluetooth and WiFi (ordered at the at this time point only available store n Germany, maker-store.de ). After delivery and unboxing of the de...

Smart Home with Snips AI

Smart Home voice assistants (also known as "smart home", "connected home") are still very much on vogue. But, regarding to Gartner's hype cycle  for emerging technologies, it's already on the falling edge of the curve and on the road to its plateau of productivity. Which means: the hype is almost over and the technology will get mature in approximately less than five years. Controlling devices at home with the voice is no future any more. It is presence. While Amazon's Alexa and Google Smart Home already recognize your wishes by voice commands in the cloud, there is a small place, where some offline voice assistants have emerged. These can process voice commands without a connection to the Internet, which is a major advantage for your private sphere - especially, if you consider that e.g. the German Home Office plans to listen to such devices to enlighten crimes. Fortunately, there is a way to protect your private sphere though you want to use smart...

Password Manager Security?

Some months have passed since the german IT news platform golem.de published an article reporting that password managers keep the passwords in memory unencrytped. Today I took the chance to make me my own picture of the problem. I used Keepass for my little Test. First, I created a new password database and protected it with a password. Step 1: Create a new encrypted password database Then I deleted the sample entries and created a new one with a certain password (password: "Hidden information 3214" ... whoops!). The result is, that the password is not shown in the Window. Step 2: Create an entry with a password Next, I copied the password over selecting the entry item in Keepass and pressing Ctrl+C and started a hex editor, HxD, to read out the process memory of Keepass (you could also read all processes memory). Step 3: Reading process memory of KeePass The last step was to search for a part of the password string (here: "Hidden in"). The resu...

AI Learns to Play Computer Games

Let's take a look at an off-topic issue in this article: gaming. Why is it even worth to talk about gaming? First of all, gaming is the first decision driven activity a human can do. Second, gaming is a huge economic factor of today's digital business. Third, everybody loves to play. So, let's take a look at challenges to the developers of computer games. One big challenge to the game developers of modern computer games is to create opponents that are challenging the player - but never too far. Always matching a grade of difficulty that evokes a kind of thrill to the player without being hopeless to beat the computer player. But why is it a challenge? Well, it is something that affects the player directly - and a frustrated player will be a hard judge to the game developer or publisher. We could say: adequate opponents in games are a kind of game quality. Computers can always easily defeat up to 98% of human players For a computer, it is no problem to beat a hum...

What's wrong with Scala? About Yate's Correction

Some months ago, I started a new job as a machine learning engineer for a german trading company. In the course of this, I began to deal more with the programming language Scala. Scala provides some benefits that makes the work easier for data engineers when building data pipelines and there's a good support for spark, which is an advantage in cluster computing. But Scala (of course) also has its idiosyncrasies. This article shows the idiosyncrasy of Yate's correction in the Statistcs package of Scala and its consequences. The Statistics Package Like many other programming languages, Scala also comes with a statistical package called "Statistics". It includes many basic methods of the describing statistics, which you need for many purposes. One of these purposes is, for example, A/B testing. So, what's wrong with Scala? For an A/B test, I tested the significance by own calculations first (in old manner, as I had learned in my studies) before using th...

Hacking Sonos Play 1 and Play 3

For several months I have been an enthusiastic owner of a Sonos home sound system. In addition to a brilliant sound and the operation via smartphone and WLAN, this also offers the possibility to implement a control via the SOAP protocol to implement user-defined functions. This means, that it's possible to "hack" the Sonos devices. Free APIs Available Fortunately, some non-proprietary APIs are available on the net or on GitHub: For Java on any machine and OS (by VMichalak) For python on Raspberry Pi SoCo API for Python on Raspberry Pi It has to be said, that the Python APIs not neccessarily run on Windows (at least they didn't run on my machine), but this is not to expect when they are proclaimed as a Raspberry Pi project. Dependency Nightmare Though the API of VMichalak was the one that worked for me, it has a lot of dependecies which need to be downloaded or to be downloaded an build what requires Maven. OKHTTP (okhttp-3.11.0.jar) OKIO (okio-1...

Pi And More 11 - R Script For Neuronal Net And Training

This is the R script used to create and train the neuronal net for the Python project . Please consider that the lines for the export of the neuron weights are disabled by the comment marker #. ################################## # # COMMON SAMPLE DATA HANDLING # ################################## load_samples = function (filename, attrib) { data = read.csv(filename, sep = "\t" ) # Remove result column data = data[, -5 ] # Calculate all combination with count of measure points n = aggregate(x ~ run + subset, data = data, FUN = length) # Keep only measurement with 80 points n = n[n[, 3 ] == 80 ,] # Create the training data matrix for non-matches dataset = matrix(ncol = 80 , nrow = 0 ) # Fill up the training data matrix with the valid cases (n) of data and transpose it for (i in 1 : dim(n)[ 1 ]) dataset = rbind(dataset, t(data $ x[(data $ run == n[i, 1 ]) & (data $ subset == n[i, 2 ])])) # add class column dataset = cbind(c(attr...

Pi And More 11 - Python Blinker Class

This source code is part of the Python magnetic field sensor and detector project . This class only provides a simple flashing indicator light for the project. ######################################## # # Python Magnetic Field Logger and Detector # by Sebastian Folz # Introduced on Pi And More 11 # ######################################## # Don't use time module, because there is no valid time without WiFi import time import sqlite3 as lite from qmc5883 import QMC5883 import statistics # import functions for system calls from subprocess import call import sys # import pushbutton class from pushbutton import pushbutton, Push # import blink class from Blinker import Blink1, Blink2 from enum import Enum import RPi.GPIO as GPIO # fix copy bug with switched arguments from shutil import copyfile # Import own neural net class from MLP import MLNN TASTER = 38 LED = 40 LONG_CYCLES = 10 # 1.5 seconds COMMIT = 10 BINSIZE = 10 #...