<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>[ N O C T E R N I T Y ]</title>
	<atom:link href="http://www.nocternity.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nocternity.net</link>
	<description>Contributing to the general pollution of the internet</description>
	<lastBuildDate>Wed, 27 Mar 2013 11:47:52 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Playing with Asterisk (4/?) &#8211; Voice mail</title>
		<link>http://www.nocternity.net/en/2013/03/27/playing-with-asterisk-4/</link>
		<comments>http://www.nocternity.net/en/2013/03/27/playing-with-asterisk-4/#comments</comments>
		<pubDate>Wed, 27 Mar 2013 11:47:52 +0000</pubDate>
		<dc:creator>Emmanuel Benoît</dc:creator>
				<category><![CDATA[Systems administration]]></category>
		<category><![CDATA[The LAN]]></category>
		<category><![CDATA[asterisk]]></category>
		<category><![CDATA[dial plan]]></category>
		<category><![CDATA[noob]]></category>
		<category><![CDATA[phones]]></category>
		<category><![CDATA[voicemail]]></category>

		<guid isPermaLink="false">https://www.nocternity.net/?p=770</guid>
		<description><![CDATA[Even in the context of a home set-up, voice mail is a "must-have" feature. My idea is to have a set of voicemail boxes - one per person, and a global "family" mailbox. Ideally, local phones / softphones should be able to access the corresponding mailboxes (the mailbox of the phone's owner and the family [...]]]></description>
				<content:encoded><![CDATA[<p>Even in the context of a home set-up, voice mail is a "must-have" feature. My idea is to have a set of voicemail boxes - one per person, and a global "family" mailbox. Ideally, local phones / softphones should be able to access the corresponding mailboxes (the mailbox of the phone's owner and the family mailbox) without having to type a password, but other mailboxes should still be available with an identifier and passwords on all internal phones.</p>
<h1>Basic set-up</h1>
<p>Before trying to do that, I created a simple set-up that only worked for one of the test lines, and always required credentials to access. The first thing to configure is the voice mail application itself. I had to re-enable the <em>app_voicemail.so</em> module, and write a configuration file for the application (aptly named <em>voicemail.conf</em>). I also wanted email notifications with the message attached. Finally, I noticed the options of having the system force setting greeting messages and password when initially logging in, and that seemed interesting. Here is the resulting configuration file.</p>
<pre class="brush:plain">[general]
format=wav49|gsm|wav

serveremail=phones@nocternity.net
fromstring=Téléphonie
attach=yes
emaildateformat=%A, %d %B %Y at %H:%M:%S
sendvoicemail=yes
charset=UTF-8

maxmsg=100
maxsecs=180
minsecs=3 
maxgreet=90
maxsilence=2 
silencethreshold=128

moveheard=yes
review=yes
forcename=yes
forcegreetings=yes

maxlogins=3
minpassword=4 

[zonemessages]
; Empty

[default]
1 =&gt; 1,Emmanuel Benoît,tseeker@nocternity.net</pre>
<p>I left the <em>zonemessages</em> section empty, because I really don't care about that feature; as for the password, it is set to "1" on my user in order to cause the voice mail application to force me to set it when I connect to it.</p>
<p>The next thing to configure was the dial plan. I had to modify one of the extensions for the internal phones in order to have it fall back on the voice mail when necessary. I initially used the following configuration:</p>
<pre class="brush:plain">exten =&gt; 100,1,Dial(${DIAL_TEST1},10,tT)
	exten =&gt; 100,n,Voicemail(1@default)
	exten =&gt; 100,n,Hangup()</pre>
<p>The new argument to <em><strong>Dial()</strong></em> simply indicates the maximal ringing time before falling back to the voice mail. In this case, "ring for 10 seconds and fall back to the voice mail if there is no response".</p>
<p>I also had to add an extension that would give users (namely, me) access to their voice mail:</p>
<pre class="brush:plain">exten =&gt; 666,1,VoiceMailMain()
	exten =&gt; 666,n,Hangup()</pre>
<p>Finally, I modified the voice mail fall-back  in order to play either the "busy" greeting or the "unavailable" greeting, depending on the <em><strong>Dial()</strong></em> application's result. This took me a while to figure out due to the somewhat twisted syntax.</p>
<pre class="brush:plain">exten =&gt; 100,1,Dial(${DIAL_TEST1},10,tT)
		exten =&gt; 100,n,Voicemail(1@default,${IF($["${DIALSTATUS}" = "BUSY"]?b:u)})
		exten =&gt; 100,n,Hangup()</pre>
<h4>Note about voice mail notifications</h4>
<p>I tried setting up voice mail notifications for the SIP clients, by adding the following to their section in the <em>sip.conf</em> file:</p>
<pre class="brush:plain">mailbox=1@default</pre>
<p>However, linphone does not appear to support this (it causes a warning on Asterisk's side), and the other free (<em>not</em> as in beer) softphones I tried had a tendency to blow up in my face.</p>
<h1>General set-up</h1>
<p>I needed to make quite a few changes in order to implement the idea I mentioned in this post's introduction.</p>
<h5>Voice mail fall-backs for all phones</h5>
<p>First, having a voice mail fall-back for all phones. In order to do that without the configuration becoming a copy-pasted mess, I had to learn about macros, which are basically dial plan sections which can be invoked from other areas of the dial plan. Here's the macro I used for the voice mail fall-back:</p>
<pre class="brush:plain">[macro-internal-call]

exten =&gt; s,1,Dial(${ARG1},10,tT)
	exten =&gt; s,n,Voicemail(${ARG2}@default,${IF($["${DIALSTATUS}" = "BUSY"]?b:u)})
	exten =&gt; s,n,Hangup()</pre>
<p>This macro takes two arguments: the phone(s) to dial, and the voice mail box to fall back to. It then needs to be used in place of the internal phones' extensions:</p>
<pre class="brush:plain">exten =&gt; 100,1,Macro(internal-call,${DIAL_TEST1},1)
exten =&gt; 101,1,Macro(internal-call,${DIAL_TEST2},1)
exten =&gt; 102,1,Macro(internal-call,${DIAL_TEST3},2)</pre>
<p>(I'd added box #2 and #9 in the meantime.) I also had to "emulate" that family voice mail box. I simply added the following extension:</p>
<pre class="brush:plain">exten =&gt; 999,1,Macro(internal-call,${DIAL_TEST1}&amp;${DIAL_TEST2}&amp;${DIAL_TEST3},9)</pre>
<p>... which will cause all phones to ring when dialed, and fall back on mailbox #9.</p>
<h5>Password-less access to voice mail</h5>
<p>The next step was to allow clients to access their own voice mail, as well as the global one, without password. I started by changing the contexts for SIP clients to something that corresponds to their owners in <em>sip.conf</em>:</p>
<pre class="brush:plain">; ...

[test1](test-template)
        context=phones-tseeker
        ;...

[test2](test-template)
        context=phones-tseeker
        ;...

[test3](test-template)
        context=phones-ju
        ;...</pre>
<p>Of course, I then needed to define these contexts in the dial plan. However, I wanted to avoid having to copy/paste common configuration; this is where the <em><strong>include</strong></em> thing comes in. It allows the extensions listed in another section to be considered. The modified <em>extensions.conf</em> looked somewhat like this:</p>
<pre class="brush:plain">[phones-tseeker]

        include =&gt; tests
        include =&gt; phones

[phones-ju]

        include =&gt; tests
        include =&gt; phones

[tests]

        ; Various 8378-prefixed tests here

[phones]

exten =&gt; 100,1,Macro(internal-call,${DIAL_TEST1},1)
; etc...

exten =&gt; 666,1,VoiceMailMain()
        exten =&gt; 666,n,Hangup()</pre>
<p>Finally, I added the lines allowing direct access to the voice mail to each "owner-specific" section:</p>
<pre class="brush:plain">[phones-tseeker]

        include =&gt; tests
        include =&gt; phones

exten =&gt; 700,1,VoiceMailMain(1@default,s)
        exten =&gt; 700,n,Hangup()
exten =&gt; 701,1,VoiceMailMain(9@default,s)
        exten =&gt; 701,n,Hangup()

[phones-ju]

        include =&gt; tests
        include =&gt; phones

exten =&gt; 700,1,VoiceMailMain(2@default,s)
        exten =&gt; 700,n,Hangup()
exten =&gt; 701,1,VoiceMailMain(9@default,s)
        exten =&gt; 701,n,Hangup()</pre>
<h1>Some thoughts for later</h1>
<p>I think it would be best if all internal numbers were prefixed with something that is not associated with outgoing calls at all. The "star" key seems like a decent prefix. In addition, it would be a good idea to make the various extensions and voice mail box numbers a little more rational and consistent.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nocternity.net/en/2013/03/27/playing-with-asterisk-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Playing with Asterisk (3/?) &#8211; A menu (sort of)</title>
		<link>http://www.nocternity.net/en/2013/03/26/playing-with-asterisk-3/</link>
		<comments>http://www.nocternity.net/en/2013/03/26/playing-with-asterisk-3/#comments</comments>
		<pubDate>Tue, 26 Mar 2013 08:37:26 +0000</pubDate>
		<dc:creator>Emmanuel Benoît</dc:creator>
				<category><![CDATA[Systems administration]]></category>
		<category><![CDATA[The LAN]]></category>
		<category><![CDATA[asterisk]]></category>
		<category><![CDATA[dial plan]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[noob]]></category>
		<category><![CDATA[phones]]></category>

		<guid isPermaLink="false">https://www.nocternity.net/?p=763</guid>
		<description><![CDATA[I wanted to try adding something that sort of feels like a menu to the dial plan. I am not sure that I will actually use one in the final setup, but it wasn't that much effort anyway. A menu (or something with similar functionality) can be implemented using either Background() or WaitExten(). Or both, [...]]]></description>
				<content:encoded><![CDATA[<p>I wanted to try adding something that sort of feels like a menu to the dial plan. I am not sure that I will actually use one in the final setup, but it wasn't that much effort anyway.</p>
<p>A menu (or something with similar functionality) can be implemented using either <em><strong>Background()</strong></em> or <em><strong>WaitExten()</strong></em>. Or both, actually. Since I don't have anything to play as a prompt, I chose to do with the latter only. After all, this is only a test.</p>
<p>First, I replaced the previous test with the following:</p>
<pre class="brush:plain">[test]

exten =&gt; 8378,1,Answer()
        exten =&gt; 8378,n,Set(TESTCOUNT=0)
        exten =&gt; 8378,n,Goto(numbers,0,1)</pre>
<p>This will cause Asterisk to answer calls to 8378 ("test"), set a channel-specific variable called <em>TESTCOUNT</em> to zero, and jump to extension 0 of the <em>numbers</em> section in the dial plan. The idea is to accumulate the digits typed by the user, and then to have Asterisk say that number. So, for each possible digit, the section will contain something like this:</p>
<pre class="brush:plain">[numbers]

exten =&gt; 0,1,Set(TESTCOUNT=$[ ${TESTCOUNT} * 10 ])
        exten =&gt; 0,n,WaitExten()
exten =&gt; 1,1,Set(TESTCOUNT=$[ ${TESTCOUNT} * 10 + 1 ])
        exten =&gt; 1,n,WaitExten()
; ... Same thing for 2 - 9 here ...</pre>
<p>Finally, pressing the star key will cause the system to say the number (using <em><strong>SayNumber()</strong></em>) that was typed and to hangup.</p>
<pre class="brush:plain">    exten =&gt; *,1,SayNumber(${TESTCOUNT})
	    exten =&gt; *,n,Hangup()</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.nocternity.net/en/2013/03/26/playing-with-asterisk-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Playing with Asterisk (2/?)</title>
		<link>http://www.nocternity.net/en/2013/03/21/playing-with-asterisk-2/</link>
		<comments>http://www.nocternity.net/en/2013/03/21/playing-with-asterisk-2/#comments</comments>
		<pubDate>Thu, 21 Mar 2013 15:56:21 +0000</pubDate>
		<dc:creator>Emmanuel Benoît</dc:creator>
				<category><![CDATA[Systems administration]]></category>
		<category><![CDATA[The LAN]]></category>
		<category><![CDATA[asterisk]]></category>
		<category><![CDATA[dial plan]]></category>
		<category><![CDATA[noob]]></category>
		<category><![CDATA[phones]]></category>
		<category><![CDATA[sip]]></category>
		<category><![CDATA[voip]]></category>

		<guid isPermaLink="false">https://www.nocternity.net/?p=750</guid>
		<description><![CDATA[Last time I managed to get a very basic Asterisk setup to work. Since then, I haven't had the time to really work on it, but I've made a few improvements here and there. Dial plan improvements In quite a few documents I read, dial plans always include a Hangup() line for all extensions, whatever [...]]]></description>
				<content:encoded><![CDATA[<p>Last time I managed to get a very basic Asterisk setup to work. Since then, I haven't had the time to really work on it, but I've made a few improvements here and there.</p>
<h1>Dial plan improvements</h1>
<p>In quite a few documents I read, dial plans always include a <strong><em>Hangup()</em></strong> line for all extensions, whatever they contain. I'm not 100% sure it's actually useful, but I added it anyway:</p>
<pre class="brush:plain">exten =&gt; 100,1,Dial(SIP/test1)
        exten =&gt; 100,2,Hangup()

exten =&gt; 101,1,Dial(SIP/test2)
        exten =&gt; 101,2,Hangup()</pre>
<p>One of the things that was a little scary about the dial plan in general was the fact that I would have needed to renumber all lines for an extension if I wanted to insert stuff in one of its parts. That would have been rather annoying. As it turns out, Asterisk supports using "<em>n</em>" as the priority field in the dial plan's extension definitions. Using it causes Asterisk to handle the "line numbering" automatically (with the exception of the first line that still needs to be 1):</p>
<pre class="brush:plain">exten =&gt; 8378,1,Answer()
        exten =&gt; 8378,n,Playback(hello-world)
        exten =&gt; 8378,n,Hangup

exten =&gt; 100,1,Dial(SIP/test1)
        exten =&gt; 100,n,Hangup()

exten =&gt; 101,1,Dial(SIP/test2)
        exten =&gt; 101,n,Hangup()</pre>
<p>Finally, I started using global variables to define the dialing targets, which would make it much easier to change if I needed to:</p>
<pre class="brush:plain">[globals]
        DIAL_TEST1=SIP/test1
        DIAL_TEST2=SIP/test2

[test]

; ...

exten =&gt; 100,1,Dial(${DIAL_TEST1})
        exten =&gt; 100,n,Hangup()

; ...</pre>
<p>Granted, it is "a little" pointless in this context, but it will come in handy later.</p>
<h1>Caller IDs for SIP clients</h1>
<p>I also added caller IDs for SIP clients. It is extremely simple to do that by simply adding a line that looks like this...</p>
<pre class="brush:plain">        callerid="TSeeker's mobile" &lt;101&gt;</pre>
<p>...to a SIP client's configuration.</p>
<h1>Transferring calls</h1>
<p>One other thing I added is the ability to transfer calls. First, I started by creating a <em>features.conf</em> file in order to define the DTMF sequences to use. Here's what it contains:</p>
<pre class="brush:plain">[general]
        ; Empty

[featuremap]
        blindxfer =&gt; #1
        atxfer =&gt; #2

[applicationmap]
        ; Empty</pre>
<p>This is not strictly necessary, as the defaults can be used. Anyway - the next step is to enable the functionality when calls are being made. This is done from the dial plan:</p>
<pre class="brush:plain">; ...
exten =&gt; 100,1,Dial(${DIAL_TEST1},,tT)
; ...</pre>
<p>In this specific case, I want to allow both sides to transfer the calls, as these are internal phones anyway (I added a third client on Ju's also-microphone-less PC to run tests).</p>
<h1>Miscellaneous changes</h1>
<p>Amongst other minor changes, I also re-configured logging using the following configuration in <em>logger.conf</em>:</p>
<pre class="brush:plain">[general]
        ; Empty

[logfiles]
        console =&gt; notice,warning,error,debug
        messages =&gt; notice,warning,error</pre>
<p>No need for Asterisk-based log file rotation as the Debian package handles that using logrotate.</p>
<p>I also modified <em>modules.conf</em> to remove more currently useless modules (it's just a bunch of <em>noload</em>'s for stuff I know I'm not gonna need so I'm not pasting this here).</p>
<p>Finally, I did not add IPv6 support yet, as I need to upgrade to 1.8 for that and I figured IPv4 would be fine for testing purposes; I don't expect many things to change because of IPv6 support anyway (although I may be wrong).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nocternity.net/en/2013/03/21/playing-with-asterisk-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Playing with Asterisk (1/?)</title>
		<link>http://www.nocternity.net/en/2013/03/19/playing-with-asterisk-1/</link>
		<comments>http://www.nocternity.net/en/2013/03/19/playing-with-asterisk-1/#comments</comments>
		<pubDate>Tue, 19 Mar 2013 10:48:44 +0000</pubDate>
		<dc:creator>Emmanuel Benoît</dc:creator>
				<category><![CDATA[Systems administration]]></category>
		<category><![CDATA[The LAN]]></category>
		<category><![CDATA[asterisk]]></category>
		<category><![CDATA[noob]]></category>
		<category><![CDATA[phones]]></category>
		<category><![CDATA[voip]]></category>

		<guid isPermaLink="false">https://www.nocternity.net/?p=733</guid>
		<description><![CDATA[The long term "plan" here at home is to switch over to VoIP for all phone calls. This includes getting rid of our old POTS phones, using softphones on the PCs, possibly buying hardware VoIP phones or, if I ever get the time to finish playing with the STM32 board, making our own; it also [...]]]></description>
				<content:encoded><![CDATA[<p>The long term "plan" here at home is to switch over to VoIP for all phone calls. This includes getting rid of our old POTS phones, using softphones on the PCs, possibly buying hardware VoIP phones or, if I ever get the time to finish playing with the STM32 board, making our own; it also implies subscribing to a pair of SIP lines and using a board to connect our POTS line to the network.</p>
<p>There's a catch, tho: I've never used Asterisk (or any other kind of VoIP software), and it seems to be rather complex. So before we do anything, I'm going to be exploring its configuration a little when I have some time and nothing more important to do.</p>
<p>Since I'm basically a complete newbie when it comes to it, I'll try and post about it as it might be useful to someone in a similar situation.</p>
<h1>System</h1>
<p>Before I go on, it should be noted that I am working with a Debian Squeeze system, running inside a Xen VM. That VM is on a network that has both IPv4 and IPv6 stacks. The idea is to have everything local going through IPv6, with support for IPv4 through NAT (which means the Linux routers here need to have <em>nf_conntrack_sip</em> and <em>nf_nat_sip</em> loaded; the VM itself only has <em>nf_conntrack_sip</em>). While I've read that NAT is terrible when it comes to SIP (and for everything else), I'm afraid I don't have much choice on the matter.</p>
<p>For now I won't be doing anything that requires specific hardware, as it is a bit pointless to buy a €700 board if you're not even remotely sure you can do what you need to with it.</p>
<p>I have ordered a pair of webcams that include microphones, and they should arrive in a few days. At the moment, however, the PCs here have no way to record sound, so my ability to test with them is limited. I figured I could use my mobile phone for testing, though. I installed Linphone on both my PC and my smartphone.</p>
<h1>Installing Asterisk</h1>
<p>This is a Debian system so  it's rather easy to install Asterisk and its various dependencies:</p>
<pre class="brush:plain">apt-get install asterisk</pre>
<p>Ok, I actually removed some recommended dependencies I won't be needing (either "for now" or "permanently").</p>
<p>The Debian package comes with a metric ton of sample configuration files under <em>/etc/asterisk</em>; while these are rather handy to have around as they are very well commented, I moved them out of the way as I prefer writing my own configuration from scratch.</p>
<h1>First steps</h1>
<p>So, the first thing I want to do is set up the server so it is possible to connect to it. That's the definition of "minimal configuration", but one has to start somewhere.</p>
<p>I left both <em>asterisk.conf</em> and <em>modules.conf</em> mostly untouched (with the exception of comments being removed), although I'll probably have to remove some modules when I have a better idea of what I'm doing. Most of the action here takes place in <em>sip.conf</em>:</p>
<pre class="brush:plain">[general]
        context=default
        allowoverlap=no
        udpbindaddr=0.0.0.0
        tcpenable=no
        srvlookup=yes

[test1]
        type=friend
        host=dynamic
        canreinvite=no
        nat=yes
        context=default
        dtmfmode=rfc2833
        allow=all
        username=test1
        secret=...</pre>
<p>The <em>general</em> section is basically the default, followed by a test user which I can use to try and connect to the server. I also included an empty dial plan (while I'm not sure it was necessary, I figured it wouldn't hurt):</p>
<pre class="brush:plain">[general]
static=yes
writeprotect=no
clearglobalvars=no

[globals]
; No variables

[default]
; Empty context</pre>
<p>After some tinkering with the Linphone configuration (I needed to add a proxy account, using <em>sip:test1@server-ip</em> as the identity and <em>sip:<em>server-ip</em></em> as the proxy address), I was able to get it to connect to the server.</p>
<h1>A basic dial plan</h1>
<p>The next logical step was to try and have the client dialing, with the server responding with something. Fortunately, Asterisk comes with a lovely <em>hello-world.gsm</em> file.</p>
<p>First I modified my test user so that its default context would be something other than <em>default</em>. I called that new context <em>test</em>. For some reason.  Then I created a simple dial plan that would cause the server to answer, play the "hello world" sound, and hangup, when the client dials "1".</p>
<pre class="brush:plain">[test]
exten =&gt; 1,1,Answer()
exten =&gt; 1,2,Playback(hello-world)
exten =&gt; 1,3,Hangup</pre>
<p>And "1" was dialed, and "Hello world" was heard, and it was good.</p>
<h1>Two accounts</h1>
<p>Having done that, I decided to try implementing calls between SIP clients. Of course, since only one of the two SIP clients has a microphone, my ability to test is limited.</p>
<p>So, I wanted to add a second SIP client. Since its configuration would end up being mostly the same as the one I already had, I decided to use a template for the clients. Here's the resulting sip.conf:</p>
<pre class="brush:plain">[test-template](!)
        type=friend
        host=dynamic
        canreinvite=no
        nat=yes
        context=test
        dtmfmode=rfc2833
        allow=all

[test1](test-template)
        username=test1
        secret=...

[test2](test-template)
        username=test2
        secret=...</pre>
<p>Then I had to add a few lines to the dial plan in order to allow dialing between one client and the other. It only takes two new lines in the dial plan:</p>
<pre class="brush:plain">exten =&gt; 100,1,Dial(SIP/test1)
exten =&gt; 101,1,Dial(SIP/test2)</pre>
<p>Because I don't have WiFi here, I had to whitelist the phone carrier's IP range on the firewall to let it connect to the server. The configuration of Linphone uses the server's <em>internal</em> IPv4 address (i.e. its address on the LAN here) as the domain, and the IPv4 address of the DSL connection as the proxy. With this configuration, I was able to call the phone from the PC and vice-versa.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nocternity.net/en/2013/03/19/playing-with-asterisk-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stuck on the CS43L22</title>
		<link>http://www.nocternity.net/en/2012/11/13/stuck-on-the-cs43l22/</link>
		<comments>http://www.nocternity.net/en/2012/11/13/stuck-on-the-cs43l22/#comments</comments>
		<pubDate>Tue, 13 Nov 2012 06:29:20 +0000</pubDate>
		<dc:creator>Emmanuel Benoît</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[cs43l22]]></category>
		<category><![CDATA[fail]]></category>
		<category><![CDATA[microcontroller]]></category>
		<category><![CDATA[sound]]></category>
		<category><![CDATA[stm32]]></category>
		<category><![CDATA[useless]]></category>

		<guid isPermaLink="false">https://www.nocternity.net/?p=723</guid>
		<description><![CDATA[I have not been making much progress lately. I am trying to get the board to produce sound through its CS23L22 chip. So far, I've managed to: make it accept commands through I2C (which I know succeeded because, well, the commands do not timeout), enable and configure the I2S bus. I've been sending data on [...]]]></description>
				<content:encoded><![CDATA[<p>I have not been making much progress lately. I am trying to get the board to produce sound through its <a title="CS43L22" href="http://www.cirrus.com/en/products/cs43l22.html">CS23L22</a> chip. So far, I've managed to:</p>
<ul>
<li>make it accept commands through I2C (which I know succeeded because, well, the commands do not timeout),</li>
<li>enable and configure the I2S bus.</li>
</ul>
<p>I've been sending data on it (basically a simple 440Hz sine wave), but there is no output. I know the bus' clock is configured correctly, because I've been pumping the data onto it directly through SPI3's data register, and toggling a LED every 22100 samples, which works just right (the LED blinks with a period of 2s). I also know that the chip works (because it does produce sound when I run the board's original firmware).</p>
<p>I'm quite sure it's something extremely silly I'm forgetting to do, or doing in the wrong order somewhere... but I have no clue where and what it is.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nocternity.net/en/2012/11/13/stuck-on-the-cs43l22/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RS232 != TTL</title>
		<link>http://www.nocternity.net/en/2012/11/07/rs232-ttl/</link>
		<comments>http://www.nocternity.net/en/2012/11/07/rs232-ttl/#comments</comments>
		<pubDate>Wed, 07 Nov 2012 19:28:14 +0000</pubDate>
		<dc:creator>Emmanuel Benoît</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[microcontroller]]></category>
		<category><![CDATA[rs232]]></category>
		<category><![CDATA[ttl]]></category>

		<guid isPermaLink="false">https://www.nocternity.net/?p=709</guid>
		<description><![CDATA[Ok, I've said it before, but repeating it one more time won't hurt: when it comes to electronics or hardware, I am completely ignorant. So, yesterday morning, I spent the best part of 3 hours trying to plug the STM32's UART ports on a PC DE9 interface, trying to get the code to work and [...]]]></description>
				<content:encoded><![CDATA[<p>Ok, I've said it before, but repeating it one more time won't hurt: when it comes to electronics or hardware, I am completely ignorant. So, yesterday morning, I spent the best part of 3 hours trying to plug the STM32's UART ports on a PC DE9 interface, trying to get the code to work and fiddling with Minicom's settings.</p>
<p>Then I looked it up. As it turns out, signals from the microcontroller are encoded using TTL (where a voltage close to 0V indicates a zero, while a voltage close to the chip's power supply voltage indicates a one), while RS232 relies on a negative voltage to indicate a zero.</p>
<p><em>*cough*</em> I felt really silly.</p>
<p>So I looked up how to interface both. There are many schematics and explanation on the web; <a title="TTL-to-RS232 adaptator explained" href="http://www.uchobby.com/index.php/2007/06/11/ttl-to-rs232-adaptor-explained/">this explanation</a> is quite good, and I ended up using their schematics and some parts I already had to build one (well, I didn't add the LEDs because I didn't see much point in these).</p>
<p>Here's the result:</p>
<p><a href="/wp-content/uploads/2012/11/IMAG0129.jpg" rel="lightbox[709]"><img class="aligncenter size-full wp-image-712" title="RS232-TTL adaptator" src="/wp-content/uploads/2012/11/IMAG0129.jpg" alt="" width="550" height="329" /></a></p>
<p><a href="/wp-content/uploads/2012/11/IMAG0130.jpg" rel="lightbox[709]"><img class="aligncenter size-full wp-image-713" title="RS232-TTL adaptor, close-up" src="/wp-content/uploads/2012/11/IMAG0130.jpg" alt="" width="550" height="329" /></a></p>
<p>And, if that can help, here are the schematics for the board itself (not exactly the one shown above, as I'd made a bit of a mistake):</p>
<p><a href="/wp-content/uploads/2012/11/rs232-ttl1.png" rel="lightbox[709]"><img class="aligncenter size-full wp-image-715" title="RS232-TTL adaptor board schematics" src="/wp-content/uploads/2012/11/rs232-ttl1.png" alt="" width="779" height="326" /></a></p>
<p>And the list of parts:</p>
<table>
<tbody>
<tr>
<th style="text-align: center;" colspan="2">Parts</th>
</tr>
<tr>
<td style="text-align: right;">R1 R2 R3 R4 R5</td>
<td style="text-align: left;">10kΩ</td>
</tr>
<tr>
<td style="text-align: right;">C1</td>
<td style="text-align: left;">10µF, 50V</td>
</tr>
<tr>
<td style="text-align: right;">D1</td>
<td style="text-align: left;">1N914</td>
</tr>
<tr>
<td style="text-align: right;">Q1</td>
<td style="text-align: left;">2N3906</td>
</tr>
<tr>
<td style="text-align: right;">Q2</td>
<td style="text-align: left;">2N3904</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.nocternity.net/en/2012/11/07/rs232-ttl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A little progress</title>
		<link>http://www.nocternity.net/en/2012/11/04/a-little-progress/</link>
		<comments>http://www.nocternity.net/en/2012/11/04/a-little-progress/#comments</comments>
		<pubDate>Sun, 04 Nov 2012 17:21:38 +0000</pubDate>
		<dc:creator>Emmanuel Benoît</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[itdb02-4.3]]></category>
		<category><![CDATA[microcontroller]]></category>
		<category><![CDATA[useless]]></category>

		<guid isPermaLink="false">https://www.nocternity.net/?p=704</guid>
		<description><![CDATA[I managed to get the TFT screen working this afternoon. For now I'm using bit-banging both to initialise the board and access the framebuffer, the idea being to try and use it with the STM32F4's FSMC later. I'm a little disappointed that the backlight is hardwired to the module's power supply (which means the SSD1963's [...]]]></description>
				<content:encoded><![CDATA[<p>I managed to get the TFT screen working this afternoon. For now I'm using bit-banging both to initialise the board and access the framebuffer, the idea being to try and use it with the STM32F4's FSMC later. I'm a little disappointed that the backlight is hardwired to the module's power supply (which means the SSD1963's backlight control can't be used) and that the tearing output pin is not connected at all. Ah well.</p>
<p><a href="/wp-content/uploads/2012/11/IMAG0123.jpg" rel="lightbox[704]"><img class="aligncenter size-full wp-image-705" title="First test pattern" src="/wp-content/uploads/2012/11/IMAG0123.jpg" alt="" width="479" height="800" /></a></p>
<p>This one actually moves:<br />
<a href="/wp-content/uploads/2012/11/IMAG0125.jpg" rel="lightbox[704]"><img class="aligncenter size-full wp-image-706" title="Second test pattern" src="/wp-content/uploads/2012/11/IMAG0125.jpg" alt="" width="550" height="361" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nocternity.net/en/2012/11/04/a-little-progress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Goa&#8217;uld cat</title>
		<link>http://www.nocternity.net/en/2012/11/03/goauld-cat/</link>
		<comments>http://www.nocternity.net/en/2012/11/03/goauld-cat/#comments</comments>
		<pubDate>Sat, 03 Nov 2012 16:31:00 +0000</pubDate>
		<dc:creator>Emmanuel Benoît</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">https://www.nocternity.net/?p=696</guid>
		<description><![CDATA[Featuring a rather unusual sarcophagus.]]></description>
				<content:encoded><![CDATA[<p>Featuring a rather unusual sarcophagus.</p>
<p><a href="/wp-content/uploads/2012/11/goauld-cat.jpg" rel="lightbox[696]"><img class="aligncenter size-full wp-image-698" title="Goa'uld cat" src="/wp-content/uploads/2012/11/goauld-cat.jpg" alt="" width="434" height="636" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nocternity.net/en/2012/11/03/goauld-cat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Toys</title>
		<link>http://www.nocternity.net/en/2012/11/03/toys/</link>
		<comments>http://www.nocternity.net/en/2012/11/03/toys/#comments</comments>
		<pubDate>Sat, 03 Nov 2012 16:11:05 +0000</pubDate>
		<dc:creator>Emmanuel Benoît</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[microcontroller]]></category>
		<category><![CDATA[useless]]></category>

		<guid isPermaLink="false">https://www.nocternity.net/?p=681</guid>
		<description><![CDATA[Just bought a few interesting toys: The ITDB02-4.3 module includes a 480x272 LCD screen controlled by an SSD1963 chip, a resistive touch screen controlled by an XPT2046, and a SD card slot. For now, I only managed to get the touchscreen working (I've never programmed for an MCU before, so I'm a bit slow). My [...]]]></description>
				<content:encoded><![CDATA[<p>Just bought a few interesting toys:</p>
<p><a href="/wp-content/uploads/2012/11/P1010055.jpg" rel="lightbox[681]"><img class="aligncenter size-large wp-image-682" title="STM32F4 Discovery" src="/wp-content/uploads/2012/11/P1010055-1024x768.jpg" alt="" width="550" height="412" /></a></p>
<p><a href="/wp-content/uploads/2012/11/P1010056.jpg" rel="lightbox[681]"><img class="aligncenter size-large wp-image-683" title="ITDB02-4.3 screen module" src="/wp-content/uploads/2012/11/P1010056-1024x768.jpg" alt="" width="550" height="412" /></a></p>
<p>The ITDB02-4.3 module includes a 480x272 LCD screen controlled by an SSD1963 chip, a resistive touch screen controlled by an XPT2046, and a SD card slot. For now, I only managed to get the touchscreen working (I've never programmed for an MCU before, so I'm a bit slow). My screwing around with the board and module can be found on <a title="TSeeker's STM32F4 Discovery code" href="https://github.com/tseeker/stm32f4-discovery">GitHub</a>.</p>
<p><a href="/wp-content/uploads/2012/11/IMAG0121.jpg" rel="lightbox[681]"><img class="aligncenter size-large wp-image-689" title="STM32F4 Discovery and ITDB02-4.3 module" src="/wp-content/uploads/2012/11/IMAG0121-613x1024.jpg" alt="" width="550" height="918" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nocternity.net/en/2012/11/03/toys/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mass destruction</title>
		<link>http://www.nocternity.net/en/2011/10/25/mass-destruction/</link>
		<comments>http://www.nocternity.net/en/2011/10/25/mass-destruction/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 09:59:57 +0000</pubDate>
		<dc:creator>Julie Bourbeillon</dc:creator>
				<category><![CDATA[Our house]]></category>
		<category><![CDATA[bedroom]]></category>
		<category><![CDATA[corridor]]></category>
		<category><![CDATA[dining room]]></category>
		<category><![CDATA[drywall]]></category>
		<category><![CDATA[floating floor]]></category>
		<category><![CDATA[hall]]></category>
		<category><![CDATA[living room]]></category>
		<category><![CDATA[moquette]]></category>
		<category><![CDATA[panelling]]></category>
		<category><![CDATA[plaster]]></category>
		<category><![CDATA[polystyrene tiles]]></category>
		<category><![CDATA[repairs]]></category>

		<guid isPermaLink="false">https://www.nocternity.net/?p=633</guid>
		<description><![CDATA[The first stage of the repairs in the house wasn't quite in the "repair" category. Indeed, most of the work implied getting raw plaster on the walls and ceilings, removing carpet from the floor, and so on.  This task kept us busy from July to October 2009. Since it would be boring to present that [...]]]></description>
				<content:encoded><![CDATA[<p>The first stage of the repairs in the house wasn't quite in the "repair" category. Indeed, most of the work implied getting raw plaster on the walls and ceilings, removing carpet from the floor, and so on.  This task kept us busy from July to October 2009. Since it would be boring to present that kind of activities everywhere in the house, I'll present a few emblematic spots.</p>
<p>The hall is a good example of what we had to face in most rooms on the ground floor.</p>
<p><a href="/wp-content/uploads/2011/10/P1010088.jpg" rel="lightbox[633]"><img class="aligncenter size-full wp-image-634" title="Mass destruction in the hall" src="/wp-content/uploads/2011/10/P1010088.jpg" alt="" width="480" height="640" /></a></p>
<p>The wallpaper is quite easy to get rid of, but there's something much, much worse : polystyrene tiles glued on all ceilings. Not only they are  quite difficult to remove because of the position you have to be in in order to remove them, but you usually leave pieces of skin on the ceiling and end up bleeding after a few hours. Last but not least, it is impossible to remove the glue without removing pieces of plaster from the ceiling. In the end, we have ceilings which look like fields of round holes.</p>
<p>We ended up with:</p>
<ul>
<li>on the one hand somewhat "correct" walls and ceiling, if you ignore the holes which will have to be filled</li>
<li>plenty of junk which we had to bring to the waste collection centre on a regular basis. We were going there so often that the employees were almost on a first name basis with us !</li>
</ul>
<p><a href="/wp-content/uploads/2011/10/P1010120.jpg" rel="lightbox[633]"><img class="aligncenter size-full wp-image-636" title="End of the mass destruction in the hall" src="/wp-content/uploads/2011/10/P1010120.jpg" alt="" width="480" height="640" /></a></p>
<p>Another rather interesting place was the living and dining rooms. If you remember the pictures from <a title="The house: origins" href="/en/2011/10/16/the-house-origins/">the origins</a>, these rooms not only had the wonderful polystyrene tiles on the ceiling but also panelling on the walls. Manu had great fun removing them and... the glue...The work in progress provides a wonderful idea of the extent of the issue.</p>
<p><a href="/wp-content/uploads/2011/10/P1010076.jpg" rel="lightbox[633]"><img class="aligncenter size-full wp-image-639" title="Living room - mass destruction in progress" src="/wp-content/uploads/2011/10/P1010076.jpg" alt="" width="640" height="480" /></a></p>
<p>In the end, this allowed us to reach that kind of stage:</p>
<p><a href="/wp-content/uploads/2011/10/P1010147.jpg" rel="lightbox[633]"><img class="aligncenter size-full wp-image-640" title="End of the mass destruction in the dining room" src="/wp-content/uploads/2011/10/P1010147.jpg" alt="" width="640" height="480" /></a></p>
<p>Last but not least, the "situation" on the first floor... We had:</p>
<ul>
<li>The ever-present polystyrene tiles on the ceilings, of course, which were impossible to unglue without removing part of the paper of the drywalls,</li>
<li>Moquette on the floors. These went off easily, even if part of them were hidden under a floating floor.</li>
<li>Moquette on the walls. That was the real pain because some kind of paper layer remained glued on the drywalls and it was awful to unglue it.</li>
</ul>
<p>For instance, we went through that kind of stage regarding the corridor on the first floor:</p>
<p><a href="/wp-content/uploads/2011/10/P1010080.jpg" rel="lightbox[633]"><img class="aligncenter size-full wp-image-642" title="First floor corridor - work in progress" src="/wp-content/uploads/2011/10/P1010080.jpg" alt="" width="640" height="480" /></a></p>
<p>... or in one of the bedrooms:</p>
<p><a href="/wp-content/uploads/2011/10/P10100821.jpg" rel="lightbox[633]"><img class="aligncenter size-full wp-image-643" title="bedroom - work in progress" src="/wp-content/uploads/2011/10/P10100821.jpg" alt="" width="640" height="480" /></a></p>
<p>And with much effort, we managed to reach these almost final conditions:</p>
<ul>
<li>In the corridor</li>
</ul>
<p><a href="/wp-content/uploads/2011/10/P1010118.jpg" rel="lightbox[633]"><img class="aligncenter size-full wp-image-644" title="Cleaned corridor" src="/wp-content/uploads/2011/10/P1010118.jpg" alt="" width="480" height="640" /></a></p>
<ul>
<li>In the bedroom:</li>
</ul>
<p><a href="/wp-content/uploads/2011/10/P1010055.jpg" rel="lightbox[633]"><img class="aligncenter size-full wp-image-645" title="Cleaned bedroom" src="/wp-content/uploads/2011/10/P1010055.jpg" alt="" width="640" height="480" /></a></p>
<p>To be honest it was quite a depressing activity: indeed we were destroying what was somewhat decent in order to reach the raw skeleton of the house. However things would soon improve, which I will explain in a later post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nocternity.net/en/2011/10/25/mass-destruction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
