Monthly Archives: June 2019

VoCore2: DIY listening-in device

It is pretty simple to do this, you only need a VoCore2 Ultimate and a compatible microphone(VoCore2 Ultimate headphone interface is HP_L, HP_R, GND, MIC)

1. Download latest firmware from vocore.io/v2.html, currently I am using 20190604.bin
2. Upgrade your vocore2, if you do not know how to upgrade, read vocore.io/v2.html first.
3. in VoCore2, run the following commands:

echo '#!/bin/sh' > /usr/bin/record
echo '/usr/bin/arecord -f dat' >> /usr/bin/record
chmod +x /usr/bin/record
echo 'nc -ll -p 9090 -e /usr/bin/record &' > /etc/rc.local 

Now VoCore2 is ready, reboot, it will automatically run.

Note: if you do not want it boot at startup, remove the final command and callΒ nc -ll -p 9090 -e /usr/bin/record

We can use any device able to connect to VoCore2 to read the sound data now πŸ™‚
For example, on my macbook, I connect to VoCore2 AP first, then call nc 192.168.61.1 9090 > test.wav
Ctrl+C to end, then I can play test.wav to get the audio I recorded.

Maybe there is some way you can make the audio live online, do your homework.

PS: I make this only for fun. πŸ™‚ Please do not use it for evil.

VoCore2: Weird Issue of Audio 2

When develop embed device, the hardest part is debug weird issue. It is because the bug is very hard to locate, it might be hardware, kernel, or application. Currently the record audio bug is absolutely a weird bug.

But I finally get it!

Bug and me are good friends, we like to play “hide and seek”, if it wins, it is free to drink my blood; if I win, I kill it!

It is because ES8388 ADC require DAC to work, what the design…It is absolutely a chip bug.

Now it works perfectly, recorded sound is very clear. πŸ™‚
And alsamixer is working fine too.

VoCore2: tinc setting up

Prepare a LINUX computer who has public IP, use it as SERVER, named s0
VoCore2 setting up Station mode or AP+Station mode, make it connect to internet, named s1

My VPN network ip address alloc to 192.168.88.xxx, and my VPN network named vonet.

Server part setting up

1. install tinc: for example, apt-get install tinc
2. prepare folders.

mkdir /etc/tinc
mkdir /etc/tinc/vonet
mkdir /etc/tinc/vonet/hosts
echo vonet >> /etc/tinc/nets.boot

3. prepare scripts.

touch /etc/tinc/vonet/tinc-down

#!/bin/sh
ifconfig $INTERFACE down

touch /etc/tinc/vonet/tinc-up

#!/bin/sh
ifconfig $INTERFACE 192.168.88.1 netmask 255.255.255.0

touch /etc/tinc/vonet/tinc.conf

Name=s0
Interface=tun0
Device=/dev/net/tun
Mode=switch

touch /etc/tinc/vonet/hosts/s0

Address=[your server public ip address]
Subnet=192.168.88.1/32

4. chmod +x /etc/tinc/vonet/tinc-*
5. create keys. tincd -n vonet -K

note: [your server public ip address] replace to your server public ip, format like 11.22.33.44.

Client part, on VoCore2

1. Install tinc:

opkg update
opkg install tinc

2. make folders

mkdir /etc/tinc
mkdir /etc/tinc/vonet
mkdir /etc/tinc/vonet/hosts
echo vonet >> /etc/tinc/nets.boot

3. scripts:

touch /etc/tinc/vonet/tinc-down

#!/bin/sh
ifconfig $INTERFACE down

touch /etc/tinc/vonet/tinc-up

#!/bin/sh
ifconfig $INTERFACE 192.168.88.12 netmask 255.255.255.0

touch /etc/tinc/vonet/tinc.conf

Name=s1
ConnectTo=s0
Interface = tun0
Device = /dev/net/tun
Mode=switch

touch /etc/tinc/vonet/s1

Subnet=192.168.88.1/32
Address=[your client ip]

4. chmod +x /etc/tinc/vonet/tinc-*
5. make keys: tincd -n vonet -K
6. setting up firewall:

uci set firewall.@zone[1].device="tun0"
uci commit firewall

note: [your client ip] is your vocore station ip address alloced from your router.

After this, copy s0 from server to client /etc/tinc/vonet/hosts
and same time, copy s1 from client to server /etc/tinc/vonet/hosts

call “tinc -n vonet”, start VPN on both server and client.