├── .gitignore
├── Jeedom
├── etatfp.php
├── setFP.sh
└── teleinfo.php
├── LICENSE
├── Logiciel
├── ProgrammateurFilPilote.ino
├── images
│ ├── remora01.jpg
│ ├── remora02.jpg
│ └── remora03.jpg
└── remora
│ ├── GFX.cpp
│ ├── GFX.h
│ ├── HardwareSerial.h
│ ├── LibTeleinfo.cpp
│ ├── LibTeleinfo.h
│ ├── MCP23017.cpp
│ ├── MCP23017.h
│ ├── README.md
│ ├── RHDatagram.cpp
│ ├── RHDatagram.h
│ ├── RHGenericDriver.cpp
│ ├── RHGenericDriver.h
│ ├── RHGenericSPI.cpp
│ ├── RHGenericSPI.h
│ ├── RHHardwareSPI.cpp
│ ├── RHHardwareSPI.h
│ ├── RHReliableDatagram.cpp
│ ├── RHReliableDatagram.h
│ ├── RHSPIDriver.cpp
│ ├── RHSPIDriver.h
│ ├── RH_RF69.cpp
│ ├── RH_RF69.h
│ ├── RadioHead.h
│ ├── SSD1306.cpp
│ ├── SSD1306.h
│ ├── ULPNode_RF_Protocol.cpp
│ ├── ULPNode_RF_Protocol.h
│ ├── WebServer
│ ├── WebServer.cpp
│ └── WebServer.h
│ ├── atomic.h
│ ├── display.cpp
│ ├── display.h
│ ├── i2c.cpp
│ ├── i2c.h
│ ├── linked_list.cpp
│ ├── linked_list.h
│ ├── pilotes.cpp
│ ├── pilotes.h
│ ├── radio_config_Si4460.h
│ ├── remora.h
│ ├── remora.ino
│ ├── rfm.cpp
│ ├── rfm.h
│ ├── route.cpp
│ ├── route.h
│ ├── spark.ignore
│ ├── tinfo.cpp
│ └── tinfo.h
├── Matériel
├── 1.0
│ ├── ProgrammateurFilPilote_1.0.brd
│ ├── ProgrammateurFilPilote_1.0.sch
│ ├── ProgrammateurFilPilote_1.0_Recto.png
│ ├── ProgrammateurFilPilote_1.0_Verso.png
│ └── Schema_ProgrammateurFilPilote_1.0.pdf
├── 1.1.1
│ ├── ProgrammateurFilPilote_1.1.1.brd
│ ├── ProgrammateurFilPilote_1.1.1.sch
│ ├── ProgrammateurFilPilote_1.1.1_Recto.png
│ ├── ProgrammateurFilPilote_1.1.1_Verso.png
│ └── Schema_ProgrammateurFilPilote_1.1.1.pdf
├── 1.1
│ ├── ProgrammateurFilPilote_1.1.brd
│ ├── ProgrammateurFilPilote_1.1.sch
│ ├── ProgrammateurFilPilote_1.1_Recto.png
│ ├── ProgrammateurFilPilote_1.1_Verso.png
│ └── Schema_ProgrammateurFilPilote_1.1.pdf
├── 1.2
│ ├── ProgrammateurFilPilote_1.2.brd
│ ├── ProgrammateurFilPilote_1.2.pdf
│ ├── ProgrammateurFilPilote_1.2.sch
│ ├── ProgrammateurFilPilote_1.2_Board.png
│ ├── ProgrammateurFilPilote_1.2_Recto.png
│ ├── ProgrammateurFilPilote_1.2_Schematic.png
│ ├── ProgrammateurFilPilote_1.2_Verso.png
│ ├── README.md
│ └── Thumbs.db
├── 1.3
│ ├── Gerbers
│ │ ├── ProgrammateurFilPilote_1.3.GBL
│ │ ├── ProgrammateurFilPilote_1.3.GBO
│ │ ├── ProgrammateurFilPilote_1.3.GBP
│ │ ├── ProgrammateurFilPilote_1.3.GBS
│ │ ├── ProgrammateurFilPilote_1.3.GML
│ │ ├── ProgrammateurFilPilote_1.3.GTL
│ │ ├── ProgrammateurFilPilote_1.3.GTO
│ │ ├── ProgrammateurFilPilote_1.3.GTP
│ │ ├── ProgrammateurFilPilote_1.3.GTS
│ │ ├── ProgrammateurFilPilote_1.3.TXT
│ │ ├── ProgrammateurFilPilote_1.3.dri
│ │ └── ProgrammateurFilPilote_1.3.gpi
│ ├── ProgrammateurFilPilote_1.3.brd
│ ├── ProgrammateurFilPilote_1.3.sch
│ ├── ProgrammateurFilPilote_1.3_Board.png
│ ├── ProgrammateurFilPilote_1.3_Recto.png
│ ├── ProgrammateurFilPilote_1.3_Schematic.png
│ ├── ProgrammateurFilPilote_1.3_Verso.png
│ ├── README.md
│ └── Tutoriel
│ │ ├── Images
│ │ ├── Le_contenu_du_kit.jpg
│ │ ├── Outillage.jpg
│ │ ├── Photo1.jpeg
│ │ ├── Photo10.jpeg
│ │ ├── Photo11.jpeg
│ │ ├── Photo12.jpeg
│ │ ├── Photo13.jpeg
│ │ ├── Photo14.jpeg
│ │ ├── Photo15.jpeg
│ │ ├── Photo16.jpeg
│ │ ├── Photo17.jpeg
│ │ ├── Photo18.jpeg
│ │ ├── Photo19.jpeg
│ │ ├── Photo2.jpeg
│ │ ├── Photo20.jpeg
│ │ ├── Photo21.jpeg
│ │ ├── Photo22.jpeg
│ │ ├── Photo23.jpeg
│ │ ├── Photo24.jpeg
│ │ ├── Photo25.jpeg
│ │ ├── Photo26.jpeg
│ │ ├── Photo27.jpeg
│ │ ├── Photo28.jpeg
│ │ ├── Photo29.jpeg
│ │ ├── Photo3.jpeg
│ │ ├── Photo30.jpeg
│ │ ├── Photo31.jpeg
│ │ ├── Photo32.jpeg
│ │ ├── Photo33.jpeg
│ │ ├── Photo34.jpeg
│ │ ├── Photo35.jpeg
│ │ ├── Photo36.jpeg
│ │ ├── Photo37.jpeg
│ │ ├── Photo38.jpeg
│ │ ├── Photo39.jpeg
│ │ ├── Photo4.jpeg
│ │ ├── Photo40.jpeg
│ │ ├── Photo41.jpeg
│ │ ├── Photo42.jpeg
│ │ ├── Photo43.jpeg
│ │ ├── Photo44.jpeg
│ │ ├── Photo5.jpeg
│ │ ├── Photo6.jpeg
│ │ ├── Photo7.jpeg
│ │ ├── Photo8.jpeg
│ │ ├── Photo9.jpeg
│ │ ├── remoara-pcb-bot-v13.jpg
│ │ └── remoara-pcb-top-v13.jpg
│ │ └── README.md
├── Librairies
│ └── TLP168J.lbr
└── README.md
├── README.md
└── schema_principe_programmateur_rail_din.png
/.gitignore:
--------------------------------------------------------------------------------
1 | *.db
2 | *.s#?
3 | *.b#?
4 | *.bin
5 |
--------------------------------------------------------------------------------
/Jeedom/etatfp.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php
2 | {'result'};
64 | $etatfp = substr($etatfp,$fp,1);
65 |
66 | // Compatibilité native Jeedom avec retour numerique :
67 | switch ($etatfp) {
68 | case 'C':
69 | echo "0";
70 | break;
71 | case 'H':
72 | echo "1";
73 | break;
74 | case 'A':
75 | echo "2";
76 | break;
77 | case 'E':
78 | echo "3";
79 | break;
80 | }
81 | //echo $etatfp;
82 | ?>
83 |
84 |
--------------------------------------------------------------------------------
/Jeedom/setFP.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Script permettant de commander le module programmateur fil pilote
3 | # thibault.chauffage@gmail.com - v0.1 05/01/2015
4 |
5 | DEVICE_ID=""
6 | SPARK_TOKEN=""
7 | FUNCTION="setfp"
8 | PARAM=$1 # Paramètre d'entrée [ZONE = 1 à 7][ORDRE = A ou C ou E ou H], ex : 3C (zone 3 en mode confort)
9 |
10 | curl https://api.spark.io/v1/devices/$DEVICE_ID/$FUNCTION -d access_token=$SPARK_TOKEN -d params=$PARAM
11 |
--------------------------------------------------------------------------------
/Jeedom/teleinfo.php:
--------------------------------------------------------------------------------
1 | #!/usr/bin/php
2 | {'result'};
70 |
71 | //On parse les infos utiles :
72 | $tinfo = json_decode($json);
73 |
74 | //recuperation de toutes les trames depuis la crte fils pilotes :
75 | $isousc = $tinfo->{'isousc'};
76 | $iinst = $tinfo->{'iinst'};
77 | $papp = $tinfo->{'papp'};
78 | $ptec = $tinfo->{'ptec'};
79 | $hchp = $tinfo->{'indexHP'};
80 | $hchc = $tinfo->{'indexHC'};
81 | $adco = $tinfo->{'ADCO'};
82 |
83 | # recuperation de la plage horaire et transformation :
84 | switch($ptec){
85 | case 0:
86 | $ptec = "HC";
87 | break;
88 | case 1:
89 | $ptec = "HP";
90 | break;
91 | }
92 |
93 | // Fabrication de l'url :
94 | $url ="http://$IP/jeedom/plugins/teleinfo/core/php/jeeTeleinfo.php?api=$API&ADCO=$adco&HCHP=$hchp&HCHC=$hchc&PAPP=$papp&IINST=$iinst&ISOUSC=$isousc&PTEC=$ptec";
95 |
96 | $publish = file_get_contents($url);
97 | ?>
98 |
99 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Thibault Ducret
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/Logiciel/ProgrammateurFilPilote.ino:
--------------------------------------------------------------------------------
1 | /*
2 | Programmateur Fil Pilote et Suivi Conso
3 | Copyright (C) 2014 Thibault Ducret
4 | Licence MIT
5 | */
6 |
7 | // Includes
8 | #include "TeleInfo.h"
9 |
10 | // Defines
11 | #define NB_FILS_PILOTES 7
12 | #define ISOUSCRITE 30
13 | #define DELESTAGE_RATIO 0.9 //ratio en % => 90%
14 | #define IMAX 35
15 |
16 | // ======== MAIN ============
17 |
18 | // Fils pilotes
19 | int SortiesFP[NB_FILS_PILOTES*2] = { D6,D7,D4,D5,D2,D3,A6,A7,A4,A5,A2,A3,A0,A1 };
20 | int isousc = ISOUSCRITE;
21 | float ratio_intensite = DELESTAGE_RATIO;
22 |
23 | void initCdeFilsPilotes();
24 | int fpControl(String command);
25 | int setFP(String command);
26 | void delestage();
27 | int fpC(int i, char cOrdre);
28 |
29 | unsigned int delestageEnCours = 1;
30 | int nbDelestage = 0;
31 |
32 | // Téléinfo
33 | TeleInfo ti; // objet téléinfo
34 | char c; // pour stocker un caractère reçu sur le port série
35 | bool trameComplete = false;
36 | int mypApp = TELEINFO_UINT_INVALIDE;
37 | int myiInst = TELEINFO_UINT_INVALIDE;
38 | int myindexHC = TELEINFO_UINT_INVALIDE;
39 | int myindexHP = TELEINFO_UINT_INVALIDE;
40 | unsigned int myisousc = TELEINFO_UINT_INVALIDE; // pour calculer la limite de délestage
41 | float myDelestLimit = 0.0;
42 | boolean init_teleinfo = false;
43 | char etatFP[20] = "";
44 |
45 |
46 | void setup()
47 | {
48 | // == Fils pilotes ==
49 | initCdeFilsPilotes();
50 | Particle.function("fp", fpControl);
51 | Particle.function("setfp", setFP);
52 | Particle.variable("nbdelest", nbDelestage);
53 | Particle.variable("etatfp", etatFP);
54 |
55 | // == Téléinfo ==
56 | Particle.variable("papp", mypApp);
57 | Particle.variable("iinst", myiInst);
58 | Particle.variable("indexhc", myindexHC);
59 | Particle.variable("indexhp", myindexHP);
60 |
61 | Serial.begin(115200); // Port série USB
62 | Serial1.begin(1200); // Port série RX/TX
63 | }
64 |
65 | void loop()
66 | {
67 | updateTeleinfo();
68 | if (myiInst >= myDelestLimit) {
69 |
70 |
71 | if (delestageEnCours == 0)
72 | {
73 | //delestageEnCours ne passe jamais à 1 ???
74 | nbDelestage += 1; // on vient juste de passer en délestage
75 | delestage();
76 | }
77 | }
78 | else {
79 | delestageEnCours = 0; // Pas de délestage
80 | }
81 | }
82 |
83 | void updateTeleinfo() {
84 |
85 | while (Serial1.available())
86 | {
87 | c = (Serial1.read() & 0x7F);
88 | trameComplete = ti.decode(c);
89 | if (trameComplete)
90 | {
91 | mypApp=(int) ti.pApp();
92 | myiInst=(int) ti.iInst();
93 | myindexHC=(int) ti.indexHC();
94 | myindexHP=(int) ti.indexHP();
95 |
96 | if(!init_teleinfo) {
97 | myisousc = ti.iSousc();
98 | myDelestLimit = myisousc * ratio_intensite;
99 | init_teleinfo = true;
100 | }
101 | }
102 | }
103 |
104 | }
105 |
106 | void initCdeFilsPilotes()
107 | {
108 | unsigned int i;
109 | for (i=0;i<(NB_FILS_PILOTES*2);i+=1) // 2*nbFilPilotes car 2 pins pour commander 1 fil pilote
110 | {
111 | pinMode(SortiesFP[i], OUTPUT); // Chaque commande de fil pilote est une sortie
112 | }
113 | delay(1000);
114 | delestage(); // Hors gel
115 | }
116 |
117 | int fpControl(String command)
118 | {
119 | // C = Confort, A = Arrêt, E = Eco, H = Hors gel
120 | // CCCCCCC => Commande tous les fils pilote en mode confort (ON)
121 | // AAAAAAA => Commande tous les fils pilote en mode arrêt
122 | // EEEEEEE => Commande tous les fils pilote en mode éco
123 | // CAAAAAA => Tous OFF sauf le fil pilote 1
124 |
125 | unsigned int i;
126 | int returnValue = -1; // Init à -1 => Erreur
127 |
128 | command.trim();
129 | command.toUpperCase();
130 |
131 | if (command.length() == NB_FILS_PILOTES) // Vérifier que l'on a la commande de tous les fils pilotes
132 | {
133 | for (i=1; i<=NB_FILS_PILOTES; i+=1)
134 | {
135 | fpC(i, command.charAt(i-1)); //charAt(i-1) car l'index de "command" commence à 0
136 | }
137 | returnValue = 0; // OK
138 | }
139 |
140 | return returnValue;
141 | }
142 |
143 | int setFP(String command)
144 | {
145 | // C = Confort, A = Arrêt, E = Eco, H = Hors gel
146 | // command = 1A => FP1 = Arrêt
147 | unsigned int i;
148 |
149 | int returnValue = -1; // Init à -1 => Erreur
150 |
151 | command.trim();
152 | command.toUpperCase();
153 |
154 | if (command.length() == 2) // Vérifier que l'on a la commande d'un seul fil pilote
155 | {
156 | i = command.charAt(0) - '0'; // numéro du fil pilote concerné, avec conversion ASCII > entier
157 | returnValue = fpC(i, command.charAt(1));
158 | }
159 | return returnValue;
160 | }
161 |
162 | int fpC(int i, char cOrdre)
163 | {
164 | // i => numéro du fil pilote (de 1 à NB_FILS_PILOTE)
165 | // cOrdre => C = Confort, A = Arrêt, E = Eco, H = Hors gel
166 |
167 | int returnValue = -1; // Init à -1 => Erreur
168 |
169 | i = i-1; // On commence à 0
170 |
171 | if (i >= 0 && i < NB_FILS_PILOTES) // Vérifier que le numéro du fil pilote ne dépasse le MAX
172 | {
173 | if (cOrdre == 'C') // Confort => Commande 0/0
174 | {
175 | digitalWrite(SortiesFP[2*i], LOW);
176 | digitalWrite(SortiesFP[(2*i)+1], LOW);
177 | etatFP[i]='C';
178 | }
179 | else if (cOrdre == 'E') // Eco => Commande 1/1
180 | {
181 | digitalWrite(SortiesFP[2*i], HIGH);
182 | digitalWrite(SortiesFP[(2*i)+1], HIGH);
183 | etatFP[i]='E';
184 | }
185 | else if (cOrdre == 'H') // Hors gel => Commande 1/0
186 | {
187 | digitalWrite(SortiesFP[2*i], HIGH);
188 | digitalWrite(SortiesFP[(2*i)+1], LOW);
189 | etatFP[i]='H';
190 | }
191 | else // Arrêt => Commande 0/1
192 | {
193 | digitalWrite(SortiesFP[2*i], LOW);
194 | digitalWrite(SortiesFP[(2*i)+1], HIGH);
195 | etatFP[i]='A';
196 | }
197 | returnValue = 0; // OK
198 | }
199 | return returnValue;
200 | }
201 |
202 | void delestage()
203 | {
204 | unsigned int i;
205 |
206 | for (i=1; i<=NB_FILS_PILOTES; i+=1)
207 | {
208 | fpC(i,'H');
209 | }
210 |
211 | return;
212 | }
213 |
--------------------------------------------------------------------------------
/Logiciel/images/remora01.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Logiciel/images/remora01.jpg
--------------------------------------------------------------------------------
/Logiciel/images/remora02.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Logiciel/images/remora02.jpg
--------------------------------------------------------------------------------
/Logiciel/images/remora03.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Logiciel/images/remora03.jpg
--------------------------------------------------------------------------------
/Logiciel/remora/GFX.h:
--------------------------------------------------------------------------------
1 | /*
2 | This is the core graphics library for all our displays, providing a common
3 | set of graphics primitives (points, lines, circles, etc.). It needs to be
4 | paired with a hardware-specific library for each display device we carry
5 | (to handle the lower-level functions).
6 |
7 | Adafruit invests time and resources providing this open source code, please
8 | support Adafruit & open-source hardware by purchasing products from Adafruit!
9 |
10 | Copyright (c) 2013 Adafruit Industries. All rights reserved.
11 |
12 | Redistribution and use in source and binary forms, with or without
13 | modification, are permitted provided that the following conditions are met:
14 |
15 | - Redistributions of source code must retain the above copyright notice,
16 | this list of conditions and the following disclaimer.
17 | - Redistributions in binary form must reproduce the above copyright notice,
18 | this list of conditions and the following disclaimer in the documentation
19 | and/or other materials provided with the distribution.
20 |
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 | POSSIBILITY OF SUCH DAMAGE.
32 |
33 | History : 15/01/2015 Charles-Henri Hallard (http://hallard.me)
34 | Ported to for Spark Core
35 | Added Bargraph functions
36 |
37 | 15/09/2015 Charles-Henri Hallard : Ajout compatibilité ESP8266
38 |
39 | */
40 |
41 | #ifndef _ADAFRUIT_GFX_H
42 | #define _ADAFRUIT_GFX_H
43 |
44 | #ifdef SPARK
45 | #include "application.h"
46 | #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
47 | #else
48 | #include "Arduino.h"
49 | #endif
50 |
51 | #define _swap(a, b) { int16_t t = a; a = b; b = t; }
52 |
53 | //class Adafruit_GFX : public Print {
54 | class Adafruit_GFX {
55 |
56 | public:
57 |
58 | Adafruit_GFX(int16_t w, int16_t h); // Constructor
59 |
60 | void printf( const char * format, ...);
61 | void print( const char * string) ;
62 |
63 | // This MUST be defined by the subclass:
64 | virtual void drawPixel(int16_t x, int16_t y, uint16_t color) = 0;
65 |
66 | // These MAY be overridden by the subclass to provide device-specific
67 | // optimized code. Otherwise 'generic' versions are used.
68 | virtual void
69 | drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color),
70 | drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color),
71 | drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color),
72 | drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color),
73 | fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color),
74 | fillScreen(uint16_t color),
75 | invertDisplay(boolean i);
76 |
77 | // These exist only with Adafruit_GFX (no subclass overrides)
78 | void
79 | drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color),
80 | drawCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername,
81 | uint16_t color),
82 | fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color),
83 | fillCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername,
84 | int16_t delta, uint16_t color),
85 | drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1,
86 | int16_t x2, int16_t y2, uint16_t color),
87 | fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1,
88 | int16_t x2, int16_t y2, uint16_t color),
89 | drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h,
90 | int16_t radius, uint16_t color),
91 | fillRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h,
92 | int16_t radius, uint16_t color),
93 | drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap,
94 | int16_t w, int16_t h, uint16_t color),
95 | drawChar(int16_t x, int16_t y, unsigned char c, uint16_t color,
96 | uint16_t bg, uint8_t size),
97 | setCursor(int16_t x, int16_t y),
98 | setTextColor(uint16_t c),
99 | setTextColor(uint16_t c, uint16_t bg),
100 | setTextSize(uint8_t s),
101 | setTextWrap(boolean w),
102 | setRotation(uint8_t r);
103 |
104 | virtual size_t write(uint8_t);
105 |
106 | int16_t
107 | height(void),
108 | width(void);
109 |
110 | uint8_t getRotation(void);
111 |
112 | void drawVerticalBargraph(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color, uint16_t percent) ;
113 | void drawHorizontalBargraph(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color, uint16_t percent) ;
114 |
115 | protected:
116 | const int16_t
117 | WIDTH, HEIGHT; // This is the 'raw' display w/h - never changes
118 | int16_t
119 | _width, _height, // Display w/h as modified by current rotation
120 | cursor_x, cursor_y;
121 | uint16_t
122 | textcolor, textbgcolor;
123 | uint8_t
124 | textsize,
125 | rotation;
126 | boolean
127 | wrap; // If set, 'wrap' text at right edge of display
128 | };
129 |
130 | #endif // _ADAFRUIT_GFX_H
131 |
--------------------------------------------------------------------------------
/Logiciel/remora/HardwareSerial.h:
--------------------------------------------------------------------------------
1 | // HardwareSerial.h
2 | // Author: Mike McCauley (mikem@airspayce.com)
3 | // Copyright (C) 2015 Mike McCauley
4 | // $Id: HardwareSerial.h,v 1.3 2015/08/13 02:45:47 mikem Exp mikem $
5 | #ifndef HardwareSerial_h
6 | #define HardwareSerial_h
7 |
8 | #include
9 |
10 | /////////////////////////////////////////////////////////////////////
11 | /// \class HardwareSerial HardwareSerial.h
12 | /// \brief Encapsulates a Posix compliant serial port as a HarwareSerial
13 | ///
14 | /// This class provides access to a serial port on Unix and OSX.
15 | /// It is equivalent to HardwareSerial in Arduino, and can be used by RH_Serial
16 | /// We implement just enough to provide the services RadioHead needs.
17 | /// Additional methods not present on Arduino are also provided for waiting for characters.
18 | ///
19 | /// The device port is configured for 8 bits, no parity, 1 stop bit and full raw transparency, so it can be used
20 | /// to send and receive any 8 bit character. A limited range of baud rates is supported.
21 | ///
22 | /// \par Device Names
23 | ///
24 | /// Device naming conventions vary from OS to OS. ON linux, an FTDI serial port may have a name like
25 | /// /dev/ttyUSB0. On OSX, it might be something like /dev/tty.usbserial-A501YSWL
26 | /// \par errors
27 | ///
28 | /// A number of these methods print error messages to stderr in the event of an IO error.
29 | class HardwareSerial
30 | {
31 | public:
32 | /// Constructor
33 | // \param [in] deviceName Name of the derial port device to connect to
34 | HardwareSerial(const char* deviceName);
35 |
36 | /// Open and configure the port.
37 | /// The named port is opened, and the given baud rate is set.
38 | /// The port is configure for raw input and output and 8,N,1 protocol
39 | /// with no flow control.
40 | /// This must be called before any other operations are attempted.
41 | /// IO failures and unsupported baud rates will result in an error message on stderr.
42 | /// \param[in] baud The desired baud rate. The only rates supported are: 50, 75, 110, 134, 150
43 | /// 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400. On some platform
44 | /// such as Linux you may also use: 460800, 921600.
45 | void begin(int baud);
46 |
47 | /// Close the port.
48 | /// If begin() has previously been called successfully, the device port will be closed.
49 | /// It may be reopened again with another call to begin().
50 | void end();
51 |
52 | /// Flush remaining data.
53 | /// Blocks until any data yet to be transmtted is sent.
54 | void flush();
55 |
56 | /// Peek at the nex available character without consuming it.
57 | /// CAUTION: Not implemented.
58 | int peek(void);
59 |
60 | /// Returns the number of bytes immediately available to be read from the
61 | /// device.
62 | /// \return 0 if none available else the number of characters available for immediate reading
63 | int available();
64 |
65 | /// Read and return the next available character.
66 | /// If no character is available prints a message to stderr and returns 0;
67 | /// \return The next available character
68 | int read();
69 |
70 | /// Transmit a single character oin the serial port.
71 | /// Returns immediately.
72 | /// IO errors are repored by printing aa message to stderr.
73 | /// \param[in] ch The character to send. Anything in the range 0x00 to 0xff is permitted
74 | /// \return 1 if successful else 0
75 | size_t write(uint8_t ch);
76 |
77 | // These are not usually in HardwareSerial but we
78 | // need them in a Unix environment
79 |
80 | /// Wait until a character is available from the port.
81 | void waitAvailable();
82 |
83 | /// Wait until a a character is available from the port.
84 | /// or the timeout expires
85 | /// \param[in] timeout The maximum time to wait in milliseconds. 0 means wait forever.
86 | /// \return true if a message is available as reported by available()
87 | bool waitAvailableTimeout(uint16_t timeout);
88 |
89 | protected:
90 | bool openDevice();
91 | bool closeDevice();
92 | bool setBaud(int baud);
93 |
94 | private:
95 | const char* _deviceName;
96 | int _device; // file desriptor
97 | int _baud;
98 | };
99 |
100 | #endif
101 |
--------------------------------------------------------------------------------
/Logiciel/remora/LibTeleinfo.h:
--------------------------------------------------------------------------------
1 | // **********************************************************************************
2 | // Driver definition for French Teleinfo
3 | // **********************************************************************************
4 | // Creative Commons Attrib Share-Alike License
5 | // You are free to use/extend this library but please abide with the CC-BY-SA license:
6 | // http://creativecommons.org/licenses/by-sa/4.0/
7 | //
8 | // For any explanation about teleinfo ou use , see my blog
9 | // http://hallard.me/category/tinfo
10 | //
11 | // Code based on following datasheet
12 | // http://www.erdf.fr/sites/default/files/ERDF-NOI-CPT_02E.pdf
13 | //
14 | // Written by Charles-Henri Hallard (http://hallard.me)
15 | //
16 | // History : V1.00 2015-06-14 - First release
17 | //
18 | // All text above must be included in any redistribution.
19 | //
20 | // Edit : Tab size set to 2 but I converted tab to sapces
21 | //
22 | // **********************************************************************************
23 |
24 | #ifndef LibTeleinfo_h
25 | #define LibTeleinfo_h
26 |
27 | #ifdef __arm__
28 | #include
29 | #include
30 | #include
31 | #include
32 | #define boolean bool
33 | #endif
34 |
35 | #ifdef ARDUINO
36 | #include
37 | #endif
38 |
39 | // Using ESP8266 ?
40 | #ifdef ESP8266
41 | //#include "stdlib_noniso.h"
42 | #include
43 | #endif
44 |
45 | // Define this if you want library to be verbose
46 | //#define TI_DEBUG
47 |
48 | // I prefix debug macro to be sure to use specific for THIS library
49 | // debugging, this should not interfere with main sketch or other
50 | // libraries
51 | #ifdef TI_DEBUG
52 | #ifdef ESP8266
53 | #define TI_Debug(x) Serial1.print(x)
54 | #define TI_Debugln(x) Serial1.println(x)
55 | #define TI_Debugf(...) Serial1.printf(__VA_ARGS__)
56 | #define TI_Debugflush Serial1.flush
57 | #else
58 | #define TI_Debug(x) Serial.print(x)
59 | #define TI_Debugln(x) Serial.println(x)
60 | #define TI_Debugf(...) Serial.printf(__VA_ARGS__)
61 | #define TI_Debugflush Serial.flush
62 | #endif
63 | #else
64 | #define TI_Debug(x)
65 | #define TI_Debugln(x)
66 | #define TI_Debugf(...)
67 | #define TI_Debugflush
68 | #endif
69 |
70 | // Linked list structure containing all values received
71 | typedef struct _ValueList ValueList;
72 | struct _ValueList
73 | {
74 | ValueList *next; // next element
75 | uint8_t checksum;// checksum
76 | uint8_t flags; // specific flags
77 | char * name; // LABEL of value name
78 | char * value; // value
79 | };
80 |
81 | // Library state machine
82 | enum _State_e {
83 | TINFO_INIT, // We're in init
84 | TINFO_WAIT_STX, // We're waiting for STX
85 | TINFO_WAIT_ETX, // We had STX, We're waiting for ETX
86 | TINFO_READY // We had STX AND ETX, So we're OK
87 | };
88 |
89 | // what we done with received value (also for callback flags)
90 | #define TINFO_FLAGS_NONE 0x00
91 | #define TINFO_FLAGS_NOTHING 0x01
92 | #define TINFO_FLAGS_ADDED 0x02
93 | #define TINFO_FLAGS_EXIST 0x04
94 | #define TINFO_FLAGS_UPDATED 0x08
95 | #define TINFO_FLAGS_ALERT 0x80 /* This will generate an alert */
96 |
97 | // Local buffer for one line of teleinfo
98 | // maximum size, I think it should be enought
99 | #define TINFO_BUFSIZE 64
100 |
101 | // Teleinfo start and end of frame characters
102 | #define TINFO_STX 0x02
103 | #define TINFO_ETX 0x03
104 | #define TINFO_SGR '\n' // start of group
105 | #define TINFO_EGR '\r' // End of group
106 |
107 | class TInfo
108 | {
109 | public:
110 | TInfo();
111 | void init();
112 | _State_e process (char c);
113 | void attachADPS(void (*_fn_ADPS)(uint8_t phase));
114 | void attachData(void (*_fn_data)(ValueList * valueslist, uint8_t state));
115 | void attachNewFrame(void (*_fn_new_frame)(ValueList * valueslist));
116 | void attachUpdatedFrame(void (*_fn_updated_frame)(ValueList * valueslist));
117 | ValueList * addCustomValue(char * name, char * value, uint8_t * flags);
118 | ValueList * getList(void);
119 | uint8_t valuesDump(void);
120 | char * valueGet(char * name, char * value);
121 | boolean listDelete();
122 |
123 | private:
124 | uint8_t clearBuffer();
125 | ValueList * valueAdd (char * name, char * value, uint8_t checksum, uint8_t * flags);
126 | boolean valueRemove (char * name);
127 | boolean valueRemoveFlagged(uint8_t flags);
128 | int labelCount();
129 | unsigned char calcChecksum(char *etiquette, char *valeur) ;
130 | void customLabel( char * plabel, char * pvalue, uint8_t * pflags) ;
131 | ValueList * checkLine(char * pline) ;
132 |
133 | _State_e _state; // Teleinfo machine state
134 | ValueList _valueslist; // Linked list of teleinfo values
135 | char _recv_buff[TINFO_BUFSIZE]; // line receive buffer
136 | uint8_t _recv_idx; // index in receive buffer
137 | boolean _frame_updated; // Data on the frame has been updated
138 | void (*_fn_ADPS)(uint8_t phase);
139 | void (*_fn_data)(ValueList * valueslist, uint8_t state);
140 | void (*_fn_new_frame)(ValueList * valueslist);
141 | void (*_fn_updated_frame)(ValueList * valueslist);
142 |
143 | //volatile uint8_t *dcport;
144 | //uint8_t dcpinmask;
145 | };
146 |
147 | #endif
148 |
--------------------------------------------------------------------------------
/Logiciel/remora/MCP23017.cpp:
--------------------------------------------------------------------------------
1 | /***************************************************
2 | This is a library for the MCP23017 i2c port expander
3 |
4 | These displays use I2C to communicate, 2 pins are required to
5 | interface
6 | Adafruit invests time and resources providing this open source code,
7 | please support Adafruit and open-source hardware by purchasing
8 | products from Adafruit!
9 |
10 | Written by Limor Fried/Ladyada for Adafruit Industries.
11 | BSD license, all text above must be included in any redistribution
12 |
13 | Adapted for Spark Core by Paul Kourany, Sept 3, 2014
14 |
15 | 15/09/2015 Charles-Henri Hallard : Ajout compatibilité ESP8266
16 |
17 | ****************************************************/
18 |
19 | #include "MCP23017.h"
20 |
21 | #ifdef ESP8266
22 | #include
23 | #endif
24 |
25 | // minihelper to keep Arduino backward compatibility
26 | static inline void wiresend(uint8_t x) {
27 | #if (ARDUINO >= 100) || defined (SPARK)
28 | Wire.write((uint8_t) x);
29 | #else
30 | Wire.send(x);
31 | #endif
32 | }
33 |
34 | static inline uint8_t wirerecv(void) {
35 | #if (ARDUINO >= 100) || defined (SPARK)
36 | return Wire.read();
37 | #else
38 | return Wire.receive();
39 | #endif
40 | }
41 |
42 | /**
43 | * Bit number associated to a give Pin
44 | */
45 | uint8_t Adafruit_MCP23017::bitForPin(uint8_t pin){
46 | return pin%8;
47 | }
48 |
49 | /**
50 | * Register address, port dependent, for a given PIN
51 | */
52 | uint8_t Adafruit_MCP23017::regForPin(uint8_t pin, uint8_t portAaddr, uint8_t portBaddr){
53 | return(pin<8) ?portAaddr:portBaddr;
54 | }
55 |
56 | /**
57 | * Reads a given register
58 | */
59 | uint8_t Adafruit_MCP23017::readRegister(uint8_t addr){
60 | // read the current GPINTEN
61 | Wire.beginTransmission(MCP23017_ADDRESS | i2caddr);
62 | wiresend(addr);
63 | Wire.endTransmission();
64 | Wire.requestFrom(MCP23017_ADDRESS | i2caddr, 1);
65 | return wirerecv();
66 | }
67 |
68 |
69 | /**
70 | * Writes a given register
71 | */
72 | void Adafruit_MCP23017::writeRegister(uint8_t regAddr, uint8_t regValue){
73 | // Write the register
74 | Wire.beginTransmission(MCP23017_ADDRESS | i2caddr);
75 | wiresend(regAddr);
76 | wiresend(regValue);
77 | Wire.endTransmission();
78 | }
79 |
80 |
81 | /**
82 | * Helper to update a single bit of an A/B register.
83 | * - Reads the current register value
84 | * - Writes the new register value
85 | */
86 | void Adafruit_MCP23017::updateRegisterBit(uint8_t pin, uint8_t pValue, uint8_t portAaddr, uint8_t portBaddr) {
87 | uint8_t regValue;
88 | uint8_t regAddr=regForPin(pin,portAaddr,portBaddr);
89 | uint8_t bit=bitForPin(pin);
90 | regValue = readRegister(regAddr);
91 |
92 | // set the value for the particular bit
93 | bitWrite(regValue,bit,pValue);
94 |
95 | writeRegister(regAddr,regValue);
96 | }
97 |
98 | ////////////////////////////////////////////////////////////////////////////////
99 |
100 | /**
101 | * Initializes the MCP23017 given its HW selected address, see datasheet for Address selection.
102 | */
103 | void Adafruit_MCP23017::begin(uint8_t addr) {
104 | if (addr > 7) {
105 | addr = 7;
106 | }
107 | i2caddr = addr;
108 |
109 | Wire.begin();
110 |
111 | // set defaults!
112 | // all inputs on port A and B
113 | writeRegister(MCP23017_IODIRA,0xff);
114 | writeRegister(MCP23017_IODIRB,0xff);
115 | }
116 |
117 | /**
118 | * Initializes the default MCP23017, with 000 for the configurable part of the address
119 | */
120 | void Adafruit_MCP23017::begin(void) {
121 | begin(0);
122 | }
123 |
124 | /**
125 | * Sets the pin mode to either INPUT or OUTPUT
126 | */
127 | void Adafruit_MCP23017::pinMode(uint8_t p, uint8_t d) {
128 | updateRegisterBit(p,(d==INPUT),MCP23017_IODIRA,MCP23017_IODIRB);
129 | }
130 |
131 | /**
132 | * Reads all 16 pins (port A and B) into a single 16 bits variable.
133 | */
134 | uint16_t Adafruit_MCP23017::readGPIOAB() {
135 | uint16_t ba = 0;
136 | uint8_t a;
137 |
138 | // read the current GPIO output latches
139 | Wire.beginTransmission(MCP23017_ADDRESS | i2caddr);
140 | wiresend(MCP23017_GPIOA);
141 | Wire.endTransmission();
142 |
143 | Wire.requestFrom(MCP23017_ADDRESS | i2caddr, 2);
144 | a = wirerecv();
145 | ba = wirerecv();
146 | ba <<= 8;
147 | ba |= a;
148 |
149 | return ba;
150 | }
151 |
152 | /**
153 | * Read a single port, A or B, and return its current 8 bit value.
154 | * Parameter b should be 0 for GPIOA, and 1 for GPIOB.
155 | */
156 | uint8_t Adafruit_MCP23017::readGPIO(uint8_t b) {
157 |
158 | // read the current GPIO output latches
159 | Wire.beginTransmission(MCP23017_ADDRESS | i2caddr);
160 | if (b == 0)
161 | wiresend(MCP23017_GPIOA);
162 | else {
163 | wiresend(MCP23017_GPIOB);
164 | }
165 | Wire.endTransmission();
166 |
167 | Wire.requestFrom(MCP23017_ADDRESS | i2caddr, 1);
168 | return wirerecv();
169 | }
170 |
171 | /**
172 | * Writes all the pins in one go. This method is very useful if you are implementing a multiplexed matrix and want to get a decent refresh rate.
173 | */
174 | void Adafruit_MCP23017::writeGPIOAB(uint16_t ba) {
175 | Wire.beginTransmission(MCP23017_ADDRESS | i2caddr);
176 | wiresend(MCP23017_GPIOA);
177 | wiresend(ba & 0xFF);
178 | wiresend(ba >> 8);
179 | Wire.endTransmission();
180 | }
181 |
182 | void Adafruit_MCP23017::digitalWrite(uint8_t pin, uint8_t d) {
183 | uint8_t gpio;
184 | uint8_t bit=bitForPin(pin);
185 |
186 |
187 | // read the current GPIO output latches
188 | uint8_t regAddr=regForPin(pin,MCP23017_OLATA,MCP23017_OLATB);
189 | gpio = readRegister(regAddr);
190 |
191 | // set the pin and direction
192 | bitWrite(gpio,bit,d);
193 |
194 | // write the new GPIO
195 | regAddr=regForPin(pin,MCP23017_GPIOA,MCP23017_GPIOB);
196 | writeRegister(regAddr,gpio);
197 | }
198 |
199 | void Adafruit_MCP23017::pullUp(uint8_t p, uint8_t d) {
200 | updateRegisterBit(p,d,MCP23017_GPPUA,MCP23017_GPPUB);
201 | }
202 |
203 | uint8_t Adafruit_MCP23017::digitalRead(uint8_t pin) {
204 | uint8_t bit=bitForPin(pin);
205 | uint8_t regAddr=regForPin(pin,MCP23017_GPIOA,MCP23017_GPIOB);
206 | return (readRegister(regAddr) >> bit) & 0x1;
207 | }
208 |
209 | /**
210 | * Configures the interrupt system. both port A and B are assigned the same configuration.
211 | * Mirroring will OR both INTA and INTB pins.
212 | * Opendrain will set the INT pin to value or open drain.
213 | * polarity will set LOW or HIGH on interrupt.
214 | * Default values after Power On Reset are: (false,flase, LOW)
215 | * If you are connecting the INTA/B pin to arduino 2/3, you should configure the interupt handling as FALLING with
216 | * the default configuration.
217 | */
218 | void Adafruit_MCP23017::setupInterrupts(uint8_t mirroring, uint8_t openDrain, uint8_t polarity){
219 | // configure the port A
220 | uint8_t ioconfValue=readRegister(MCP23017_IOCONA);
221 | bitWrite(ioconfValue,6,mirroring);
222 | bitWrite(ioconfValue,2,openDrain);
223 | bitWrite(ioconfValue,1,polarity);
224 | writeRegister(MCP23017_IOCONA,ioconfValue);
225 |
226 | // Configure the port B
227 | ioconfValue=readRegister(MCP23017_IOCONB);
228 | bitWrite(ioconfValue,6,mirroring);
229 | bitWrite(ioconfValue,2,openDrain);
230 | bitWrite(ioconfValue,1,polarity);
231 | writeRegister(MCP23017_IOCONB,ioconfValue);
232 | }
233 |
234 | /**
235 | * Set's up a pin for interrupt. uses arduino MODEs: CHANGE, FALLING, RISING.
236 | *
237 | * Note that the interrupt condition finishes when you read the information about the port / value
238 | * that caused the interrupt or you read the port itself. Check the datasheet can be confusing.
239 | *
240 | */
241 | void Adafruit_MCP23017::setupInterruptPin(uint8_t pin, uint8_t mode) {
242 |
243 | // set the pin interrupt control (0 means change, 1 means compare against given value);
244 | updateRegisterBit(pin,(mode!=CHANGE),MCP23017_INTCONA,MCP23017_INTCONB);
245 | // if the mode is not CHANGE, we need to set up a default value, different value triggers interrupt
246 |
247 | // In a RISING interrupt the default value is 0, interrupt is triggered when the pin goes to 1.
248 | // In a FALLING interrupt the default value is 1, interrupt is triggered when pin goes to 0.
249 | updateRegisterBit(pin,(mode==FALLING),MCP23017_DEFVALA,MCP23017_DEFVALB);
250 |
251 | // enable the pin for interrupt
252 | updateRegisterBit(pin,HIGH,MCP23017_GPINTENA,MCP23017_GPINTENB);
253 |
254 | }
255 |
256 | uint8_t Adafruit_MCP23017::getLastInterruptPin(){
257 | uint8_t intf;
258 |
259 | // try port A
260 | intf=readRegister(MCP23017_INTFA);
261 | for(int i=0;i<8;i++) if (bitRead(intf,i)) return i;
262 |
263 | // try port B
264 | intf=readRegister(MCP23017_INTFB);
265 | for(int i=0;i<8;i++) if (bitRead(intf,i)) return i+8;
266 |
267 | return MCP23017_INT_ERR;
268 |
269 | }
270 | uint8_t Adafruit_MCP23017::getLastInterruptPinValue(){
271 | uint8_t intPin=getLastInterruptPin();
272 | if(intPin!=MCP23017_INT_ERR){
273 | uint8_t intcapreg=regForPin(intPin,MCP23017_INTCAPA,MCP23017_INTCAPB);
274 | uint8_t bit=bitForPin(intPin);
275 | return (readRegister(intcapreg)>>bit) & (0x01);
276 | }
277 |
278 | return MCP23017_INT_ERR;
279 | }
280 |
--------------------------------------------------------------------------------
/Logiciel/remora/MCP23017.h:
--------------------------------------------------------------------------------
1 | /***************************************************
2 | This is a library for the MCP23017 i2c port expander
3 |
4 | These displays use I2C to communicate, 2 pins are required to
5 | interface
6 | Adafruit invests time and resources providing this open source code,
7 | please support Adafruit and open-source hardware by purchasing
8 | products from Adafruit!
9 |
10 | Written by Limor Fried/Ladyada for Adafruit Industries.
11 | BSD license, all text above must be included in any redistribution
12 |
13 | 15/09/2015 Charles-Henri Hallard : Ajout compatibilité ESP8266
14 |
15 | ****************************************************/
16 |
17 | #ifndef _Adafruit_MCP23017_H_
18 | #define _Adafruit_MCP23017_H_
19 |
20 | #if defined (SPARK)
21 | #include "application.h"
22 | #define bitRead(value, bit) (((value) >> (bit)) & 0x01)
23 | #define bitSet(value, bit) ((value) |= (1UL << (bit)))
24 | #define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
25 | #define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
26 | #else
27 | #include "Arduino.h"
28 | #endif
29 |
30 | // Don't forget the Wire library
31 | class Adafruit_MCP23017 {
32 | public:
33 | void begin(uint8_t addr);
34 | void begin(void);
35 |
36 | void pinMode(uint8_t p, uint8_t d);
37 | void digitalWrite(uint8_t p, uint8_t d);
38 | void pullUp(uint8_t p, uint8_t d);
39 | uint8_t digitalRead(uint8_t p);
40 |
41 | void writeGPIOAB(uint16_t);
42 | uint16_t readGPIOAB();
43 | uint8_t readGPIO(uint8_t b);
44 |
45 | void setupInterrupts(uint8_t mirroring, uint8_t open, uint8_t polarity);
46 | void setupInterruptPin(uint8_t p, uint8_t mode);
47 | uint8_t getLastInterruptPin();
48 | uint8_t getLastInterruptPinValue();
49 |
50 | /* Charles-Henri Hallard, put these 2 in public */
51 | uint8_t readRegister(uint8_t addr);
52 | void writeRegister(uint8_t addr, uint8_t value);
53 |
54 | private:
55 | uint8_t i2caddr;
56 |
57 | uint8_t bitForPin(uint8_t pin);
58 | uint8_t regForPin(uint8_t pin, uint8_t portAaddr, uint8_t portBaddr);
59 |
60 | /**
61 | * Utility private method to update a register associated with a pin (whether port A/B)
62 | * reads its value, updates the particular bit, and writes its value.
63 | */
64 | void updateRegisterBit(uint8_t p, uint8_t pValue, uint8_t portAaddr, uint8_t portBaddr);
65 |
66 | };
67 |
68 | #define MCP23017_ADDRESS 0x20
69 |
70 | // registers
71 | #define MCP23017_IODIRA 0x00
72 | #define MCP23017_IPOLA 0x02
73 | #define MCP23017_GPINTENA 0x04
74 | #define MCP23017_DEFVALA 0x06
75 | #define MCP23017_INTCONA 0x08
76 | #define MCP23017_IOCONA 0x0A
77 | #define MCP23017_GPPUA 0x0C
78 | #define MCP23017_INTFA 0x0E
79 | #define MCP23017_INTCAPA 0x10
80 | #define MCP23017_GPIOA 0x12
81 | #define MCP23017_OLATA 0x14
82 |
83 |
84 | #define MCP23017_IODIRB 0x01
85 | #define MCP23017_IPOLB 0x03
86 | #define MCP23017_GPINTENB 0x05
87 | #define MCP23017_DEFVALB 0x07
88 | #define MCP23017_INTCONB 0x09
89 | #define MCP23017_IOCONB 0x0B
90 | #define MCP23017_GPPUB 0x0D
91 | #define MCP23017_INTFB 0x0F
92 | #define MCP23017_INTCAPB 0x11
93 | #define MCP23017_GPIOB 0x13
94 | #define MCP23017_OLATB 0x15
95 |
96 | #define MCP23017_INT_ERR 255
97 |
98 | #endif
99 |
--------------------------------------------------------------------------------
/Logiciel/remora/README.md:
--------------------------------------------------------------------------------
1 | Version Logicielle pour toutes les versions du matériel
2 | =======================================================
3 |
4 | Cette version logicielle est compatible avec la version matérielle [1.2][1] ainsi que les anciennes versions des cartes electroniques. Elle est aussi compatible avec les cartes à base d'ESP8266 via un [adaptateur][5]
5 |
6 | Installation (Particle)
7 | -----------------------
8 |
9 | - Télécharger l'environnement de développement [Particle-Dev][2] puis lancer l'IDE.
10 | - Télécharger l'archive du repo logiciel [github][3] et le copier sur votre disque dur puis le décompresser
11 | - Une fois l'IDE ouvert, menu File/Open et ouvrir le dossier programmateur-fil-pilote-wifi-master\Logiciel\remora
12 | - Dans le menu Particle/Log in to Particle Cloud, entrez vos identifiants Particle pour vous connecter
13 | - Dans le menu Particle/Select Device selectionnez votre Spark Core ou Particle Photon
14 | - Ouvrir ensuite depuis l'IDE les fichers remora.ino et remora.h
15 | - Selectionner la version de carte utilisé dans le fichier remora.h (les defines REMORA_BOARD_Vxx)
16 | - Selectionner les modules utilisés dans le fichier remora.h (les defines MOD_xxxx)
17 | - Selectionner l'onglet remora.ino
18 | - Lancer la compilation+upload (icone éclair en haut à gauche)
19 | - Si vous avez une erreur de type "App code was invalid" durant la compilation, supprimer le ficher README.md du dossier
20 |
21 | Installation (Arduino ESP8266)
22 | ------------------------------
23 |
24 | - Suivre la procédure détaillée [ici](https://github.com/esp8266/Arduino)
25 | - Ouvrir ensuite depuis l'IDE le ficher remora.ino
26 | - Selectionner la version de carte utilisé dans le fichier remora.h (les defines REMORA_BOARD_Vxx)
27 | - Selectionner les modules utilisés dans le fichier remora.h (les defines MOD_xxxx)
28 | - choisir la carte NodeMCU 1.0 (ESP12E-Module) ainsi que le bon serial port
29 | - Lancer la compilation + upload
30 | - La procédure OTA sera détaillée ultérieurement
31 |
32 | API Exposée
33 | -----------
34 |
35 | Description complète bientôt
36 |
37 | A faire
38 | -------
39 |
40 | - Mettre des icones plus sympas sur l'afficheur
41 | - Gérer les retour de sondes RF, pour le moment seules les trames sont affichées sur la serial, rien n'est encore fait
42 | - Gérer le RF des sondes Oregon Scientific
43 | - pour le moment seul les [OLED][4] I2C sont gérés
44 | - tout autre idée est bienvenue
45 |
46 | Historiques des Modifications
47 | -----------------------------
48 | 16/02/2015 : Ajout délestage cascadocyclique / Possibilité de ne récupérer l'état que d'un seul fil pilote
49 |
50 | 14/04/2015 : Ajout d'une variable spark pour la teleinfo. Passage en un seul appel pour script jeedom. Les variables d'origine restent utilisables.
51 |
52 | 30/09/2015 : voir le post [dédié][6].
53 |
54 |
55 |
56 | Exemple
57 | -------
58 |
59 | Pour les photos la téléinfo n'était pas branchée sur la carte, c'est pour celà que les compteurs et le bargraphe sont à 0
60 |
61 |
62 |
63 |
64 |
65 | Avec la téléinfo branchée sur la carte, le bargraph indique la puissance instantanée par rapport au contrat souscrit, ici soit 11% car on consomme 5A sur un contrat de 45A. Nous sommes en heures pleines (affichage sur fond blanc)
66 |
67 |
68 |
69 | [1]: https://github.com/thibdct/programmateur-fil-pilote-wifi/tree/master/Mat%C3%A9riel/1.2
70 | [2]: https://www.particle.io/dev
71 | [3]: https://github.com/thibdct/programmateur-fil-pilote-wifi/archive/master.zip
72 | [4]: http://www.ebay.com/itm/291216700457
73 | [5]: https://github.com/hallard/Particle2NodeMCU/blob/master/README.md
74 | [6]: https://community.hallard.me/topic/92/nouvelle-version-remora-compatible-esp8266
75 |
--------------------------------------------------------------------------------
/Logiciel/remora/RHDatagram.cpp:
--------------------------------------------------------------------------------
1 | // RHDatagram.cpp
2 | //
3 | // Copyright (C) 2011 Mike McCauley
4 | // $Id: RHDatagram.cpp,v 1.6 2014/05/23 02:20:17 mikem Exp $
5 |
6 | #include "RHDatagram.h"
7 |
8 | RHDatagram::RHDatagram(RHGenericDriver& driver, uint8_t thisAddress)
9 | :
10 | _driver(driver),
11 | _thisAddress(thisAddress)
12 | {
13 | }
14 |
15 | ////////////////////////////////////////////////////////////////////
16 | // Public methods
17 | bool RHDatagram::init()
18 | {
19 | bool ret = _driver.init();
20 | if (ret)
21 | setThisAddress(_thisAddress);
22 | return ret;
23 | }
24 |
25 | void RHDatagram::setThisAddress(uint8_t thisAddress)
26 | {
27 | _driver.setThisAddress(thisAddress);
28 | // Use this address in the transmitted FROM header
29 | setHeaderFrom(thisAddress);
30 | _thisAddress = thisAddress;
31 | }
32 |
33 | bool RHDatagram::sendto(uint8_t* buf, uint8_t len, uint8_t address)
34 | {
35 | setHeaderTo(address);
36 | return _driver.send(buf, len);
37 | }
38 |
39 | bool RHDatagram::recvfrom(uint8_t* buf, uint8_t* len, uint8_t* from, uint8_t* to, uint8_t* id, uint8_t* flags)
40 | {
41 | if (_driver.recv(buf, len))
42 | {
43 | if (from) *from = headerFrom();
44 | if (to) *to = headerTo();
45 | if (id) *id = headerId();
46 | if (flags) *flags = headerFlags();
47 | return true;
48 | }
49 | return false;
50 | }
51 |
52 | bool RHDatagram::available()
53 | {
54 | return _driver.available();
55 | }
56 |
57 | void RHDatagram::waitAvailable()
58 | {
59 | _driver.waitAvailable();
60 | }
61 |
62 | bool RHDatagram::waitPacketSent()
63 | {
64 | return _driver.waitPacketSent();
65 | }
66 |
67 | bool RHDatagram::waitPacketSent(uint16_t timeout)
68 | {
69 | return _driver.waitPacketSent(timeout);
70 | }
71 |
72 | bool RHDatagram::waitAvailableTimeout(uint16_t timeout)
73 | {
74 | return _driver.waitAvailableTimeout(timeout);
75 | }
76 |
77 | uint8_t RHDatagram::thisAddress()
78 | {
79 | return _thisAddress;
80 | }
81 |
82 | void RHDatagram::setHeaderTo(uint8_t to)
83 | {
84 | _driver.setHeaderTo(to);
85 | }
86 |
87 | void RHDatagram::setHeaderFrom(uint8_t from)
88 | {
89 | _driver.setHeaderFrom(from);
90 | }
91 |
92 | void RHDatagram::setHeaderId(uint8_t id)
93 | {
94 | _driver.setHeaderId(id);
95 | }
96 |
97 | void RHDatagram::setHeaderFlags(uint8_t set, uint8_t clear)
98 | {
99 | _driver.setHeaderFlags(set, clear);
100 | }
101 |
102 | uint8_t RHDatagram::headerTo()
103 | {
104 | return _driver.headerTo();
105 | }
106 |
107 | uint8_t RHDatagram::headerFrom()
108 | {
109 | return _driver.headerFrom();
110 | }
111 |
112 | uint8_t RHDatagram::headerId()
113 | {
114 | return _driver.headerId();
115 | }
116 |
117 | uint8_t RHDatagram::headerFlags()
118 | {
119 | return _driver.headerFlags();
120 | }
121 |
122 |
123 |
124 |
--------------------------------------------------------------------------------
/Logiciel/remora/RHDatagram.h:
--------------------------------------------------------------------------------
1 | // RHDatagram.h
2 | // Author: Mike McCauley (mikem@airspayce.com)
3 | // Copyright (C) 2011 Mike McCauley
4 | // $Id: RHDatagram.h,v 1.14 2015/08/12 23:18:51 mikem Exp $
5 |
6 | #ifndef RHDatagram_h
7 | #define RHDatagram_h
8 |
9 | #include "RHGenericDriver.h"
10 |
11 | // This is the maximum possible message size for radios supported by RadioHead.
12 | // Not all radios support this length, and many are much smaller
13 | #define RH_MAX_MESSAGE_LEN 255
14 |
15 | /////////////////////////////////////////////////////////////////////
16 | /// \class RHDatagram RHDatagram.h
17 | /// \brief Manager class for addressed, unreliable messages
18 | ///
19 | /// Every RHDatagram node has an 8 bit address (defaults to 0).
20 | /// Addresses (DEST and SRC) are 8 bit integers with an address of RH_BROADCAST_ADDRESS (0xff)
21 | /// reserved for broadcast.
22 | ///
23 | /// \par Media Access Strategy
24 | ///
25 | /// RHDatagram and the underlying drivers always transmit as soon as sendto() is called.
26 | ///
27 | /// \par Message Lengths
28 | ///
29 | /// Not all Radio drivers supported by RadioHead can handle the same message lengths. Some radios can handle
30 | /// up to 255 octets, and some as few as 28. If you attempt to send a message that is too long for
31 | /// the underlying driver, sendTo() will return false and will not transmit the message.
32 | /// It is the programmers responsibility to make
33 | /// sure that messages passed to sendto() do not exceed the capability of the radio. You can use the
34 | /// *_MAX_MESSAGE_LENGTH definitions or driver->maxMessageLength() to help.
35 | ///
36 | /// \par Headers
37 | ///
38 | /// Each message sent and received by a RadioHead driver includes 4 headers:
39 | /// \b TO The node address that the message is being sent to (broadcast RH_BROADCAST_ADDRESS (255) is permitted)
40 | /// \b FROM The node address of the sending node
41 | /// \b ID A message ID, distinct (over short time scales) for each message sent by a particilar node
42 | /// \b FLAGS A bitmask of flags. The most significant 4 bits are reserved for use by RadioHead. The least
43 | /// significant 4 bits are reserved for applications.
44 | ///
45 | class RHDatagram
46 | {
47 | public:
48 | /// Constructor.
49 | /// \param[in] driver The RadioHead driver to use to transport messages.
50 | /// \param[in] thisAddress The address to assign to this node. Defaults to 0
51 | RHDatagram(RHGenericDriver& driver, uint8_t thisAddress = 0);
52 |
53 | /// Initialise this instance and the
54 | /// driver connected to it.
55 | bool init();
56 |
57 | /// Sets the address of this node. Defaults to 0.
58 | /// This will be used to set the FROM address of all messages sent by this node.
59 | /// In a conventional multinode system, all nodes will have a unique address
60 | /// (which you could store in EEPROM).
61 | /// \param[in] thisAddress The address of this node
62 | void setThisAddress(uint8_t thisAddress);
63 |
64 | /// Sends a message to the node(s) with the given address
65 | /// RH_BROADCAST_ADDRESS is a valid address which will cause the message
66 | /// to be accepted by all RHDatagram nodes within range.
67 | /// \param[in] buf Pointer to the binary message to send
68 | /// \param[in] len Number of octets to send (> 0)
69 | /// \param[in] address The address to send the message to.
70 | /// \return true if the message not too loing fot eh driver, and the message was transmitted.
71 | bool sendto(uint8_t* buf, uint8_t len, uint8_t address);
72 |
73 | /// Turns the receiver on if it not already on.
74 | /// If there is a valid message available for this node, copy it to buf and return true
75 | /// The SRC address is placed in *from if present and not NULL.
76 | /// The DEST address is placed in *to if present and not NULL.
77 | /// If a message is copied, *len is set to the length.
78 | /// You should be sure to call this function frequently enough to not miss any messages
79 | /// It is recommended that you call it in your main loop.
80 | /// \param[in] buf Location to copy the received message
81 | /// \param[in,out] len Pointer to available space in buf. Set to the actual number of octets copied.
82 | /// \param[in] from If present and not NULL, the referenced uint8_t will be set to the FROM address
83 | /// \param[in] to If present and not NULL, the referenced uint8_t will be set to the TO address
84 | /// \param[in] id If present and not NULL, the referenced uint8_t will be set to the ID
85 | /// \param[in] flags If present and not NULL, the referenced uint8_t will be set to the FLAGS
86 | /// (not just those addressed to this node).
87 | /// \return true if a valid message was copied to buf
88 | bool recvfrom(uint8_t* buf, uint8_t* len, uint8_t* from = NULL, uint8_t* to = NULL, uint8_t* id = NULL, uint8_t* flags = NULL);
89 |
90 | /// Tests whether a new message is available
91 | /// from the Driver.
92 | /// On most drivers, this will also put the Driver into RHModeRx mode until
93 | /// a message is actually received bythe transport, when it will be returned to RHModeIdle.
94 | /// This can be called multiple times in a timeout loop.
95 | /// \return true if a new, complete, error-free uncollected message is available to be retreived by recv()
96 | bool available();
97 |
98 | /// Starts the Driver receiver and blocks until a valid received
99 | /// message is available.
100 | void waitAvailable();
101 |
102 | /// Blocks until the transmitter
103 | /// is no longer transmitting.
104 | bool waitPacketSent();
105 |
106 | /// Blocks until the transmitter is no longer transmitting.
107 | /// or until the timeout occuers, whichever happens first
108 | /// \param[in] timeout Maximum time to wait in milliseconds.
109 | /// \return true if the radio completed transmission within the timeout period. False if it timed out.
110 | bool waitPacketSent(uint16_t timeout);
111 |
112 | /// Starts the Driver receiver and blocks until a received message is available or a timeout
113 | /// \param[in] timeout Maximum time to wait in milliseconds.
114 | /// \return true if a message is available
115 | bool waitAvailableTimeout(uint16_t timeout);
116 |
117 | /// Sets the TO header to be sent in all subsequent messages
118 | /// \param[in] to The new TO header value
119 | void setHeaderTo(uint8_t to);
120 |
121 | /// Sets the FROM header to be sent in all subsequent messages
122 | /// \param[in] from The new FROM header value
123 | void setHeaderFrom(uint8_t from);
124 |
125 | /// Sets the ID header to be sent in all subsequent messages
126 | /// \param[in] id The new ID header value
127 | void setHeaderId(uint8_t id);
128 |
129 | /// Sets and clears bits in the FLAGS header to be sent in all subsequent messages
130 | /// \param[in] set bitmask of bits to be set
131 | /// \param[in] clear bitmask of flags to clear
132 | void setHeaderFlags(uint8_t set, uint8_t clear = RH_FLAGS_NONE);
133 |
134 | /// Returns the TO header of the last received message
135 | /// \return The TO header of the most recently received message.
136 | uint8_t headerTo();
137 |
138 | /// Returns the FROM header of the last received message
139 | /// \return The FROM header of the most recently received message.
140 | uint8_t headerFrom();
141 |
142 | /// Returns the ID header of the last received message
143 | /// \return The ID header of the most recently received message.
144 | uint8_t headerId();
145 |
146 | /// Returns the FLAGS header of the last received message
147 | /// \return The FLAGS header of the most recently received message.
148 | uint8_t headerFlags();
149 |
150 | /// Returns the address of this node.
151 | /// \return The address of this node
152 | uint8_t thisAddress();
153 |
154 | protected:
155 | /// The Driver we are to use
156 | RHGenericDriver& _driver;
157 |
158 | /// The address of this node
159 | uint8_t _thisAddress;
160 | };
161 |
162 | #endif
163 |
--------------------------------------------------------------------------------
/Logiciel/remora/RHGenericDriver.cpp:
--------------------------------------------------------------------------------
1 | // RHGenericDriver.cpp
2 | //
3 | // Copyright (C) 2014 Mike McCauley
4 | // $Id: RHGenericDriver.cpp,v 1.18 2015/01/02 21:38:24 mikem Exp $
5 |
6 | #include "RHGenericDriver.h"
7 |
8 | RHGenericDriver::RHGenericDriver()
9 | :
10 | _mode(RHModeInitialising),
11 | _thisAddress(RH_BROADCAST_ADDRESS),
12 | _txHeaderTo(RH_BROADCAST_ADDRESS),
13 | _txHeaderFrom(RH_BROADCAST_ADDRESS),
14 | _txHeaderId(0),
15 | _txHeaderFlags(0),
16 | _rxBad(0),
17 | _rxGood(0),
18 | _txGood(0)
19 | {
20 | }
21 |
22 | bool RHGenericDriver::init()
23 | {
24 | return true;
25 | }
26 |
27 | // Blocks until a valid message is received
28 | void RHGenericDriver::waitAvailable()
29 | {
30 | while (!available())
31 | YIELD;
32 | }
33 |
34 | // Blocks until a valid message is received or timeout expires
35 | // Return true if there is a message available
36 | // Works correctly even on millis() rollover
37 | bool RHGenericDriver::waitAvailableTimeout(uint16_t timeout)
38 | {
39 | unsigned long starttime = millis();
40 | while ((millis() - starttime) < timeout)
41 | {
42 | if (available())
43 | return true;
44 | YIELD;
45 | }
46 | return false;
47 | }
48 |
49 | bool RHGenericDriver::waitPacketSent()
50 | {
51 | while (_mode == RHModeTx)
52 | YIELD; // Wait for any previous transmit to finish
53 | return true;
54 | }
55 |
56 | bool RHGenericDriver::waitPacketSent(uint16_t timeout)
57 | {
58 | unsigned long starttime = millis();
59 | while ((millis() - starttime) < timeout)
60 | {
61 | if (_mode != RHModeTx) // Any previous transmit finished?
62 | return true;
63 | YIELD;
64 | }
65 | return false;
66 | }
67 |
68 | void RHGenericDriver::setPromiscuous(bool promiscuous)
69 | {
70 | _promiscuous = promiscuous;
71 | }
72 |
73 | void RHGenericDriver::setThisAddress(uint8_t address)
74 | {
75 | _thisAddress = address;
76 | }
77 |
78 | void RHGenericDriver::setHeaderTo(uint8_t to)
79 | {
80 | _txHeaderTo = to;
81 | }
82 |
83 | void RHGenericDriver::setHeaderFrom(uint8_t from)
84 | {
85 | _txHeaderFrom = from;
86 | }
87 |
88 | void RHGenericDriver::setHeaderId(uint8_t id)
89 | {
90 | _txHeaderId = id;
91 | }
92 |
93 | void RHGenericDriver::setHeaderFlags(uint8_t set, uint8_t clear)
94 | {
95 | _txHeaderFlags &= ~clear;
96 | _txHeaderFlags |= set;
97 | }
98 |
99 | uint8_t RHGenericDriver::headerTo()
100 | {
101 | return _rxHeaderTo;
102 | }
103 |
104 | uint8_t RHGenericDriver::headerFrom()
105 | {
106 | return _rxHeaderFrom;
107 | }
108 |
109 | uint8_t RHGenericDriver::headerId()
110 | {
111 | return _rxHeaderId;
112 | }
113 |
114 | uint8_t RHGenericDriver::headerFlags()
115 | {
116 | return _rxHeaderFlags;
117 | }
118 |
119 | int8_t RHGenericDriver::lastRssi()
120 | {
121 | return _lastRssi;
122 | }
123 |
124 | RHGenericDriver::RHMode RHGenericDriver::mode()
125 | {
126 | return _mode;
127 | }
128 |
129 | void RHGenericDriver::setMode(RHMode mode)
130 | {
131 | _mode = mode;
132 | }
133 |
134 | bool RHGenericDriver::sleep()
135 | {
136 | return false;
137 | }
138 |
139 | // Diagnostic help
140 | void RHGenericDriver::printBuffer(const char* prompt, const uint8_t* buf, uint8_t len)
141 | {
142 | uint8_t i;
143 |
144 | #ifdef RH_HAVE_SERIAL
145 | Serial.println(prompt);
146 | for (i = 0; i < len; i++)
147 | {
148 | if (i % 16 == 15)
149 | Serial.println(buf[i], HEX);
150 | else
151 | {
152 | Serial.print(buf[i], HEX);
153 | Serial.print(' ');
154 | }
155 | }
156 | Serial.println("");
157 | #endif
158 | }
159 |
160 | uint16_t RHGenericDriver::rxBad()
161 | {
162 | return _rxBad;
163 | }
164 |
165 | uint16_t RHGenericDriver::rxGood()
166 | {
167 | return _rxGood;
168 | }
169 |
170 | uint16_t RHGenericDriver::txGood()
171 | {
172 | return _txGood;
173 | }
174 |
175 | #if (RH_PLATFORM == RH_PLATFORM_ARDUINO) && defined(RH_PLATFORM_ATTINY)
176 | // Tinycore does not have __cxa_pure_virtual, so without this we
177 | // get linking complaints from the default code generated for pure virtual functions
178 | extern "C" void __cxa_pure_virtual()
179 | {
180 | while (1);
181 | }
182 | #endif
183 |
--------------------------------------------------------------------------------
/Logiciel/remora/RHGenericSPI.cpp:
--------------------------------------------------------------------------------
1 | // RHGenericSPI.cpp
2 | // Author: Mike McCauley (mikem@airspayce.com)
3 | // Copyright (C) 2011 Mike McCauley
4 | // Contributed by Joanna Rutkowska
5 | // $Id: RHGenericSPI.cpp,v 1.2 2014/04/12 05:26:05 mikem Exp $
6 |
7 | #include "RHGenericSPI.h"
8 |
9 | RHGenericSPI::RHGenericSPI(Frequency frequency, BitOrder bitOrder, DataMode dataMode)
10 | :
11 | _frequency(frequency),
12 | _bitOrder(bitOrder),
13 | _dataMode(dataMode)
14 | {
15 | }
16 |
17 | void RHGenericSPI::setBitOrder(BitOrder bitOrder)
18 | {
19 | _bitOrder = bitOrder;
20 | }
21 |
22 | void RHGenericSPI::setDataMode(DataMode dataMode)
23 | {
24 | _dataMode = dataMode;
25 | }
26 |
27 | void RHGenericSPI::setFrequency(Frequency frequency)
28 | {
29 | _frequency = frequency;
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/Logiciel/remora/RHGenericSPI.h:
--------------------------------------------------------------------------------
1 | // RHGenericSPI.h
2 | // Author: Mike McCauley (mikem@airspayce.com)
3 | // Copyright (C) 2011 Mike McCauley
4 | // Contributed by Joanna Rutkowska
5 | // $Id: RHGenericSPI.h,v 1.7 2014/04/14 08:37:11 mikem Exp $
6 |
7 | #ifndef RHGenericSPI_h
8 | #define RHGenericSPI_h
9 |
10 | #include "RadioHead.h"
11 |
12 | /////////////////////////////////////////////////////////////////////
13 | /// \class RHGenericSPI RHGenericSPI.h
14 | /// \brief Base class for SPI interfaces
15 | ///
16 | /// This generic abstract class is used to encapsulate hardware or software SPI interfaces for
17 | /// a variety of platforms.
18 | /// The intention is so that driver classes can be configured to use hardware or software SPI
19 | /// without changing the main code.
20 | ///
21 | /// You must provide a subclass of this class to driver constructors that require SPI.
22 | /// A concrete subclass that encapsualates the standard Arduino hardware SPI and a bit-banged
23 | /// software implementation is included.
24 | ///
25 | /// Do not directly use this class: it must be subclassed and the following abstract functions at least
26 | /// must be implmented:
27 | /// - begin()
28 | /// - end()
29 | /// - transfer()
30 | class RHGenericSPI
31 | {
32 | public:
33 |
34 | /// \brief Defines constants for different SPI modes
35 | ///
36 | /// Defines constants for different SPI modes
37 | /// that can be passed to the constructor or setMode()
38 | /// We need to define these in a device and platform independent way, because the
39 | /// SPI implementation is different on each platform.
40 | typedef enum
41 | {
42 | DataMode0 = 0, ///< SPI Mode 0: CPOL = 0, CPHA = 0
43 | DataMode1, ///< SPI Mode 1: CPOL = 0, CPHA = 1
44 | DataMode2, ///< SPI Mode 2: CPOL = 1, CPHA = 0
45 | DataMode3, ///< SPI Mode 3: CPOL = 1, CPHA = 1
46 | } DataMode;
47 |
48 | /// \brief Defines constants for different SPI bus frequencies
49 | ///
50 | /// Defines constants for different SPI bus frequencies
51 | /// that can be passed to setFrequency().
52 | /// The frequency you get may not be exactly the one according to the name.
53 | /// We need to define these in a device and platform independent way, because the
54 | /// SPI implementation is different on each platform.
55 | typedef enum
56 | {
57 | Frequency1MHz = 0, ///< SPI bus frequency close to 1MHz
58 | Frequency2MHz, ///< SPI bus frequency close to 2MHz
59 | Frequency4MHz, ///< SPI bus frequency close to 4MHz
60 | Frequency8MHz, ///< SPI bus frequency close to 8MHz
61 | Frequency16MHz ///< SPI bus frequency close to 16MHz
62 | } Frequency;
63 |
64 | /// \brief Defines constants for different SPI endianness
65 | ///
66 | /// Defines constants for different SPI endianness
67 | /// that can be passed to setBitOrder()
68 | /// We need to define these in a device and platform independent way, because the
69 | /// SPI implementation is different on each platform.
70 | typedef enum
71 | {
72 | BitOrderMSBFirst = 0, ///< SPI MSB first
73 | BitOrderLSBFirst, ///< SPI LSB first
74 | } BitOrder;
75 |
76 | /// Constructor
77 | /// Creates an instance of an abstract SPI interface.
78 | /// Do not use this contructor directly: you must instead use on of the concrete subclasses provided
79 | /// such as RHHardwareSPI or RHSoftwareSPI
80 | /// \param[in] frequency One of RHGenericSPI::Frequency to select the SPI bus frequency. The frequency
81 | /// is mapped to the closest available bus frequency on the platform.
82 | /// \param[in] bitOrder Select the SPI bus bit order, one of RHGenericSPI::BitOrderMSBFirst or
83 | /// RHGenericSPI::BitOrderLSBFirst.
84 | /// \param[in] dataMode Selects the SPI bus data mode. One of RHGenericSPI::DataMode
85 | RHGenericSPI(Frequency frequency = Frequency1MHz, BitOrder bitOrder = BitOrderMSBFirst, DataMode dataMode = DataMode0);
86 |
87 | /// Transfer a single octet to and from the SPI interface
88 | /// \param[in] data The octet to send
89 | /// \return The octet read from SPI while the data octet was sent
90 | virtual uint8_t transfer(uint8_t data) = 0;
91 |
92 | /// SPI Configuration methods
93 | /// Enable SPI interrupts (if supported)
94 | /// This can be used in an SPI slave to indicate when an SPI message has been received
95 | virtual void attachInterrupt() {};
96 |
97 | /// Disable SPI interrupts (if supported)
98 | /// This can be used to diable the SPI interrupt in slaves where that is supported.
99 | virtual void detachInterrupt() {};
100 |
101 | /// Initialise the SPI library.
102 | /// Call this after configuring and before using the SPI library
103 | virtual void begin() = 0;
104 |
105 | /// Disables the SPI bus (leaving pin modes unchanged).
106 | /// Call this after you have finished using the SPI interface
107 | virtual void end() = 0;
108 |
109 | /// Sets the bit order the SPI interface will use
110 | /// Sets the order of the bits shifted out of and into the SPI bus, either
111 | /// LSBFIRST (least-significant bit first) or MSBFIRST (most-significant bit first).
112 | /// \param[in] bitOrder Bit order to be used: one of RHGenericSPI::BitOrder
113 | virtual void setBitOrder(BitOrder bitOrder);
114 |
115 | /// Sets the SPI data mode: that is, clock polarity and phase.
116 | /// See the Wikipedia article on SPI for details.
117 | /// \param[in] dataMode The mode to use: one of RHGenericSPI::DataMode
118 | virtual void setDataMode(DataMode dataMode);
119 |
120 | /// Sets the SPI clock divider relative to the system clock.
121 | /// On AVR based boards, the dividers available are 2, 4, 8, 16, 32, 64 or 128.
122 | /// The default setting is SPI_CLOCK_DIV4, which sets the SPI clock to one-quarter
123 | /// the frequency of the system clock (4 Mhz for the boards at 16 MHz).
124 | /// \param[in] frequency The data rate to use: one of RHGenericSPI::Frequency
125 | virtual void setFrequency(Frequency frequency);
126 |
127 | protected:
128 | /// The configure SPI Bus frequency, one of RHGenericSPI::Frequency
129 | Frequency _frequency; // Bus frequency, one of RHGenericSPI::Frequency
130 |
131 | /// Bit order, one of RHGenericSPI::BitOrder
132 | BitOrder _bitOrder;
133 |
134 | /// SPI bus mode, one of RHGenericSPI::DataMode
135 | DataMode _dataMode;
136 | };
137 | #endif
138 |
--------------------------------------------------------------------------------
/Logiciel/remora/RHHardwareSPI.cpp:
--------------------------------------------------------------------------------
1 | // RHHardwareSPI.h
2 | // Author: Mike McCauley (mikem@airspayce.com)
3 | // Copyright (C) 2011 Mike McCauley
4 | // Contributed by Joanna Rutkowska
5 | // $Id: RHHardwareSPI.cpp,v 1.12 2015/07/01 00:46:05 mikem Exp $
6 |
7 | #include "RHHardwareSPI.h"
8 |
9 | // Declare a single default instance of the hardware SPI interface class
10 | RHHardwareSPI hardware_spi;
11 |
12 | #ifdef RH_HAVE_HARDWARE_SPI
13 |
14 | #if (RH_PLATFORM == RH_PLATFORM_STM32) // Maple etc
15 | // Declare an SPI interface to use
16 | HardwareSPI SPI(1);
17 | #elif (RH_PLATFORM == RH_PLATFORM_STM32STD) // STM32F4 Discovery
18 | // Declare an SPI interface to use
19 | HardwareSPI SPI(1);
20 | #endif
21 |
22 | // Arduino Due has default SPI pins on central SPI headers, and not on 10, 11, 12, 13
23 | // as per otherArduinos
24 | // http://21stdigitalhome.blogspot.com.au/2013/02/arduino-due-hardware-spi.html
25 | #if defined (__arm__) && !defined(CORE_TEENSY) && !defined(SPARK)
26 | // Arduino Due in 1.5.5 has no definitions for SPI dividers
27 | // SPI clock divider is based on MCK of 84MHz
28 | #define SPI_CLOCK_DIV16 (VARIANT_MCK/84000000) // 1MHz
29 | #define SPI_CLOCK_DIV8 (VARIANT_MCK/42000000) // 2MHz
30 | #define SPI_CLOCK_DIV4 (VARIANT_MCK/21000000) // 4MHz
31 | #define SPI_CLOCK_DIV2 (VARIANT_MCK/10500000) // 8MHz
32 | #define SPI_CLOCK_DIV1 (VARIANT_MCK/5250000) // 16MHz
33 | #endif
34 |
35 | RHHardwareSPI::RHHardwareSPI(Frequency frequency, BitOrder bitOrder, DataMode dataMode)
36 | :
37 | RHGenericSPI(frequency, bitOrder, dataMode)
38 | {
39 | }
40 |
41 | uint8_t RHHardwareSPI::transfer(uint8_t data)
42 | {
43 | return SPI.transfer(data);
44 | }
45 |
46 | void RHHardwareSPI::attachInterrupt()
47 | {
48 | #if (RH_PLATFORM == RH_PLATFORM_ARDUINO) || (RH_PLATFORM == RH_PLATFORM_PARTICLE)
49 | // Slave SPI does not exist on ESP8266
50 | #ifndef ESP8266
51 | SPI.attachInterrupt();
52 | #endif
53 | #endif
54 | }
55 |
56 | void RHHardwareSPI::detachInterrupt()
57 | {
58 | #if (RH_PLATFORM == RH_PLATFORM_ARDUINO) || (RH_PLATFORM == RH_PLATFORM_PARTICLE)
59 | // Slave SPI does not exisi on ESP8266
60 | #ifndef ESP8266
61 | SPI.detachInterrupt();
62 | #endif
63 | #endif
64 | }
65 |
66 | void RHHardwareSPI::begin()
67 | {
68 | // Sigh: there are no common symbols for some of these SPI options across all platforms
69 | #if (RH_PLATFORM == RH_PLATFORM_ARDUINO) || (RH_PLATFORM == RH_PLATFORM_UNO32) || (RH_PLATFORM == RH_PLATFORM_PARTICLE)
70 | uint8_t dataMode;
71 | if (_dataMode == DataMode0)
72 | dataMode = SPI_MODE0;
73 | else if (_dataMode == DataMode1)
74 | dataMode = SPI_MODE1;
75 | else if (_dataMode == DataMode2)
76 | dataMode = SPI_MODE2;
77 | else if (_dataMode == DataMode3)
78 | dataMode = SPI_MODE3;
79 | else
80 | dataMode = SPI_MODE0;
81 | #if (RH_PLATFORM == RH_PLATFORM_ARDUINO) && defined(__arm__) && defined(CORE_TEENSY) && !defined(SPARK)
82 | // Temporary work-around due to problem where avr_emulation.h does not work properly for the setDataMode() cal
83 | SPCR &= ~SPI_MODE_MASK;
84 | #else
85 | SPI.setDataMode(dataMode);
86 | #endif
87 |
88 | #if (RH_PLATFORM == RH_PLATFORM_ARDUINO) && defined (__arm__) && !defined(CORE_TEENSY) && !defined(SPARK)
89 | // Arduino Due in 1.5.5 has its own BitOrder :-(
90 | ::BitOrder bitOrder;
91 | #else
92 | uint8_t bitOrder;
93 | #endif
94 | if (_bitOrder == BitOrderLSBFirst)
95 | bitOrder = LSBFIRST;
96 | else
97 | bitOrder = MSBFIRST;
98 | SPI.setBitOrder(bitOrder);
99 |
100 | #ifdef ESP8266
101 | long divider;
102 | #else
103 | uint8_t divider;
104 | #endif
105 | switch (_frequency)
106 | {
107 | case Frequency1MHz:
108 | default:
109 | #ifdef ESP8266
110 | divider = SPI_CLOCK_DIV16;
111 | #elif F_CPU == 8000000
112 | divider = SPI_CLOCK_DIV8;
113 | #else
114 | #if (RH_PLATFORM == RH_PLATFORM_PARTICLE)
115 | #if PLATFORM_ID == 0 // Core 72MHz => 1.12MHz
116 | divider = SPI_CLOCK_DIV64;
117 |
118 | #elif PLATFORM_ID == 6 // Photon 120MHZ =3.6MHz
119 | divider = SPI_CLOCK_DIV128;
120 | #else
121 | #error "*** Particle PLATFORM_ID not supported by this library. Particle PLATFORM should be Core or Photon"
122 | #endif
123 | #else
124 | divider = SPI_CLOCK_DIV16;
125 | #endif
126 | #endif
127 | break;
128 |
129 | case Frequency2MHz:
130 | #ifdef ESP8266
131 | divider = SPI_CLOCK_DIV8;
132 | #elif F_CPU == 8000000
133 | divider = SPI_CLOCK_DIV4;
134 | #else
135 | #if (RH_PLATFORM == RH_PLATFORM_PARTICLE)
136 | #if PLATFORM_ID == 0 // Core 72MHz => 2.25Mhz
137 | divider = SPI_CLOCK_DIV32;
138 | #elif PLATFORM_ID == 6 // Photon 120MHZ =>1.8Mhz
139 | divider = SPI_CLOCK_DIV64;
140 | #else
141 | #error "*** Particle PLATFORM_ID not supported by this library. Particle PLATFORM should be Core or Photon"
142 | #endif
143 | #else
144 | divider = SPI_CLOCK_DIV8;
145 | #endif
146 | #endif
147 | break;
148 |
149 | case Frequency4MHz:
150 | #ifdef ESP8266
151 | divider = SPI_CLOCK_DIV4;
152 | #elif F_CPU == 8000000
153 | divider = SPI_CLOCK_DIV2;
154 | #else
155 | #if (RH_PLATFORM == RH_PLATFORM_PARTICLE)
156 | #if PLATFORM_ID == 0 // Core 72MHz => 4.5Mhz
157 | divider = SPI_CLOCK_DIV16;
158 | #elif PLATFORM_ID == 6 // Photon 120MHZ =>3.75Mhz
159 | divider = SPI_CLOCK_DIV32;
160 | #else
161 | #error "*** Particle PLATFORM_ID not supported by this library. Particle PLATFORM should be Core or Photon"
162 | #endif
163 | #else
164 | divider = SPI_CLOCK_DIV4;
165 | #endif
166 | #endif
167 | break;
168 |
169 | case Frequency8MHz:
170 | #if (RH_PLATFORM == RH_PLATFORM_PARTICLE)
171 | #if PLATFORM_ID == 0 // Core 72MHz => 9Mhz
172 | divider = SPI_CLOCK_DIV8;
173 | #elif PLATFORM_ID == 6 // Photon 120MHZ =>7.5Mhz
174 | divider = SPI_CLOCK_DIV16;
175 | #else
176 | #error "*** Particle PLATFORM_ID not supported by this library. Particle PLATFORM should be Core or Photon"
177 | #endif
178 | #else
179 | divider = SPI_CLOCK_DIV2; // 4MHz on an 8MHz Arduino
180 | #endif
181 |
182 | break;
183 |
184 | case Frequency16MHz:
185 | #if (RH_PLATFORM == RH_PLATFORM_PARTICLE)
186 | #if PLATFORM_ID == 0 // Core 72MHz => 18Mhz
187 | divider = SPI_CLOCK_DIV4;
188 | #elif PLATFORM_ID == 6 // Photon 120MHZ =>16Mhz
189 | divider = SPI_CLOCK_DIV8;
190 | #else
191 | #error "*** Particle PLATFORM_ID not supported by this library. Particle PLATFORM should be Core or Photon"
192 | #endif
193 | #else
194 | divider = SPI_CLOCK_DIV2; // Not really 16MHz, only 8MHz. 4MHz on an 8MHz Arduino
195 | #endif
196 |
197 | break;
198 |
199 | }
200 | SPI.setClockDivider(divider);
201 | SPI.begin();
202 |
203 | #elif (RH_PLATFORM == RH_PLATFORM_STM32) // Maple etc
204 | spi_mode dataMode;
205 | // Hmmm, if we do this as a switch, GCC on maple gets v confused!
206 | if (_dataMode == DataMode0)
207 | dataMode = SPI_MODE_0;
208 | else if (_dataMode == DataMode1)
209 | dataMode = SPI_MODE_1;
210 | else if (_dataMode == DataMode2)
211 | dataMode = SPI_MODE_2;
212 | else if (_dataMode == DataMode3)
213 | dataMode = SPI_MODE_3;
214 | else
215 | dataMode = SPI_MODE_0;
216 |
217 | uint32 bitOrder;
218 | if (_bitOrder == BitOrderLSBFirst)
219 | bitOrder = LSBFIRST;
220 | else
221 | bitOrder = MSBFIRST;
222 |
223 | SPIFrequency frequency; // Yes, I know these are not exact equivalents.
224 | switch (_frequency)
225 | {
226 | case Frequency1MHz:
227 | default:
228 | frequency = SPI_1_125MHZ;
229 | break;
230 |
231 | case Frequency2MHz:
232 | frequency = SPI_2_25MHZ;
233 | break;
234 |
235 | case Frequency4MHz:
236 | frequency = SPI_4_5MHZ;
237 | break;
238 |
239 | case Frequency8MHz:
240 | frequency = SPI_9MHZ;
241 | break;
242 |
243 | case Frequency16MHz:
244 | frequency = SPI_18MHZ;
245 | break;
246 |
247 | }
248 | SPI.begin(frequency, bitOrder, dataMode);
249 |
250 | #elif (RH_PLATFORM == RH_PLATFORM_STM32STD) // STM32F4 discovery
251 | uint8_t dataMode;
252 | if (_dataMode == DataMode0)
253 | dataMode = SPI_MODE0;
254 | else if (_dataMode == DataMode1)
255 | dataMode = SPI_MODE1;
256 | else if (_dataMode == DataMode2)
257 | dataMode = SPI_MODE2;
258 | else if (_dataMode == DataMode3)
259 | dataMode = SPI_MODE3;
260 | else
261 | dataMode = SPI_MODE0;
262 |
263 | uint32_t bitOrder;
264 | if (_bitOrder == BitOrderLSBFirst)
265 | bitOrder = LSBFIRST;
266 | else
267 | bitOrder = MSBFIRST;
268 |
269 | SPIFrequency frequency; // Yes, I know these are not exact equivalents.
270 | switch (_frequency)
271 | {
272 | case Frequency1MHz:
273 | default:
274 | frequency = SPI_1_3125MHZ;
275 | break;
276 |
277 | case Frequency2MHz:
278 | frequency = SPI_2_625MHZ;
279 | break;
280 |
281 | case Frequency4MHz:
282 | frequency = SPI_5_25MHZ;
283 | break;
284 |
285 | case Frequency8MHz:
286 | frequency = SPI_10_5MHZ;
287 | break;
288 |
289 | case Frequency16MHz:
290 | frequency = SPI_21_0MHZ;
291 | break;
292 |
293 | }
294 | SPI.begin(frequency, bitOrder, dataMode);
295 | #elif (RH_PLATFORM == RH_PLATFORM_RASPI) // Raspberry PI
296 | uint8_t dataMode;
297 | if (_dataMode == DataMode0)
298 | dataMode = BCM2835_SPI_MODE0;
299 | else if (_dataMode == DataMode1)
300 | dataMode = BCM2835_SPI_MODE1;
301 | else if (_dataMode == DataMode2)
302 | dataMode = BCM2835_SPI_MODE2;
303 | else if (_dataMode == DataMode3)
304 | dataMode = BCM2835_SPI_MODE3;
305 |
306 | uint8_t bitOrder;
307 | if (_bitOrder == BitOrderLSBFirst)
308 | bitOrder = BCM2835_SPI_BIT_ORDER_LSBFIRST;
309 | else
310 | bitOrder = BCM2835_SPI_BIT_ORDER_MSBFIRST;
311 |
312 | uint32_t divider;
313 | switch (_frequency)
314 | {
315 | case Frequency1MHz:
316 | default:
317 | divider = BCM2835_SPI_CLOCK_DIVIDER_256;
318 | break;
319 | case Frequency2MHz:
320 | divider = BCM2835_SPI_CLOCK_DIVIDER_128;
321 | break;
322 | case Frequency4MHz:
323 | divider = BCM2835_SPI_CLOCK_DIVIDER_64;
324 | break;
325 | case Frequency8MHz:
326 | divider = BCM2835_SPI_CLOCK_DIVIDER_32;
327 | break;
328 | case Frequency16MHz:
329 | divider = BCM2835_SPI_CLOCK_DIVIDER_16;
330 | break;
331 | }
332 | SPI.begin(divider, bitOrder, dataMode);
333 | #else
334 | #warning RHHardwareSPI does not support this platform yet. Consider adding it and contributing a patch.
335 | #endif
336 | }
337 |
338 | void RHHardwareSPI::end()
339 | {
340 | return SPI.end();
341 | }
342 |
343 | #endif
344 |
--------------------------------------------------------------------------------
/Logiciel/remora/RHHardwareSPI.h:
--------------------------------------------------------------------------------
1 | // RHHardwareSPI.h
2 | // Author: Mike McCauley (mikem@airspayce.com)
3 | // Copyright (C) 2011 Mike McCauley
4 | // Contributed by Joanna Rutkowska
5 | // $Id: RHHardwareSPI.h,v 1.9 2014/08/12 00:54:52 mikem Exp $
6 |
7 | #ifndef RHHardwareSPI_h
8 | #define RHHardwareSPI_h
9 |
10 | #include "RHGenericSPI.h"
11 |
12 | /////////////////////////////////////////////////////////////////////
13 | /// \class RHHardwareSPI RHHardwareSPI.h
14 | /// \brief Encapsulate a hardware SPI bus interface
15 | ///
16 | /// This concrete subclass of GenericSPIClass encapsulates the standard Arduino hardware and other
17 | /// hardware SPI interfaces.
18 | class RHHardwareSPI : public RHGenericSPI
19 | {
20 | #ifdef RH_HAVE_HARDWARE_SPI
21 | public:
22 | /// Constructor
23 | /// Creates an instance of a hardware SPI interface, using whatever SPI hardware is available on
24 | /// your processor platform. On Arduino and Uno32, uses SPI. On Maple, uses HardwareSPI.
25 | /// \param[in] frequency One of RHGenericSPI::Frequency to select the SPI bus frequency. The frequency
26 | /// is mapped to the closest available bus frequency on the platform.
27 | /// \param[in] bitOrder Select the SPI bus bit order, one of RHGenericSPI::BitOrderMSBFirst or
28 | /// RHGenericSPI::BitOrderLSBFirst.
29 | /// \param[in] dataMode Selects the SPI bus data mode. One of RHGenericSPI::DataMode
30 | RHHardwareSPI(Frequency frequency = Frequency1MHz, BitOrder bitOrder = BitOrderMSBFirst, DataMode dataMode = DataMode0);
31 |
32 | /// Transfer a single octet to and from the SPI interface
33 | /// \param[in] data The octet to send
34 | /// \return The octet read from SPI while the data octet was sent
35 | uint8_t transfer(uint8_t data);
36 |
37 | // SPI Configuration methods
38 | /// Enable SPI interrupts
39 | /// This can be used in an SPI slave to indicate when an SPI message has been received
40 | /// It will cause the SPI_STC_vect interrupt vectr to be executed
41 | void attachInterrupt();
42 |
43 | /// Disable SPI interrupts
44 | /// This can be used to diable the SPI interrupt in slaves where that is supported.
45 | void detachInterrupt();
46 |
47 | /// Initialise the SPI library
48 | /// Call this after configuring the SPI interface and before using it to transfer data.
49 | /// Initializes the SPI bus by setting SCK, MOSI, and SS to outputs, pulling SCK and MOSI low, and SS high.
50 | void begin();
51 |
52 | /// Disables the SPI bus (leaving pin modes unchanged).
53 | /// Call this after you have finished using the SPI interface.
54 | void end();
55 | #else
56 | // not supported on ATTiny etc
57 | uint8_t transfer(uint8_t data) {return 0;}
58 | void begin(){}
59 | void end(){}
60 |
61 | #endif
62 | };
63 |
64 | // Built in default instance
65 | extern RHHardwareSPI hardware_spi;
66 |
67 | #endif
68 |
--------------------------------------------------------------------------------
/Logiciel/remora/RHReliableDatagram.cpp:
--------------------------------------------------------------------------------
1 | // RHReliableDatagram.cpp
2 | //
3 | // Define addressed datagram
4 | //
5 | // Part of the Arduino RH library for operating with HopeRF RH compatible transceivers
6 | // (see http://www.hoperf.com)
7 | // RHDatagram will be received only by the addressed node or all nodes within range if the
8 | // to address is RH_BROADCAST_ADDRESS
9 | //
10 | // Author: Mike McCauley (mikem@airspayce.com)
11 | // Copyright (C) 2011 Mike McCauley
12 | // $Id: RHReliableDatagram.cpp,v 1.14 2015/08/13 02:45:47 mikem Exp mikem $
13 |
14 | #include "RHReliableDatagram.h"
15 |
16 | ////////////////////////////////////////////////////////////////////
17 | // Constructors
18 | RHReliableDatagram::RHReliableDatagram(RHGenericDriver& driver, uint8_t thisAddress)
19 | : RHDatagram(driver, thisAddress)
20 | {
21 | _retransmissions = 0;
22 | _lastSequenceNumber = 0;
23 | _timeout = RH_DEFAULT_TIMEOUT;
24 | _retries = RH_DEFAULT_RETRIES;
25 | }
26 |
27 | ////////////////////////////////////////////////////////////////////
28 | // Public methods
29 | void RHReliableDatagram::setTimeout(uint16_t timeout)
30 | {
31 | _timeout = timeout;
32 | }
33 |
34 | ////////////////////////////////////////////////////////////////////
35 | void RHReliableDatagram::setRetries(uint8_t retries)
36 | {
37 | _retries = retries;
38 | }
39 |
40 | ////////////////////////////////////////////////////////////////////
41 | uint8_t RHReliableDatagram::retries()
42 | {
43 | return _retries;
44 | }
45 |
46 | ////////////////////////////////////////////////////////////////////
47 | bool RHReliableDatagram::sendtoWait(uint8_t* buf, uint8_t len, uint8_t address)
48 | {
49 | // Assemble the message
50 | uint8_t thisSequenceNumber = ++_lastSequenceNumber;
51 | uint8_t retries = 0;
52 | while (retries++ <= _retries)
53 | {
54 | setHeaderId(thisSequenceNumber);
55 | setHeaderFlags(RH_FLAGS_NONE, RH_FLAGS_ACK); // Clear the ACK flag
56 | sendto(buf, len, address);
57 | waitPacketSent();
58 |
59 | // Never wait for ACKS to broadcasts:
60 | if (address == RH_BROADCAST_ADDRESS)
61 | return true;
62 |
63 | if (retries > 1)
64 | _retransmissions++;
65 | unsigned long thisSendTime = millis(); // Timeout does not include original transmit time
66 |
67 | // Compute a new timeout, random between _timeout and _timeout*2
68 | // This is to prevent collisions on every retransmit
69 | // if 2 nodes try to transmit at the same time
70 | uint16_t timeout = _timeout + (_timeout * random(0, 256) / 256);
71 | int32_t timeLeft;
72 | while ((timeLeft = timeout - (millis() - thisSendTime)) > 0)
73 | {
74 | if (waitAvailableTimeout(timeLeft))
75 | {
76 | uint8_t from, to, id, flags;
77 | if (recvfrom(0, 0, &from, &to, &id, &flags)) // Discards the message
78 | {
79 | // Now have a message: is it our ACK?
80 | if ( from == address
81 | && to == _thisAddress
82 | && (flags & RH_FLAGS_ACK)
83 | && (id == thisSequenceNumber))
84 | {
85 | // Its the ACK we are waiting for
86 | return true;
87 | }
88 | else if ( !(flags & RH_FLAGS_ACK)
89 | && (id == _seenIds[from]))
90 | {
91 | // This is a request we have already received. ACK it again
92 | acknowledge(id, from);
93 | }
94 | // Else discard it
95 | }
96 | }
97 | // Not the one we are waiting for, maybe keep waiting until timeout exhausted
98 | YIELD;
99 | }
100 | // Timeout exhausted, maybe retry
101 | YIELD;
102 | }
103 | // Retries exhausted
104 | return false;
105 | }
106 |
107 | ////////////////////////////////////////////////////////////////////
108 | bool RHReliableDatagram::recvfromAck(uint8_t* buf, uint8_t* len, uint8_t* from, uint8_t* to, uint8_t* id, uint8_t* flags)
109 | {
110 | uint8_t _from;
111 | uint8_t _to;
112 | uint8_t _id;
113 | uint8_t _flags;
114 | // Get the message before its clobbered by the ACK (shared rx and tx buffer in some drivers
115 | if (available() && recvfrom(buf, len, &_from, &_to, &_id, &_flags))
116 | {
117 | // Never ACK an ACK
118 | if (!(_flags & RH_FLAGS_ACK))
119 | {
120 | // Its a normal message for this node, not an ACK
121 | if (_to != RH_BROADCAST_ADDRESS)
122 | {
123 | // Its not a broadcast, so ACK it
124 | // Acknowledge message with ACK set in flags and ID set to received ID
125 | acknowledge(_id, _from);
126 | }
127 | // If we have not seen this message before, then we are interested in it
128 | if (_id != _seenIds[_from])
129 | {
130 | if (from) *from = _from;
131 | if (to) *to = _to;
132 | if (id) *id = _id;
133 | if (flags) *flags = _flags;
134 | _seenIds[_from] = _id;
135 | return true;
136 | }
137 | // Else just re-ack it and wait for a new one
138 | }
139 | }
140 | // No message for us available
141 | return false;
142 | }
143 |
144 | bool RHReliableDatagram::recvfromAckTimeout(uint8_t* buf, uint8_t* len, uint16_t timeout, uint8_t* from, uint8_t* to, uint8_t* id, uint8_t* flags)
145 | {
146 | unsigned long starttime = millis();
147 | int32_t timeLeft;
148 | while ((timeLeft = timeout - (millis() - starttime)) > 0)
149 | {
150 | if (waitAvailableTimeout(timeLeft))
151 | {
152 | if (recvfromAck(buf, len, from, to, id, flags))
153 | return true;
154 | }
155 | YIELD;
156 | }
157 | return false;
158 | }
159 |
160 | uint32_t RHReliableDatagram::retransmissions()
161 | {
162 | return _retransmissions;
163 | }
164 |
165 | void RHReliableDatagram::resetRetransmissions()
166 | {
167 | _retransmissions = 0;
168 | }
169 |
170 | void RHReliableDatagram::acknowledge(uint8_t id, uint8_t from)
171 | {
172 | setHeaderId(id);
173 | setHeaderFlags(RH_FLAGS_ACK);
174 | // We would prefer to send a zero length ACK,
175 | // but if an RH_RF22 receives a 0 length message with a CRC error, it will never receive
176 | // a 0 length message again, until its reset, which makes everything hang :-(
177 | // So we send an ACK of 1 octet
178 | // REVISIT: should we send the RSSI for the information of the sender?
179 | uint8_t ack = '!';
180 | sendto(&ack, sizeof(ack), from);
181 | waitPacketSent();
182 | }
183 |
184 |
--------------------------------------------------------------------------------
/Logiciel/remora/RHSPIDriver.cpp:
--------------------------------------------------------------------------------
1 | // RHSPIDriver.cpp
2 | //
3 | // Copyright (C) 2014 Mike McCauley
4 | // $Id: RHSPIDriver.cpp,v 1.9 2014/05/03 00:20:36 mikem Exp $
5 |
6 | #include "RHSPIDriver.h"
7 |
8 | RHSPIDriver::RHSPIDriver(uint8_t slaveSelectPin, RHGenericSPI& spi)
9 | :
10 | _spi(spi),
11 | _slaveSelectPin(slaveSelectPin)
12 | {
13 | }
14 |
15 | bool RHSPIDriver::init()
16 | {
17 | // start the SPI library with the default speeds etc:
18 | // On Arduino Due this defaults to SPI1 on the central group of 6 SPI pins
19 | _spi.begin();
20 |
21 | // Initialise the slave select pin
22 | // On Maple, this must be _after_ spi.begin
23 | pinMode(_slaveSelectPin, OUTPUT);
24 | digitalWrite(_slaveSelectPin, HIGH);
25 |
26 | delay(100);
27 | return true;
28 | }
29 |
30 | uint8_t RHSPIDriver::spiRead(uint8_t reg)
31 | {
32 | uint8_t val;
33 | ATOMIC_BLOCK_START;
34 | digitalWrite(_slaveSelectPin, LOW);
35 | _spi.transfer(reg & ~RH_SPI_WRITE_MASK); // Send the address with the write mask off
36 | val = _spi.transfer(0); // The written value is ignored, reg value is read
37 | digitalWrite(_slaveSelectPin, HIGH);
38 | ATOMIC_BLOCK_END;
39 | return val;
40 | }
41 |
42 | uint8_t RHSPIDriver::spiWrite(uint8_t reg, uint8_t val)
43 | {
44 | uint8_t status = 0;
45 | ATOMIC_BLOCK_START;
46 | digitalWrite(_slaveSelectPin, LOW);
47 | status = _spi.transfer(reg | RH_SPI_WRITE_MASK); // Send the address with the write mask on
48 | _spi.transfer(val); // New value follows
49 | digitalWrite(_slaveSelectPin, HIGH);
50 | ATOMIC_BLOCK_END;
51 | return status;
52 | }
53 |
54 | uint8_t RHSPIDriver::spiBurstRead(uint8_t reg, uint8_t* dest, uint8_t len)
55 | {
56 | uint8_t status = 0;
57 | ATOMIC_BLOCK_START;
58 | digitalWrite(_slaveSelectPin, LOW);
59 | status = _spi.transfer(reg & ~RH_SPI_WRITE_MASK); // Send the start address with the write mask off
60 | while (len--)
61 | *dest++ = _spi.transfer(0);
62 | digitalWrite(_slaveSelectPin, HIGH);
63 | ATOMIC_BLOCK_END;
64 | return status;
65 | }
66 |
67 | uint8_t RHSPIDriver::spiBurstWrite(uint8_t reg, const uint8_t* src, uint8_t len)
68 | {
69 | uint8_t status = 0;
70 | ATOMIC_BLOCK_START;
71 | digitalWrite(_slaveSelectPin, LOW);
72 | status = _spi.transfer(reg | RH_SPI_WRITE_MASK); // Send the start address with the write mask on
73 | while (len--)
74 | _spi.transfer(*src++);
75 | digitalWrite(_slaveSelectPin, HIGH);
76 | ATOMIC_BLOCK_END;
77 | return status;
78 | }
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/Logiciel/remora/RHSPIDriver.h:
--------------------------------------------------------------------------------
1 | // RHSPIDriver.h
2 | // Author: Mike McCauley (mikem@airspayce.com)
3 | // Copyright (C) 2014 Mike McCauley
4 | // $Id: RHSPIDriver.h,v 1.9 2014/04/23 06:00:59 mikem Exp $
5 |
6 | #ifndef RHSPIDriver_h
7 | #define RHSPIDriver_h
8 |
9 | #include "RHGenericDriver.h"
10 | #include "RHHardwareSPI.h"
11 |
12 | // This is the bit in the SPI address that marks it as a write
13 | #define RH_SPI_WRITE_MASK 0x80
14 |
15 | class RHGenericSPI;
16 |
17 | /////////////////////////////////////////////////////////////////////
18 | /// \class RHSPIDriver RHSPIDriver.h
19 | /// \brief Base class for a RadioHead drivers that use the SPI bus
20 | /// to communicate with its transport hardware.
21 | ///
22 | /// This class can be subclassed by Drivers that require to use the SPI bus.
23 | /// It can be configured to use either the RHHardwareSPI class (if there is one available on the platform)
24 | /// of the bitbanged RHSoftwareSPI class. The default behaviour is to use a pre-instantiated built-in RHHardwareSPI
25 | /// interface.
26 | ///
27 | /// SPI bus access is protected by ATOMIC_BLOCK_START and ATOMIC_BLOCK_END, which will ensure interrupts
28 | /// are disabled during access.
29 | ///
30 | /// The read and write routines implement commonly used SPI conventions: specifically that the MSB
31 | /// of the first byte transmitted indicates that it is a write and the remaining bits indicate the rehgister to access)
32 | /// This can be overriden
33 | /// in subclasses if necessaryor an alternative class, RHNRFSPIDriver can be used to access devices like
34 | /// Nordic NRF series radios, which have different requirements.
35 | ///
36 | /// Application developers are not expected to instantiate this class directly:
37 | /// it is for the use of Driver developers.
38 | class RHSPIDriver : public RHGenericDriver
39 | {
40 | public:
41 | /// Constructor
42 | /// \param[in] slaveSelectPin The controler pin to use to select the desired SPI device. This pin will be driven LOW
43 | /// during SPI communications with the SPI device that uis iused by this Driver.
44 | /// \param[in] spi Reference to the SPI interface to use. The default is to use a default built-in Hardware interface.
45 | RHSPIDriver(uint8_t slaveSelectPin = SS, RHGenericSPI& spi = hardware_spi);
46 |
47 | /// Initialise the Driver transport hardware and software.
48 | /// Make sure the Driver is properly configured before calling init().
49 | /// \return true if initialisation succeeded.
50 | bool init();
51 |
52 | /// Reads a single register from the SPI device
53 | /// \param[in] reg Register number
54 | /// \return The value of the register
55 | uint8_t spiRead(uint8_t reg);
56 |
57 | /// Writes a single byte to the SPI device
58 | /// \param[in] reg Register number
59 | /// \param[in] val The value to write
60 | /// \return Some devices return a status byte during the first data transfer. This byte is returned.
61 | /// it may or may not be meaningfule depending on the the type of device being accessed.
62 | uint8_t spiWrite(uint8_t reg, uint8_t val);
63 |
64 | /// Reads a number of consecutive registers from the SPI device using burst read mode
65 | /// \param[in] reg Register number of the first register
66 | /// \param[in] dest Array to write the register values to. Must be at least len bytes
67 | /// \param[in] len Number of bytes to read
68 | /// \return Some devices return a status byte during the first data transfer. This byte is returned.
69 | /// it may or may not be meaningfule depending on the the type of device being accessed.
70 | uint8_t spiBurstRead(uint8_t reg, uint8_t* dest, uint8_t len);
71 |
72 | /// Write a number of consecutive registers using burst write mode
73 | /// \param[in] reg Register number of the first register
74 | /// \param[in] src Array of new register values to write. Must be at least len bytes
75 | /// \param[in] len Number of bytes to write
76 | /// \return Some devices return a status byte during the first data transfer. This byte is returned.
77 | /// it may or may not be meaningfule depending on the the type of device being accessed.
78 | uint8_t spiBurstWrite(uint8_t reg, const uint8_t* src, uint8_t len);
79 |
80 | protected:
81 | /// Reference to the RHGenericSPI instance to use to trasnfer data with teh SPI device
82 | RHGenericSPI& _spi;
83 |
84 | /// The pin number of the Slave Selct pin that is used to select the desired device.
85 | uint8_t _slaveSelectPin;
86 | };
87 |
88 | #endif
89 |
--------------------------------------------------------------------------------
/Logiciel/remora/SSD1306.h:
--------------------------------------------------------------------------------
1 | /*********************************************************************
2 | This is a library for our Monochrome OLEDs based on SSD1306 drivers
3 |
4 | Pick one up today in the adafruit shop!
5 | ------> http://www.adafruit.com/category/63_98
6 |
7 | These displays use SPI to communicate, 4 or 5 pins are required to
8 | interface
9 |
10 | Adafruit invests time and resources providing this open source code,
11 | please support Adafruit and open-source hardware by purchasing
12 | products from Adafruit!
13 |
14 | Written by Limor Fried/Ladyada for Adafruit Industries.
15 | BSD license, check license.txt for more information
16 | All text above, and the splash screen must be included in any redistribution
17 |
18 |
19 | History : 15/01/2015 Charles-Henri Hallard (http://hallard.me)
20 | Ported to for Spark Core
21 | 15/09/2015 Charles-Henri Hallard : Ajout compatibilité ESP8266
22 |
23 |
24 | *********************************************************************/
25 |
26 | #ifndef _ADAFRUIT_SSD1306_H
27 | #define _ADAFRUIT_SSD1306_H
28 |
29 | #ifdef SPARK
30 | #include "application.h"
31 | #endif
32 |
33 | #include "./GFX.h"
34 |
35 |
36 | #define BLACK 0
37 | #define WHITE 1
38 |
39 | #define SSD1306_I2C_ADDRESS 0x3C // 011110+SA0+RW - 0x3C or 0x3D
40 | // Address for 128x32 is 0x3C
41 | // Address for 128x64 is 0x3D (default) or 0x3C (if SA0 is grounded)
42 |
43 | /*=========================================================================
44 | SSD1306 Displays
45 | -----------------------------------------------------------------------
46 | The driver is used in multiple displays (128x64, 128x32, etc.).
47 | Select the appropriate display below to create an appropriately
48 | sized framebuffer, etc.
49 |
50 | SSD1306_128_64 128x64 pixel display
51 |
52 | SSD1306_128_32 128x32 pixel display
53 |
54 | -----------------------------------------------------------------------*/
55 | #define SSD1306_128_64
56 | //#define SSD1306_128_32
57 | /*=========================================================================*/
58 |
59 | #if defined SSD1306_128_64 && defined SSD1306_128_32
60 | #error "Only one SSD1306 display can be specified at once in SSD1306.h"
61 | #endif
62 | #if !defined SSD1306_128_64 && !defined SSD1306_128_32
63 | #error "At least one SSD1306 display must be specified in SSD1306.h"
64 | #endif
65 |
66 | #if defined SSD1306_128_64
67 | #define SSD1306_LCDWIDTH 128
68 | #define SSD1306_LCDHEIGHT 64
69 | #endif
70 | #if defined SSD1306_128_32
71 | #define SSD1306_LCDWIDTH 128
72 | #define SSD1306_LCDHEIGHT 32
73 | #endif
74 |
75 | #define SSD1306_SETCONTRAST 0x81
76 | #define SSD1306_DISPLAYALLON_RESUME 0xA4
77 | #define SSD1306_DISPLAYALLON 0xA5
78 | #define SSD1306_NORMALDISPLAY 0xA6
79 | #define SSD1306_INVERTDISPLAY 0xA7
80 | #define SSD1306_DISPLAYOFF 0xAE
81 | #define SSD1306_DISPLAYON 0xAF
82 |
83 | #define SSD1306_SETDISPLAYOFFSET 0xD3
84 | #define SSD1306_SETCOMPINS 0xDA
85 |
86 | #define SSD1306_SETVCOMDETECT 0xDB
87 |
88 | #define SSD1306_SETDISPLAYCLOCKDIV 0xD5
89 | #define SSD1306_SETPRECHARGE 0xD9
90 |
91 | #define SSD1306_SETMULTIPLEX 0xA8
92 |
93 | #define SSD1306_SETLOWCOLUMN 0x00
94 | #define SSD1306_SETHIGHCOLUMN 0x10
95 |
96 | #define SSD1306_SETSTARTLINE 0x40
97 |
98 | #define SSD1306_MEMORYMODE 0x20
99 | #define SSD1306_COLUMNADDR 0x21
100 | #define SSD1306_PAGEADDR 0x22
101 |
102 | #define SSD1306_COMSCANINC 0xC0
103 | #define SSD1306_COMSCANDEC 0xC8
104 |
105 | #define SSD1306_SEGREMAP 0xA0
106 |
107 | #define SSD1306_CHARGEPUMP 0x8D
108 |
109 | #define SSD1306_EXTERNALVCC 0x1
110 | #define SSD1306_SWITCHCAPVCC 0x2
111 |
112 | // Scrolling #defines
113 | #define SSD1306_ACTIVATE_SCROLL 0x2F
114 | #define SSD1306_DEACTIVATE_SCROLL 0x2E
115 | #define SSD1306_SET_VERTICAL_SCROLL_AREA 0xA3
116 | #define SSD1306_RIGHT_HORIZONTAL_SCROLL 0x26
117 | #define SSD1306_LEFT_HORIZONTAL_SCROLL 0x27
118 | #define SSD1306_VERTICAL_AND_RIGHT_HORIZONTAL_SCROLL 0x29
119 | #define SSD1306_VERTICAL_AND_LEFT_HORIZONTAL_SCROLL 0x2A
120 |
121 | class Adafruit_SSD1306 : public Adafruit_GFX {
122 | public:
123 | Adafruit_SSD1306(int8_t SID, int8_t SCLK, int8_t DC, int8_t RST, int8_t CS);
124 | Adafruit_SSD1306(int8_t DC, int8_t RST, int8_t CS);
125 | Adafruit_SSD1306(int8_t RST);
126 |
127 | void begin(uint8_t i2caddr = SSD1306_I2C_ADDRESS);
128 | void ssd1306_command(uint8_t c);
129 | void ssd1306_data(uint8_t c);
130 |
131 | void clearDisplay(void);
132 | void invertDisplay(uint8_t i);
133 | void display();
134 |
135 | void startscrollright(uint8_t start, uint8_t stop);
136 | void startscrollleft(uint8_t start, uint8_t stop);
137 |
138 | void startscrolldiagright(uint8_t start, uint8_t stop);
139 | void startscrolldiagleft(uint8_t start, uint8_t stop);
140 | void stopscroll(void);
141 |
142 | void dim(bool dim);
143 |
144 | void drawPixel(int16_t x, int16_t y, uint16_t color);
145 |
146 | virtual void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
147 | virtual void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
148 |
149 | private:
150 | int8_t _i2caddr, _vccstate, sid, sclk, dc, rst, cs;
151 | void fastSPIwrite(uint8_t c);
152 |
153 | boolean hwSPI;
154 |
155 | inline void drawFastVLineInternal(int16_t x, int16_t y, int16_t h, uint16_t color) __attribute__((always_inline));
156 | inline void drawFastHLineInternal(int16_t x, int16_t y, int16_t w, uint16_t color) __attribute__((always_inline));
157 |
158 | };
159 |
160 | #endif
161 |
--------------------------------------------------------------------------------
/Logiciel/remora/atomic.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This is port of Dean Camera's ATOMIC_BLOCK macros for AVR to ARM Cortex M3
3 | * v1.0
4 | * Mark Pendrith, Nov 27, 2012.
5 | *
6 | * From Mark:
7 | * >When I ported the macros I emailed Dean to ask what attribution would be
8 | * >appropriate, and here is his response:
9 | * >
10 | * >>Mark,
11 | * >>I think it's great that you've ported the macros; consider them
12 | * >>public domain, to do with whatever you wish. I hope you find them >useful .
13 | * >>
14 | * >>Cheers!
15 | * >>- Dean
16 | */
17 |
18 | #ifdef __arm__
19 | #ifndef _CORTEX_M3_ATOMIC_H_
20 | #define _CORTEX_M3_ATOMIC_H_
21 |
22 | static __inline__ uint32_t __get_primask(void) \
23 | { uint32_t primask = 0; \
24 | __asm__ volatile ("MRS %[result], PRIMASK\n\t":[result]"=r"(primask)::); \
25 | return primask; } // returns 0 if interrupts enabled, 1 if disabled
26 |
27 | static __inline__ void __set_primask(uint32_t setval) \
28 | { __asm__ volatile ("MSR PRIMASK, %[value]\n\t""dmb\n\t""dsb\n\t""isb\n\t"::[value]"r"(setval):);
29 | __asm__ volatile ("" ::: "memory");}
30 |
31 | static __inline__ uint32_t __iSeiRetVal(void) \
32 | { __asm__ volatile ("CPSIE i\n\t""dmb\n\t""dsb\n\t""isb\n\t"); \
33 | __asm__ volatile ("" ::: "memory"); return 1; }
34 |
35 | static __inline__ uint32_t __iCliRetVal(void) \
36 | { __asm__ volatile ("CPSID i\n\t""dmb\n\t""dsb\n\t""isb\n\t"); \
37 | __asm__ volatile ("" ::: "memory"); return 1; }
38 |
39 | static __inline__ void __iSeiParam(const uint32_t *__s) \
40 | { __asm__ volatile ("CPSIE i\n\t""dmb\n\t""dsb\n\t""isb\n\t"); \
41 | __asm__ volatile ("" ::: "memory"); (void)__s; }
42 |
43 | static __inline__ void __iCliParam(const uint32_t *__s) \
44 | { __asm__ volatile ("CPSID i\n\t""dmb\n\t""dsb\n\t""isb\n\t"); \
45 | __asm__ volatile ("" ::: "memory"); (void)__s; }
46 |
47 | static __inline__ void __iRestore(const uint32_t *__s) \
48 | { __set_primask(*__s); __asm__ volatile ("dmb\n\t""dsb\n\t""isb\n\t"); \
49 | __asm__ volatile ("" ::: "memory"); }
50 |
51 |
52 | #define ATOMIC_BLOCK(type) \
53 | for ( type, __ToDo = __iCliRetVal(); __ToDo ; __ToDo = 0 )
54 |
55 | #define ATOMIC_RESTORESTATE \
56 | uint32_t primask_save __attribute__((__cleanup__(__iRestore))) = __get_primask()
57 |
58 | #define ATOMIC_FORCEON \
59 | uint32_t primask_save __attribute__((__cleanup__(__iSeiParam))) = 0
60 |
61 | #define NONATOMIC_BLOCK(type) \
62 | for ( type, __ToDo = __iSeiRetVal(); __ToDo ; __ToDo = 0 )
63 |
64 | #define NONATOMIC_RESTORESTATE \
65 | uint32_t primask_save __attribute__((__cleanup__(__iRestore))) = __get_primask()
66 |
67 | #define NONATOMIC_FORCEOFF \
68 | uint32_t primask_save __attribute__((__cleanup__(__iCliParam))) = 0
69 |
70 | #endif
71 | #endif
72 |
--------------------------------------------------------------------------------
/Logiciel/remora/display.cpp:
--------------------------------------------------------------------------------
1 | // **********************************************************************************
2 | // OLED display management source file for remora project
3 | // **********************************************************************************
4 | // Creative Commons Attrib Share-Alike License
5 | // You are free to use/extend but please abide with the CC-BY-SA license:
6 | // http://creativecommons.org/licenses/by-sa/4.0/
7 | //
8 | // Written by Charles-Henri Hallard (http://hallard.me)
9 | //
10 | // History : V1.00 2015-01-22 - First release
11 | //
12 | // 15/09/2015 Charles-Henri Hallard : Ajout compatibilité ESP8266
13 | //
14 | // All text above must be included in any redistribution.
15 | // **********************************************************************************
16 | #include "display.h"
17 |
18 | // Instantiate OLED (no reset pin)
19 | Adafruit_SSD1306 display(-1);
20 |
21 | // Différents état de l'affichage possible
22 | const char * screen_name[] = {"RF", "System", "Teleinfo"};
23 | screen_e screen_state;
24 |
25 | /* ======================================================================
26 | Function: displaySplash
27 | Purpose : display setup splash screen OLED screen
28 | Input : -
29 | Output : -
30 | Comments: -
31 | ====================================================================== */
32 | void display_splash(void)
33 | {
34 | display.clearDisplay() ;
35 | display.setTextColor(WHITE);
36 | display.setCursor(0,0);
37 | display.setTextSize(2);
38 | display.print(" REMORA\n");
39 | display.print("Fil Pilote\n");
40 | display.setTextSize(1);
41 | //display.print(WiFi.localIP());
42 | display.display();
43 | }
44 |
45 | /* ======================================================================
46 | Function: displaySys
47 | Purpose : display Téléinfo related information on OLED screen
48 | Input : -
49 | Output : -
50 | Comments: -
51 | ====================================================================== */
52 | void displayTeleinfo(void)
53 | {
54 | uint percent = 0;
55 |
56 | // Effacer le buffer de l'affichage
57 | display.clearDisplay();
58 | display.setTextSize(1);
59 | display.setTextColor(WHITE);
60 | display.setCursor(0,0);
61 |
62 | // si en heure pleine inverser le texte sur le compteur HP
63 | if (ptec == PTEC_HP )
64 | display.setTextColor(BLACK, WHITE); // 'inverted' text
65 |
66 | display.print("Pleines ");
67 | display.printf("%09ld\n", myindexHP);
68 | display.setTextColor(WHITE); // normaltext
69 |
70 | // si en heure creuse inverser le texte sur le compteur HC
71 | if (ptec == PTEC_HC )
72 | display.setTextColor(BLACK, WHITE); // 'inverted' text
73 |
74 | display.print("Creuses ");
75 | display.printf("%09ld\n", myindexHC);
76 | display.setTextColor(WHITE); // normaltext
77 |
78 | // Poucentrage de la puissance totale
79 | percent = (uint) myiInst * 100 / myisousc ;
80 |
81 | //Serial.print("myiInst="); Serial.print(myiInst);
82 | //Serial.print(" myisousc="); Serial.print(myisousc);
83 | //Serial.print(" percent="); Serial.println(percent);
84 |
85 | // Information additionelles
86 | display.printf("%d W %d%% %3d A", mypApp, percent, myiInst);
87 |
88 | // etat des fils pilotes
89 | display.setCursor(0,32);
90 | display.setTextSize(2);
91 | #ifdef SPARK
92 | display.printf("%02d:%02d:%02d",Time.hour(),Time.minute(),Time.second());
93 | #endif
94 |
95 | display.setCursor(0,48);
96 | display.printf("%s %c", etatFP, etatrelais+'0' );
97 |
98 | // Bargraphe de puissance
99 | display.drawVerticalBargraph(114,0,12,40,1, percent);
100 |
101 | display.setTextColor(BLACK, WHITE); // 'inverted' text
102 | }
103 |
104 | /* ======================================================================
105 | Function: displaySys
106 | Purpose : display system related information on OLED screen
107 | Input : -
108 | Output : -
109 | Comments: -
110 | ====================================================================== */
111 | void displaySys(void)
112 | {
113 | // To DO
114 | }
115 |
116 |
117 | /* ======================================================================
118 | Function: displayRf
119 | Purpose : display RF related information on OLED screen
120 | Input : -
121 | Output : -
122 | Comments: -
123 | ====================================================================== */
124 | void displayRf(void)
125 | {/*
126 | int16_t percent;
127 |
128 | display.printf("RF69 G%d I%d", NETWORK_ID, NODE_ID);
129 |
130 | // rssi range 0 (0%) to 115 (100%)
131 | percent = ((module.rssi+115) * 100) / 115;
132 |
133 | //displayClearline(current_line);
134 | //display.setCursor(0,current_line);
135 | //display.print(F("["));
136 | //display.print(module.size);
137 | display.printf("G%d I%d %d%%\n", module.groupid, module.nodeid,percent);
138 | display.printf("[%02X] ", module.size);
139 |
140 | byte n = module.size;
141 | uint8_t * p = module.data;
142 |
143 | // Max 4 data per line on LCD
144 | if (n>12)
145 | n=12;
146 |
147 | for (byte i = 0; i < n; ++i)
148 | display.printf("%02X ", *p++);
149 |
150 | //display.drawHorizontalBargraph(106,current_line+1, 22, 6, 1, percent);
151 |
152 | display.printf("%d%% ", percent);
153 | */
154 | }
155 |
156 | /* ======================================================================
157 | Function: display_setup
158 | Purpose : prepare and init stuff, configuration, ..
159 | Input : -
160 | Output : true if OLED module found, false otherwise
161 | Comments: -
162 | ====================================================================== */
163 | bool display_setup(void)
164 | {
165 | bool ret = false;
166 |
167 | Serial.print("Initializing OLED...Searching...");
168 | Serial.flush();
169 |
170 | // Par defaut affichage des infos de téléinfo
171 | screen_state = screen_teleinfo;
172 |
173 | // Init et detection des modules I2C
174 | if (!i2c_detect(OLED_I2C_ADDRESS)) {
175 | Serial.println("Not found!");
176 | } else {
177 | Serial.print("Setup...");
178 | Serial.flush();
179 |
180 | // initialize with the I2C addr for the 128x64
181 | display.begin(OLED_I2C_ADDRESS);
182 | display.clearDisplay() ;
183 | display.display();
184 | Serial.println("OK!");
185 | ret = true;
186 | }
187 |
188 | Serial.flush();
189 |
190 | return (ret);
191 | }
192 |
193 | /* ======================================================================
194 | Function: display_loop
195 | Purpose : main loop for OLED display
196 | Input : -
197 | Output : -
198 | Comments: -
199 | ====================================================================== */
200 | void display_loop(void)
201 | {
202 | // Si pas de heartbeat via la teleinfo, le faire
203 | // via l'affichage
204 | #ifndef MOD_TELEINFO
205 | LedRGBON(COLOR_BLUE);
206 | #endif
207 |
208 | display.setCursor(0,0);
209 |
210 | if (screen_state==screen_sys)
211 | displaySys();
212 | else if (screen_state==screen_rf)
213 | displayRf();
214 | else if (screen_state==screen_teleinfo)
215 | displayTeleinfo();
216 |
217 | // Affichage physique sur l'écran
218 | display.display();
219 |
220 | #ifndef MOD_TELEINFO
221 | LedRGBOFF();
222 | #endif
223 |
224 | }
225 |
--------------------------------------------------------------------------------
/Logiciel/remora/display.h:
--------------------------------------------------------------------------------
1 | // **********************************************************************************
2 | // OLED display management header file for remora project
3 | // **********************************************************************************
4 | // Creative Commons Attrib Share-Alike License
5 | // You are free to use/extend but please abide with the CC-BY-SA license:
6 | // http://creativecommons.org/licenses/by-sa/4.0/
7 | //
8 | // Written by Charles-Henri Hallard (http://hallard.me)
9 | //
10 | // History : V1.00 2015-01-22 - First release
11 | //
12 | // 15/09/2015 Charles-Henri Hallard : Ajout compatibilité ESP8266
13 | //
14 | // All text above must be included in any redistribution.
15 | //
16 | // **********************************************************************************
17 |
18 | #ifndef __DISPLAY_H__
19 | #define __DISPLAY_H__
20 |
21 | #include "remora.h"
22 |
23 | #define OLED_I2C_ADDRESS 0x3C
24 |
25 | // OLED Parameters
26 | #define OLED_LINE_0 0
27 | #define OLED_LINE_1 8
28 | #define OLED_LINE_2 16
29 | #define OLED_LINE_3 24
30 | #define OLED_LINE_4 32
31 | #define OLED_LINE_5 40
32 | #define OLED_LINE_6 48
33 | #define OLED_LINE_7 56
34 | //#define OLED_CHAR_SIZE 5
35 | #define OLED_CHAR_SIZE 7
36 |
37 | #define OLED_SPACE1 OLED_CHAR_SIZE
38 | #define OLED_SPACE2 OLED_CHAR_SIZE*2
39 | #define OLED_SPACE3 OLED_CHAR_SIZE*3
40 | #define OLED_SPACE4 OLED_CHAR_SIZE*4
41 |
42 | // The various screen states supported
43 | typedef enum
44 | {
45 | screen_rf = 0,
46 | screen_sys,
47 | screen_teleinfo,
48 | screen_end
49 | } screen_e;
50 |
51 | // Variables exported for other source file
52 | // ========================================
53 | extern Adafruit_SSD1306 display; /* OLED */
54 | extern const char * screen_name[] ;
55 | extern screen_e screen_state ;
56 |
57 | // Function exported for other source file
58 | // =======================================
59 | void display_splash();
60 | bool display_setup();
61 | void display_loop();
62 |
63 | #endif
64 |
--------------------------------------------------------------------------------
/Logiciel/remora/i2c.cpp:
--------------------------------------------------------------------------------
1 | // **********************************************************************************
2 | // I2C management source file for remora project
3 | // **********************************************************************************
4 | // Creative Commons Attrib Share-Alike License
5 | // You are free to use/extend but please abide with the CC-BY-SA license:
6 | // http://creativecommons.org/licenses/by-sa/4.0/
7 | //
8 | // Written by Charles-Henri Hallard (http://hallard.me)
9 | //
10 | // History : V1.00 2015-01-22 - First release
11 | //
12 | // All text above must be included in any redistribution.
13 | //
14 | // **********************************************************************************
15 |
16 | #include "i2c.h"
17 |
18 | /* ======================================================================
19 | Function: i2c_init
20 | Purpose : initialize the I2C function and setup
21 | Input : -
22 | Output : -
23 | Comments: -
24 | ====================================================================== */
25 | bool i2c_init(void)
26 | {
27 | // Set i2C speed
28 | #if defined (SPARK)
29 | Wire.setSpeed(CLOCK_SPEED_400KHZ);
30 | #elif defined (ESP8266)
31 | // Sepecific ESP8266 to set I2C Speed
32 | Wire.setClock(400000);
33 | #endif
34 |
35 | Wire.begin();
36 | }
37 |
38 | /* ======================================================================
39 | Function: i2c_detect
40 | Purpose : check that a adressed device respond
41 | Input : I2C device address
42 | Output : true is seen (ACKed device) false otherwise
43 | Comments: i2c_init should have been called before
44 | ====================================================================== */
45 | bool i2c_detect(uint8_t _address)
46 | {
47 | Wire.beginTransmission(_address);
48 | return (Wire.endTransmission() == 0 ? true : false);
49 | }
50 |
51 | /* ======================================================================
52 | Function: i2c_scan
53 | Purpose : scan I2C bus and display result
54 | Input : address wanted to search (0xFF)
55 | Output : true if I2C device found at address given
56 | Comments: mostly used for debug purpose
57 | ====================================================================== */
58 | uint8_t i2c_scan()
59 | {
60 | byte error, address;
61 | uint8_t nDevices = 0;
62 |
63 | unsigned long start = millis();
64 |
65 | Serial.println(F("Scanning I2C bus ..."));
66 |
67 | // slow down i2C speed in case of slow device
68 | #if defined (SPARK)
69 | Wire.setSpeed(CLOCK_SPEED_100KHZ);
70 | #elif defined (ESP8266)
71 | // Sepecific ESP8266 to set I2C Speed
72 | Wire.setClock(100000);
73 | #endif
74 |
75 | for(address = 1; address < 127; address++ )
76 | {
77 | // The i2c_scanner uses the return value of
78 | // the Write.endTransmisstion to see if
79 | // a device did acknowledge to the address.
80 | Wire.beginTransmission(address);
81 | error = Wire.endTransmission();
82 |
83 | if (error == 0)
84 | {
85 | Serial.print(F("I2C device found at address 0x"));
86 | if (address<16)
87 | Serial.print("0");
88 | Serial.print(address,HEX);
89 |
90 | if (address>=0x20 && address<=0x27)
91 | Serial.println("-> MCP23017 !");
92 | else if (address==0x3C || address==0x3D)
93 | Serial.println("-> OLED !");
94 | else if (address==0x29 || address==0x39 || address==0x49)
95 | Serial.println("-> TSL2561 !");
96 | else
97 | Serial.println("-> Unknown device !");
98 |
99 | nDevices++;
100 | }
101 | }
102 |
103 | Serial.print(nDevices);
104 | Serial.print(F(" I2C devices found, scan took "));
105 | Serial.print(millis()-start);
106 | Serial.println(" ms");
107 |
108 | // Get back to full speed
109 | // slow down i2C speed in case of slow device
110 | #if defined (SPARK)
111 | Wire.setSpeed(CLOCK_SPEED_400KHZ);
112 | #elif defined (ESP8266)
113 | // Sepecific ESP8266 to set I2C Speed
114 | Wire.setClock(400000);
115 | #endif
116 |
117 | return (nDevices);
118 | }
119 |
--------------------------------------------------------------------------------
/Logiciel/remora/i2c.h:
--------------------------------------------------------------------------------
1 | // **********************************************************************************
2 | // I2C management header file for remora project
3 | // **********************************************************************************
4 | // Creative Commons Attrib Share-Alike License
5 | // You are free to use/extend but please abide with the CC-BY-SA license:
6 | // http://creativecommons.org/licenses/by-sa/4.0/
7 | //
8 | // Written by Charles-Henri Hallard (http://hallard.me)
9 | //
10 | // History : V1.00 2015-01-22 - First release
11 | //
12 | // All text above must be included in any redistribution.
13 | //
14 | // **********************************************************************************
15 | #ifndef I2C_h
16 | #define I2C_h
17 |
18 | #include "remora.h"
19 |
20 | #ifdef ESP8266
21 | #include
22 | #endif
23 |
24 | // Variables exported to other source file
25 | // ========================================
26 | // define RF var for whole project
27 |
28 | // Function exported for other source file
29 | // =======================================
30 | bool i2c_init(void);
31 | bool i2c_detect(uint8_t);
32 | uint8_t i2c_scan(void);
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/Logiciel/remora/linked_list.cpp:
--------------------------------------------------------------------------------
1 | // **********************************************************************************
2 | // ULPNode RF Gateway Basic Linked List source file
3 | // **********************************************************************************
4 | // Creative Commons Attrib Share-Alike License
5 | // You are free to use/extend this library but please abide with the CC-BY-SA license:
6 | // http://creativecommons.org/licenses/by-sa/4.0/
7 | //
8 | // For any explanation of ULPNode RF Protocol see
9 | // https://hallard.me/ulpnode-rf-protocol/
10 | //
11 | // For any explanation of ULPNode see
12 | // https://hallard.me/category/ulpnode
13 | //
14 | // Written by Charles-Henri Hallard (http://hallard.me)
15 | //
16 | // History : V1.10 2015-09-05 - Creation
17 | //
18 | // All text above must be included in any redistribution.
19 | //
20 | // **********************************************************************************
21 | #include "./linked_list.h"
22 |
23 | /* ======================================================================
24 | Function: ll_Delete
25 | Purpose : Delete the ENTIRE Linked List, not a value
26 | Input : pointer to the top of the linked list
27 | Output : True if Ok False Otherwise
28 | Comments: -
29 | ====================================================================== */
30 | boolean ll_Delete(NodeList * me)
31 | {
32 | // Got a pointer
33 | if (me) {
34 | NodeList *current;
35 |
36 | // For each linked list
37 | while ((current = me->next)) {
38 | // Get the next
39 | me->next = current->next;
40 |
41 | // Free the current
42 | free(current);
43 | }
44 |
45 | // Free the top element
46 | me->next = NULL ;
47 | return (true);
48 | }
49 |
50 | return (false);
51 | }
52 |
53 | /* ======================================================================
54 | Function: ll_Add
55 | Purpose : Add element to the Linked List
56 | Input : pointer to the top of the linked list
57 | network ID
58 | node ID
59 | RSSI
60 | second ellapsed since start
61 | Output : pointer to the new node (or founded one)
62 | Comments: last seen is filled with old value in return
63 | ====================================================================== */
64 | NodeList * ll_Add(NodeList * me, uint8_t groupid, uint8_t nodeid, int8_t rssi, unsigned long * sec)
65 | {
66 | // Create pointer on the new node
67 | NodeList *newNode = NULL;
68 |
69 | // Something to use
70 | if (me) {
71 |
72 | // Loop thru the node to see if we know it
73 | while (me->next) {
74 | // go to next node
75 | me = me->next;
76 |
77 | // Check if we already have this node id and group id
78 | if ( me->groupid == groupid && me->nodeid == nodeid) {
79 |
80 | // Save old value
81 | unsigned long old_sec = me->lastseen;
82 |
83 | // Update data
84 | me->rssi = rssi ;
85 | me->lastseen = *sec;
86 |
87 | // Return old value
88 | *sec = old_sec;
89 |
90 | // That's all
91 | return (me);
92 | }
93 | }
94 |
95 | // We did not find this node, it's new
96 | // Create new node with size to store data
97 | if ((newNode = (NodeList *) malloc(sizeof(NodeList)) ) != NULL) {
98 | // Setup our new node values
99 | newNode->next = NULL;
100 | newNode->groupid = groupid ;
101 | newNode->nodeid = nodeid;
102 | newNode->rssi = rssi ;
103 | newNode->lastseen = *sec;
104 |
105 | // add the new node on the list
106 | me->next = newNode;
107 |
108 | // return pointer on the new node
109 | return (newNode);
110 | }
111 | }
112 | // Error
113 | return ( (NodeList *) NULL );
114 | }
115 |
116 | /* ======================================================================
117 | Function: ll_Dump
118 | Purpose : dump linked list content
119 | Input : pointer on the linked list
120 | current seconds ellapsed
121 | Output : total number of values
122 | Comments: -
123 | ====================================================================== */
124 | uint8_t ll_Dump(NodeList * me, unsigned long sec)
125 | {
126 | // Get our linked list
127 | uint8_t index = 0;
128 |
129 | // Got one ?
130 | if (me) {
131 | // Loop thru the node
132 | while (me->next) {
133 | // go to next node
134 | me = me->next;
135 |
136 | index++;
137 | Serial.print(index) ; Serial.print(F(") ")) ;
138 | Serial.print(F("Group:")); Serial.print(me->groupid, DEC) ;
139 | Serial.print(F(" Node:")); Serial.print(me->nodeid, DEC) ;
140 | Serial.print(F(" RSSI:")); Serial.print(me->rssi, DEC) ;
141 | Serial.print(F(" seen:")); Serial.print(sec-me->lastseen) ;
142 | Serial.println(F("")) ;
143 | }
144 | }
145 |
146 | return index;
147 | }
148 |
--------------------------------------------------------------------------------
/Logiciel/remora/linked_list.h:
--------------------------------------------------------------------------------
1 | // **********************************************************************************
2 | // ULPNode RF Gateway Basic Linked List header file
3 | // **********************************************************************************
4 | // Creative Commons Attrib Share-Alike License
5 | // You are free to use/extend this library but please abide with the CC-BY-SA license:
6 | // http://creativecommons.org/licenses/by-sa/4.0/
7 | //
8 | // For any explanation of ULPNode RF Protocol see
9 | // https://hallard.me/ulpnode-rf-protocol/
10 | //
11 | // For any explanation of ULPNode see
12 | // https://hallard.me/category/ulpnode
13 | //
14 | // Written by Charles-Henri Hallard (http://hallard.me)
15 | //
16 | // History : V1.10 2015-09-05 - Creation
17 | //
18 | // All text above must be included in any redistribution.
19 | //
20 | // **********************************************************************************
21 | #ifndef __LINKED_LIST_H__
22 | #define __LINKED_LIST_H__
23 |
24 | #include "remora.h"
25 |
26 | // Linked list structure containing all nodes seen
27 | typedef struct _NodeList NodeList;
28 | struct _NodeList
29 | {
30 | NodeList *next; // next element
31 | uint8_t nodeid; // Node ID
32 | uint8_t groupid; // Network ID
33 | int8_t rssi; // RSSI
34 | unsigned long lastseen; // Last seen time (in second)
35 | };
36 |
37 | // Variables exported to other source file
38 | // ========================================
39 | // extern _NodeList nodes_list;
40 |
41 | // Function exported to other source file
42 | // =======================================
43 | boolean ll_Delete(NodeList * me);
44 | NodeList * ll_Add(NodeList * me, uint8_t nodeid, uint8_t groupid, int8_t rssi, unsigned long * sec);
45 | uint8_t ll_Dump(NodeList * me, unsigned long sec);
46 |
47 | #endif
48 |
--------------------------------------------------------------------------------
/Logiciel/remora/pilotes.h:
--------------------------------------------------------------------------------
1 | // **********************************************************************************
2 | // Programmateur Fil Pilote et Suivi Conso
3 | // **********************************************************************************
4 | // Copyright (C) 2014 Thibault Ducret
5 | // Licence MIT
6 | //
7 | // History : 15/01/2015 Charles-Henri Hallard (http://hallard.me)
8 | // Intégration de version 1.2 de la carte electronique
9 | // 15/09/2015 Charles-Henri Hallard : Ajout compatibilité ESP8266
10 | //
11 | // **********************************************************************************
12 |
13 | #ifndef PILOTES_h
14 | #define PILOTES_h
15 |
16 | #include "remora.h"
17 |
18 | // Fils pilotes
19 | #define NB_FILS_PILOTES 7
20 |
21 | // Cartes Version 1.0 et 1.1
22 | #if defined (REMORA_BOARD_V10) || defined (REMORA_BOARD_V11)
23 | // Les fils pilotes sont connectés de la façon suivante sur le core
24 | // # Fil Pilote Digital Port
25 | // FP1 (a et b) -> D6,D7
26 | // FP2 (a et b) -> D4/D5
27 | // FP3 (a et b) -> D2/D3
28 | // FP4 (a et b) -> A6/A7
29 | // FP5 (a et b) -> A4/A5
30 | // FP6 (a et b) -> A2/A3
31 | // FP7 (a et b) -> A0,A1
32 | // Relais -> A1 (attention partagé avec FP7)
33 | #define FP1 D6,D7
34 | #define FP2 D4,D5
35 | #define FP3 D2,D3
36 | #define FP4 A6,A7
37 | #define FP5 A4,A5
38 | #define FP6 A2,A3
39 | #if defined (REMORA_BOARD_V10)
40 | #define FP7 A0,A1
41 | #else
42 | #undef NB_FILS_PILOTES
43 | #define NB_FILS_PILOTES 6
44 | #endif
45 | #else
46 | // Les fils pilotes sont connectés de la façon suivante sur l'I/O expander
47 | // # Fil Pilote MCP IO/Port Digital Port
48 | // FP1 (a et b) -> GPB6, GPB7 -> 14/15
49 | // FP2 (a et b) -> GPB4, GPB5 -> 12/13
50 | // FP3 (a et b) -> GPB2, GPB3 -> 10/11
51 | // FP4 (a et b) -> GPA1, GPA0 -> 1/0
52 | // FP5 (a et b) -> GPA3, GPA2 -> 3/2
53 | // FP6 (a et b) -> GPA5, GPA4 -> 5/4
54 | // FP7 (a et b) -> GPA7, GPA6 -> 7/6
55 | // Relais -> GPB1 -> 9
56 | // LED -> GPB0 -> 8
57 | #define FP1 14,15
58 | #define FP2 12,13
59 | #define FP3 10,11
60 | #define FP4 1,0
61 | #define FP5 3,2
62 | #define FP6 5,4
63 | #define FP7 7,6
64 |
65 | #define RELAIS_PIN 9
66 | #define LED_PIN 8
67 | #endif
68 |
69 | // Variables exported to other source file
70 | // ========================================
71 | extern Adafruit_MCP23017 mcp;
72 | extern int SortiesFP[];
73 | extern char etatFP[];
74 | extern char memFP[];
75 | extern int nivDelest;
76 | extern uint8_t plusAncienneZoneDelestee;
77 | extern unsigned long timerDelestRelest;
78 |
79 | // Function exported for other source file
80 | // =======================================
81 | bool pilotes_setup(void);
82 | bool pilotes_loop(void);
83 | void delester1zone(void);
84 | void relester1zone(void);
85 | void decalerDelestage(void);
86 | void initFP(void);
87 | int setfp(String);
88 | int setfp_interne(uint8_t fp, char cOrdre);
89 | int fp(String);
90 | int relais(String);
91 |
92 | #endif
93 |
--------------------------------------------------------------------------------
/Logiciel/remora/remora.h:
--------------------------------------------------------------------------------
1 | // **********************************************************************************
2 | // Programmateur Fil Pilote et Suivi Conso
3 | // **********************************************************************************
4 | // Copyright (C) 2014 Thibault Ducret
5 | // Licence MIT
6 | //
7 | // History : 15/01/2015 Charles-Henri Hallard (http://hallard.me)
8 | // Intégration de version 1.2 de la carte electronique
9 | // 15/09/2015 Charles-Henri Hallard : Ajout compatibilité ESP8266
10 | //
11 | // **********************************************************************************
12 | #ifndef REMORA_h
13 | #define REMORA_h
14 |
15 | // Spark Core main firmware include file
16 | #ifdef SPARK
17 | #include "application.h"
18 | #endif
19 |
20 | // Définir ici le type de carte utilsé
21 | //#define REMORA_BOARD_V10 // Version 1.0
22 | //#define REMORA_BOARD_V11 // Version 1.1
23 | #define REMORA_BOARD_V12 // Version 1.2
24 |
25 | // Définir ici les modules utilisés sur la carte Remora
26 | #define MOD_RF69 /* Module RF */
27 | #define MOD_OLED /* Afficheur */
28 | #define MOD_TELEINFO /* Teleinfo */
29 | //#define MOD_RF_OREGON /* Reception des sondes orégon */
30 |
31 | // Librairies du projet remora Pour Particle
32 | #ifdef SPARK
33 | #include "MCP23017.h"
34 | #include "SSD1306.h"
35 | #include "GFX.h"
36 | #include "ULPNode_RF_Protocol.h"
37 | #include "LibTeleinfo.h"
38 | //#include "WebServer.h"
39 |
40 | #include "display.h"
41 | #include "i2c.h"
42 | #include "pilotes.h"
43 | #include "rfm.h"
44 | #include "tinfo.h"
45 | #include "linked_list.h"
46 | #include "route.h"
47 | #include "RadioHead.h"
48 | #include "RH_RF69.h"
49 | #include "RHDatagram.h"
50 | #include "RHReliableDatagram.h"
51 |
52 | //#include "OLED_local.h"
53 | //#include "mfGFX_local.h"
54 |
55 | #define _yield() Particle.process()
56 | #endif
57 |
58 | // Librairies du projet remora Pour Particle
59 | #ifdef ESP8266
60 | #if defined (REMORA_BOARD_V10) || defined (REMORA_BOARD_V11)
61 | #error "La version ESP8266 NodeMCU n'est pas compatible avec les cartes V1.1x"
62 | #endif
63 |
64 | // Définir ici les identifiants de
65 | // connexion à votre réseau Wifi
66 | #define DEFAULT_WIFI_SSID "************"
67 | #define DEFAULT_WIFI_PASS "************"
68 | #define DEFAULT_OTA_PORT 8266
69 | #define DEFAULT_HOSTNAME "remora"
70 | #include "Arduino.h"
71 | #include "./MCP23017.h"
72 | //#include "./RFM69registers.h"
73 | //#include "./RFM69.h"
74 | #include "./SSD1306.h"
75 | #include "./GFX.h"
76 | #include "./ULPNode_RF_Protocol.h"
77 | #include "./LibTeleinfo.h"
78 |
79 | #define _yield() yield()
80 | #endif
81 |
82 | // Includes du projets remora
83 | #include "linked_list.h"
84 | #include "i2c.h"
85 | #include "rfm.h"
86 | #include "display.h"
87 | #include "pilotes.h"
88 | #include "tinfo.h"
89 |
90 | // RGB LED related MACROS
91 | #if defined (SPARK)
92 | #define COLOR_RED 255, 0, 0
93 | #define COLOR_ORANGE 255, 127, 0
94 | #define COLOR_YELLOW 255, 255, 0
95 | #define COLOR_GREEN 0, 255, 0
96 | #define COLOR_CYAN 0, 255, 255
97 | #define COLOR_BLUE 0, 0, 255
98 | #define COLOR_MAGENTA 255, 0, 255
99 |
100 | #define LedRGBOFF() RGB.color(0,0,0)
101 | #define LedRGBON(x) RGB.color(x)
102 |
103 | // RFM69 Pin mapping
104 | #define RF69_CS SS // default SPI SS Pin
105 | #define RF69_IRQ 2
106 |
107 | #elif defined (ESP8266)
108 | #define COLOR_RED rgb_brightness, 0, 0
109 | #define COLOR_ORANGE rgb_brightness, rgb_brightness>>1, 0
110 | #define COLOR_YELLOW rgb_brightness, rgb_brightness, 0
111 | #define COLOR_GREEN 0, rgb_brightness, 0
112 | #define COLOR_CYAN 0, rgb_brightness, rgb_brightness
113 | #define COLOR_BLUE 0, 0, rgb_brightness
114 | #define COLOR_MAGENTA rgb_brightness, 0, rgb_brightness
115 |
116 | // On ESP8266 we use NeopixelBus library to drive neopixel RGB LED
117 | //#define LedRGBOFF() { rgb_led.SetPixelColor(0,0,0,0); rgb_led.Show(); }
118 | //#define LedRGBON(x) { rgb_led.SetPixelColor(0,x); rgb_led.Show(); }
119 | #define LedRGBOFF() {}
120 | #define LedRGBON(x) {}
121 |
122 | // RFM69 Pin mapping
123 | #define RF69_CS 15
124 | #define RF69_IRQ 2
125 | #endif
126 |
127 | // Ces modules ne sont pas disponibles sur les carte 1.0 et 1.1
128 | #if defined (REMORA_BOARD_V10) || defined (REMORA_BOARD_V11)
129 | #undef MOD_RF69
130 | #undef MOD_OLED
131 | #undef MOD_RF_OREGON
132 |
133 | // en revanche le relais l'est sur la carte 1.1
134 | #ifdef REMORA_BOARD_V11
135 | #define RELAIS_PIN A1
136 | #endif
137 |
138 | // Creation macro unique et indépendante du type de
139 | // carte pour le controle des I/O
140 | #define _digitalWrite(p,v) digitalWrite(p,v)
141 | #define _pinMode(p,v) pinMode(p,v)
142 |
143 | // Carte 1.2+
144 | #else
145 | #define LED_PIN 8
146 | #define RELAIS_PIN 9
147 |
148 | // Creation macro unique et indépendante du type de
149 | // carte pour le controle des I/O
150 | #define _digitalWrite(p,v) mcp.digitalWrite(p,v)
151 | #define _pinMode(p,v) mcp.pinMode(p,v)
152 | #endif
153 |
154 | // Masque de bits pour le status global de l'application
155 | #define STATUS_MCP 0x0001 // I/O expander detecté
156 | #define STATUS_OLED 0x0002 // Oled detecté
157 | #define STATUS_RFM 0x0004 // RFM69 detecté
158 | #define STATUS_TINFO 0x0008 // Trame téléinfo detecté
159 |
160 | // Variables exported to other source file
161 | // ========================================
162 | // define var for whole project
163 |
164 | // status global de l'application
165 | extern uint16_t status;
166 | extern unsigned long uptime ;
167 |
168 |
169 | #ifdef SPARK
170 | // Particle WebServer
171 | //extern WebServer server("", 80);
172 | #endif
173 |
174 | #ifdef ESP8266
175 | // ESP8266 WebServer
176 | extern ESP8266WebServer server;
177 | #endif
178 |
179 |
180 | extern uint16_t status; // status global de l'application
181 |
182 | // Function exported for other source file
183 | // =======================================
184 | char * timeAgo(unsigned long);
185 |
186 | #endif
187 |
--------------------------------------------------------------------------------
/Logiciel/remora/rfm.cpp:
--------------------------------------------------------------------------------
1 | // **********************************************************************************
2 | // RFM69 module management source file for remora project
3 | // **********************************************************************************
4 | // Creative Commons Attrib Share-Alike License
5 | // You are free to use/extend but please abide with the CC-BY-SA license:
6 | // http://creativecommons.org/licenses/by-sa/4.0/
7 | //
8 | // Written by Charles-Henri Hallard (http://hallard.me)
9 | //
10 | // History : V1.00 2015-01-22 - First release
11 | //
12 | // All text above must be included in any redistribution.
13 | //
14 | // **********************************************************************************
15 |
16 | #include "./linked_list.h"
17 | #include "./ULPNode_RF_Protocol.h"
18 | #include "./rfm.h"
19 | #include "./RH_RF69.h"
20 |
21 |
22 | unsigned long rf_rgb_led_timer = 0;
23 |
24 | // data received by RF module
25 | // independent from module received (RF12 or RF69)
26 | // used to display or send to serial
27 | RFData data;
28 |
29 | // Linked list of nodes seens
30 | NodeList nodes_list;
31 |
32 | // RadioHead Library need driver and message class
33 | //RH_RF69 rf69_drv(RF69_CS, RF69_IRQ);// instance of the radio driver
34 | //RHDatagram rf69(rf69_drv); // Manage message delivery and receipt
35 | //RH_RF69 * prf69_drv = &rf69_drv;
36 | #ifdef ESP8266
37 | #ifdef RH_RF69_IRQLESS
38 | RH_RF69 driver(RF69_CS, RF69_IRQ);// instance of the radio driver
39 | #else
40 | // instance of the radio driver we can't use GPPIO2
41 | RH_RF69 driver(RF69_IRQ, RF69_CS);
42 | #endif
43 | #else
44 | // instance of the radio driver
45 | RH_RF69 driver(RF69_CS, RF69_IRQ);
46 | #endif
47 |
48 | /* ======================================================================
49 | Function: rfm_receive_data
50 | Purpose : receive data payload on RF and manage ACK
51 | Input : -
52 | Output : millis since this node has been seen
53 | Comments: called from loop, this is a non blocking receiver
54 | ====================================================================== */
55 | unsigned long rfm_receive_data(void)
56 | {
57 | unsigned long node_last_seen = 0;
58 |
59 | LedRGBON(COLOR_BLUE);
60 | rf_rgb_led_timer = millis();
61 |
62 | // Fill known values
63 | data.size = sizeof(data.buffer);
64 | data.groupid = RFM69_NETWORKID;
65 | data.ack = '\0'; // default no ack
66 |
67 | // grab the frame received
68 | if (driver.recv(data.buffer, &data.size)) {
69 | bool known_node = false;
70 | int nb_node;
71 | int current;
72 | uint8_t toid;
73 |
74 | // Get header data
75 | data.nodeid = driver.headerFrom();
76 | toid = driver.headerTo();
77 | data.seqid = driver.headerId();
78 | data.flags = driver.headerFlags();
79 | data.rssi = driver.lastRssi();
80 |
81 | // Are we authorized to send response ?
82 | // This is in case of multiple gateways with same ID
83 | //if (!(config.mode & CFG_RF69_NOSEND)) {
84 | if (true) {
85 | // Sender explicitly requested a ACK ?
86 | if (data.flags & RF_PAYLOAD_REQ_ACK) {
87 | //DebugF("Frame from ");
88 | //Debug(data.nodeid);
89 | //DebugF(" to ");
90 | //Debug(toid);
91 | //DebugF(" want ACK ");
92 |
93 | // Never ACK on broadcast address or a already ACK response
94 | if (toid!=RH_BROADCAST_ADDRESS && !(data.flags & RH_FLAGS_ACK)) {
95 | //DebugF("Me=");
96 | //Debug(toid);
97 | //DebugF(" Sending ACK to ");
98 | //Debug(data.nodeid);
99 |
100 | // Header is now ACK response (set) and no more ACK Request (clear)
101 | driver.setHeaderFlags(RH_FLAGS_ACK, RF_PAYLOAD_REQ_ACK);
102 | driver.setHeaderId(data.seqid);
103 | driver.setHeaderTo(data.nodeid);
104 | driver.setHeaderFrom(toid);
105 | data.ack = '!';
106 |
107 | // We have powerfull speed CPU, but Wait slave to setup the receiver for
108 | // ACK reception
109 | #if (RF_GATEWAY_PLATFORM==RF_GATEWAY_PLATFORM_PARTICLE) || defined (ESP8266)
110 | delay(1);
111 | //delayMicroseconds(100);
112 | #endif
113 |
114 | // Send the response packet
115 | driver.send(&data.ack, sizeof(data.ack));
116 | driver.waitPacketSent();
117 |
118 | // ACK makes led to green
119 | #if defined (RGB_LED_PIN)
120 | LedRGBON(0,COLOR_GREEN);
121 | #endif
122 |
123 | }
124 | }
125 | }
126 | // Prepare our last seen value
127 | node_last_seen = uptime;
128 |
129 | ll_Add(&nodes_list, data.groupid, data.nodeid, data.rssi, &node_last_seen);
130 | //ll_Dump(&nodes_list, g_second);
131 |
132 | } // revcfrom()
133 |
134 | return node_last_seen;
135 | }
136 |
137 |
138 | /* ======================================================================
139 | Function: rfm_setup
140 | Purpose : prepare and init stuff, configuration, ..
141 | Input : -
142 | Output : true if RF module found, false otherwise
143 | Comments: -
144 | ====================================================================== */
145 | bool rfm_setup(void)
146 | {
147 | bool ret = false;
148 |
149 | Serial.print("Initializing RFM69...");
150 | Serial.flush();
151 |
152 | // RF Radio initialization
153 | // =======================
154 | // Defaults after RadioHead init are
155 | // 434.0MHz
156 | // modulation GFSK_Rb250Fd250, +13dbM
157 | // No encryption
158 | if (!driver.init()) {
159 | Serial.println("Not found!");
160 | } else {
161 | Serial.println("OK!");
162 |
163 | // If you are using a high power RF69, you *must* set a Tx power in the
164 | // range 14 to 20 like this:
165 | driver.setTxPower(20);
166 |
167 | // set driver parameters
168 | driver.setThisAddress(RFM69_NODEID); // filtering address when receiving
169 | driver.setHeaderFrom(RFM69_NODEID); // Transmit From Node
170 |
171 | // Init of our linked list of seen received nodes
172 | nodes_list.next = NULL ;
173 | nodes_list.groupid = 0 ;
174 | nodes_list.nodeid = 0 ;
175 | nodes_list.rssi = 0 ;
176 | nodes_list.lastseen = 0 ;
177 | }
178 |
179 | Serial.flush();
180 | return (ret);
181 |
182 | }
183 |
184 | /* ======================================================================
185 | Function: rfm_loop
186 | Purpose : really need to tell ?
187 | Input : -
188 | Output : -
189 | Comments: -
190 | ====================================================================== */
191 | void rfm_loop(void)
192 | {
193 |
194 | static uint8_t got_first = false;
195 | static unsigned long packet_last_seen=0;// second since last packet received
196 | uint8_t packetReceived = 0;
197 | unsigned long node_last_seen; // Second since we saw this node
198 | unsigned long currentMillis = millis();
199 |
200 | // Data received from driver ?
201 | if (driver.available()) {
202 | node_last_seen = rfm_receive_data();
203 | packet_last_seen = uptime;
204 | packetReceived = true;
205 | }
206 |
207 | // received data ?
208 | if (packetReceived) {
209 | // command code
210 | uint8_t cmd = data.buffer[0];
211 | unsigned long seen = uptime-node_last_seen;
212 |
213 | #define DEBUG_VERBOSE
214 | #ifdef DEBUG_VERBOSE
215 | // Dump Raw packet
216 | Serial.print(F("# ("));
217 | Serial.print(uptime);
218 | Serial.print(F(")"));
219 |
220 | if (data.flags & RF_PAYLOAD_REQ_ACK)
221 | Serial.print(F(" ACKED"));
222 |
223 |
224 | Serial.print(F(" <- node:")); Serial.print(data.nodeid,DEC);
225 | Serial.print(F(" size:")); Serial.print(data.size);
226 | Serial.print(F(" type:")); Serial.print(decode_frame_type(cmd));
227 | Serial.print(F(" (0x")); Serial.print(cmd,HEX);
228 | Serial.print(F(") RSSI:")); Serial.print(data.rssi,DEC);
229 | Serial.print(F("dB seen :"));
230 | Serial.print(timeAgo(seen));
231 |
232 | // Detail to know exactly number of seconds between node send
233 | if ( seen<=300 && seen>0 ) {
234 | Serial.print(F(" ("));
235 | Serial.print(seen);
236 | Serial.print(F(")"));
237 | }
238 |
239 | Serial.print(F("\r\n# buffer:"));
240 |
241 | char buff[4];
242 | for (uint8_t i=0; icommand = RF_PL_PINGBACK;
268 | ppl->vbat = 0;
269 | ppl->rssi = data.rssi; // RSSI of node
270 | ppl->status = 0;
271 |
272 | driver.setHeaderId(data.seqid);
273 | driver.setHeaderFlags(RH_FLAGS_NONE);
274 |
275 | // We're on a fast gateway, let node some time
276 | // To node to set to receive mode before sending response
277 | delay(2);
278 | driver.setHeaderTo(data.nodeid);
279 | driver.send((uint8_t *) ppl, (uint8_t) sizeof(RFPingPayload)) ;
280 | driver.waitPacketSent();
281 |
282 | // Start line with a # (comment)
283 | // indicate external parser that it's just debug information
284 | Serial.print(F("\r\n# -> "));
285 | Serial.print(data.nodeid,DEC);
286 | Serial.print(F(" PINGBACK ("));
287 | Serial.print(ppl->rssi,DEC);
288 | Serial.println(F("dB)"));
289 | }
290 |
291 | // Start blue led
292 | LedRGBON(COLOR_BLUE);
293 | rf_rgb_led_timer=millis();
294 |
295 | // known Payload ? send frame to serial
296 | if (cmd) {
297 | Serial.println(json_str);
298 | }
299 |
300 |
301 | // Display Results only if something new received
302 | // As display on OLED is quite long, this avoid time out
303 | // on ack of RF module because if we are in display, we can't
304 | // ACK quickly and may be delayed by 100ms, but if we are
305 | // there this is because we received a command and treated ACK
306 | //#ifdef MOD_LCD
307 | // screen_state = screen_rf;
308 | // doDisplay();
309 | // #endif
310 |
311 | }
312 |
313 | // Do we have led timer expiration ?
314 | if (rf_rgb_led_timer && (millis()-rf_rgb_led_timer >= RF_LED_BLINK_MS)) {
315 | LedRGBOFF(); // Light Off the LED
316 | rf_rgb_led_timer=0; // Stop virtual timer
317 | }
318 |
319 | }
320 |
--------------------------------------------------------------------------------
/Logiciel/remora/rfm.h:
--------------------------------------------------------------------------------
1 | // **********************************************************************************
2 | // RFM69 module management headers file for remora project
3 | // **********************************************************************************
4 | // Creative Commons Attrib Share-Alike License
5 | // You are free to use/extend but please abide with the CC-BY-SA license:
6 | // http://creativecommons.org/licenses/by-sa/4.0/
7 | //
8 | // Written by Charles-Henri Hallard (http://hallard.me)
9 | //
10 | // History : V1.00 2015-01-22 - First release
11 | //
12 | // All text above must be included in any redistribution.
13 | //
14 | // **********************************************************************************
15 |
16 | #ifndef RFM_h
17 | #define RFM_h
18 |
19 | #include "remora.h"
20 | #include "RH_RF69.h"
21 |
22 | // You will need to initialize the radio by telling it what ID it has and what network it's on
23 | // The NodeID takes values from 1-127, 0 is reserved for sending broadcast messages (send to all nodes)
24 | // The Network ID takes values from 0-255
25 | #define RFM69_NODEID 1 // Node ID used for this unit
26 | #define RFM69_NETWORKID 69 // the network ID we are on
27 | #define RFM69_FREQUENCY 43400 // RFM69 434.00MHz
28 | #define RFM69_TXPWR 13 // +13dB (set to 14..20 for RFM69HW)
29 | #define RFM69_MODEM_MAX 26 // Number of modem config values MAX strored in flash RH_RH69 driver
30 | #define RFM69_MODEMCFG RH_RF69::GFSK_Rb250Fd250 // RadioHead default modem config
31 |
32 | // Mode of tranmission
33 | #define ACK_TIME 50 // # of ms to wait for an ack if asked
34 | #define RF_RETRIES 3 // # of retries before dropping response
35 | #define RF_NO_ACK 0 // Just send
36 | #define RF_ACK 1 // Just send and ask for ack
37 | #define RF_RESP 2 // Just send and wait response
38 |
39 | #define RF_LED_BLINK_MS 150 // Time of RGB LED blink
40 |
41 |
42 | // data received by RF module
43 | // independent from module received
44 | // used to display or send to serial
45 | typedef struct
46 | {
47 | uint8_t nodeid; /* Node ID */
48 | uint8_t groupid; /* Group ID */
49 | uint8_t size; /* Data Size */
50 | int8_t rssi; /* RSSI */
51 | uint8_t flags; /* header flags */
52 | uint8_t checksum; /* Serial checksum*/
53 | uint8_t seqid; /* Sequence ID */
54 | uint8_t ack; /* do we ACKED */
55 | uint8_t buffer[RH_RF69_MAX_MESSAGE_LEN];
56 | } RFData;
57 |
58 | // Variables exported to other source file
59 | // ========================================
60 | // define RF var for whole project
61 | extern unsigned long rf_rgb_led_timer;
62 | extern RH_RF69 driver;
63 |
64 | // Function exported for other source file
65 | // =======================================
66 | bool rfm_setup(void);
67 | void rfm_loop(void);
68 |
69 | #endif
70 |
--------------------------------------------------------------------------------
/Logiciel/remora/route.cpp:
--------------------------------------------------------------------------------
1 | // **********************************************************************************
2 | // Remora WEB Server, route web function
3 | // **********************************************************************************
4 | // Creative Commons Attrib Share-Alike License
5 | // You are free to use/extend this library but please abide with the CC-BY-SA license:
6 | // Attribution-NonCommercial-ShareAlike 4.0 International License
7 | // http://creativecommons.org/licenses/by-nc-sa/4.0/
8 | //
9 | // This program works with the Remora board
10 | // see schematic here https://github.com/thibdct/programmateur-fil-pilote-wifi
11 | //
12 | // Written by Charles-Henri Hallard (http://hallard.me)
13 | //
14 | // History : V1.00 2015-06-14 - First release
15 | //
16 | // All text above must be included in any redistribution.
17 | //
18 | // **********************************************************************************
19 |
20 | // Include header
21 | #include "route.h"
22 |
23 | /* ======================================================================
24 | Function: handleRoot
25 | Purpose : handle main page /, display information
26 | Input : -
27 | Output : -
28 | Comments: -
29 | ====================================================================== */
30 | #ifdef NO_USE_FOR_NOW
31 | //void handleRoot(WebServer &server, WebServer::ConnectionType type, char *url_tail, bool tail_complete)
32 | void handleRoot(void)
33 | {
34 | String response="";
35 |
36 | // Just to debug where we are
37 | Serial.print(F("Serving / page..."));
38 |
39 | // Send headers
40 | server.httpSuccess();
41 |
42 | // if we're handling a GET or POST, we can output our data here.
43 | // For a HEAD request, we just stop after outputting headers.
44 | if (type == WebServer::HEAD)
45 | return;
46 |
47 | server.printP(F("Remora\n"));
48 | switch (type)
49 | {
50 | case WebServer::GET:
51 | server.printP(F("GET from "));
52 | break;
53 | case WebServer::POST:
54 | server.printP(F("POST to "));
55 | break;
56 | default:
57 | server.printP(F("UNKNOWN request for "));
58 | }
59 |
60 | server.printP(F("unidentified URL requested.
\n"));
61 | server.printP(tail_complete ? F("URL='") : F("INCOMPLETE URL='"));
62 | server.print(url_tail);
63 | server.printP(F("'
\n"));
64 | server.printP(F(""));
65 |
66 | Serial.print(F("OK!"));
67 | }
68 |
69 | /* ======================================================================
70 | Function: formatNumberJSON
71 | Purpose : check if data value is full number and send correct JSON format
72 | Input : String where to add response
73 | char * value to check
74 | Output : -
75 | Comments: 00150 => 150
76 | ADCO => "ADCO"
77 | 1 => 1
78 | ====================================================================== */
79 | #ifdef ESP8266
80 | void formatNumberJSON( String &response, char * value)
81 | {
82 | // we have at least something ?
83 | if (value && strlen(value))
84 | {
85 | boolean isNumber = true;
86 | uint8_t c;
87 | char * p = value;
88 |
89 | // just to be sure
90 | if (strlen(p)<=16) {
91 | // check if value is number
92 | while (*p && isNumber) {
93 | if ( *p < '0' || *p > '9' )
94 | isNumber = false;
95 | p++;
96 | }
97 |
98 | // this will add "" on not number values
99 | if (!isNumber) {
100 | response += '\"' ;
101 | response += value ;
102 | response += F("\":") ;
103 | } else {
104 | // this will remove leading zero on numbers
105 | p = value;
106 | while (*p=='0' && *(p+1) )
107 | p++;
108 | response += p ;
109 | }
110 | } else {
111 | Serial.println(F("formatNumberJSON error!"));
112 | }
113 | }
114 | }
115 |
116 |
117 | /* ======================================================================
118 | Function: tinfoJSONTable
119 | Purpose : dump all teleinfo values in JSON table format for browser
120 | Input : linked list pointer on the concerned data
121 | true to dump all values, false for only modified ones
122 | Output : -
123 | Comments: -
124 | ====================================================================== */
125 | void tinfoJSONTable(void)
126 | {
127 | ValueList * me = tinfo.getList();
128 | String response = "";
129 |
130 | // Just to debug where we are
131 | Serial.print(F("Serving /tinfoJSONTable page...\r\n"));
132 |
133 | // Got at least one ?
134 | if (me) {
135 | uint8_t index=0;
136 |
137 | boolean first_item = true;
138 | // Json start
139 | response += F("[\r\n");
140 |
141 | // Loop thru the node
142 | while (me->next) {
143 |
144 | // we're there
145 | #ifdef ESP8266
146 | ESP.wdtFeed();
147 | #endif
148 |
149 | // go to next node
150 | me = me->next;
151 |
152 | // First item do not add , separator
153 | if (first_item)
154 | first_item = false;
155 | else
156 | response += F(",\r\n");
157 |
158 | Serial.print(F("(")) ;
159 | Serial.print(++index) ;
160 | Serial.print(F(") ")) ;
161 |
162 | if (me->name) Serial.print(me->name) ;
163 | else Serial.print(F("NULL")) ;
164 |
165 | Serial.print(F("=")) ;
166 |
167 | if (me->value) Serial.print(me->value) ;
168 | else Serial.print(F("NULL")) ;
169 |
170 | Serial.print(F(" '")) ;
171 | Serial.print(me->checksum) ;
172 | Serial.print(F("' "));
173 |
174 | // Flags management
175 | if ( me->flags) {
176 | Serial.print(F("Flags:0x"));
177 | Serial.print(me->flags, HEX);
178 | Serial.print(F(" => "));
179 | Serial.print(me->flags);
180 | if ( me->flags & TINFO_FLAGS_EXIST)
181 | Serial.print(F("Exist ")) ;
182 | if ( me->flags & TINFO_FLAGS_UPDATED)
183 | Serial.print(F("Updated ")) ;
184 | if ( me->flags & TINFO_FLAGS_ADDED)
185 | Serial.print(F("New ")) ;
186 | }
187 |
188 | Serial.println() ;
189 |
190 | response += F("{\"na\":\"");
191 | response += me->name ;
192 | response += F("\", \"va\":\"") ;
193 | response += me->value;
194 | response += F("\", \"ck\":\"") ;
195 | if (me->checksum == '"' || me->checksum == '\\' || me->checksum == '/')
196 | response += '\\';
197 | response += (char) me->checksum;
198 | response += F("\", \"fl\":");
199 | response += me->flags ;
200 | response += '}' ;
201 |
202 | }
203 | // Json end
204 | response += F("\r\n]");
205 |
206 | } else {
207 | Serial.println(F("sending 404..."));
208 | server.send ( 404, "text/plain", "No data" );
209 | }
210 | Serial.print(F("sending..."));
211 | server.send ( 200, "text/json", response );
212 | Serial.print(F("OK!"));
213 | }
214 |
215 |
216 | /* ======================================================================
217 | Function: sendJSON
218 | Purpose : dump all values in JSON
219 | Input : linked list pointer on the concerned data
220 | true to dump all values, false for only modified ones
221 | Output : -
222 | Comments: -
223 | ====================================================================== */
224 | void sendJSON(void)
225 | {
226 | ValueList * me = tinfo.getList();
227 | String response = "";
228 |
229 | // Got at least one ?
230 | if (me) {
231 | // Json start
232 | response += F("{\"_UPTIME\":");
233 | response += seconds;
234 |
235 | // Loop thru the node
236 | while (me->next) {
237 |
238 | // we're there
239 | ESP.wdtFeed();
240 |
241 | // go to next node
242 | me = me->next;
243 |
244 | response += F(",\"") ;
245 | response += me->name ;
246 | response += F("\":") ;
247 | formatNumberJSON(response, me->value);
248 | }
249 | // Json end
250 | response += F("}\r\n") ;
251 |
252 | } else {
253 | server.send ( 404, "text/plain", "No data" );
254 | }
255 | server.send ( 200, "text/json", response );
256 | }
257 |
258 | /* ======================================================================
259 | Function: handleNotFound
260 | Purpose : default WEB routing when URI is not found
261 | Input : linked list pointer on the concerned data
262 | true to dump all values, false for only modified ones
263 | Output : -
264 | Comments: We search is we have a name that match to this URI, if one we
265 | return it's pair name/value in json
266 | ====================================================================== */
267 | void handleNotFound(void)
268 | {
269 | String response = "";
270 |
271 | // We check for an known label
272 | ValueList * me = tinfo.getList();
273 | const char * uri;
274 | boolean found = false;
275 |
276 | // Led on
277 | LedBluON();
278 |
279 | // convert uri to char * for compare
280 | uri = server.uri().c_str();
281 |
282 | Serial.printf("handleNotFound(%s)\r\n", uri);
283 |
284 | // Got at least one and consistent URI ?
285 | if (me && uri && *uri=='/' && *++uri ) {
286 |
287 | // Loop thru the linked list of values
288 | while (me->next && !found) {
289 |
290 | // we're there
291 | ESP.wdtFeed();
292 |
293 | // go to next node
294 | me = me->next;
295 |
296 | //Debugf("compare to '%s' ", me->name);
297 | // Do we have this one ?
298 | if (stricmp (me->name, uri) == 0 )
299 | {
300 | // no need to continue
301 | found = true;
302 |
303 | // Add to respone
304 | response += F("{\"") ;
305 | response += me->name ;
306 | response += F("\":") ;
307 | formatNumberJSON(response, me->value);
308 | response += F("}\r\n");
309 | }
310 | }
311 | }
312 |
313 | // Got it, send json
314 | if (found) {
315 | server.send ( 200, "text/json", response );
316 | } else {
317 | // send error message in plain text
318 | String message = "File Not Found\n\n";
319 | message += "URI: ";
320 | message += server.uri();
321 | message += "\nMethod: ";
322 | message += ( server.method() == HTTP_GET ) ? "GET" : "POST";
323 | message += "\nArguments: ";
324 | message += server.args();
325 | message += "\n";
326 |
327 | for ( uint8_t i = 0; i < server.args(); i++ ) {
328 | message += " " + server.argName ( i ) + ": " + server.arg ( i ) + "\n";
329 | }
330 |
331 | server.send ( 404, "text/plain", message );
332 | }
333 |
334 | // Led off
335 | LedBluOFF();
336 | }
337 | #endif
338 |
339 | #endif
340 |
--------------------------------------------------------------------------------
/Logiciel/remora/route.h:
--------------------------------------------------------------------------------
1 | // **********************************************************************************
2 | // Remora WEB Server, route web function
3 | // **********************************************************************************
4 | // Creative Commons Attrib Share-Alike License
5 | // You are free to use/extend this library but please abide with the CC-BY-SA license:
6 | // Attribution-NonCommercial-ShareAlike 4.0 International License
7 | // http://creativecommons.org/licenses/by-nc-sa/4.0/
8 | //
9 | // This program works with the Remora board
10 | // see schematic here https://github.com/thibdct/programmateur-fil-pilote-wifi
11 | //
12 | // Written by Charles-Henri Hallard (http://hallard.me)
13 | //
14 | // History : V1.00 2015-06-14 - First release
15 | //
16 | // All text above must be included in any redistribution.
17 | //
18 | // **********************************************************************************
19 |
20 | #ifndef ROUTE_H
21 | #define ROUTE_H
22 |
23 | // Include main project include file
24 | #include "remora.h"
25 |
26 | // Web response max size
27 | #define RESPONSE_BUFFER_SIZE 4096
28 |
29 | // Exported variables/object instancied in main sketch
30 | // ===================================================
31 | extern char response[];
32 | extern uint16_t response_idx;
33 |
34 | // declared exported function from route.cpp
35 | // ===================================================
36 | //void handleRoot(void);
37 | //void handleRoot(WebServer &server, WebServer::ConnectionType type, char *url_tail, bool tail_complete);
38 | void handleNotFound(void);
39 | void tinfoJSONTable(void);
40 | void sendJSON(void);
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/Logiciel/remora/spark.ignore:
--------------------------------------------------------------------------------
1 | README.md
2 | .gitignore
3 | *.jpg
4 | *.png
5 | *.txt
6 |
--------------------------------------------------------------------------------
/Logiciel/remora/tinfo.h:
--------------------------------------------------------------------------------
1 | // **********************************************************************************
2 | // Teleinfo header file for remora project
3 | // **********************************************************************************
4 | // Copyright (C) 2014 Thibault Ducret
5 | // Licence MIT
6 | //
7 | // History : 15/01/2015 Charles-Henri Hallard (http://hallard.me)
8 | // Intégration de version 1.2 de la carte electronique
9 | // 15/09/2015 Charles-Henri Hallard Utilisation Librairie Teleinfo Universelle
10 | //
11 | // **********************************************************************************
12 | #ifndef TINFO_h
13 | #define TINFO_h
14 |
15 | #include "remora.h"
16 |
17 | // Nombre de secondes pendant lesquelles
18 | // nous pouvons attendre une etiquette/trame téléinfo
19 | #define TINFO_DATA_TIMEOUT 1
20 | #define TINFO_FRAME_TIMEOUT 3
21 | #define ISOUSCRITE 30 // sera mis à jour à la reception de trame teleinfo
22 | #define DELESTAGE_RATIO 0.9 //ratio en % => 90%
23 | #define RELESTAGE_RATIO 0.8 //ratio en % => 80%
24 | #define IMAX 35 // sera mis à jour à la reception de trame teleinfo
25 | #define TINFO_LED_BLINK_MS 150 // Time of RGB LED blink
26 |
27 | // Tarif en cours au format numérique
28 | enum ptec_e { PTEC_HP = 1, PTEC_HC = 2 };
29 |
30 | // Variables exported to other source file
31 | // ========================================
32 | extern TInfo tinfo;
33 | extern unsigned int mypApp;
34 | extern unsigned int myiInst;
35 | extern unsigned int myindexHC;
36 | extern unsigned int myindexHP;
37 | extern unsigned int myisousc;
38 | extern ptec_e ptec; // Puisance tarifaire en cours
39 | extern char myPeriode[];
40 | extern char mytinfo[];
41 | extern char myAction[];
42 |
43 | extern int etatrelais;
44 | extern float myDelestLimit;
45 | extern float myRelestLimit;
46 |
47 | // Function exported for other source file
48 | // =======================================
49 | bool tinfo_setup(bool);
50 | void tinfo_loop();
51 |
52 | #endif
53 |
--------------------------------------------------------------------------------
/Matériel/1.0/ProgrammateurFilPilote_1.0_Recto.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.0/ProgrammateurFilPilote_1.0_Recto.png
--------------------------------------------------------------------------------
/Matériel/1.0/ProgrammateurFilPilote_1.0_Verso.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.0/ProgrammateurFilPilote_1.0_Verso.png
--------------------------------------------------------------------------------
/Matériel/1.0/Schema_ProgrammateurFilPilote_1.0.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.0/Schema_ProgrammateurFilPilote_1.0.pdf
--------------------------------------------------------------------------------
/Matériel/1.1.1/ProgrammateurFilPilote_1.1.1_Recto.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.1.1/ProgrammateurFilPilote_1.1.1_Recto.png
--------------------------------------------------------------------------------
/Matériel/1.1.1/ProgrammateurFilPilote_1.1.1_Verso.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.1.1/ProgrammateurFilPilote_1.1.1_Verso.png
--------------------------------------------------------------------------------
/Matériel/1.1.1/Schema_ProgrammateurFilPilote_1.1.1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.1.1/Schema_ProgrammateurFilPilote_1.1.1.pdf
--------------------------------------------------------------------------------
/Matériel/1.1/ProgrammateurFilPilote_1.1_Recto.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.1/ProgrammateurFilPilote_1.1_Recto.png
--------------------------------------------------------------------------------
/Matériel/1.1/ProgrammateurFilPilote_1.1_Verso.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.1/ProgrammateurFilPilote_1.1_Verso.png
--------------------------------------------------------------------------------
/Matériel/1.1/Schema_ProgrammateurFilPilote_1.1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.1/Schema_ProgrammateurFilPilote_1.1.pdf
--------------------------------------------------------------------------------
/Matériel/1.2/ProgrammateurFilPilote_1.2.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.2/ProgrammateurFilPilote_1.2.pdf
--------------------------------------------------------------------------------
/Matériel/1.2/ProgrammateurFilPilote_1.2_Board.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.2/ProgrammateurFilPilote_1.2_Board.png
--------------------------------------------------------------------------------
/Matériel/1.2/ProgrammateurFilPilote_1.2_Recto.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.2/ProgrammateurFilPilote_1.2_Recto.png
--------------------------------------------------------------------------------
/Matériel/1.2/ProgrammateurFilPilote_1.2_Schematic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.2/ProgrammateurFilPilote_1.2_Schematic.png
--------------------------------------------------------------------------------
/Matériel/1.2/ProgrammateurFilPilote_1.2_Verso.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.2/ProgrammateurFilPilote_1.2_Verso.png
--------------------------------------------------------------------------------
/Matériel/1.2/README.md:
--------------------------------------------------------------------------------
1 | Version matérielle 1.2c
2 | =======================
3 |
4 | Modifications
5 | -------------
6 | Cette version reprend toutes les caractéristiques de la version [initiale][1] en y ajoutant les fonctionnalités suivantes :
7 |
8 | - Ajout d'un contrôleur d'entrées sortie I2C [MCP23017][10] pour libérer les I/O du Spark Core
9 | - Possibilité de mettre deux types de relais dont un [avec contact NO + NF][5]
10 | - Possibilité de mettre un emetteur récepteur sans fil de type [RFM12B][6], [RFM69CW][7], [RFM69HW][8] ou [RFM69CW][9] 433Mhz ou 868MHz
11 | - Possibilité de mettre un [récepteur 433MHz][4] pour récupérer par exemple les trames des capteurs de température Orégon Scientific
12 | - Ajout d'un connecteur I2C ET SPI pour des afficheurs OLED de type [I2C][2] ou [SPI][3]
13 | - Ajout d'un connecteur de type Grove I2C
14 | - Ajout d'une LED 3mm (déportable ou non) sur le boitier
15 | - Ajout de pin out disponibles sur toutes les pattes du Spark Core
16 |
17 | Changements apportés dans la révision 1.2c
18 | - Correction informations du silk au niveau du connecteur grove
19 | - Déplacement connecteur grove pour ne pas géner en cas d'insertion un module grove
20 | - Déplacement de la LED pour qu'elle ne soit plus située sous le LCD
21 | - Agrandissement des PAD des optos pour une soudure plus aisée
22 | - Inversion des plots 3.3V et GND afin de pouvoir souder un double plot uniquement (5V+GND), les triples étant moins facile à trouver et je suis pas certain que le 3.3V soit utilisé (mais il reste disponible)
23 |
24 | Attention, deux erreurs étaient présentes sur le PCB 1.2 original (corrigées dans la revision 1.2c) :
25 | - le dessin sur le PCB du connecteur grove est inversé, donc si vous souhaitez le souder, il faut le faire dans le sens inversé par rapport au dessin du PCB (mais toujours à souder sur le dessus).
26 | - la diode D14 est inversée, il faut donc la souder dans le sens inverse de ce qui est indiqué sur le PCB
27 |
28 |
29 | Description Détaillée
30 | =====================
31 |
32 | **Schematic**
33 | 
34 |
35 |
36 | **Boards**
37 |
38 |
39 |
40 |
41 |
42 | [1]: https://github.com/thibdct/programmateur-fil-pilote-wifi/blob/master/README.md
43 | [2]: http://www.ebay.com/itm/291216700457
44 | [3]: http://www.ebay.com/itm/141371873602
45 | [4]: http://www.ebay.com/itm/290935235157
46 | [5]: http://www.seeedstudio.com/depot/index.php?main_page=opl_info&opl_id=136
47 |
48 | [6]: http://www.anarduino.com/details.jsp?pid=142
49 | [7]: http://www.anarduino.com/details.jsp?pid=145
50 | [8]: http://www.anarduino.com/details.jsp?pid=136
51 | [9]: http://www.anarduino.com/details.jsp?pid=122
52 | [10]: http://www.adafruit.com/product/732
53 |
54 |
--------------------------------------------------------------------------------
/Matériel/1.2/Thumbs.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.2/Thumbs.db
--------------------------------------------------------------------------------
/Matériel/1.3/Gerbers/ProgrammateurFilPilote_1.3.GBP:
--------------------------------------------------------------------------------
1 | G75*
2 | %MOIN*%
3 | %OFA0B0*%
4 | %FSLAX25Y25*%
5 | %IPPOS*%
6 | %LPD*%
7 | %AMOC8*
8 | 5,1,8,0,0,1.08239X$1,22.5*
9 | %
10 | %ADD10C,0.00100*%
11 | %ADD11R,0.06299X0.07087*%
12 | %ADD12R,0.08000X0.05000*%
13 | %ADD13C,0.01000*%
14 | %ADD14R,0.05000X0.07874*%
15 | %ADD15R,0.09000X0.06969*%
16 | %ADD16R,0.04600X0.06300*%
17 | D10*
18 | X0057595Y0046433D02*
19 | X0057595Y0288933D01*
20 | X0057598Y0289175D01*
21 | X0057607Y0289416D01*
22 | X0057621Y0289657D01*
23 | X0057642Y0289898D01*
24 | X0057668Y0290138D01*
25 | X0057700Y0290378D01*
26 | X0057738Y0290617D01*
27 | X0057781Y0290854D01*
28 | X0057831Y0291091D01*
29 | X0057886Y0291326D01*
30 | X0057946Y0291560D01*
31 | X0058013Y0291792D01*
32 | X0058084Y0292023D01*
33 | X0058162Y0292252D01*
34 | X0058245Y0292479D01*
35 | X0058333Y0292704D01*
36 | X0058427Y0292927D01*
37 | X0058526Y0293147D01*
38 | X0058631Y0293365D01*
39 | X0058740Y0293580D01*
40 | X0058855Y0293793D01*
41 | X0058975Y0294003D01*
42 | X0059100Y0294209D01*
43 | X0059230Y0294413D01*
44 | X0059365Y0294614D01*
45 | X0059505Y0294811D01*
46 | X0059649Y0295005D01*
47 | X0059798Y0295195D01*
48 | X0059952Y0295381D01*
49 | X0060110Y0295564D01*
50 | X0060272Y0295743D01*
51 | X0060439Y0295918D01*
52 | X0060610Y0296089D01*
53 | X0060785Y0296256D01*
54 | X0060964Y0296418D01*
55 | X0061147Y0296576D01*
56 | X0061333Y0296730D01*
57 | X0061523Y0296879D01*
58 | X0061717Y0297023D01*
59 | X0061914Y0297163D01*
60 | X0062115Y0297298D01*
61 | X0062319Y0297428D01*
62 | X0062525Y0297553D01*
63 | X0062735Y0297673D01*
64 | X0062948Y0297788D01*
65 | X0063163Y0297897D01*
66 | X0063381Y0298002D01*
67 | X0063601Y0298101D01*
68 | X0063824Y0298195D01*
69 | X0064049Y0298283D01*
70 | X0064276Y0298366D01*
71 | X0064505Y0298444D01*
72 | X0064736Y0298515D01*
73 | X0064968Y0298582D01*
74 | X0065202Y0298642D01*
75 | X0065437Y0298697D01*
76 | X0065674Y0298747D01*
77 | X0065911Y0298790D01*
78 | X0066150Y0298828D01*
79 | X0066390Y0298860D01*
80 | X0066630Y0298886D01*
81 | X0066871Y0298907D01*
82 | X0067112Y0298921D01*
83 | X0067353Y0298930D01*
84 | X0067595Y0298933D01*
85 | X0375095Y0298933D01*
86 | X0397595Y0276433D01*
87 | X0397595Y0058933D01*
88 | X0375095Y0036433D01*
89 | X0067595Y0036433D01*
90 | X0067353Y0036436D01*
91 | X0067112Y0036445D01*
92 | X0066871Y0036459D01*
93 | X0066630Y0036480D01*
94 | X0066390Y0036506D01*
95 | X0066150Y0036538D01*
96 | X0065911Y0036576D01*
97 | X0065674Y0036619D01*
98 | X0065437Y0036669D01*
99 | X0065202Y0036724D01*
100 | X0064968Y0036784D01*
101 | X0064736Y0036851D01*
102 | X0064505Y0036922D01*
103 | X0064276Y0037000D01*
104 | X0064049Y0037083D01*
105 | X0063824Y0037171D01*
106 | X0063601Y0037265D01*
107 | X0063381Y0037364D01*
108 | X0063163Y0037469D01*
109 | X0062948Y0037578D01*
110 | X0062735Y0037693D01*
111 | X0062525Y0037813D01*
112 | X0062319Y0037938D01*
113 | X0062115Y0038068D01*
114 | X0061914Y0038203D01*
115 | X0061717Y0038343D01*
116 | X0061523Y0038487D01*
117 | X0061333Y0038636D01*
118 | X0061147Y0038790D01*
119 | X0060964Y0038948D01*
120 | X0060785Y0039110D01*
121 | X0060610Y0039277D01*
122 | X0060439Y0039448D01*
123 | X0060272Y0039623D01*
124 | X0060110Y0039802D01*
125 | X0059952Y0039985D01*
126 | X0059798Y0040171D01*
127 | X0059649Y0040361D01*
128 | X0059505Y0040555D01*
129 | X0059365Y0040752D01*
130 | X0059230Y0040953D01*
131 | X0059100Y0041157D01*
132 | X0058975Y0041363D01*
133 | X0058855Y0041573D01*
134 | X0058740Y0041786D01*
135 | X0058631Y0042001D01*
136 | X0058526Y0042219D01*
137 | X0058427Y0042439D01*
138 | X0058333Y0042662D01*
139 | X0058245Y0042887D01*
140 | X0058162Y0043114D01*
141 | X0058084Y0043343D01*
142 | X0058013Y0043574D01*
143 | X0057946Y0043806D01*
144 | X0057886Y0044040D01*
145 | X0057831Y0044275D01*
146 | X0057781Y0044512D01*
147 | X0057738Y0044749D01*
148 | X0057700Y0044988D01*
149 | X0057668Y0045228D01*
150 | X0057642Y0045468D01*
151 | X0057621Y0045709D01*
152 | X0057607Y0045950D01*
153 | X0057598Y0046191D01*
154 | X0057595Y0046433D01*
155 | D11*
156 | X0198087Y0155390D03*
157 | X0209111Y0155390D03*
158 | X0209288Y0175528D03*
159 | X0198264Y0175528D03*
160 | X0198087Y0195390D03*
161 | X0209111Y0195390D03*
162 | X0209111Y0215390D03*
163 | X0198087Y0215390D03*
164 | X0198087Y0235390D03*
165 | X0209111Y0235390D03*
166 | X0209111Y0255390D03*
167 | X0198087Y0255390D03*
168 | X0197762Y0275813D03*
169 | X0208786Y0275813D03*
170 | X0277083Y0286433D03*
171 | X0288107Y0286433D03*
172 | X0302083Y0286433D03*
173 | X0313107Y0286433D03*
174 | D12*
175 | X0180099Y0275390D03*
176 | X0180099Y0265390D03*
177 | X0180099Y0255390D03*
178 | X0180099Y0245390D03*
179 | X0180099Y0235390D03*
180 | X0180099Y0225390D03*
181 | X0180099Y0215390D03*
182 | X0180099Y0205390D03*
183 | X0180099Y0195390D03*
184 | X0180099Y0185390D03*
185 | X0180099Y0175390D03*
186 | X0180099Y0165390D03*
187 | X0180099Y0155705D03*
188 | X0180099Y0145705D03*
189 | X0152099Y0145705D03*
190 | X0152099Y0155705D03*
191 | X0152099Y0165390D03*
192 | X0152099Y0175390D03*
193 | X0152099Y0185390D03*
194 | X0152099Y0195390D03*
195 | X0152099Y0205390D03*
196 | X0152099Y0215390D03*
197 | X0152099Y0225390D03*
198 | X0152099Y0235390D03*
199 | X0152099Y0245390D03*
200 | X0152099Y0255390D03*
201 | X0152099Y0265390D03*
202 | X0152099Y0275390D03*
203 | D13*
204 | X0316973Y0111366D02*
205 | X0316973Y0104492D01*
206 | X0316973Y0111366D02*
207 | X0320973Y0111366D01*
208 | X0320973Y0104492D01*
209 | X0316973Y0104492D01*
210 | X0316973Y0105491D02*
211 | X0320973Y0105491D01*
212 | X0320973Y0106490D02*
213 | X0316973Y0106490D01*
214 | X0316973Y0107489D02*
215 | X0320973Y0107489D01*
216 | X0320973Y0108488D02*
217 | X0316973Y0108488D01*
218 | X0316973Y0109487D02*
219 | X0320973Y0109487D01*
220 | X0320973Y0110486D02*
221 | X0316973Y0110486D01*
222 | X0324847Y0111366D02*
223 | X0324847Y0104492D01*
224 | X0324847Y0111366D02*
225 | X0328847Y0111366D01*
226 | X0328847Y0104492D01*
227 | X0324847Y0104492D01*
228 | X0324847Y0105491D02*
229 | X0328847Y0105491D01*
230 | X0328847Y0106490D02*
231 | X0324847Y0106490D01*
232 | X0324847Y0107489D02*
233 | X0328847Y0107489D01*
234 | X0328847Y0108488D02*
235 | X0324847Y0108488D01*
236 | X0324847Y0109487D02*
237 | X0328847Y0109487D01*
238 | X0328847Y0110486D02*
239 | X0324847Y0110486D01*
240 | X0348469Y0111374D02*
241 | X0348469Y0104500D01*
242 | X0348469Y0111374D02*
243 | X0352469Y0111374D01*
244 | X0352469Y0104500D01*
245 | X0348469Y0104500D01*
246 | X0348469Y0105499D02*
247 | X0352469Y0105499D01*
248 | X0352469Y0106498D02*
249 | X0348469Y0106498D01*
250 | X0348469Y0107497D02*
251 | X0352469Y0107497D01*
252 | X0352469Y0108496D02*
253 | X0348469Y0108496D01*
254 | X0348469Y0109495D02*
255 | X0352469Y0109495D01*
256 | X0352469Y0110494D02*
257 | X0348469Y0110494D01*
258 | X0355969Y0111374D02*
259 | X0355969Y0104500D01*
260 | X0355969Y0111374D02*
261 | X0359969Y0111374D01*
262 | X0359969Y0104500D01*
263 | X0355969Y0104500D01*
264 | X0355969Y0105499D02*
265 | X0359969Y0105499D01*
266 | X0359969Y0106498D02*
267 | X0355969Y0106498D01*
268 | X0355969Y0107497D02*
269 | X0359969Y0107497D01*
270 | X0359969Y0108496D02*
271 | X0355969Y0108496D01*
272 | X0355969Y0109495D02*
273 | X0359969Y0109495D01*
274 | X0359969Y0110494D02*
275 | X0355969Y0110494D01*
276 | X0356343Y0048374D02*
277 | X0356343Y0041500D01*
278 | X0356343Y0048374D02*
279 | X0360343Y0048374D01*
280 | X0360343Y0041500D01*
281 | X0356343Y0041500D01*
282 | X0356343Y0042499D02*
283 | X0360343Y0042499D01*
284 | X0360343Y0043498D02*
285 | X0356343Y0043498D01*
286 | X0356343Y0044497D02*
287 | X0360343Y0044497D01*
288 | X0360343Y0045496D02*
289 | X0356343Y0045496D01*
290 | X0356343Y0046495D02*
291 | X0360343Y0046495D01*
292 | X0360343Y0047494D02*
293 | X0356343Y0047494D01*
294 | X0348469Y0048374D02*
295 | X0348469Y0041500D01*
296 | X0348469Y0048374D02*
297 | X0352469Y0048374D01*
298 | X0352469Y0041500D01*
299 | X0348469Y0041500D01*
300 | X0348469Y0042499D02*
301 | X0352469Y0042499D01*
302 | X0352469Y0043498D02*
303 | X0348469Y0043498D01*
304 | X0348469Y0044497D02*
305 | X0352469Y0044497D01*
306 | X0352469Y0045496D02*
307 | X0348469Y0045496D01*
308 | X0348469Y0046495D02*
309 | X0352469Y0046495D01*
310 | X0352469Y0047494D02*
311 | X0348469Y0047494D01*
312 | X0332721Y0048374D02*
313 | X0332721Y0041500D01*
314 | X0332721Y0048374D02*
315 | X0336721Y0048374D01*
316 | X0336721Y0041500D01*
317 | X0332721Y0041500D01*
318 | X0332721Y0042499D02*
319 | X0336721Y0042499D01*
320 | X0336721Y0043498D02*
321 | X0332721Y0043498D01*
322 | X0332721Y0044497D02*
323 | X0336721Y0044497D01*
324 | X0336721Y0045496D02*
325 | X0332721Y0045496D01*
326 | X0332721Y0046495D02*
327 | X0336721Y0046495D01*
328 | X0336721Y0047494D02*
329 | X0332721Y0047494D01*
330 | X0324847Y0048374D02*
331 | X0324847Y0041500D01*
332 | X0324847Y0048374D02*
333 | X0328847Y0048374D01*
334 | X0328847Y0041500D01*
335 | X0324847Y0041500D01*
336 | X0324847Y0042499D02*
337 | X0328847Y0042499D01*
338 | X0328847Y0043498D02*
339 | X0324847Y0043498D01*
340 | X0324847Y0044497D02*
341 | X0328847Y0044497D01*
342 | X0328847Y0045496D02*
343 | X0324847Y0045496D01*
344 | X0324847Y0046495D02*
345 | X0328847Y0046495D01*
346 | X0328847Y0047494D02*
347 | X0324847Y0047494D01*
348 | X0316973Y0048374D02*
349 | X0316973Y0041500D01*
350 | X0316973Y0048374D02*
351 | X0320973Y0048374D01*
352 | X0320973Y0041500D01*
353 | X0316973Y0041500D01*
354 | X0316973Y0042499D02*
355 | X0320973Y0042499D01*
356 | X0320973Y0043498D02*
357 | X0316973Y0043498D01*
358 | X0316973Y0044497D02*
359 | X0320973Y0044497D01*
360 | X0320973Y0045496D02*
361 | X0316973Y0045496D01*
362 | X0316973Y0046495D02*
363 | X0320973Y0046495D01*
364 | X0320973Y0047494D02*
365 | X0316973Y0047494D01*
366 | X0364217Y0048374D02*
367 | X0364217Y0041500D01*
368 | X0364217Y0048374D02*
369 | X0368217Y0048374D01*
370 | X0368217Y0041500D01*
371 | X0364217Y0041500D01*
372 | X0364217Y0042499D02*
373 | X0368217Y0042499D01*
374 | X0368217Y0043498D02*
375 | X0364217Y0043498D01*
376 | X0364217Y0044497D02*
377 | X0368217Y0044497D01*
378 | X0368217Y0045496D02*
379 | X0364217Y0045496D01*
380 | X0364217Y0046495D02*
381 | X0368217Y0046495D01*
382 | X0368217Y0047494D02*
383 | X0364217Y0047494D01*
384 | D14*
385 | X0362280Y0061937D03*
386 | X0370154Y0061937D03*
387 | X0346532Y0061937D03*
388 | X0338658Y0061937D03*
389 | X0330784Y0061937D03*
390 | X0322910Y0061937D03*
391 | X0322910Y0138709D03*
392 | X0338610Y0138709D03*
393 | X0370154Y0138709D03*
394 | D15*
395 | X0128135Y0145433D03*
396 | X0110056Y0145433D03*
397 | X0110056Y0165433D03*
398 | X0128135Y0165433D03*
399 | X0128135Y0185433D03*
400 | X0110056Y0185433D03*
401 | X0110056Y0205433D03*
402 | X0128135Y0205433D03*
403 | X0128135Y0225433D03*
404 | X0110056Y0225433D03*
405 | X0110056Y0245433D03*
406 | X0128135Y0245433D03*
407 | X0128135Y0265433D03*
408 | X0110056Y0265433D03*
409 | D16*
410 | X0344095Y0243933D03*
411 | X0350095Y0243933D03*
412 | X0356095Y0243933D03*
413 | M02*
414 |
--------------------------------------------------------------------------------
/Matériel/1.3/Gerbers/ProgrammateurFilPilote_1.3.GML:
--------------------------------------------------------------------------------
1 | G75*
2 | %MOIN*%
3 | %OFA0B0*%
4 | %FSLAX25Y25*%
5 | %IPPOS*%
6 | %LPD*%
7 | %AMOC8*
8 | 5,1,8,0,0,1.08239X$1,22.5*
9 | %
10 | %ADD10C,0.00100*%
11 | D10*
12 | X0057595Y0046433D02*
13 | X0057595Y0288933D01*
14 | X0057598Y0289175D01*
15 | X0057607Y0289416D01*
16 | X0057621Y0289657D01*
17 | X0057642Y0289898D01*
18 | X0057668Y0290138D01*
19 | X0057700Y0290378D01*
20 | X0057738Y0290617D01*
21 | X0057781Y0290854D01*
22 | X0057831Y0291091D01*
23 | X0057886Y0291326D01*
24 | X0057946Y0291560D01*
25 | X0058013Y0291792D01*
26 | X0058084Y0292023D01*
27 | X0058162Y0292252D01*
28 | X0058245Y0292479D01*
29 | X0058333Y0292704D01*
30 | X0058427Y0292927D01*
31 | X0058526Y0293147D01*
32 | X0058631Y0293365D01*
33 | X0058740Y0293580D01*
34 | X0058855Y0293793D01*
35 | X0058975Y0294003D01*
36 | X0059100Y0294209D01*
37 | X0059230Y0294413D01*
38 | X0059365Y0294614D01*
39 | X0059505Y0294811D01*
40 | X0059649Y0295005D01*
41 | X0059798Y0295195D01*
42 | X0059952Y0295381D01*
43 | X0060110Y0295564D01*
44 | X0060272Y0295743D01*
45 | X0060439Y0295918D01*
46 | X0060610Y0296089D01*
47 | X0060785Y0296256D01*
48 | X0060964Y0296418D01*
49 | X0061147Y0296576D01*
50 | X0061333Y0296730D01*
51 | X0061523Y0296879D01*
52 | X0061717Y0297023D01*
53 | X0061914Y0297163D01*
54 | X0062115Y0297298D01*
55 | X0062319Y0297428D01*
56 | X0062525Y0297553D01*
57 | X0062735Y0297673D01*
58 | X0062948Y0297788D01*
59 | X0063163Y0297897D01*
60 | X0063381Y0298002D01*
61 | X0063601Y0298101D01*
62 | X0063824Y0298195D01*
63 | X0064049Y0298283D01*
64 | X0064276Y0298366D01*
65 | X0064505Y0298444D01*
66 | X0064736Y0298515D01*
67 | X0064968Y0298582D01*
68 | X0065202Y0298642D01*
69 | X0065437Y0298697D01*
70 | X0065674Y0298747D01*
71 | X0065911Y0298790D01*
72 | X0066150Y0298828D01*
73 | X0066390Y0298860D01*
74 | X0066630Y0298886D01*
75 | X0066871Y0298907D01*
76 | X0067112Y0298921D01*
77 | X0067353Y0298930D01*
78 | X0067595Y0298933D01*
79 | X0375095Y0298933D01*
80 | X0397595Y0276433D01*
81 | X0397595Y0058933D01*
82 | X0375095Y0036433D01*
83 | X0067595Y0036433D01*
84 | X0067353Y0036436D01*
85 | X0067112Y0036445D01*
86 | X0066871Y0036459D01*
87 | X0066630Y0036480D01*
88 | X0066390Y0036506D01*
89 | X0066150Y0036538D01*
90 | X0065911Y0036576D01*
91 | X0065674Y0036619D01*
92 | X0065437Y0036669D01*
93 | X0065202Y0036724D01*
94 | X0064968Y0036784D01*
95 | X0064736Y0036851D01*
96 | X0064505Y0036922D01*
97 | X0064276Y0037000D01*
98 | X0064049Y0037083D01*
99 | X0063824Y0037171D01*
100 | X0063601Y0037265D01*
101 | X0063381Y0037364D01*
102 | X0063163Y0037469D01*
103 | X0062948Y0037578D01*
104 | X0062735Y0037693D01*
105 | X0062525Y0037813D01*
106 | X0062319Y0037938D01*
107 | X0062115Y0038068D01*
108 | X0061914Y0038203D01*
109 | X0061717Y0038343D01*
110 | X0061523Y0038487D01*
111 | X0061333Y0038636D01*
112 | X0061147Y0038790D01*
113 | X0060964Y0038948D01*
114 | X0060785Y0039110D01*
115 | X0060610Y0039277D01*
116 | X0060439Y0039448D01*
117 | X0060272Y0039623D01*
118 | X0060110Y0039802D01*
119 | X0059952Y0039985D01*
120 | X0059798Y0040171D01*
121 | X0059649Y0040361D01*
122 | X0059505Y0040555D01*
123 | X0059365Y0040752D01*
124 | X0059230Y0040953D01*
125 | X0059100Y0041157D01*
126 | X0058975Y0041363D01*
127 | X0058855Y0041573D01*
128 | X0058740Y0041786D01*
129 | X0058631Y0042001D01*
130 | X0058526Y0042219D01*
131 | X0058427Y0042439D01*
132 | X0058333Y0042662D01*
133 | X0058245Y0042887D01*
134 | X0058162Y0043114D01*
135 | X0058084Y0043343D01*
136 | X0058013Y0043574D01*
137 | X0057946Y0043806D01*
138 | X0057886Y0044040D01*
139 | X0057831Y0044275D01*
140 | X0057781Y0044512D01*
141 | X0057738Y0044749D01*
142 | X0057700Y0044988D01*
143 | X0057668Y0045228D01*
144 | X0057642Y0045468D01*
145 | X0057621Y0045709D01*
146 | X0057607Y0045950D01*
147 | X0057598Y0046191D01*
148 | X0057595Y0046433D01*
149 | M02*
150 |
--------------------------------------------------------------------------------
/Matériel/1.3/Gerbers/ProgrammateurFilPilote_1.3.GTP:
--------------------------------------------------------------------------------
1 | G75*
2 | %MOIN*%
3 | %OFA0B0*%
4 | %FSLAX25Y25*%
5 | %IPPOS*%
6 | %LPD*%
7 | %AMOC8*
8 | 5,1,8,0,0,1.08239X$1,22.5*
9 | %
10 | %ADD10C,0.00100*%
11 | %ADD11R,0.07087X0.06299*%
12 | %ADD12R,0.06299X0.07087*%
13 | %ADD13R,0.08000X0.05000*%
14 | %ADD14R,0.06299X0.07874*%
15 | %ADD15R,0.08661X0.04134*%
16 | %ADD16R,0.04134X0.03937*%
17 | %ADD17R,0.09000X0.06969*%
18 | %ADD18R,0.04000X0.04500*%
19 | %ADD19R,0.06969X0.09000*%
20 | D10*
21 | X0057595Y0046433D02*
22 | X0057595Y0288933D01*
23 | X0057598Y0289175D01*
24 | X0057607Y0289416D01*
25 | X0057621Y0289657D01*
26 | X0057642Y0289898D01*
27 | X0057668Y0290138D01*
28 | X0057700Y0290378D01*
29 | X0057738Y0290617D01*
30 | X0057781Y0290854D01*
31 | X0057831Y0291091D01*
32 | X0057886Y0291326D01*
33 | X0057946Y0291560D01*
34 | X0058013Y0291792D01*
35 | X0058084Y0292023D01*
36 | X0058162Y0292252D01*
37 | X0058245Y0292479D01*
38 | X0058333Y0292704D01*
39 | X0058427Y0292927D01*
40 | X0058526Y0293147D01*
41 | X0058631Y0293365D01*
42 | X0058740Y0293580D01*
43 | X0058855Y0293793D01*
44 | X0058975Y0294003D01*
45 | X0059100Y0294209D01*
46 | X0059230Y0294413D01*
47 | X0059365Y0294614D01*
48 | X0059505Y0294811D01*
49 | X0059649Y0295005D01*
50 | X0059798Y0295195D01*
51 | X0059952Y0295381D01*
52 | X0060110Y0295564D01*
53 | X0060272Y0295743D01*
54 | X0060439Y0295918D01*
55 | X0060610Y0296089D01*
56 | X0060785Y0296256D01*
57 | X0060964Y0296418D01*
58 | X0061147Y0296576D01*
59 | X0061333Y0296730D01*
60 | X0061523Y0296879D01*
61 | X0061717Y0297023D01*
62 | X0061914Y0297163D01*
63 | X0062115Y0297298D01*
64 | X0062319Y0297428D01*
65 | X0062525Y0297553D01*
66 | X0062735Y0297673D01*
67 | X0062948Y0297788D01*
68 | X0063163Y0297897D01*
69 | X0063381Y0298002D01*
70 | X0063601Y0298101D01*
71 | X0063824Y0298195D01*
72 | X0064049Y0298283D01*
73 | X0064276Y0298366D01*
74 | X0064505Y0298444D01*
75 | X0064736Y0298515D01*
76 | X0064968Y0298582D01*
77 | X0065202Y0298642D01*
78 | X0065437Y0298697D01*
79 | X0065674Y0298747D01*
80 | X0065911Y0298790D01*
81 | X0066150Y0298828D01*
82 | X0066390Y0298860D01*
83 | X0066630Y0298886D01*
84 | X0066871Y0298907D01*
85 | X0067112Y0298921D01*
86 | X0067353Y0298930D01*
87 | X0067595Y0298933D01*
88 | X0375095Y0298933D01*
89 | X0397595Y0276433D01*
90 | X0397595Y0058933D01*
91 | X0375095Y0036433D01*
92 | X0067595Y0036433D01*
93 | X0067353Y0036436D01*
94 | X0067112Y0036445D01*
95 | X0066871Y0036459D01*
96 | X0066630Y0036480D01*
97 | X0066390Y0036506D01*
98 | X0066150Y0036538D01*
99 | X0065911Y0036576D01*
100 | X0065674Y0036619D01*
101 | X0065437Y0036669D01*
102 | X0065202Y0036724D01*
103 | X0064968Y0036784D01*
104 | X0064736Y0036851D01*
105 | X0064505Y0036922D01*
106 | X0064276Y0037000D01*
107 | X0064049Y0037083D01*
108 | X0063824Y0037171D01*
109 | X0063601Y0037265D01*
110 | X0063381Y0037364D01*
111 | X0063163Y0037469D01*
112 | X0062948Y0037578D01*
113 | X0062735Y0037693D01*
114 | X0062525Y0037813D01*
115 | X0062319Y0037938D01*
116 | X0062115Y0038068D01*
117 | X0061914Y0038203D01*
118 | X0061717Y0038343D01*
119 | X0061523Y0038487D01*
120 | X0061333Y0038636D01*
121 | X0061147Y0038790D01*
122 | X0060964Y0038948D01*
123 | X0060785Y0039110D01*
124 | X0060610Y0039277D01*
125 | X0060439Y0039448D01*
126 | X0060272Y0039623D01*
127 | X0060110Y0039802D01*
128 | X0059952Y0039985D01*
129 | X0059798Y0040171D01*
130 | X0059649Y0040361D01*
131 | X0059505Y0040555D01*
132 | X0059365Y0040752D01*
133 | X0059230Y0040953D01*
134 | X0059100Y0041157D01*
135 | X0058975Y0041363D01*
136 | X0058855Y0041573D01*
137 | X0058740Y0041786D01*
138 | X0058631Y0042001D01*
139 | X0058526Y0042219D01*
140 | X0058427Y0042439D01*
141 | X0058333Y0042662D01*
142 | X0058245Y0042887D01*
143 | X0058162Y0043114D01*
144 | X0058084Y0043343D01*
145 | X0058013Y0043574D01*
146 | X0057946Y0043806D01*
147 | X0057886Y0044040D01*
148 | X0057831Y0044275D01*
149 | X0057781Y0044512D01*
150 | X0057738Y0044749D01*
151 | X0057700Y0044988D01*
152 | X0057668Y0045228D01*
153 | X0057642Y0045468D01*
154 | X0057621Y0045709D01*
155 | X0057607Y0045950D01*
156 | X0057598Y0046191D01*
157 | X0057595Y0046433D01*
158 | D11*
159 | X0282345Y0230921D03*
160 | X0282345Y0241945D03*
161 | X0338461Y0141919D03*
162 | X0338461Y0130896D03*
163 | X0334934Y0108803D03*
164 | X0334934Y0097780D03*
165 | X0337595Y0054945D03*
166 | X0337595Y0043921D03*
167 | D12*
168 | X0300107Y0161433D03*
169 | X0289083Y0161433D03*
170 | X0322083Y0211433D03*
171 | X0333107Y0211433D03*
172 | X0337857Y0239183D03*
173 | X0326833Y0239183D03*
174 | X0314857Y0255183D03*
175 | X0303833Y0255183D03*
176 | X0209111Y0245390D03*
177 | X0198087Y0245390D03*
178 | X0198087Y0265390D03*
179 | X0209111Y0265390D03*
180 | X0209111Y0285390D03*
181 | X0198087Y0285390D03*
182 | X0198087Y0225390D03*
183 | X0209111Y0225390D03*
184 | X0209111Y0205390D03*
185 | X0198087Y0205390D03*
186 | X0198087Y0185390D03*
187 | X0209111Y0185390D03*
188 | X0208717Y0165705D03*
189 | X0197694Y0165705D03*
190 | X0118457Y0059783D03*
191 | X0107433Y0059783D03*
192 | X0107173Y0043743D03*
193 | X0118197Y0043743D03*
194 | D13*
195 | X0152099Y0155311D03*
196 | X0152099Y0165311D03*
197 | X0152099Y0175390D03*
198 | X0152099Y0185390D03*
199 | X0152099Y0195390D03*
200 | X0152099Y0205390D03*
201 | X0152099Y0215390D03*
202 | X0152099Y0225390D03*
203 | X0152099Y0235390D03*
204 | X0152099Y0245390D03*
205 | X0152099Y0255390D03*
206 | X0152099Y0265390D03*
207 | X0152099Y0275390D03*
208 | X0152099Y0285390D03*
209 | X0180099Y0285390D03*
210 | X0180099Y0275390D03*
211 | X0180099Y0265390D03*
212 | X0180099Y0255390D03*
213 | X0180099Y0245390D03*
214 | X0180099Y0235390D03*
215 | X0180099Y0225390D03*
216 | X0180099Y0215390D03*
217 | X0180099Y0205390D03*
218 | X0180099Y0195390D03*
219 | X0180099Y0185390D03*
220 | X0180099Y0175390D03*
221 | X0180099Y0165311D03*
222 | X0180099Y0155311D03*
223 | D14*
224 | X0365470Y0131338D03*
225 | X0375470Y0131338D03*
226 | X0375470Y0093779D03*
227 | X0365470Y0093779D03*
228 | D15*
229 | X0367595Y0066846D03*
230 | X0367595Y0056020D03*
231 | D16*
232 | X0373599Y0061433D03*
233 | D17*
234 | X0128135Y0155433D03*
235 | X0110056Y0155433D03*
236 | X0110056Y0175433D03*
237 | X0128135Y0175433D03*
238 | X0128135Y0195433D03*
239 | X0110056Y0195433D03*
240 | X0110056Y0215433D03*
241 | X0128135Y0215433D03*
242 | X0128135Y0235433D03*
243 | X0110056Y0235433D03*
244 | X0110056Y0255433D03*
245 | X0128135Y0255433D03*
246 | X0128135Y0275433D03*
247 | X0110056Y0275433D03*
248 | D18*
249 | X0335595Y0078433D03*
250 | X0342595Y0078433D03*
251 | X0339095Y0070433D03*
252 | D19*
253 | X0166095Y0061972D03*
254 | X0166095Y0043894D03*
255 | M02*
256 |
--------------------------------------------------------------------------------
/Matériel/1.3/Gerbers/ProgrammateurFilPilote_1.3.TXT:
--------------------------------------------------------------------------------
1 | %
2 | M48
3 | M72
4 | T01C0.01300
5 | T02C0.01400
6 | T03C0.02500
7 | T04C0.03150
8 | T05C0.03200
9 | T06C0.03500
10 | T07C0.03543
11 | T08C0.04000
12 | T09C0.04016
13 | T10C0.04331
14 | T11C0.05118
15 | T12C0.05200
16 | %
17 | T01
18 | X181345Y190183
19 | X181345Y210183
20 | X181345Y230183
21 | X181345Y250183
22 | X181345Y270183
23 | X218845Y225183
24 | X215345Y216433
25 | X214845Y196433
26 | T02
27 | X125095Y48933
28 | X175720Y63933
29 | X185970Y63933
30 | X217220Y65433
31 | X227595Y71433
32 | X237220Y70433
33 | X254720Y92933
34 | X235720Y106433
35 | X225220Y106433
36 | X215220Y106433
37 | X202595Y106433
38 | X185095Y106433
39 | X187565Y155183
40 | X181345Y170183
41 | X187565Y175183
42 | X192595Y173933
43 | X192595Y193933
44 | X187565Y195183
45 | X192595Y213933
46 | X187565Y215183
47 | X192595Y233933
48 | X187565Y235183
49 | X192595Y253933
50 | X187565Y255183
51 | X192595Y273933
52 | X187565Y275183
53 | X227595Y261433
54 | X222595Y246433
55 | X251095Y206933
56 | X277970Y218058
57 | X320095Y226433
58 | X319720Y232058
59 | X320095Y244433
60 | X320595Y250183
61 | X345470Y262683
62 | X369720Y284433
63 | X250470Y167308
64 | X257595Y151433
65 | X250470Y147308
66 | X294970Y179058
67 | X342595Y216433
68 | X356095Y221433
69 | X356595Y205683
70 | X352595Y192183
71 | X347595Y171933
72 | X391470Y136558
73 | X375154Y106433
74 | X377470Y81308
75 | X354595Y55433
76 | X329845Y77683
77 | X326595Y96933
78 | X318973Y101433
79 | X314220Y101933
80 | X310095Y98933
81 | X313595Y112433
82 | X322470Y117308
83 | X331220Y117558
84 | X317595Y126433
85 | X286220Y95433
86 | X297595Y81433
87 | X306720Y81933
88 | X295095Y62433
89 | X295095Y286433
90 | T03
91 | X142595Y136433
92 | T04
93 | X318595Y197746
94 | X324595Y190120
95 | X330595Y197746
96 | X335595Y190120
97 | X334595Y259622
98 | X334595Y267496
99 | X334595Y275370
100 | X334595Y283244
101 | T05
102 | X137465Y43853
103 | X137465Y53853
104 | X137465Y63853
105 | X237735Y146453
106 | X237735Y156453
107 | X237735Y166453
108 | X237735Y176453
109 | X237735Y186453
110 | X237735Y196453
111 | X237735Y206453
112 | X237735Y216453
113 | X237735Y226453
114 | X237735Y236453
115 | X237735Y246453
116 | X237735Y256453
117 | X237735Y266453
118 | X237735Y276453
119 | X267735Y276453
120 | X267735Y266453
121 | X267735Y256453
122 | X267735Y246453
123 | X267735Y236453
124 | X267735Y226453
125 | X267735Y216453
126 | X267735Y206453
127 | X267735Y196453
128 | X267735Y186453
129 | X267735Y176453
130 | X267735Y166453
131 | X267735Y156453
132 | X267735Y146453
133 | X290345Y146433
134 | X313345Y161433
135 | X323345Y161433
136 | X382595Y61433
137 | T06
138 | X190845Y43433
139 | X200845Y43433
140 | X210845Y43433
141 | X220845Y43433
142 | X230845Y43433
143 | X240845Y43433
144 | X250845Y43433
145 | X260845Y43433
146 | X270845Y43433
147 | X280845Y43433
148 | X290845Y43433
149 | X300845Y43433
150 | X300845Y133558
151 | X290845Y133558
152 | X280845Y133558
153 | X270845Y133558
154 | X260845Y133558
155 | X250845Y133558
156 | X240845Y133558
157 | X230845Y133558
158 | X220845Y133558
159 | X210845Y133558
160 | X200845Y133558
161 | X190845Y133558
162 | T07
163 | X282595Y270958
164 | X292595Y270908
165 | X302595Y270958
166 | X312620Y270908
167 | T08
168 | X190883Y53539
169 | X200883Y53539
170 | X210883Y53539
171 | X220883Y53539
172 | X230883Y53539
173 | X240883Y53539
174 | X250883Y53539
175 | X260883Y53539
176 | X270883Y53539
177 | X280883Y53539
178 | X290883Y53539
179 | X300883Y53539
180 | X300883Y123539
181 | X290883Y123539
182 | X280883Y123539
183 | X270883Y123539
184 | X260883Y123539
185 | X250883Y123539
186 | X240883Y123539
187 | X230883Y123539
188 | X220883Y123539
189 | X210883Y123539
190 | X200883Y123539
191 | X190883Y123539
192 | X378595Y195683
193 | X378595Y205683
194 | T09
195 | X294595Y191433
196 | X305095Y186433
197 | X305095Y176433
198 | X305095Y196433
199 | X294595Y201433
200 | X305095Y206433
201 | X294595Y211433
202 | X305095Y216433
203 | X294595Y221433
204 | X305095Y226433
205 | X305095Y236433
206 | T10
207 | X153745Y92236
208 | X163745Y112236
209 | X123745Y112236
210 | X103745Y112236
211 | T11
212 | X111079Y76811
213 | X159111Y76811
214 | X166985Y100433
215 | X159111Y124055
216 | X111079Y124055
217 | T12
218 | X76355Y69328
219 | X76355Y89128
220 | X76394Y109265
221 | X76394Y129065
222 | X76394Y149359
223 | X76394Y169159
224 | X76394Y188859
225 | X76394Y208559
226 | X76394Y228259
227 | X76394Y247959
228 | X76394Y267759
229 | X378796Y159565
230 | X378796Y179365
231 | X378845Y221733
232 | X378845Y241433
233 | X378845Y261133
234 | M30
235 |
--------------------------------------------------------------------------------
/Matériel/1.3/Gerbers/ProgrammateurFilPilote_1.3.dri:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Gerbers/ProgrammateurFilPilote_1.3.dri
--------------------------------------------------------------------------------
/Matériel/1.3/Gerbers/ProgrammateurFilPilote_1.3.gpi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Gerbers/ProgrammateurFilPilote_1.3.gpi
--------------------------------------------------------------------------------
/Matériel/1.3/ProgrammateurFilPilote_1.3_Board.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/ProgrammateurFilPilote_1.3_Board.png
--------------------------------------------------------------------------------
/Matériel/1.3/ProgrammateurFilPilote_1.3_Recto.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/ProgrammateurFilPilote_1.3_Recto.png
--------------------------------------------------------------------------------
/Matériel/1.3/ProgrammateurFilPilote_1.3_Schematic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/ProgrammateurFilPilote_1.3_Schematic.png
--------------------------------------------------------------------------------
/Matériel/1.3/ProgrammateurFilPilote_1.3_Verso.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/ProgrammateurFilPilote_1.3_Verso.png
--------------------------------------------------------------------------------
/Matériel/1.3/README.md:
--------------------------------------------------------------------------------
1 | Version matérielle 1.3
2 | =======================
3 |
4 | Modifications
5 | -------------
6 | Cette version reprend toutes les caractéristiques de la version [initiale][1] en y ajoutant les fonctionnalités suivantes :
7 |
8 | - Ajout d'un contrôleur d'entrées sortie I2C [MCP23017][10] pour libérer les I/O du Spark Core
9 | - Possibilité de mettre deux types de relais dont un [avec contact NO + NF][5]
10 | - Possibilité de mettre un emetteur récepteur sans fil de type [RFM12B][6], [RFM69CW][7], [RFM69HW][8] ou [RFM69CW][9] 433Mhz ou 868MHz
11 | - Possibilité de mettre un [récepteur 433MHz][4] pour récupérer par exemple les trames des capteurs de température Orégon Scientific
12 | - Ajout d'un connecteur I2C ET SPI pour des afficheurs OLED de type [I2C][2] ou [SPI][3]
13 | - Ajout d'un connecteur de type Grove I2C
14 | - Ajout d'une LED 3mm (déportable ou non) sur le boitier
15 | - Ajout de pin out disponibles sur toutes les pattes du Spark Core
16 |
17 | Changements apportés dans la révision 1.3 vs 1.2
18 | - Ajout d'un étage a MOSFET pour la téléinfo, pour une meilleure compatibilité di signal téléinfo
19 | - Ajout d'une RGB LED pour ESP8266
20 | - Ajout d'un pont diviseur sur le recepteur 433MHZ pour transformer sa sortie 5V en 3V3 pour l'ESP8266
21 | - Possibilité de mettre une base ESP8266 (NodeMCU) via cet [adaptateur][11]
22 |
23 |
24 | Description Détaillée
25 | =====================
26 |
27 | **Schematic**
28 | 
29 |
30 |
31 | **Boards**
32 |
33 |
34 |
35 |
36 |
37 | [1]: https://github.com/thibdct/programmateur-fil-pilote-wifi/blob/master/README.md
38 | [2]: http://www.ebay.com/itm/291216700457
39 | [3]: http://www.ebay.com/itm/141371873602
40 | [4]: http://www.ebay.com/itm/290935235157
41 | [5]: http://www.seeedstudio.com/depot/index.php?main_page=opl_info&opl_id=136
42 |
43 | [6]: http://www.anarduino.com/details.jsp?pid=142
44 | [7]: http://www.anarduino.com/details.jsp?pid=145
45 | [8]: http://www.anarduino.com/details.jsp?pid=136
46 | [9]: http://www.anarduino.com/details.jsp?pid=122
47 | [10]: http://www.adafruit.com/product/732
48 | [11]: https://github.com/hallard/Particle2NodeMCU
49 |
50 |
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Le_contenu_du_kit.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Le_contenu_du_kit.jpg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Outillage.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Outillage.jpg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo1.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo1.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo10.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo10.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo11.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo11.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo12.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo12.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo13.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo13.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo14.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo14.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo15.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo15.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo16.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo16.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo17.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo17.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo18.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo18.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo19.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo19.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo2.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo2.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo20.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo20.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo21.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo21.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo22.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo22.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo23.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo23.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo24.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo24.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo25.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo25.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo26.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo26.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo27.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo27.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo28.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo28.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo29.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo29.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo3.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo3.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo30.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo30.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo31.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo31.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo32.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo32.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo33.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo33.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo34.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo34.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo35.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo35.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo36.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo36.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo37.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo37.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo38.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo38.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo39.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo39.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo4.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo4.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo40.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo40.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo41.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo41.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo42.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo42.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo43.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo43.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo44.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo44.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo5.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo5.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo6.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo6.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo7.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo7.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo8.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo8.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/Photo9.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/Photo9.jpeg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/remoara-pcb-bot-v13.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/remoara-pcb-bot-v13.jpg
--------------------------------------------------------------------------------
/Matériel/1.3/Tutoriel/Images/remoara-pcb-top-v13.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/Matériel/1.3/Tutoriel/Images/remoara-pcb-top-v13.jpg
--------------------------------------------------------------------------------
/Matériel/README.md:
--------------------------------------------------------------------------------
1 | Liste matériel
2 | ==============
3 |
4 | BOM File
5 | --------
6 | Vous trouverez la liste du matériel en fonction de la version à l'adresse [suivante][1] (google doc)
7 |
8 |
9 | [1]: https://docs.google.com/spreadsheets/d/1HEebySHMIzUFYeRYVwTHakMmaWHZ26DxMvw0GtgDD7c
10 |
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Le programmateur fil pilote WiFi open source
2 | ============================================
3 |
4 | Principe
5 | --------
6 | Avec de simples requêtes HTTP, vous allez pouvoir :
7 | - **Contrôler vos chauffages électriques** (7 zones / 4 ordres fil pilote)
8 | - **Récupérer votre consommation électrique** (et toutes les informations du compteur électrique)
9 |
10 | Avantages :
11 | - **Pas de serveur dédié nécessaire**
12 | - **Intégration facile dans le tableau électrique**
13 | - **Connexion WiFi** (pas de câble Ethernet à connecter)
14 |
15 | 
16 |
17 | Idées d'applications
18 | --------------------
19 | - Contrôle de la température de chaque pièce via votre box domotique
20 | - Coupure du chauffage automatique en cas de consommation électrique trop importante (délestage)
21 | - Lancement du chauffage en partant du travail à partir de votre smartphone
22 | - Et bien d'autres...
23 |
24 | Licence
25 | -------
26 | Les codes sources sont distribués sous la licence MIT
27 | Les autres éléments sont distribués sous la licence [Creative Commons Attribution-NonCommercial-ShareAlike 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)
28 |
--------------------------------------------------------------------------------
/schema_principe_programmateur_rail_din.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tducret/programmateur-fil-pilote-wifi/367df0b4b363042b4e6e7ec7f2a8d6088da148cc/schema_principe_programmateur_rail_din.png
--------------------------------------------------------------------------------