Quantcast
Channel: Eva & Quirinius
Viewing all 69 articles
Browse latest View live

NNTPgrab on Raspberry Pi with Raspbian

$
0
0
NNTPgrab is a program to download and process NZB files from newsservers. Below is a instruction how to get NNTPgrab running on a Raspberry Pi with Raspbian armhf.

The easy way: use the precompiled binary:

sudo dpkg -i nntpgrab_0.7.2-1_armhf.deb 
sudo ldconfig 

nntpgrab_gui 
nntpgrab_server

That should work.



However, if you would like to compile your own NNTPgrab (which can take quite some time), do this:

sudo apt-get update
sudo apt-get install libgtk-3-dev libsoup2.4-dev intltool libsoup-gnome2.4-dev par2 libgnutls-dev

bunzip2 nntpgrab-0.7.2.tar.bz2 
tar xvf nntpgrab-0.7.2.tar 
cd nntpgrab-0.7.2/

./configure
make
sudo make install


You might need this:


sudo ldconfig


If you want to create your own *deb file, continue with:

sudo apt-get install checkinstall
sudo checkinstall -D make install
ls -al nntp*deb


HTH


Calculating pi on the Pi

$
0
0
Here's a way to calculate pi (3.141592...) on the Raspberry Pi:

First get the source:

wget http://myownlittleworld.com/miscellaneous/computers/files/pi_css5/pi_css5_src.tgz
tar xvzf pi_css5_src.tgz
cd pi_css5_src/


If you would now run 'make', you would get errors. That's because of this line in Makefile:


CFLAGS += -march=i686 -malign-double


