Skip to main content

Getting XBMC to work with AirPlay on iOS7

· One min read

Since iOS 7 broke Airplay for XBMC, a guy figured out how to get it working again. It involves sending extra Bonjour publishes.

When building ffmpeg make sure to enable gnutls support (required for HTTP Live Streaming over HTTPS) Make sure that you have enabled airplay and avahi support (in gentoo, use flags airplay, avahi), and that you have libshairplay installed when building XBMC. https://github.com/juhovh/shairplay (gentoo ebuild here)

So the trick is to publish an extra airplay service with a different name after XBMC has published. For instance after 60 seconds:

avahi-publish -s "iXBMC" _airplay._tcp 36667 "deviceid=FF:FF:FF:FF:FF:FF" "features=0x77" "model=AppleTV3,2" "srcvers=101.28"

Replace FF:FF:FF:FF:FF:FF with your mac address

You can put it in .xinitrc or rc.local, like this:

(sleep 60 && avahi-publish -s "iXBMC" _airplay._tcp 36667 "deviceid=FF:FF:FF:FF:FF:FF" "features=0x77" "model=AppleTV3,2" "srcvers=101.28") &

Source: ermax @ xbmc forums

Transponders / initial tuning list for Canal Digital DVB-C Trondheim

· One min read

For some reason, w_scan isn't working for my Terratec Cinergy C HD PCI. I had some trouble finding initial scan data. But finally I found a list that gives me all channels for Canal Digital cable in Trondheim.

# no-trondheim-CanalDigital (cable)
C 290000000 6950000 NONE QAM256
C 298000000 6950000 NONE QAM256
C 306000000 6950000 NONE QAM64
C 314000000 6950000 NONE QAM64
C 322000000 6950000 NONE QAM64
C 346000000 6950000 NONE QAM64
C 354000000 6950000 NONE QAM64
C 362000000 6950000 NONE QAM64
C 370000000 6950000 NONE QAM64
C 378000000 6950000 NONE QAM64
C 386000000 6950000 NONE QAM64
C 394000000 6950000 NONE QAM64
C 402000000 6950000 NONE QAM64
C 410000000 6950000 NONE QAM256
C 418000000 6950000 NONE QAM64
C 426000000 6950000 NONE QAM64
C 434000000 6950000 NONE QAM64
C 450000000 6950000 NONE QAM64
C 458000000 6950000 NONE QAM64
C 474000000 6950000 NONE QAM64
C 490000000 6950000 NONE QAM256
C 610000000 6950000 NONE QAM64

Taken from: http://mspc.no/forum/showthread.php?tid=612

Custom pwm input range/travel in MultiWii

· One min read

I use MultiWii for my quadcopter. But I had a problem. My transmitter was not able to send values in the full range (1000-2000), so i had to scale the value from the center point (1500) up, and down.

Replace the fraction 22/20 with whatever scaling value you want, and replace THROTTLEPIN with whatever pin you want to scale.

Here are the changes I made (RX.ino in MultiWii 2.2):

@@ -110,8 +114,13 @@
rcValue[rc_value_pos] = dTime; \
if((rc_value_pos==THROTTLEPIN || rc_value_pos==YAWPIN || \
rc_value_pos==PITCHPIN || rc_value_pos==ROLLPIN) \
- && dTime>FAILSAFE_DETECT_TRESHOLD) \
- GoodPulses |= (1<<rc_value_pos); \
+ && dTime>FAILSAFE_DETECT_TRESHOLD) { \
+ GoodPulses |= (1<<rc_value_pos); \
+ if (rc_value_pos == THROTTLEPIN) { \
+ tmp = ((int16_t)dTime-1500)*22/20+1500; \
+ rcValue[rc_value_pos] = tmp; \
+ } \
+ } \
} \
} else edgeTime[pin_pos] = cTime; \
}
@@ -133,6 +142,7 @@
uint8_t mask;
uint8_t pin;
uint16_t cTime,dTime;
+ int16_t tmp;
static uint16_t edgeTime[8];
static uint8_t PCintLast;
#if defined(FAILSAFE) && !defined(PROMICRO)

XBMC with Canal Digital Norway using tvheadend/oscam for crypted channels on Gentoo

· 3 min read

