Angelos Italianknows Blog

Monday 13 April 2015

Building a voice actuated IOT controller

Ive been meaning to use one of my RaspberryPIs for something  "cool" recently.. And Ive decided to create myself a raspberry PI version of Siri.... Recently Amazon announced the Amazon Echo. A very nice looking package... However nothing beats homebrew right??

Initial research

Ive discovered three principle voice-control frameworks


  1. Jasper
  2. CMU Sphinx aka PocketSphinx
    and finally
  3. VoiceControl by Steven Hickson

Jasper

I like Jasper , it appears to be well thought out and appears to have a lot of extensions, compatibility with different voice recognition/ text to speech systems... 
Issues
- Documentation is a bit hit-n-miss
- Rather large and not sure why....

CMU Sphinx/PocketSphinx

I recently followed the tutorial by Wolf Paulus on his blog and got it all working. When compiling everything I had to ignore the "make check" step, it works regardless, and after I created some dictionaries then it all worked fine.. Except... I could only get it to detect words Id created using the dictionary approach, I couldnt get it to detect/parse a sentence which wasnt in the vocab list.. 
I kept getting "input overrun, read calls are too rare (non-fatal)".. From my googling at 2am I think this is because the PI has run out of steam.. Wolf appears to be using a PI v2 so I think Im gonna need to upgrade..... 

VoiceControl

Havent tried this one yet.. will do and let you know

Sunday 12 April 2015

Getting Text to Voice from Google

I'm currently goofing around trying to get some voice recognition working on my Raspberry-PI and whilst trying to get  some Text to Speech working I stumbled across this little script which uses Google Translate to do the business. Very cute so i thought Id share!

Create a shell Script (e.g. speak.sh) and type these commands in



#!/bin/bash
say() { local IFS=+;/usr/bin/mplayer -ao alsa -really-quiet -noconsolecontrols "http://translate.google.com/translate_tts?tl=en&q=$*"; }
say $*
Short, Sharp and Sweet...

Wednesday 14 August 2013

How to get D-Link D615 D4 to work as a WIFI Repeater



How to get D-Link D615 D4 to work as a WIFI Repeater

(To be refined)




See http://www.dd-wrt.com/wiki/index.php/Wlan_Repeater




Check the IP of router A by connecting to it by a cable (not wifi)...

for me this would be 192.168.0.1, a friend has it set at 192.168.1.254...

whatever it is, connect to it with Firefox...we will presume it's 192.168.1.254 here.

2) Check the range of DHCP, I will presume it's 192.168.1.100 to 192.168.1.199 (max 100 clients)...the reason we check this is so that we can avoid this range when setting a static IP to our laptop/computer later.

3) Disable wireless security on router A (this will be re-enabled later). Note: This may not always be required, but apparently it is...and you're reading this guide so perhaps you should!)

4) Ensure SSID is NOT hidden (again this can be changed later).

5) Give yourself (laptop/computer) a static IP of (for example) 192.168.1.99, with Gateway and DNS set to 192.168.1.254...




6) Now connect laptop/computer to router B instead.

7) Ensure everything is reset to default. For the dir-615 I suggest once it's turned on and booted up, hold down the reset button for 5-7 seconds. This will also default the router to 192.168.1.1 with the dd-wrt firmware installed.

Note: the wiki suggests a 30/30/30 reset, well that was less efficient for me, and of course just took me to the emergency room on stage 3...perhaps something "deep" was reset in the first 2 stages?

8) Change router B to an IP of 192.168.1.253, Gateway and Local DNS to 192.168.1.254...click APPLY.

(note: these numbers are a bit backwards IMO, I prefer: A at .0.1, B at .0.2, and me at .0.3 but hey!)

9) Login to router B again at the new IP from (8).




10) Before we start setting up the repeater bridge, you might want to check that router B can see router A...

you can do this in any mode except for Repeater Bridge (lol), so just go to Status/Wireless, down the bottom of the screen you will see a button labled "Site Survey"...click it, wait, you should see the SSID and channel number for router A...along with a bunch of random neighbours.




