Posts mit dem Label Layout werden angezeigt. Alle Posts anzeigen
Posts mit dem Label Layout werden angezeigt. Alle Posts anzeigen

Montag, 11. Februar 2013

11. The CDCard - and the playlists for Squeezeboxes

When I started the first experiments in this project, the ultimate target consisted of a quick access to the music of my CD's. That it has evolved in this way, I was not aware. So let us turn to the CDCard .

Actually, the theoretical side clear: we need an advanced playlist in m3u format.. How has the look basically, we saw yesterday. So basically there are no problems. No problems? Most of the playlists of other programs are not expanded - they do not work. So I adapted a working method for me. I would imagine at this point for all those who struggle with the playlist just like me.

I assume that ripping a CD is very well known to almost everyone. FYI: I rib with Audiograbber. The files are then in mp3 format in a dedicated CD folder.

I received this week from my heating oil suppliers a CD "Après Ski Classics" gift that will serve me now as an example. When grabbing can Audiograbber also create a playlist m3u . Which looks like this - simply poor:  

01 - Tim Toupet - Du hast die Haare schön-1.mp3
02 - K2 - Der Berg ruft (Remix 2000).mp3
03 - Olaf Henning - Cowboy & Indianer (komm hol das Lasso raus).mp3
04 - Jürgen Drews - König an der Schneebar.mp3
05 - The BossHoss - Hey Ya!.mp3
06 - Peter Wackel - Après Ski.mp3
07 - Helmut Aus Mallorca - Der alte Holzmichel.mp3
08 - A-Teens - Gimme! Gimme! Gimme!.mp3
09 - Scooter - The Question is what is the Question.mp3
10 - Didi Diesel - I bin der Champ.mp3
11 - Henning & Holm - Maddalena 2001 (Du Luder).mp3
12 - Bata Illic - Michaela.mp3
13 - Sonthofen Allstars - Alles Wunderbar.mp3
14 - Cascada - Everytime we touch.mp3
15 - Hermes House Band - I will Survive (Radio Edit).mp3



This is definitely not the extended format! The LMS will roar with laughter! WE can do this in a better way.. Therefore we need the best editing program for MP3's for me - MP3Tag . At the time of this blog with the version 2.54. The RFID card is already identified and has the UID/CS 78-12-179-209-32. I have now added a new field to the ID3 tags: RFID-Karte (RFID-card).

MP3Tag with the new fields EAN code and RFID-Card


We need this field later in the export yet. MP3Tag in there under File - Export the ability to describe an export file. My export is called of course Squeezebox-Playlist (what else). The syntax is:  

$filename(U:\playlists\%RFID_CARD%.m3u,utf-8)
#CURTRACK 0
#EXTM3U$loop(%track%)
#EXTURL:file:///volume1/music/$cutLeft($replace(%_path%,\,/, ,'%20'),3)
#EXTINF:%_length_seconds%,%title%
/volume1/music/$cutLeft($replace(%_path%,\,/),3)$loopend()


We definitely have not MP3Tag as a focus, take it as it is and create yourselves your own export. During the export the following window will be displayed. It is important, that the file name is entered as shown in the picture on the left. Then the program automatically retrieves the RFID number from the ID3 tag. If  we now press OK we get THE playlist we need and already saved in the correct folder. Wow! The playlist now has the following content:

#CURTRACK 0
#EXTM3U
#EXTURL:file:///volume1/music/Pop/Sampler/Après%20Ski%20Classics/01%20-%20Tim%20Toupet%20-%20Du%20hast%20die%20Haare%20schön.mp3
#EXTINF:223,Du hast die Haare schön
/volume1/music/Pop/Sampler/Après Ski Classics/01 - Tim Toupet - Du hast die Haare schön.mp3
#EXTURL:file:///volume1/music/Pop/Sampler/Après%20Ski%20Classics/02%20-%20K2%20-%20Der%20Berg%20ruft%20(Remix%202000).mp3
#EXTINF:236,Der Berg ruft (Remix 2000)
/volume1/music/Pop/Sampler/Après Ski Classics/02 - K2 - Der Berg ruft (Remix 2000).mp3
...
etc,

This looks definitely more like an extended playlist - and it works . Here it is in the directory playlist with all the otherplaylists.




Does it work?? No! An error message is spreading. Not these error now!!