These flags are x86-only, which do not work on our Raspi's ARM. So let's get rid of that line: use an editor like vi or nano to comment out that line (put a # in front of it), or use the command line:


cp Makefile Makefile.org
sed -i -e "s/^CFLAGS +=/#CFLAGS +=/g" Makefile
grep march Makefile


The last command should now give (and note the "#" at the beginning of the line):

#CFLAGS += -march=i686 -malign-double

You should now run make:

make

If that goes without errors, the pi calculation can start:

./pi_css5 100000


The output should look like this:

pi@raspberrypi ~/pi_css5_src $ ./pi_css5 100000
Calculation of PI using FFT and AGM, ver. LG1.1.2-MP1.5.2a.memsave
initializing...
nfft= 32768
radix= 10000
error_margin= 0.000620286
calculating 131072 digits of PI...
AGM iteration
precision= 48: 0.48 sec
precision= 80: 0.49 sec
precision= 176: 0.48 sec
precision= 352: 0.49 sec
precision= 688: 0.48 sec
precision= 1392: 0.49 sec
precision= 2784: 0.48 sec
precision= 5584: 0.49 sec
precision= 11168: 0.48 sec
precision= 22336: 0.49 sec
precision= 44688: 0.48 sec
precision= 89408: 0.49 sec
precision= 178816: 0.48 sec
writing pi131072.txt...
7.61 sec. (real time)
pi@raspberrypi ~/pi_css5_src/ $ 


So that's 131072 digits of PI in 7.61 seconds. The result is in the file pi131072.txt

FWIW: on my laptop with Core i3 M370 2.40GHz laptop the same calculation only takes 0.29 seconds ...


Listening to FM radio via Software Defined Radio

$
0
0

Cool: I'm able to listen to FM radio using "Software Defined Radio" (SDR). With SDR, a computer does most of the radio/frequency handling (like demodulation). Thanks to Realtek, you only need a 12 Euro USB stick, and some open source software.

Command to listen to 98.9 MHz:


$ sudo rtl_fm -f 98900000 -W -s 200000 -r 48000 - | aplay -r 48k -f S16_LE -t raw -c 1
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000013

Using device 0: ezcap USB 2.0 DVB-T/DAB/FM dongle
Found Rafael Micro R820T tuner
Oversampling input by: 2x.
Oversampling output by: 4x.
Buffer size: 5.12ms
Tuned to 99315000 Hz.
Sampling at 1600000 Hz.
Output at 48000 Hz.
Tuner gain set to automatic.
Playing raw data 'stdin' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono

Signal is quite noisy at the moment, but that is probably caused by a bad antenna.

Expect script to execute commands on a Zyxel modem

$
0
0
Below is an 'expect' script to execute commands on a Zyxel modem (a Zyxel P-2812HNU-F1, to be precise), for example to find the ARP addresses or IP address in use.

Example usage:

expect zyxel-command.exp admin mypassword 192.168.1.254 'show arp'
expect zyxel-command.exp admin mypassword 192.168.1.254 'show hosts'

So, the general format is:

expect zyxel-command.exp admin

Example extended usage and output:


sander@R540:~$ expect zyxel-command.exp admin mypassword 192.168.1.254 'show arp' | grep Ether | grep br0 | sort
192.168.1.38     Ether       C      FC:0F:E6:55:E7:38  *        br0
192.168.1.39     Ether       C      28:37:37:54:0E:8D  *        br0
192.168.1.45     Ether       C      00:37:6D:01:ED:9A  *        br0
192.168.1.49     Ether       C      00:06:DC:44:57:F3  *        br0
192.168.1.50     Ether       CM     B8:27:EB:10:21:56  *        br0
192.168.1.52     Ether       CM     B8:27:EB:87:A0:A2  *        br0
192.168.1.54     Ether       C      18:F4:6A:9C:CE:D4  *        br0
192.168.1.60     Ether       C      5C:59:48:84:E4:16  *        br0
192.168.1.61     Ether       C      04:46:65:7A:9D:55  *        br0
sander@R540:~$


The full script:


#!/usr/bin/expect -f

set timeout 9

set timeout 9
set username [lindex $argv 0]
set password [lindex $argv 1]
set hostname [lindex $argv 2]
set command [lindex $argv 3]

if {[llength $argv] == 0} {
  send_user "Usage: scriptname username password hostname command\n"
  exit 1
}

spawn ssh $username@$hostname

match_max 100000
expect "password:"
send -- "$password\r"
expect "ZySH>"
send -- "$command\r"
expect "ZySH>"
send -- "exit\r"
expect eof



Software Defined Radio on Linux

$
0
0
Here are some easy steps to get Software Defined Radio (SDR) working on Linux for FM radio. No need to install drivers, and no need to dive into GNU Radio Companion (GRC).

Step 1 Get an USB stick that's SDR capable, so with the Realtek chipset RTL2838

I bought this one for 11 Euro on DX.com

http://dx.com/p/dvb-t-digital-tv-receiver-usb-dongle-w-fm-remote-control-antenna-black-149928



Step 2 Compile the SDR-RTL code

The make for rtl-sdr uses 'cmake', so the make is a bit different than with the normal make:


sudo apt-get install cmake libusb-1.0-0-dev

git clone git://git.osmocom.org/rtl-sdr.git

cd rtl-sdr/
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo ldconfig

Now you should have the rtl_* executables installed. You can test that by typing "rtl" followed by pressing TAB.

Step 3 Tune to a frequency and listen to FM radio

Now you can listen to FM Radio, in the case below: 96.9 MHz:


$ rtl_fm -f 96.9e6 -W -s 150e3 -r 48e3 - | aplay -r 48k -f S16_LE -t raw -c 1 
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000013

Using device 0: ezcap USB 2.0 DVB-T/DAB/FM dongle
Found Rafael Micro R820T tuner
Oversampling input by: 2x.
Oversampling output by: 4x.
Buffer size: 6.83ms
Tuned to 97215000 Hz.
Sampling at 1200000 Hz.
Output at 48000 Hz.
Tuner gain set to automatic.


I had to put the -s parameter to 150000 to get the best sound.

Remarks

I needed a good antenna (read: the cable company's) for a noiseless signal; the accompanied antenna resulted in a lot of noise.
My ultimate goal is to get DAB radio working.




Ubuntu shortcuts for "sudo apt-get ..."

$
0
0
As I often use "sudo apt-get update && sudo apt-get upgrade" and "sudo apt-get install ...", I created some shortcuts for those commands:


-rwxr-xr-x 1 sander sander 27 mrt 17 12:10 /usr/bin/sadu*
-rwxr-xr-x 1 sander sander 25 mrt 17 12:09 /usr/bin/sagi*
-rwxr-xr-x 1 sander sander 45 mrt 17 12:08 /usr/bin/sagusagu*

with the following contents:


/usr/bin/sagusagu

sudo apt-get update && sudo apt-get upgrade


/usr/bin/sagi

sudo apt-get install $1


/usr/bin/sadu

sudo apt-get dist-upgrade


I can now run "sagusagu" to update & upgrade my Ubuntu system. :-)


Enrich your Ubuntu by creating short-hands for "sudo apt-get ..." commands:

$
0
0

Handy short-cuts for Ubuntu and Debian:

echo "alias sagusagu='sudo apt-get update && sudo apt-get upgrade'"  >> .bash_aliases

echo "alias sadu='sudo apt-get dist-upgrade'"  >> .bash_aliases
echo "alias sagi='sudo apt-get install $1'"  >> .bash_aliases


You now have three new commands (after starting a new shell):

  • sagusagu: updates and upgrades your system
  • sadu: does a dist-upgrade (needed if you see "kept back" messages)
  • sagi ... : installs a software package


I can now run my daily update by typing "sagusagu".

Belastingaangifte op Ubuntu 64-bit


Sony TV running Linux MIPS

$
0
0
Funny: in my webserver log there is this UserAgent logging:

"Opera/9.80 (Linux mips; U; InettvBrowser/2.2 (00014A;SonyDTV115;0002;0100) KDL32EX650; CC/NLD; nl) Presto/2.10.250 Version/11.60"

So apparently a Sony KDL-32EX650 LED TV is running Linux on MIPS?

history command without the history line numbers

$
0
0
A handy one-liner to remove history "line" numbers from the history command:


history | cut -c8-

Should work on any Linux, and probably other Unix-es too. Handy if you want to put your commands in a document.

HTH

"This video is currently unavailable" solved by opting-out from the HTML5 trial

$
0
0
I keep getting "This video is currently unavailable" with youtube in Chromium (not in Firefox). 

It was solved by going to www.youtube.com/html5 and opt out of the "HTML5 trial".

So ... a trial indeed. More a trial-and-error ... :-(

Koninklijk mininumloon

$
0
0
Raadsel: wat valt op aan deze woorden:

minimumloon
koninklijk
philipoom
opiumpijp
puinhoop
polynoom
polonium
plukloon
pilipili
pijplijn


... en wat valt op aan deze woorden:

secretaressedag
gezagdraagster
databaseserver
aardgasreserve
zeereerwaarde
vredesverdrag
staatsverdrag
rabarbertaart
geraardsbergs
gebrevetteerd

Oplossingen graag in de comments.

ASUS Download Master built-in NZB downloader

$
0
0
It seems the ASUS Download Master (which you can use on an ASUS RT-AC66U, for example) has a built-in NZB downloader.

The screenshots show the configuration screen. Most important: fill out your newsserver + account.

After configuring it, you can access it via http://:8081/downloadmaster/index.asp, for example http://192.168.0.100:8081/downloadmaster/index.asp

Happy downloading!




Network stuff of the Hosola Datalogger

$
0
0
Here are some network-technical notes on the datalogger used by the Hosola Photovoltaics (PV) inverter (and possibly other brands).

The MAC address of my inverter is

ac:cf:23:12:85:1dHi-flying electronics technology Co.,Ltd

So the  OUI (Organizational Unique Identifier) is ac:cf:23:
Thus, if you have arp-scan installed (Linux), you can find the IP address of the datalogger like this:

$ sudo arp-scan --localnet --interface=wlan0 | grep -i  ac:cf:23:
192.168.0.112     ac:cf:23:12:85:1d     Hi-flying electronics technology Co.,Ltd

With the IP address known, you can access the datalogger from your PC

nmap gives this as this guesstimate of the OS on the datalogger:

Device type: switch
Running: 3Com embedded
OS details: 3Com Baseline Switch 2250-SFP Plus

Open ports:

80/tcp   open  http
8899/tcp open  ospf-lite

Port 80 is of course the built-in webserver (default account: admin/admin). The webserver says it is "Server: Ralink HTTPD".
I have not yet discovered what the port 8899 does (other than just accepting connections).

You can access the datalogger using your webbrowser via (for example) http://192.168.0.112/ . After login (default: admin/admin) you can access all info.
Sometimes it can be handy to access the webserver from another program or the command line. First results for that:

curl -u admin:admin  http://192.168.0.112/

should give you access to the front page.
Some more useful stuff is at http://192.168.0.112/js/status.js (you can open this in your webbroser). To get the information from the command line, you can use something like this:

$ curl -u admin:admin  http://192.168.0.112/js/status.js --stderr /dev/null | sed -e 's/;/\n/g' | grep -e "^var" | grep -i webdata
var webData="H4993F0274,V1.05,V1.05,SolarSmart 2.2KW,  2200,143,248,25,,0,

The meaning of the last values (so: 2200,143,248,25,,3,) are respectively:
Rated power 2200 W
Current power 143 W
Yield today 2.48 kWh
Total yield 2.5 kWh
Alarms ---
Last updated 3 Min Ago

So, a very ugly one-line for getting the current power production is:

sander@flappie:~$ curl -u admin:admin  http://192.168.0.112/js/status.js --stderr /dev/null | sed -e 's/;/\n/g' | grep -e "^var" | grep -i webdata | awk '{ print $4 }' | awk -F, '{ print $2 }' 
126
sander@flappie:~$

So the current power production is 126 Watt.

PS:

The Hosola can log it's data to SolarMAN (http://www.solarmanpv.com/). You have to fill out a serial number for that. Use the serial that's broadcast by the Hosola Acess Point. So with something like AP_604443661 ... use the numbers 604443661 in the SolarMAN registration interface.
You can also find this number in the Hosola datalogger webinterface: Status -> Device information
-> Device serial number.
So: do NOT use the "Inverter serial number", which is something like H4993F0274





Dealextreme: the unpublished reviews - USB RS232 Cable

$
0
0
Dealextreme (http://dealextreme.com/ , http://dx.com/ )  is a great site for all kinds of Chinese stuff. They also offer the possibility to write and publish a review of stuff you've bought. You can also earn points this way. Great.

One pity: they seem to not publish critical reviews. Hey, that must be the reason most of their products have great reviews! ;-(

So, after my critical review not getting published on their site, I'll publish it here

It's about the USB RS232 Cable (SKU: 622) as offered here: http://dx.com/p/usb-rs232-cable-622

My review:


Pros:
Nice price. Very decent build. When recognized under Linux, the lsusb id is: 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter

Cons:
It's not RS232: signal level is 0V and 5V. The 0V is not allowed on RS232: signal levels should be at least -5V and +5V. See the Wikipedia Result: this does not work with devices that need real RS232, like the device I was connecting to. Recognition under Linux was flaky; often I have to unplug & plug until the device is seen. Annoying.

Other:
DX should change to title to "USB serial cable". No false RS232 claims

Bottomline:
Don't buy it if you really need RS232 signal levels.

Original input on dx.com ... which was not published and just vanished:

Inline image 1


Hosola is Hope Solar

Sitecom X6 - force auto-upgrade firmware

PS3 and Philips HTL2160 gives 8001002B error for bluetooth

$
0
0
I was trying to connect a PS3 via bluetooth to my Philips HTL2160 soundbar. The PS3 does see the Philips HTL2160. After instructing to connect, the PS3 asks for a PIN code, and after entering "0000", the PS3 gives an error message "... 8001002B"

Googling that error message reveals the following:

"The PS3 currently does not have support for the A2DP profile for Bluetooth audio devices; therefore, you will not be able to stream music from it, just in-game voice."

Ouch. So I guess that means no bluetooth connection between PS3 and the Philips HTL2160 soundbar. That means I have to get a fiber cable.

UPnP statistics - Mean Bytes per Packet

$
0
0
It appears my Sitecom X4 N300 reports Bytes and Packets sent and received via it's Internet link via ... UPnP!

So based on miniupnpc on my Ubuntu, I issue this UPnP command:

$ upnpc -s | grep Sent
Bytes:   Sent: 414657716Recv: 1589866153
Packets: Sent:   4116501Recv:    8067387

That results in the following calculation:

SentRecv
Bytes4146577161589866153
Packets41165018067387
mean Bytes per Packet101197

The 101 bytes-per-packet for upstream Internet traffic is as I expected.
However the 197 bytes-per-packet for downstream Internet traffic is not as I expected: I expected something around 1000.

PS:

Ah. Scrap the calculation ... 32-bit roll-over! After a fresh reboot, the result is:

sander@flappie:~$ upnpc -s | grep Sent
Bytes:   Sent:  2776182Recv: 234274519
Packets: Sent:    42854Recv:   158103

With some little awk, this results in:

sander@flappie:~$ upnpc -s | awk '/Bytes:/ { bytessent = $3; bytesrecv = $5 } /Packets/ {print "Bytes per Packet\nSent: " bytessent/$3 "\nRecv: " bytesrecv/$5 } '
Bytes per Packet
Sent: 64.4328
Recv: 1487.01


So: Sent is 64 bytes/packet, Received is ... 1487 bytes/packet. That's as I expected it

PS2:

The script to let MRTG monitor the bytes received and sent is:

upnpc -s | awk '/Bytes/ { print $5 "\n" $3 "\n\n\n" }'

HTH





Ziggo's Lokaal Centrum #1 in Den Haag

$
0
0
Gevonden in Den Haag: Ziggo's Lokaal Centrum #1.

Lokatie: Bezuidenhout. Naam: GV-LC0001. Zou de nummering voor Den Haag in Bezuidenhout zijn begonnen?

Ziggo bouwt trouwens een nieuwe LC: stukken groter, en met de aanduiding "mini-data-center".

Foto's worden nog bijgevoegd.






Viewing all 69 articles
Browse latest View live