11) Start setting up your (soon to be) repeater bridge by going in the Basic tab:

WAN, Connection type: Disable

Router name: whatever

Local IP: 192.168.1.253 Subnet: 255.255.255.0 Gateway 192.168.1.254 Local DNS: 192.168.1.254

WAN Port: Assign WAN Port to Switch: tick this

Time Settings: whatever

12) Click SAVE only - note, we apply the settings later so only click save for now...

notice how DHCP dissapears from the menu, this is because we can get DHCP from router A if we so please.




13) Go to the Wireless/Basic Settings tab (note how we skipped the rest of "Setup" tabs for now):

Wireless Mode: Repeater Bridge

Wireless Network Mode: I use mixed because I know both routers can handle b,g,n (802.11)

SSID: must be the SAME as router A

Channel: must be the SAME as router A

Channel Width: 20 MHz

SSID Broadcast: Enabled (disable later if you want)

Network Configuration: Bridged

Click Save




14) Go next to Wireless/Wireless Security

Security Mode: Disabled (we will enable it on both routers later)

Click Save




15) Go to Services/Services

Disable DNSMasq

Click Save




16) Go to Security/Firewall

First UNcheck everything except Filter Multicast

Now on SPI Firewall, set it to Disable

Click Save




17) Go to Administration/Management

At the bottom of the page click Apply Settings

Basically the instructions are correct except for

1. The DHCP bits dont disappear by themselves, you need to disable DHCP

2. You do not configure a seperate VLAN in the wireless bit..

Monday 20 May 2013

VNC on Mac

MountainLion's inBuilt VNC server sucks.. Keeps crashing, not responding etc..

Solution, use a different one.. The best one Ive found is RealVNC, works a treat on Macs.. 

Tuesday 19 February 2013

Something geeky to try out

Hey all here's something geeky you can try out at work


On Windows
C:\tracert 216.81.59.173


On Linux
$ traceroute 216.81.59.173
The result
C:\Users\angelo>tracert 216.81.59.173

Tracing route to read.more.at.beaglenetworks.net [216.81.59.173]
over a maximum of 30 hops:

  1     9 ms     3 ms     3 ms  10.121.104.6
  2     *        *        *     Request timed out.
  3     8 ms     6 ms     7 ms  192.168.1.1
  4     8 ms     8 ms     9 ms  62.28.235.49
  5    13 ms    18 ms    31 ms  62.28.252.253
  6    64 ms    12 ms    13 ms  62.28.252.254
  7    18 ms    20 ms    19 ms  lis2-cr1-te0-0-3.cprm.net [195.8.10.157]
  8    70 ms    72 ms    71 ms  par1-cr1-gi2-0-0.cprm.net [195.8.0.234]
  9    77 ms    69 ms    73 ms  195.8.1.25
 10    74 ms    79 ms    69 ms  20gigabitethernet1-3.core1.ams1.he.net [195.69.1
45.150]
 11    61 ms    62 ms    61 ms  10gigabitethernet2-1.core1.par2.he.net [184.105.
213.102]
 12   288 ms   408 ms   310 ms  10gigabitethernet7-1.core1.ash1.he.net [184.105.
213.93]
 13   145 ms   292 ms   306 ms  10gigabitethernet1-2.core1.atl1.he.net [184.105.
213.110]
 14   231 ms   410 ms   305 ms  216.66.0.26
 15     *        *        *     Request timed out.
 16   174 ms   223 ms   305 ms  Episode.IV [206.214.251.1]
 17   224 ms   306 ms   305 ms  A.NEW.HOPE [206.214.251.6]
 18   221 ms   174 ms   234 ms  It.is.a.period.of.civil.war [206.214.251.9]
 19   174 ms   233 ms   304 ms  Rebel.spaceships [206.214.251.14]
 20   224 ms   306 ms   306 ms  striking.from.a.hidden.base [206.214.251.17]
 21   223 ms   306 ms   229 ms  have.won.their.first.victory [206.214.251.22]
 22   250 ms   305 ms   215 ms  against.the.evil.Galactic.Empire [206.214.251.25
]
 23   236 ms   306 ms   305 ms  During.the.battle [206.214.251.30]
 24   174 ms   237 ms   219 ms  Rebel.spies.managed [206.214.251.33]
 25   241 ms   305 ms   305 ms  to.steal.secret.plans [206.214.251.38]
 26   223 ms   305 ms   171 ms  to.the.Empires.ultimate.weapon [206.214.251.41]

 27   273 ms   307 ms   306 ms  the.DEATH.STAR [206.214.251.46]
 28   226 ms   306 ms   307 ms  an.armored.space.station [206.214.251.49]
 29   226 ms   307 ms   304 ms  with.enough.power.to [206.214.251.54]
 30   327 ms   306 ms   305 ms  destroy.an.entire.planet [206.214.251.57]

