Errors I met to use AIY Voice Kit from Google

Errors I met.

Couldn’t use my 32GB Micro SD card.

Couldn’t authorize “AIY-voice-kit-python/src/examples/voice/assistant_grpc_demo.py”.

Re make new project on Google Chrome and used ssh of Chrome extention solved OAuth authorizing problem. 😄

(Used default Micro SD card.)

ssh commands memo

ssh pi@ipAdress #connect to raspberry
#cp from Local to Remote
scp '/home/masa/Downloads/client_id.json' pi@ipAdress:/home/pi


To solve error message below
masa@em-p:~$ ssh pi@192.168.0.12
The authenticity of host '192.168.0.12 (192.168.0.12)' can't be established.
ECDSA key fingerprint is SHA256:WC9qeJxGqf1L0Ne29soplRZ0TBzy2nEeeAKjaDCkYQs.
Are you sure you want to continue connecting (yes/no)? no
Host key verification failed.

 

at ~/.ssh/config

host 192.168.1.* 
StrictHostKeyChecking no

Permission change to 600.

chmod 600 ~/.ssh/config

Japanese Ref site
https://journal.lampetty.net/entry/wp/391

Advertisements

Android Studio:Wifi sample build error

Error message tried to build wifi sample code from Android Studio “File > import samples” maybe lol.
https://developer.android.com/studio/write/sample-code

No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android

 

Starting from the result, download NDK and copy file to SDK directory solved this.
But the latest NDK hasn’t “mips64el-linux-android” any longer.

android-ndk-r16b-linux-x86_64.zip

is maybe the last one which has “mips64el-linux-android”

Copied to the file to “Sdk > ndk-bundle > toolchains” solved this…

 

Download
https://developer.android.com/ndk/downloads/?hl=zh-en
Reference
https://github.com/google/filament/issues/15

Starting Android Programming: Android Studio Run Configuration Error

androidprog.jpg

Gotta this error message from Android Studio when started android programming for the first time.

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugJavaWithJavac'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:103) at org.gradle.api.internal.

From the solvent start, set proper path of JDK was effective.
I also downloaded other SDK version for each Android version.

 

Other error message.

Edit Configuration: Error Please select Android SDK

I Logged in to Google Account

Installed many SDK versions and Tools from SDK Manager icon on Android Studio.

Right upper icon on Android Studio – Project settings (icon) > change JDK to /usr/lib/jvm/1.8

I guess my case was cause of JVM path.
Perhaps SDK was only latest one, I downloaded even the oldest one.
It expanded to 11.9GB…

Screenshot from 2018-12-05 12-58-07.jpg

Solved this !!!

 

Next execute on my tablet.
http://cg.hatenadiary.jp/entry/2015/01/02/185636

My Ubuntu didn’t recognize my tablet.

installed adb

make sure the tablet’s

developer options > usb debugging on

Use sudo usermod -aG plugdev $LOGNAME to add yourself to the plugdev group about adb command.

cd to ..

masa@em-p:~/Android/Sdk/platform-tools$ ./adb devices
List of devices attached
adb server version (32) doesn’t match this client (40); killing…
* daemon started successfully

Changed cable.
restart tablet and ubuntu resolved this.
Often usb debugging mode is don’t know why..

androidProg2

Jaydle Development Journal:JA(va) Y(outube)D(l)-E(xtended)

I’m going to make post about note of jaydle development.
This is program which enhance youtube-dl command.

First I made prototype in bash.

It can download simultaneously and can download by just search keywords.
E.G

“jaydle -keywords tsunami disasters”

will downloads result videos top 10 automatically.
And I have numbering option from the top search result.
So you can know the order of search result after downloading.

But this shell script needing edit somehow. LoL.

I’m planning to make public journal of Jaydle development. e.g. Implementing SwingWorker, Menu bar, Serialization of the store path, …

So watching me!!!

Programming column: A programming unified viewand

My case fun of programming started from bash script. Was really wanted to accustomed with unix or Linux culture bought tons of unix used books mainly under $10.. lol.

Before that I learned Java but it’s hard to living well with OS ( computing environment). Especially make files, directories, reading, writing, using regular expression and co-operating with environment.

Bash is perfect for co-work with the environments. But not Object Oriented so hard to code maintain and manage.

Once you got through one bash book ( My case O’reilly’s “Learning bash shell” Second edition maybe) u will be interested in Sed & Awk.

Sed is “Stream EDitor” by my memory. This using ed text editor inside might be? Ed is very old text editing program. AT&T Bell Lab’s product. Line orient and matrix(mother) of Vi text editor. It won’t even display whole text. 🤓 Because it’s for printer type display(teletype). In the era no crt display and printed to papers. So this was efficient for paper printer.