"Problem: File cannot be opened for:"

This is certainly an error in the playlist script. I noticed it immediately.

#EXTURL:file:///volume1/music/Pop/Sampler/Après%20Ski%20Classics/01%20-%20Tim%20Toupet%20-%20Du%20hast%20die%20Haare%20schön.mp3

The first track includes a German special characters. And the LMS does not like special characters. The "ö" makes trouble! For this english version of the script this fact is not really important, but there are people from other countries with special characters.

In the script the following line

#EXTURL:file:///volume1/music/$cutLeft($replace(%_path%,\,/,,'% 20'),3)

a "\" is replaced by a "/" and a " " by a "20%" , is changed as follows:
#EXTURL:file:///volume1/music/$cutLeft($replace(%_path%,\,/, ,'%20',ä,%C3%A4,ö,%C3%B6,ü,%C3%BC),3) 

The error message has gone! Should such an error messages appear you have to search in this environment first!

The RFID card is now hidden in the CD cover and can not be seen from outside.




I did that with all my CD's: Ripping - storing in the database - preparing the RID-card - creating the playlist and storing them - CDCard hiding in the CD covers. DONE!   With over 300 CD's not a work for one day - that lasts! :-) But the result is always a pleasure.

I had thought at the beginning that it will last a whil to find a specific playlist in this crowd. The opposite is the case! Because the contents are sorted in a special directory, everything is serially numbered! Bother to write the UID and CS on the Card. The troubleshooting is much easier.

We walk slowly to the finish line. How a PlaylistCard is built, you should not have, according to the reading of the last blogs, any difficulties. I leave this to you!

Next time we want to see the DuinoSqueeze  in action. Video? Let's wait and see. It will definitely take some time.


Sonntag, 6. Januar 2013

6. Das Platinen-Layout von ID:789

Den gestrigen Tag habe ich mit dem Hinweis auf die .brd-Datei verlassen. Die .brd-Datei hat nichts mit der Bunderepublik Deutschland zu tun, sondern zeigt das Layout der Platine.

Hier mal ein Überblick:
Copyright Adafruit

Zusammen mit der .sch-Datei kann ich alle relevanten Punkte auf dem Board finden. In der .brd-Datei finden sich alle Bauteile-Bezeichnungen, auch die, die nicht auf dem Shield aufgedruckt sind. Ich habe mal alle wichtigen Baugruppen und Platinenpunkte in einem Bild zusammengefasst.


Allgemein kann ich sagen, dass genügend Möglichkeiten, um irgendetwas anzuschließen, vorhanden sind. Es ist gut erkennbar, dass viele Ein-/Ausgänge nicht verwendet werden, sondern nur deshalb vorhanden sind, um das Board stapelbar zu machen. Für jemanden, der das Board wirklich als Shield benutzt, ist es quasi plug 'n play. Wer aber - so wie ich - das Shield "auslagern" möchte, muss sich schon mit der Pinbelegung auseinandersetzen.

Auf dem Foto, sieht es so aus, als hätte ich vier Lötpunkte, um Ground anzuschließen. Wirklich vier? Ein Blick auf das Layout gibt Auskunft. Aha!! Nur ein einziger ist möglich. Das ist genau das, was ich gestern meinte: Ein Blick auf das Layout lohnt sich!

Kurze Erläuterung zu den gelben Kästchen:
Q1 = Pegelwandler SDA
Q2 = Pegelwandler SCL
Q3 = Pegelwandler SCK
Q4 = Pegelwandler RSTP
FSR = Festspannungsregler 5V/3.3V
IRQ = Anschaltung einer LED an den Interrupt (IRQ)

Die grünen Leitungen stellen die beiden Leitungen SDA und SCL dar. Sie sind an fünf verschiedenen Punkten abgreifbar:

SDA: Oben links 2x (SDA), MOSI (gesonderte Steckerleiste), und unten rechts 2x (Analog In 4)
SCL: Oben rechts 2x (SCL), SS (gesonderte Steckerleiste) und unten rechts 2x (Analog In 5).

Die gelben Leitungen sind die Punkte, die ich auf eine gesonderte Steckerleiste führen werde.


Als Nächstes geht es an die "Verdrahtung" und es gibt den 1. Testlauf.

Samstag, 5. Januar 2013