Trace complete.

C:\Users\angelo>tracert 216.81.59.173





Thursday 14 February 2013

Creating a Media Server for home


Well recently I've managed to blag myself a nice little HP Microserver (N40L) for home server use from http://www.check.co.uk. Its a nice little server, not too powerful, not very noisy  and integrated raid 0 & 1.. Perfect me thinks..

Until now I've been running my trusty old Joggler running Xubuntu with a USB Hub connected to a printer, harddrive(s) and keyboard/mouse combo.. It worked well, but wasn't really powerful enough to do media transcoding , fast file transfers etc...

So now the Microserver... Which Distro??

Initially I thought Id try Amahi or OpenMediaVault, Amahi is now built on top of Ubuntu, which means I can install other products easily, and OpenMediaVault is built on debian.. I also tried Zentyal, which again is installed on Ubuntu Server 12.04LTS, and installs everything.....

Eventually after rebuilding the server many times I've settled on... ... Vanilla Ubuntu and installing the products manually. Why??


  • Amahi
    • Nice product, easy setup however most things I want it to do I need to "Pay" for a add on, even though the add-ons are opensource and free.. Now the way it works is that yes the add-ons are free, but the payment is to pay someone to write the packager and maybe a UI to administrate it, also to support the project itself.... Now Im not against that, or paying, but not when I can do it just as easily myself... 
  • OpenMediaVault 
    • Didnt go for this in the end as it was based on Debian, and I kinda like the idea of being Ubuntu based simply for the software centre support etc... 
  • Zentyal
    • I really liked this install, it had different versions (office, gateway etc) but no "home" install. The closest I could use was "office", however that wanted to install LDAP etc, something I dont need at home... Also when I tried to install it Samba wouldnt install properly (something to do with mismatched versions/dependancies...), I spent some time on trying to fix it and then gave up....
So yes eventually I settled on basic Ubuntu 12.04LTS(although I might upgrade that to 13.04 when its released soon)..
Current set of products installed
  • Ubuntu Server 12.04LTS, better than Ubuntu Desktop as it has less desktop software installed
  • Ubuntu Desktop , need this so when you VNC you have a gnome desktop or something 
  • VNC Server, for remote desktop
  • WebMin,  simple admin tool for adding users, groups, samba shares etc
  • Samba, for network sharing to windows devices
  • Oracle Java, needed by software like Serviio
  • Serviio, DLNA software, works a treat!, also needs a collection of renderers decoders etc installed
  • ssh-server, Already installed I believe,  but needed for ssh access
  • lm-sensors, to monitor the machine
  • ssmpt, simple emailer
  • Apache, already installed as part of server, but need to configure a "admin" landing page..
Future products
  • Squeezebox server
  • Maybe LTSP, Linux terminal Services, instead of VNCServer
  • transmission bit torrent client

My next blog posting will detail what software I installed, and basic configuration. Virtually all of it requires nothing more than a collection of apt-get's and the hardest bit was ensuring you have all the "pre-requisites" installed.. Thankfully simply googling "Install Product X" was sufficient for this..

The blog posting will almost certainly simply contain a list of headings, a link to docs to install that component and then some notes... I'm half tempted to write a script which will do all the apt-gets , installs etc....




Wednesday 1 August 2012