So I decided to set up DVB support on my XBMC, so that i can use XBMC for all my media needs. With oscam, the only hardware we need is a DVB-C card and a cheap PCSC smart card reader.

My TV card is a TerraTecCinergy C DVB-C. My Smartcard reader is a SDI010 (works with CCID). I did this on gentoo but it should be just as easy on most Linux OS.

The process

First you need to install CCID and pcsc-lite:

emerge -av pcsc-lite ccid

On gentoo PCSC daemon will auto start when you plug in the USB reader if you add this to /etc/rc.conf:

rc_hotplug="pcscd"

Else you might need to start the service.

Checkout oscam source:

svn co http://www.streamboard.tv/svn/oscam/trunk oscam
cd oscam

Now let's build oscam with PCSC support:

make pcsc-libusb

Now configure oscam:

mkdir /usr/local/etc

Contents of /usr/local/etc/oscam.conf:

[global]
nice = -1
WaitForCards = 1
logfile = /tmp/oscam.log
usrfile = /tmp/oscamuser.log
cwlogdir = /tmp/cw
[webif]
httpport = 8888
httpallowed = 127.0.0.1
[newcamd]
key = 0102030405060708091011121314
port = 32000@0B00:000000

Note that you should change key to something more non-predictable.

Contents of /usr/local/etc/oscam.server:

[reader]
label                 = canaldigital
protocol              = pcsc
device                = 0
caid                  = 0B00
detect                = cd
ident                 = 0B00:000000
group                 = 1
emmcache              = 1,3,2

Contents of /usr/local/etc/oscam.user:

[account]
user = tvheadend
pwd = tvheadend
uniq = 0
group = 1
ident = 0B00:000000
caid = 0B00
au = canaldigital

Note that you should change user/pwd.

Run oscam:

./Distribution/oscam-1.20-unstable_*-libusb-pcsc

You can see its output from /tmp/oscam.log

Install and start tvheadend:

emerge -av tvheadend
/etc/init.d/tvheadend start
  1. Browse to http://localhost:9981/
  2. Go to Configuration -> Code word client
  3. Add entry
  4. Hostname: your ip
  5. Port: 32000
  6. Username: tvheadend
  7. Password: tvheadend
  8. DES Key: 01:02:03:04:05:06:07:08:09:10:11:12:13:14
  9. Check Enabled and Update card.
  10. Save

Now you can install XBMC tvheadend addon, plugin the smart card and, in theory just start watching TV!