5. Der RFID-Karte auf den Zahn gefühlt

Ich habe mir also  die RFID-Karte ID:789 von Adafruit zugelegt. Wie es sich gehört, wird zuerst mal nachgesehen, was denn bei Adafruit dafür verfügbar ist. Mich interessiert zum jetzigen Zeitpunkt nur die Hardware.

In dem Produktblatt sind verschiedene Reiter zu finden, die wir uns der Reihe nach mal ansehen wollen:

Reiter "Beschreibung"
Hier sind wertvolle Beschreibungen und Hinweise zum Aufbau enthalten. Auch wer die SPI-Schnittstelle benutzen möchte, soll sich die Hinweise zu Gemüte führen. Kurz und gut: Pflichtlektüre.

Reiter "Technische Einzelheiten"
Die nackte Größenangabe ist hier definitiv zu mager. Ich hätte grundsätzlich Angaben zum Stromverbrauch bei verschiedenen Zuständen erwartet. Welche Spannungen werden/können verwendet werden? Leider keine Antworten.

Reiter "Tutorials"

  • Sehr gute Zusatzinformationen zum Thema RFID. Hier konnte ich auch tiefergehende Daten zu den RFID-Karten, die ich  einsetzen werde, finden. Ich benutze Mifare S50 - Karten. In dem genannten Dokument gibt es dazu mehr. Wirklich lesenswert!
  • Da ich nicht die Funktion NFC von Handys benutzen werde und ich da nicht 'reingeschaut habe, kann ich hierzu auch nichts schreiben.
  • Die weiteren Informationen sind Datenblätter und Zeitdiagramme. Die Datenblätter können viele Fragen beantworten, wenn es nicht mehr weitergeht. Ich komme auf die Datenblätter nochmal zurück
Reiter "Download"
Hier bin ich auf eine falsche Fährte geführt worden. Da muss man höllisch aufpassen!!

Die Links zu den Libraries funktionieren und leiten uns auf die benötigten I2C-Sketche. Die werde ich zu einem späteren Zeitpunkt ausprobieren.

Das Antennen-Design bezieht sich auf den verwendeten RFID-Chip PN532 von NXP. Der wird auf meinem Board verwendet. Also auch ok.

Das Schaltbild unter Schematics soll später folgen; es gibt aber einen Link, der funktioniert - und der landet auf dem Schaltbild des Breakout-Boards (ID:364)!! Ich habe es nicht sofort gemerkt, und mich gefragt, wie das mit der Spannungsversorgung und den Pegeln auf den Ein und Ausgängen ist. Ein Blick in die Datenblätter sagt mir, dass die max. Spannung 3,6V ist. Aus- und Eingangspegel liegen bei 3.3V. Die Frage, die ich mir stelle: Wie kann ich den Pegel anpassen? Das Tutorail zeigt nämlich das Breakout-Board mit einer zusätzlichen Pegelanpassung. Brauche ich die auch?

Dann habe ich mal im Forum bei Adafruit gesucht und bin auch fündig geworden. In einem Post vom 13.11.2012 fragt jemand nach dem Schaltbild von dem NFC-Shield. In der Antwort gibt es einen Link auf github, Dort gibt es u.a. eine .brd und eine .sch-Datei. Was zum Teufel soll/kann ich mit der Datei machen? Das zu diesem Format gehörende Programm heißt eagle und ist als Download verfügbar. Bei der Installation kann man eine freie Version mit eingeschränkten Möglichkeiten auswählen (eagle-light).

Und dann sehe ich im Schaltbild (*.sch-Datei) , was ich brauche:

Copyright Adafruit
Beide Leitungen, sowohl die SDA als auch die SCL haben je einen Pegelwandler (Levelshifter) verwendet. Die IRQ-Leitung benötigt keinen Pegelwandler, da es ein Ausgang ist und der Arduino-Eingang mit den 3.3V spielend leicht fertig werden sollte.

Auch die Frage nach der Versorgungsspannung wird durch das Schaltbild klar:
Copyright Adafruit
Das Shield hat einen eigenen Festspannungsregler "onboard". Der macht aus 5V die notwendigen 3.3V.

Die Platine hat also alles, was mein Herz begehrt!

Aber wo ist denn was auf der Platine? Dazu schau ich morgen mal auf die *.brd-Datei.





.