Awk is acronym for “Adrian will kome “. 🤕

This is splendid language, Jon Bentley was attracted . Perl’s main influencer..

Python is made by masters of low or middle level languages. There are tons of splendid libraries, functions and programming style guide lines.

The point of the view rom function builder on Java, python or frameworks like angular are built arts by the hackers.

Now they must be loving Arduino or Raspy because that’s EECS “Ying and Yang”.

Compiler knowledge is essential.

 

Almost Unix commands are written in C.
But those are very small programs. Like things between programs and API.
Programming approach history is getting generality as it in mathematical description.
Unix commands are more like organic, C? Lol.
I thought like this when reviewing Grep command usage and bash programming.

To be continued,,,

Personal Memo: SwingWorker class study note (English)

24, Oct, 2018 Wed

Memo to know how to use “SwingWorker” class

publish() is connected with process()

Publish() is used in doInBackground() and send data chunk to process().

SwingWorker<T,V>
T – Result type
V – Type for intermediate result

In processBuild() which is my own, I could’t invoke publish() method.
publish() is method should used in doInBackground() method..
How it be written to process method which takes arguments in doInBackground()?

Reference site
http://www.javacreed.com/swing-worker-example/

MultiThreading is natural.
Practically Swing suppose to launch several threads.

First post end. To be continued…

Personal Memo: SwingWorker class study note (日本語)

SwingWorkerクラスの使い方

publish() – process()と結びついている

publish()はdoInBackground()の内部で使われるが、process()にデータチャンクを送信する。

SwingWorker<T,V>
T – 結果の型
V – 中間結果の型

processBuildメソッド中で、publish()メソッドが使えない。

publish()はdoInBackground()中で使うメソッド

引数を取る処理をdoInBackground()で行うときどうすればいい?

このサイトを参考にする
http://www.javacreed.com/swing-worker-example/

マルチスレッドで当たり前。
Swingは実質スレッドがいくつかある。

jarコマンドによる実行可能Jarの作成

 

 

jar

オプション

c JARファイルの作成
f ファイル名の決定
v 内容のリストをverboseモードで
m   マニフェストファイルから値と名前を特定する
-C はfileオペランドで指定されたファイルを処理する際にディレクトリが一時的に変更される

 

参考
https://docs.oracle.com/javase/jp/8/docs/technotes/tools/unix/jar.html
https://docs.oracle.com/javase/jp/8/docs/technotes/guides/jar/jar.html

 

この時のディレクトリ・ファイル構成

~/Desktop/git/masa-examplesがソースのルートディレクトリ
     applications - JaydlePrototype01.java がメインメソッドを含むクラス
     practice - IOMethods.java  がメインクラスで使った依存するクラス

 

まず~/Desktop/git/にJaydleBuildディレクトリを作成
~/Desktop/git/masa-examplesから以下のコマンドを実行

 

javac -d ../JaydleBuild/ applications/JaydlePrototype01.java 
javac -d ../JaydleBuild/ practice/IOMethods.java

 

これでJaydleBuildディレクトリにクラスファイルができた。

 

masa@em-p:~/Desktop/git/JaydleBuildTest$ tree
.
├── applications
│   └── JaydlePrototype01.class
└── practice
    └── IOMethods.class

2 directories, 2 files

のように、

パッケージのディレクトリが作成されている。

 

次に簡単なマニフェストファイルを同ディレクトリに作成

Manifest-Version: 1.0
Main-Class: applications.JaydlePrototype01

 

そして、さっき作ったクラスファイルとマニフェストファイルをjarコマンドでまとめる。

masa@em-p:~/Desktop/git/JaydleBuildTest$ jar cmf Manifest.txt JaydleJarTest.jar ../masa-examples/

失敗。間違ったJARができた。

 

masa@em-p:~/Desktop/git/JaydleBuildTest$ jar cmf Manifest.txt JaydleJarTest.jar .

これでちゃんと作れた。

Screenshot from 2018-10-21 22-56-14

参考
jar コマンドで実行可能な JAR ファイルを作成する | まくまく Java ノート
http://maku77.github.io/java/jar/executable-jar.html

 

YoutubeのMVの音声を抽出してMP3として保存できます。たぶんLinux環境だと動きます。
https://github.com/iamaturtle113/Jaydle

WindowsとMacでは試してないです。Macなら動くかも?Windowsはターミナルのコマンドがちょっと厳しいか。

注 Youtube-dlコマンドがターミナルから起動できることが条件です。