<?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>EquinoxeFR &#187; Embarqué &raquo; EquinoxeFR</title>
	<atom:link href="http://www.equinoxefr.org/post/tag/embarque/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.equinoxefr.org</link>
	<description>DIY Lab</description>
	<lastBuildDate>Sun, 05 Feb 2012 21:33:11 +0000</lastBuildDate>
	<language>fr</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Agent d&#8217;inventaire OCS-NG et clients légers</title>
		<link>http://www.equinoxefr.org/post/2011/12/27/agent-dinventaire-ocs-ng-et-clients-legers/</link>
		<comments>http://www.equinoxefr.org/post/2011/12/27/agent-dinventaire-ocs-ng-et-clients-legers/#comments</comments>
		<pubDate>Tue, 27 Dec 2011 11:07:14 +0000</pubDate>
		<dc:creator>EquinoxeFR</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[agent]]></category>
		<category><![CDATA[Embarqué]]></category>
		<category><![CDATA[inventaire]]></category>
		<category><![CDATA[ocs-ng]]></category>
		<category><![CDATA[Planet-Libre]]></category>
		<category><![CDATA[t5tux]]></category>

		<guid isPermaLink="false">http://www.equinoxefr.org/?p=1354</guid>
		<description><![CDATA[Depuis quelques années nous utilisons des clients légers HP pour lesquels nous avons développé une image sous linux (t5tux). Cette drôle d&#8217;idée présente de nombreux avantages: On ne dépend de personne pour les mises à jour des client ( RDP, Citrix et autres&#8230; ). Cette image a été faite quand HP ne proposait pas linux &#8230; </p><p><a class="more-link block-button" href="http://www.equinoxefr.org/post/2011/12/27/agent-dinventaire-ocs-ng-et-clients-legers/">Lire la Suite &#187;</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.equinoxefr.org/wp-content/uploads/2011/12/t5.jpg" rel="lightbox[1354]"><img class="aligncenter size-full wp-image-1355" title="t5" src="http://www.equinoxefr.org/wp-content/uploads/2011/12/t5.jpg" alt="" width="220" height="220" /></a></p>
<p>Depuis quelques années nous utilisons des clients légers HP pour lesquels nous avons développé une image sous linux (<a href="http://linuxfr.org/news/naissance-de-t5tux">t5tux</a>). Cette drôle d&#8217;idée présente de nombreux avantages:</p>
<ul>
<li>On ne dépend de personne pour les mises à jour des client ( RDP, Citrix et autres&#8230; ).</li>
<li>Cette image a été faite quand HP ne proposait pas linux sur ses clients légers.</li>
<li>La même image fonctionne sur plusieurs générations de clients.</li>
<li>La config est téléchargée en TFTP.</li>
<li>L&#8217;image se met à jour toute seule avec PXE.</li>
<li>On apprend plein de choses&#8230;</li>
</ul>
<p>Bref&#8230; l&#8217;histoire continue avec un nouveau problème: inventorier ces postes avec <a href="http://www.ocsinventory-ng.org/en/" target="_blank">OCS-NG</a>.</p>
<p>OCS dispose d&#8217;un agent d&#8217;inventaire pour linux mais celui-ci est assez lourd. De plus, il dispose d&#8217;un grand nombre de fonctionnalités inutiles dans notre cas. Nous souhaitons un minimum d&#8217;infos: numéro de série, model, ip, mac&#8230;</p>
<p>La communication entre l&#8217;agent et le serveur se fait avec un fichier XML compressé ou non avec ZLIB et transmis dans une reqûete de type POST. Pourquoi ne pas générer un XML minimaliste et l&#8217;envoyer nous même ?</p>
<p>Un simple script bash, épaulé de quelques utilitaires: dmidecode, busybox, wget fera l&#8217;affaire.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #666666; font-style: italic;">#! /bin/sh</span>
&nbsp;
<span style="color: #007800;">model</span>=<span style="color: #000000; font-weight: bold;">`/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>dmidecode <span style="color: #660033;">-s</span> system-product-name<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">type</span>=<span style="color: #000000; font-weight: bold;">`/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>dmidecode <span style="color: #660033;">-s</span> baseboard-product-name<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">bytes</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">free</span> <span style="color: #660033;">-k</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> Mem <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $2 }'</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">memory</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$bytes</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1024</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">bytes</span>=<span style="color: #000000; font-weight: bold;">`</span>fdisk <span style="color: #660033;">-l</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> Disk <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> da <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-f2</span> -d, <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $1 }'</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">disk</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$bytes</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1024</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1024</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">serial</span>=<span style="color: #000000; font-weight: bold;">`/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>dmidecode <span style="color: #660033;">-s</span> system-serial-number<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">hwaddr</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ifconfig</span> eth0 <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> HWaddr <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s/.*HWaddr \(.*\)/\1/&quot;</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">ip</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ifconfig</span> eth0 <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;inet addr&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s/.*addr:\(.*\) B.*/\1/&quot;</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">tag</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">hostname</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-f1</span> -d-<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">hostname</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">hostname</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Model: <span style="color: #007800;">$model</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Ram: <span style="color: #007800;">$memory</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Disk: <span style="color: #007800;">$disk</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Serial: <span style="color: #007800;">$serial</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Mac: <span style="color: #007800;">$hwaddr</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;ip: <span style="color: #007800;">$ip</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;tag: <span style="color: #007800;">$tag</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;hostname: <span style="color: #007800;">$hostname</span>&quot;</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&lt;&lt;</span> EOF <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>inventory.xml
<span style="color: #000000; font-weight: bold;">&lt;</span>?xml <span style="color: #007800;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #007800;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span>?<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>REQUEST<span style="color: #000000; font-weight: bold;">&gt;</span>
  <span style="color: #000000; font-weight: bold;">&lt;</span>CONTENT<span style="color: #000000; font-weight: bold;">&gt;</span>
    <span style="color: #000000; font-weight: bold;">&lt;</span>ACCOUNTINFO<span style="color: #000000; font-weight: bold;">&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;</span>KEYNAME<span style="color: #000000; font-weight: bold;">&gt;</span>TAG<span style="color: #000000; font-weight: bold;">&lt;/</span>KEYNAME<span style="color: #000000; font-weight: bold;">&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;</span>KEYVALUE<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #007800;">$tag</span><span style="color: #000000; font-weight: bold;">&lt;/</span>KEYVALUE<span style="color: #000000; font-weight: bold;">&gt;</span>
    <span style="color: #000000; font-weight: bold;">&lt;/</span>ACCOUNTINFO<span style="color: #000000; font-weight: bold;">&gt;</span>
    <span style="color: #000000; font-weight: bold;">&lt;</span>BIOS<span style="color: #000000; font-weight: bold;">&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;</span>ASSETTAG<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #007800;">$serial</span><span style="color: #000000; font-weight: bold;">&lt;/</span>ASSETTAG<span style="color: #000000; font-weight: bold;">&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;</span>BMANUFACTURER<span style="color: #000000; font-weight: bold;">&gt;</span>Hewlett-Packard<span style="color: #000000; font-weight: bold;">&lt;/</span>BMANUFACTURER<span style="color: #000000; font-weight: bold;">&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;</span>MMANUFACTURER<span style="color: #000000; font-weight: bold;">&gt;</span>Hewlett-Packard<span style="color: #000000; font-weight: bold;">&lt;/</span>MMANUFACTURER<span style="color: #000000; font-weight: bold;">&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;</span>MSN<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #007800;">$serial</span><span style="color: #000000; font-weight: bold;">&lt;/</span>MSN<span style="color: #000000; font-weight: bold;">&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;</span>SMANUFACTURER<span style="color: #000000; font-weight: bold;">&gt;</span>Hewlett-Packard<span style="color: #000000; font-weight: bold;">&lt;/</span>SMANUFACTURER<span style="color: #000000; font-weight: bold;">&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;</span>SMODEL<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #007800;">$model</span> - <span style="color: #007800;">$type</span><span style="color: #000000; font-weight: bold;">&lt;/</span>SMODEL<span style="color: #000000; font-weight: bold;">&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;</span>SSN<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #007800;">$serial</span><span style="color: #000000; font-weight: bold;">&lt;/</span>SSN<span style="color: #000000; font-weight: bold;">&gt;</span>
    <span style="color: #000000; font-weight: bold;">&lt;/</span>BIOS<span style="color: #000000; font-weight: bold;">&gt;</span>
    <span style="color: #000000; font-weight: bold;">&lt;</span>HARDWARE<span style="color: #000000; font-weight: bold;">&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;</span>CHECKSUM<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000;">131071</span><span style="color: #000000; font-weight: bold;">&lt;/</span>CHECKSUM<span style="color: #000000; font-weight: bold;">&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;</span>MEMORY<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #007800;">$memory</span><span style="color: #000000; font-weight: bold;">&lt;/</span>MEMORY<span style="color: #000000; font-weight: bold;">&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;</span>NAME<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #007800;">$hostname</span><span style="color: #000000; font-weight: bold;">&lt;/</span>NAME<span style="color: #000000; font-weight: bold;">&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;</span>OSCOMMENTS<span style="color: #000000; font-weight: bold;">&gt;</span>T5TUX<span style="color: #000000; font-weight: bold;">&lt;/</span>OSCOMMENTS<span style="color: #000000; font-weight: bold;">&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;</span>OSNAME<span style="color: #000000; font-weight: bold;">&gt;</span>t5tux<span style="color: #000000; font-weight: bold;">&lt;/</span>OSNAME<span style="color: #000000; font-weight: bold;">&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;</span>VMSYSTEM<span style="color: #000000; font-weight: bold;">&gt;</span>Physical<span style="color: #000000; font-weight: bold;">&lt;/</span>VMSYSTEM<span style="color: #000000; font-weight: bold;">&gt;</span>
    <span style="color: #000000; font-weight: bold;">&lt;/</span>HARDWARE<span style="color: #000000; font-weight: bold;">&gt;</span>
    <span style="color: #000000; font-weight: bold;">&lt;</span>NETWORKS<span style="color: #000000; font-weight: bold;">&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;</span>DESCRIPTION<span style="color: #000000; font-weight: bold;">&gt;</span>eth0<span style="color: #000000; font-weight: bold;">&lt;/</span>DESCRIPTION<span style="color: #000000; font-weight: bold;">&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;</span>IPADDRESS<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #007800;">$ip</span><span style="color: #000000; font-weight: bold;">&lt;/</span>IPADDRESS<span style="color: #000000; font-weight: bold;">&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;</span>MACADDR<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #007800;">$hwaddr</span><span style="color: #000000; font-weight: bold;">&lt;/</span>MACADDR<span style="color: #000000; font-weight: bold;">&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;</span>TYPE<span style="color: #000000; font-weight: bold;">&gt;</span>Ethernet<span style="color: #000000; font-weight: bold;">&lt;/</span>TYPE<span style="color: #000000; font-weight: bold;">&gt;</span>
    <span style="color: #000000; font-weight: bold;">&lt;/</span>NETWORKS<span style="color: #000000; font-weight: bold;">&gt;</span>
    <span style="color: #000000; font-weight: bold;">&lt;</span>STORAGES<span style="color: #000000; font-weight: bold;">&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;</span>DESCRIPTION<span style="color: #000000; font-weight: bold;">&gt;</span>FLASH<span style="color: #000000; font-weight: bold;">&lt;/</span>DESCRIPTION<span style="color: #000000; font-weight: bold;">&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;</span>DISKSIZE<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #007800;">$disk</span><span style="color: #000000; font-weight: bold;">&lt;/</span>DISKSIZE<span style="color: #000000; font-weight: bold;">&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;</span>TYPE<span style="color: #000000; font-weight: bold;">&gt;</span>disk<span style="color: #000000; font-weight: bold;">&lt;/</span>TYPE<span style="color: #000000; font-weight: bold;">&gt;</span>
    <span style="color: #000000; font-weight: bold;">&lt;/</span>STORAGES<span style="color: #000000; font-weight: bold;">&gt;</span>
  <span style="color: #000000; font-weight: bold;">&lt;/</span>CONTENT<span style="color: #000000; font-weight: bold;">&gt;</span>
  <span style="color: #000000; font-weight: bold;">&lt;</span>DEVICEID<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #007800;">$hostname</span>-<span style="color: #000000;">9999</span>-01-01-01-01-01<span style="color: #000000; font-weight: bold;">&lt;/</span>DEVICEID<span style="color: #000000; font-weight: bold;">&gt;</span>
  <span style="color: #000000; font-weight: bold;">&lt;</span>QUERY<span style="color: #000000; font-weight: bold;">&gt;</span>INVENTORY<span style="color: #000000; font-weight: bold;">&lt;/</span>QUERY<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>REQUEST<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
EOF
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">--post-file</span>=<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>inventory.xml http:<span style="color: #000000; font-weight: bold;">//</span>ocs-ng.xxxx.fr<span style="color: #000000; font-weight: bold;">/</span>ocsinventory</pre></td></tr></table></div>

<p>Quelques astuces:</p>
<ul>
<li>wget avec un &laquo;&nbsp;&#8211;post-file monfichier&nbsp;&raquo; ou curl avec un &laquo;&nbsp;&#8211;binary-data @monfichier&nbsp;&raquo; permettent de poster des données.</li>
<li>le CHECKSUM à 131071 indique que toutes les données sont modifiées. J&#8217;ai trouvé cette info sur un forum mais pas dans la doc officielle.</li>
<li>Le client léger est en lecture seule du coup le DEVICEID ne peut être stocké. La date servant à sa génération est falsifiée: &laquo;&nbsp;9999-01-01-01-01-01&#8243;</li>
</ul>
<p>Très simple et pas forcément très élégant mais ça marche très bien !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.equinoxefr.org/post/2011/12/27/agent-dinventaire-ocs-ng-et-clients-legers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fonera et station météo Lacrosse Technology WS2305 (Etape 1 la station WS2305)</title>
		<link>http://www.equinoxefr.org/post/2007/11/24/fonera-et-station-meteo-lacrosse-technology-ws2305-etape-1-la-station-ws2305/</link>
		<comments>http://www.equinoxefr.org/post/2007/11/24/fonera-et-station-meteo-lacrosse-technology-ws2305-etape-1-la-station-ws2305/#comments</comments>
		<pubDate>Sat, 24 Nov 2007 14:30:00 +0000</pubDate>
		<dc:creator>EquinoxeFR</dc:creator>
				<category><![CDATA[Electronique]]></category>
		<category><![CDATA[Hack it]]></category>
		<category><![CDATA[Adaptateur]]></category>
		<category><![CDATA[bitscope]]></category>
		<category><![CDATA[diy]]></category>
		<category><![CDATA[Embarqué]]></category>
		<category><![CDATA[Fonera]]></category>
		<category><![CDATA[openwrt]]></category>
		<category><![CDATA[oscilloscope]]></category>
		<category><![CDATA[RS232]]></category>
		<category><![CDATA[souder]]></category>
		<category><![CDATA[USB]]></category>
		<category><![CDATA[wifi]]></category>
		<category><![CDATA[ws2305]]></category>

		<guid isPermaLink="false">http://www.equinoxefr.org/wordpress/?p=37</guid>
		<description><![CDATA[<p>Nous allons voir comment transformer une statio météo Lacrosse Technology WS2305 en station Méteo Wifi avec connexion sur un serveur. Pour cela nous allons utiliser la fameuse fonera légèrement modifiée.</p> <p><img src="/public/Fonera/Fonera.png" alt="Fonera.png" /> <img src="/public/Fonera/p30_lcf_72dpi_ws2305bla_alu.jpg" alt="p30_lcf_72dpi_ws2305bla_alu.jpg" /></p>]]></description>
			<content:encoded><![CDATA[<p>Nous allons voir comment transformer une statio météo Lacrosse Technology WS2305 en station Méteo Wifi avec connexion sur un serveur. Pour cela nous allons utiliser la fameuse fonera légèrement modifiée.</p>
<p><img src="/public/Fonera/Fonera.png" alt="Fonera.png" /> <img src="/public/Fonera/p30_lcf_72dpi_ws2305bla_alu.jpg" alt="p30_lcf_72dpi_ws2305bla_alu.jpg" /></p>
<p><span id="more-37"></span></p>
<p><strong>ATTENTION: L&#8217;auteur ne pourra être tenu responsable en cas de détérioration de vos équipements. Sachez que ces bidouilles font &laquo;&nbsp;sauter&nbsp;&raquo; la garantie de la fonera et de la station météo&#8230;</strong></p>
<p>Tout d&#8217;abord, occupons nous de la station météo. Après avoir retiré les vis présentes sur la face arrière, nous pouvons accéder à la carte électronique de la station. Et là surprise, il y a très peu de composants.</p>
<p><a href="/public/Electronique/WS2300/IMG_1150_800x600.jpg" rel="lightbox[37]"><img src="/public/Electronique/WS2300/.IMG_1150_800x600_m.jpg" alt="IMG_1150_800x600.jpg" /></a></p>
<p>Tout le coeur de la station est dans une puce coulée dans l&#8217;époxy donc impossible à identifier. Ce que nous devons rechercher, ce sont les entrées sorties TTL du port série avant la conversion RS232. Pas de max232 ou équivalent, la transformation des signaux a l&#8217;air d&#8217;être réalisée avec des diodes et des transistors. A l&#8217;aide d&#8217;un oscilloscope, nous recherchons des signaux TTL aux alentours de ces transistors; dans le même temps, nous dialoguons avec la station à l&#8217;aide du logiciel open2300 installé sur le PC.</p>
<p><a href="/public/Electronique/WS2300/IMG_1152_800x600.jpg" rel="lightbox[37]"><img src="/public/Electronique/WS2300/.IMG_1152_800x600_m.jpg" alt="IMG_1152_800x600.jpg" /></a></p>
<p>Après quelques minutes de recherches, j&#8217;ai localisé 2 points avec des signaux TTL présents lors des transferts. Un des deux point présente un &laquo;&nbsp;traffic&nbsp;&raquo; beaucoup plus important que le second, il doit s&#8217;agir du TX (envoie les informations au PC)</p>
<p><a href="/public/Electronique/WS2300/BitScope.png" rel="lightbox[37]"><img src="/public/Electronique/WS2300/.BitScope_m.jpg" alt="BitScope.png" /></a></p>
<p>alors que l&#8217;autre doit être RX (recoit uniquement les commandes du PC).</p>
<p><a href="/public/Electronique/WS2300/BitScope2.png" rel="lightbox[37]"><img src="/public/Electronique/WS2300/.BitScope2_m.jpg" alt="BitScope2.png" /></a></p>
<p><a href="/public/Electronique/WS2300/IMG_1151_800x600.jpg" rel="lightbox[37]"><img src="/public/Electronique/WS2300/.IMG_1151_800x600_m.jpg" alt="IMG_1151_800x600.jpg" /></a></p>
<p>Afin de confirmer tout cela, j&#8217;ai ressorti mon adaptateur TTL/USB que j&#8217;ai branché sur ces deux ports et sur une masse trouvée au niveau du porte piles. <a href="/public/Electronique/WS2300/IMG_1154_800x600.jpg" rel="lightbox[37]"><img src="/public/Electronique/WS2300/.IMG_1154_800x600_m.jpg" alt="IMG_1154_800x600.jpg" /></a></p>
<p><a href="/public/Electronique/WS2300/IMG_1155_800x600.jpg" rel="lightbox[37]"><img src="/public/Electronique/WS2300/.IMG_1155_800x600_m.jpg" alt="IMG_1155_800x600.jpg" /></a></p>
<ul>
<li>Rouge: TX</li>
<li>Blanc: RX</li>
<li>Blindage: GND</li>
</ul>
<p><a href="/public/Electronique/WS2300/IMG_1157_800x600.jpg" rel="lightbox[37]"><img src="/public/Electronique/WS2300/.IMG_1157_800x600_m.jpg" alt="IMG_1157_800x600.jpg" /></a></p>
<p>Une fois le cable série d&#8217;origine débranché, j&#8217;ai tenté un transfert via l&#8217;adaptateur TTL/USB et là, Oh miracle, la station répond aux commandes et transmet des informations <img src='http://www.equinoxefr.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<pre> pierre@EquinoxeFR:~/Download/open2300-1.10$ ./fetch2300
Date 2007-Nov-24
Time 14:09:03
Ti 21.5
Timin 21.5
Timax 21.5
TTimin 00:00
DTimin 2001-01-01
TTimax 00:00
DTimax 2001-01-01
To 81.1
Tomin 81.1
Tomax 81.1
TTomin 00:10
DTomin 2000-00-00
TTomax 00:10
DTomax 2000-00-00
DP 81.1
DPmin 81.1
DPmax 81.1
TDPmin 00:10
DDPmin 2000-00-00
TDPmax 00:10
DDPmax 2000-00-00
RHi 59
RHimin 59
RHimax 59
TRHimin 00:00
DRHimin 2001-01-01
TRHimax 00:00
DRHimax 2001-01-01
RHo 67
RHomin 67
RHomax 67
TRHomin 00:07
DRHomin 2001-01-01
TRHomax 00:07
DRHomax 2001-01-01
WS 51.0
DIRtext N
DIR0 0.0
DIR1 0.0
DIR2 0.0
DIR3 0.0
DIR4 0.0
DIR5 0.0
WC 81.1
WCmin 81.1
WCmax 81.1
TWCmin 00:10
DWCmin 2000-00-00
TWCmax 00:10
DWCmax 2000-00-00
WSmin 0.0
WSmax 0.0
TWSmin 00:00
DWSmin 2001-01-01
TWSmax 00:00
DWSmax 2001-01-01
R1h 0.00
R1hmax 0.00
TR1hmax 00:00
DR1hmax 2001-01-01
R24h 0.00
R24hmax 0.00
TR24hmax 00:00
DR24hmax 2001-01-01
Rtot 0.00
TRtot 19:10
DRtot 2007-11-22
RP 1032.100
RPmin 1032.100
RPmax 1032.100
TRPmin 00:00
DRPmin 2001-01-01
TRPmax 00:00
DRPmax 2001-01-01
Tendency Steady
Forecast Cloudy</pre>
<p>Il ne reste plus qu&#8217;à souder 3 câbles pour sortir RX,TX, GND de la station.</p>
<p><a href="/public/Electronique/WS2300/IMG_1156_800x600.jpg" rel="lightbox[37]"><img src="/public/Electronique/WS2300/IMG_1156_800x600.jpg" alt="IMG_1156_800x600.jpg" /></a></p>
<p>A bientôt pour la deuxième étape: Le branchement sur la Fonera.</p>
<p><strong>Info:</strong></p>
<p>Si comme moi, vous n&#8217;utilisez pas l&#8217;anémomètre (en appartement c&#8217;est difficile), les diverses commandes du projet open2300 sont très longues à s&#8217;exécuter. En effet, en cas d&#8217;erreur de mesure de l&#8217;anémomètre, il y a plusieurs essais espacés de 10 sec. Faites un petit tour dans le code du fichier <code>rw2300.c</code> afin de commenter toutes les lignes : <em><code>sleep_long(10); //wait 10 seconds for new wind measurement</code></em>. Vous verrez que la récupération des données est beaucoup plus rapide.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.equinoxefr.org/post/2007/11/24/fonera-et-station-meteo-lacrosse-technology-ws2305-etape-1-la-station-ws2305/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Jouer avec les entrées sorties GPIO sur la Fonera.</title>
		<link>http://www.equinoxefr.org/post/2007/11/11/jouer-avec-les-entrees-sorties-gpio-sur-la-fonera/</link>
		<comments>http://www.equinoxefr.org/post/2007/11/11/jouer-avec-les-entrees-sorties-gpio-sur-la-fonera/#comments</comments>
		<pubDate>Sun, 11 Nov 2007 07:20:00 +0000</pubDate>
		<dc:creator>EquinoxeFR</dc:creator>
				<category><![CDATA[Hack it]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[diy]]></category>
		<category><![CDATA[Embarqué]]></category>
		<category><![CDATA[firmware]]></category>
		<category><![CDATA[Fonera]]></category>
		<category><![CDATA[openwrt]]></category>
		<category><![CDATA[Planet-Libre]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.equinoxefr.org/wordpress/?p=36</guid>
		<description><![CDATA[<p>Intéressé par l'accès aux GPIO, et avec l'aide du fameux blog de <a href="http://www.lefinnois.net/wp/index.php/2007/04/27/gpios-et-la-fonera/" hreflang="fr">Denis Bodor</a>, voilà quelques infos pour ajouter le module du noyau à votre Fonera. Celle-ci doit avoir été flashée avec le firmware OpenWrt Kamikaze 7.09.</p> <p><img src="/public/Fonera/Fonera.png" alt="Fonera.png" /></p>]]></description>
			<content:encoded><![CDATA[<p>Intéressé par l&#8217;accès aux GPIO, et avec l&#8217;aide du fameux blog de <a hreflang="fr" href="http://www.lefinnois.net/wp/index.php/2007/04/27/gpios-et-la-fonera/">Denis Bodor</a>, voilà quelques infos pour ajouter le module du noyau à votre Fonera. Celle-ci doit avoir été flashée avec le firmware OpenWrt Kamikaze 7.09.</p>
<p><img src="/public/Fonera/Fonera.png" alt="Fonera.png" /></p>
<p>Récupérer et compiler OpenWrt (Je suis sous ubuntu avec les paquets de développement nécessaires)</p>
<p>Le téléchargement du kit de développement OpenWrt se fait au travers d&#8217;un accès Subversion.</p>
<pre> svn co https://svn.openwrt.org/openwrt/tags/kamikaze_7.09</pre>
<p>Pour pouvoir utiliser les accès aux GPIO, vous devez ajouter à votre Fonera un module du noyau. Voilà une archive toute prête pour être intégrée dans le SDK d&#8217;OpenWrt. Je ne suis pas à l&#8217;origine de ces sources, juste du makefile <img src='http://www.equinoxefr.org/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Récupérez ce paquet: <a hreflang="fr" href="/public/Fonera/proc_gpio.tgz">proc_gpio.tgz</a> puis décompressez le dans le répertoire <code>kamikaze_7.09/package</code>. Vous pouvez ensuite lancer un make menuconfig dans le répertoire <code>kamikaze_7.09</code>. Dans le menu &laquo;&nbsp;kernel modules&nbsp;&raquo; / &laquo;&nbsp;Other modules&nbsp;&raquo; vous trouverez le fameux proc_gpio. Pensez a régler le système comme étant un <code>Atheros 2.6</code>, sinon vous n&#8217;aurez pas ce choix dans le menu.</p>
<p><img src="/public/Fonera/Capture-pierre_EquinoxeFR___-Download-OpenWrt-kamikaze_7.09.png" alt="Capture-pierre_EquinoxeFR___-Download-OpenWrt-kamikaze_7.09.png" /></p>
<p>Ensuite passez par un classique <code>make</code></p>
<p>Vous aurez alors un fichier <code>./bin/packages/kmod-kmod-gpio_1_mips.ipk</code> à télécharger et à installer sur votre fonera. Une version déjà compilée est disponible <a hreflang="fr" href="/public/Fonera/kmod-kmod-gpio_1_mips.ipk">ici</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.equinoxefr.org/post/2007/11/11/jouer-avec-les-entrees-sorties-gpio-sur-la-fonera/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino &#8211; carte Diecimila</title>
		<link>http://www.equinoxefr.org/post/2007/10/24/arduino-carte-diecimila/</link>
		<comments>http://www.equinoxefr.org/post/2007/10/24/arduino-carte-diecimila/#comments</comments>
		<pubDate>Wed, 24 Oct 2007 21:34:00 +0000</pubDate>
		<dc:creator>EquinoxeFR</dc:creator>
				<category><![CDATA[Electronique]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[ATMEGA]]></category>
		<category><![CDATA[ATMEGA8]]></category>
		<category><![CDATA[diy]]></category>
		<category><![CDATA[Embarqué]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Photos]]></category>
		<category><![CDATA[USB]]></category>

		<guid isPermaLink="false">http://www.equinoxefr.org/wordpress/?p=33</guid>
		<description><![CDATA[<p>Elle est enfin là, posée sur mon bureau, attendant de folles expérimentations...</p> <p><img src="/public/Electronique/Arduino/arduino_extreme_260.jpg" alt="arduino_extreme_260.jpg" /></p>]]></description>
			<content:encoded><![CDATA[<p>Elle est enfin là, posée sur mon bureau, attendant de folles expérimentations&#8230;</p>
<p><img src="/public/Electronique/Arduino/arduino_extreme_260.jpg" alt="arduino_extreme_260.jpg" /></p>
<p><span id="more-33"></span></p>
<p>Après 3 longues semaines d&#8217;attente, je viens de recevoir ma carte de développement Arduino Diecimila.</p>
<p>Je l&#8217;ai commandé sur le site <a href="http://www.adafruit.com/" hreflang="en">adafruit</a> pour 22 €. Ce qui en fait certainement la carte de développement embarqué la moins chère du marché. En plus c&#8217;est de l&#8217;OpenHardware ( en dehors du µC ) et le soft de l&#8217;OpenSource.</p>
<p><img src="/public/Electronique/Arduino/ArduinoDiecimila400.jpg" alt="ArduinoDiecimila400.jpg" /></p>
<p><a href="/public/Electronique/Arduino/arduino_board.png" rel="lightbox[33]"><img src="/public/Electronique/Arduino/.arduino_board_m.jpg" alt="arduino_board.png" /></a></p>
<p>La carte est construite autour d&#8217;un processeur ATMEGA 168 (compatible ATMEGA8) cadencé à 16MHz avec 16Ko de mémoire flash. Elle dispose d&#8217;un port USB qui peut servir à la programmation du µC mais aussi à interagir avec le PC (protocole série). Côté entrée sorties, elle est plutôt bien fournie avec 14 ports Digital I/O  dont 6 avec sortie PWM et 6 ports analogiques.</p>
<p>La grande force de cette carte est certainement le prix mais aussi sa facilité de programmation. Elle est programmable en C avec un logiciel de développement extrêmement simple ( compatible Linux, Mac, Win )</p>
<p><a href="/public/Electronique/Arduino/Capture-Arduino_-_0010_Alpha.png" rel="lightbox[33]"><img src="/public/Electronique/Arduino/.Capture-Arduino_-_0010_Alpha_m.jpg" alt="Capture-Arduino_-_0010_Alpha.png" /></a></p>
<p>Il faut par exemple faire un simple <code>int i=analogRead(3)</code> pour récupérer la valeur d&#8217;une entrée analogique comme un capteur IR sharp connecté au port 3. De quoi s&#8217;amuser sans être un pro de l&#8217;assembleur&#8230;</p>
<p>Voilà, il me tarde de tester tout ca <img src='http://www.equinoxefr.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Le premier projet va être une carte de pilotage de mon appareil Photo Canon EOS 400D pour réaliser des photos &quot;ultra rapides&quot;  à l&#8217;aide d&#8217;une barrière IR (chute d&#8217;une goutte d&#8217;eau) ou d&#8217;un microphone (éclatement d&#8217;un ballon).</p>
<p>P.S: En réalité je n&#8217;ai pas réussi à attendre du coup je me suis fabriqué une carte sur une plaque d&#8217;essais à l&#8217;aide d&#8217;un µC ATMEGA8 qui trainait dans mes affaires&#8230; je vous fait un petit billet là dessus dès que j&#8217;ai 5 min.</p>
<p>Toutes les infos sur la technologie arduino sont dispos <a href="http://www.arduino.cc/" hreflang="en">ici</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.equinoxefr.org/post/2007/10/24/arduino-carte-diecimila/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