(For XBMC addons i used this ebuild: http://data.gpo.zugaina.org/vdr-devel/media-plugins/xbmc-addon-pvr/xbmc-addon-pvr-9999.ebuild)

References

http://www.satnigmo.com/900/canaldigital-nordic-oscam-config/ http://cardshare-viasat-canaldigital.blogspot.no/2012/08/oscam-config-oscamserver.html http://www.streamboard.tv/oscam/wiki/CardsList https://tvheadend.org/projects/tvheadend/wiki/Tvheadend_oscam_ziggo

Building/installing libcec 2 on Raspberry PI

· One min read

Tested on Raspbian wheezy

On your linux computer

From https://github.com/Pulse-Eight/libcec/tags download libcec-2.0.5-repack. Apply this patch to configure.ac: https://github.com/vulpesvelox/libcec/commit/3671569235896a7ed448384ea6777a981fd49be9.

tar xvf libcec-2.0.5-repack.tar.gz && cd libcec-libcec-2.0.5-repack
./project/RPi/build.sh "${PWD}"/project/RPi/build

On the PI

apt-get install rsync

On your linux computer

rsync -avz -e ssh project/RPi/build pi@192.168.1.121:
rsync -avz -e ssh project/RPi/deps/lib/liblockdev.* pi@192.168.1.121:build/lib

On the PI

cp -a build/* /usr/local/
/usr/local/bin/cec-client

Fun time!

hls-vod - HTTP Live Streaming with on-the-fly encoding of any video file

· One min read

HTTP Live Streaming with on-the-fly encoding of any video file for Apple TV/iPhone/iPad/iPod and possibly other devices.

hls-vod lets you stream your whole video collection on-demand, regardless of format (as long as VLC can transcode it), to your iOS devices, playable from Safari, working AirPlay as well.

It is built on node.js.

Usage:

npm i -g hls-vod
hls-vod --root-path /path/to/my/videos

iOS Web App cache manifest + self-signed SSL problem

· One min read

So I am making a HTTPS HTML5 Web App, and I was having problems getting HTML5 Application Cache working on iOS when adding the App to home screen. In Chrome and Safari Mobile everything was working fine, but when i added the App to the Home Screen, NETWORK resources stopped working. After hours of de-hairing, I figured out that the problem was that I was using a self-signed SSL certificate. Since this is just an internal web app for controlling my home, I didn't want to pay for an SSL certificate for each of my subdomains, so I created my own CA-certificate. I linked this with my server SSL certificate for my web app server and added the CA certificate to my profiles on the iPhone. Now safari accepts my server SSL cert, and the Home Screen web app does too. Success!

libxcomfort, open source Moeller xComfort library

· One min read

libxcomfort is an open source library for controlling Moeller / Eaton's xComfort devices through the CKOZ-00/03 USB dongle. Currently RS232 is not implemented, only the USB protocol. It can currently be used for:

  • Getting/setting the dim value.
  • Starting/stopping gradual up/down dimming
  • Turning actuators/dimmers hard on/off.
  • Some other commands like reporting temperatures/measurements have been partially reverse engineered but not implemented.

Check it out here: https://github.com/mifi/libxcomfort

Frilett - Fake Mobillett Proof of Concept

· One min read

Lenge siden sist!

Hatt det litt moro med HTML/CSS. For en stund tilbake slengte jeg sammen en proof of concept klone av ATB sin Mobillett-app implementert som web-app. Genererer automatisk en billett, men man kan også hastekjøpe en billett gjennom eksisterende Mobillett konto med penger på dersom denne har blitt registrert på siden. Da vil den vise en gyldig billett fra din konto! Barcode inneholder også gyldig data fra billetten. Fungerer utmerket på iPhone.

Check it out! (åpne den i din mobile nettleser) http://frilett.mifi.no/

NB! Må ikke brukes for å forfalske billetter og unngå betaling! Denne er bare laget for å vise hvor enkelt det kan være å forfalske en slik elektronisk billett!

Hvordan laste ned / rippe video fra VGTV

· 2 min read

Det er overraskende enkelt å lagre video fra VGTV.

Jeg har laget et python-skript som automatisk henter ut adressen. Last ned skriptet her.

Kopier lenken til videoen du vil ha, feks. http://www.vgtv.no/?id=33283&category=1

Bruk python fra komandolinja og hent ut adressen ved hjelp av skriptet, eks.:

python vgtv_url.py http://www.vgtv.no/?id=33283
python.exe vgtv_url.py http://www.vgtv.no/?id=33283

(Windows CMD)

Du vil så få en rtmp:// URL. Åpne denne i VLC og fortell VLC å automatisk lagre videostrømmen.

Eventuelt, bruk VLC eller mplayer på kommandolinjen med en av disse one-linerne:

vlc "$(python vgtv_url.py http://www.vgtv.no/?id=X)" --demux=dump --demuxdump-file=video.mp4
mplayer -dumpfile video.mp4 -dumpstream "$(python vgtv_url.py http://www.vgtv.no/?id=X)"

Gammel (manuell) metode:

  1. Ta URL-en til en video, f.eks.: http://www.vgtv.no/?id=33283&category=1

  2. Notér id (her: 33283)

  3. Gå inn på: http://www.vgtv.no/api/?do=playlist&id=NOTERT_ID F.eks.: http://www.vgtv.no/api/?do=playlist&id=33283

  4. Fra XML-filen, hent ut rtmp-adressen under følgende hierarki (prøv et vilkårlig location-element): <playlist> <trackList> <track> <location>

Åpne så denne URL-en i MPlayer. F.eks.:

mplayer -dumpfile video.mp4 -dumpstream rtmp://88.87.43.102/streaming/mp4:storage/compressed//33283/flash_1000.mp4

Dette kan også gjøres med VLC:

vlc rtmp://88.87.43.98/streaming/mp4:storage/compressed//33283/flash_1000.mp4 --demux=dump --demuxdump-file=video.mp4

Vent, og du har snart videoen på disk.