├── BUILD
└── WiFiSwitchWebServer_00000.bin
├── ConfigFunctions.ino
├── ESP_WiFiSwitch.ino
├── ElectronicDesignAutomation
├── Gerber
│ ├── WifiSwitch-Edge_Cuts.gbr
│ ├── WifiSwitch-NPTH.drl
│ └── WifiSwitch.drl
├── Schematic.png
├── WifiSwitch - Copy.lib
├── WifiSwitch-cache.dcm
├── WifiSwitch-cache.lib
├── WifiSwitch.cmp
├── WifiSwitch.csv
├── WifiSwitch.dcm
├── WifiSwitch.kicad_pcb
├── WifiSwitch.lib
├── WifiSwitch.net
├── WifiSwitch.pro
├── WifiSwitch.sch
└── WifiSwitch.xml
├── LICENSE
├── README.md
├── helperFunctions.ino
├── mqttFunctions.ino
├── other
└── flashSettings.png
└── serverFunctions.ino
/BUILD/WiFiSwitchWebServer_00000.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/biohazardxxx/ESP_WiFiSwitch/1c642fe2b00fbf83324e2228826ad341f687ce45/BUILD/WiFiSwitchWebServer_00000.bin
--------------------------------------------------------------------------------
/ConfigFunctions.ino:
--------------------------------------------------------------------------------
1 | bool loadConfig() {
2 | File configFile = SPIFFS.open("/config.json", "r");
3 | if (!configFile) {
4 | Serial.println("Failed to open config file");
5 | return false;
6 | }
7 |
8 | size_t size = configFile.size();
9 | if (size > 1024) {
10 | Serial.println("Config file size is too large");
11 | return false;
12 | }
13 |
14 | // Allocate a buffer to store contents of the file.
15 | std::unique_ptr buf(new char[size]);
16 |
17 | // We don't use String here because ArduinoJson library requires the input
18 | // buffer to be mutable. If you don't use ArduinoJson, you may as well
19 | // use configFile.readString instead.
20 | configFile.readBytes(buf.get(), size);
21 |
22 | StaticJsonBuffer<400> jsonBuffer;
23 | JsonObject& json = jsonBuffer.parseObject(buf.get());
24 |
25 | if (!json.success()) {
26 | Serial.println("Failed to parse config file");
27 | return false;
28 | }
29 |
30 | int otaFlagC = json["otaFlag"];
31 | String esidC = json["esid"];
32 | String epassC = json["epass"];
33 | int iotModeC = json["iotMode"];
34 | String pubTopicC = json["pubTopic"];
35 | String subTopicC = json["subTopic"];
36 | String mqttServerC = json["mqttServer"];
37 |
38 | // Real world application would store these values in some variables for
39 | // later use.
40 | otaFlag = otaFlagC;
41 | esid = esidC;
42 | epass = epassC;
43 | iotMode = iotModeC;
44 | pubTopic = pubTopicC;
45 | subTopic = subTopicC;
46 | mqttServer = mqttServerC;
47 | Serial.print("otaFlag: ");
48 | Serial.println(otaFlag);
49 | Serial.print("esid: ");
50 | Serial.println(esid);
51 | Serial.print("epass: ");
52 | Serial.println(epass);
53 | Serial.print("iotMode: ");
54 | Serial.println(iotMode);
55 | Serial.print("pubTopic: ");
56 | Serial.println(pubTopic);
57 | Serial.print("subTopic: ");
58 | Serial.println(subTopic);
59 | Serial.print("mqttServer: ");
60 | Serial.println(mqttServer);
61 | Serial.print("esid: ");
62 | Serial.println(esid);
63 | return true;
64 | }
65 |
66 | bool saveConfig() {
67 | StaticJsonBuffer<400> jsonBuffer;
68 | JsonObject& json = jsonBuffer.createObject();
69 | json["otaFlag"] = otaFlag;
70 | json["esid"] = esid;
71 | json["epass"] = epass;
72 | json["iotMode"] = iotMode;
73 | json["pubTopic"] = pubTopic;
74 | json["subTopic"] = subTopic;
75 | json["mqttServer"] = mqttServer;
76 |
77 | File configFile = SPIFFS.open("/config.json", "w");
78 | if (!configFile) {
79 | Serial.println("Failed to open config file for writing");
80 | return false;
81 | }
82 |
83 | json.printTo(configFile);
84 | return true;
85 | }
86 |
87 |
88 | void setOtaFlag(int intOta){
89 | otaFlag=intOta;
90 | saveConfig();
91 | yield();
92 | }
93 |
94 | bool clearConfig(){
95 | Debugln("DEBUG: In config clear!");
96 | return SPIFFS.format();
97 | }
98 |
99 |
--------------------------------------------------------------------------------
/ESP_WiFiSwitch.ino:
--------------------------------------------------------------------------------
1 | /*
2 | * This sketch is running a web server for configuring WiFI if can't connect or for controlling of one GPIO to switch a light/LED
3 | * Also it supports to change the state of the light via MQTT message and gives back the state after change.
4 | * The push button has to switch to ground. It has following functions: Normal press less than 1 sec but more than 50ms-> Switch light. Restart press: 3 sec -> Restart the module. Reset press: 20 sec -> Clear the settings in EEPROM
5 | * While a WiFi config is not set or can't connect:
6 | * http://server_ip will give a config page with
7 | * While a WiFi config is set:
8 | * http://server_ip/gpio -> Will display the GIPIO state and a switch form for it
9 | * http://server_ip/gpio?state=0 -> Will change the GPIO directly and display the above aswell
10 | * http://server_ip/cleareeprom -> Will reset the WiFi setting and rest to configure mode as AP
11 | * server_ip is the IP address of the ESP8266 module, will be
12 | * printed to Serial when the module is connected. (most likly it will be 192.168.4.1)
13 | * To force AP config mode, press button 20 Secs!
14 | * For several snippets used, the credit goes to:
15 | * - https://github.com/esp8266
16 | * - https://github.com/chriscook8/esp-arduino-apboot
17 | * - https://github.com/knolleary/pubsubclient
18 | * - https://github.com/vicatcu/pubsubclient <- Currently this needs to be used instead of the origin
19 | * - https://gist.github.com/igrr/7f7e7973366fc01d6393
20 | * - http://www.esp8266.com/viewforum.php?f=25
21 | * - http://www.esp8266.com/viewtopic.php?f=29&t=2745
22 | * - And the whole Arduino and ESP8266 comunity
23 | */
24 |
25 | #define DEBUG
26 | //#define WEBOTA
27 | //debug added for information, change this according your needs
28 |
29 | #ifdef DEBUG
30 | #define Debug(x) Serial.print(x)
31 | #define Debugln(x) Serial.println(x)
32 | #define Debugf(...) Serial.printf(__VA_ARGS__)
33 | #define Debugflush Serial.flush
34 | #else
35 | #define Debug(x) {}
36 | #define Debugln(x) {}
37 | #define Debugf(...) {}
38 | #define Debugflush {}
39 | #endif
40 |
41 |
42 | #include
43 | #include
44 | #include
45 | #include
46 | //#include
47 | #include
48 | #include
49 | #include
50 | #include "FS.h"
51 |
52 | extern "C" {
53 | #include "user_interface.h" //Needed for the reset command
54 | }
55 |
56 | //***** Settings declare *********************************************************************************************************
57 | String hostName ="WiFiSwitch"; //The MQTT ID -> MAC adress will be added to make it kind of unique
58 | int iotMode=0; //IOT mode: 0 = Web control, 1 = MQTT (No const since it can change during runtime)
59 | //select GPIO's
60 | #define OUTPIN 13 //output pin
61 | #define INPIN 0 // input pin (push button)
62 |
63 | #define RESTARTDELAY 3 //minimal time in sec for button press to reset
64 | #define HUMANPRESSDELAY 50 // the delay in ms untill the press should be handled as a normal push by human. Button debounce. !!! Needs to be less than RESTARTDELAY & RESETDELAY!!!
65 | #define RESETDELAY 20 //Minimal time in sec for button press to reset all settings and boot to config mode
66 |
67 | //##### Object instances #####
68 | MDNSResponder mdns;
69 | ESP8266WebServer server(80);
70 | WiFiClient wifiClient;
71 | PubSubClient mqttClient;
72 | Ticker btn_timer;
73 | Ticker otaTickLoop;
74 |
75 | //##### Flags ##### They are needed because the loop needs to continue and cant wait for long tasks!
76 | int rstNeed=0; // Restart needed to apply new settings
77 | int toPub=0; // determine if state should be published.
78 | int configToClear=0; // determine if config should be cleared.
79 | int otaFlag=0;
80 | boolean inApMode=0;
81 | //##### Global vars #####
82 | int webtypeGlob;
83 | int otaCount=300; //imeout in sec for OTA mode
84 | int current; //Current state of the button
85 | unsigned long count = 0; //Button press time counter
86 | String st; //WiFi Stations HTML list
87 | String state; //State of light
88 | char buf[40]; //For MQTT data recieve
89 | char* host; //The DNS hostname
90 | //To be read from Config file
91 | String esid="";
92 | String epass = "";
93 | String pubTopic;
94 | String subTopic;
95 | String mqttServer = "";
96 | const char* otaServerIndex = "";
97 |
98 | //-------------- void's -------------------------------------------------------------------------------------
99 | void setup() {
100 | Serial.begin(115200);
101 | delay(10);
102 | // prepare GPIO2
103 | pinMode(OUTPIN, OUTPUT);
104 | pinMode(INPIN, INPUT_PULLUP);
105 | btn_timer.attach(0.05, btn_handle);
106 | Debugln("DEBUG: Entering loadConfig()");
107 | if (!SPIFFS.begin()) {
108 | Serial.println("Failed to mount file system");
109 | }
110 |
111 | uint8_t mac[6];
112 | WiFi.macAddress(mac);
113 | hostName += "-";
114 | hostName += macToStr(mac);
115 | String hostTemp=hostName;
116 | hostTemp.replace(":","-");
117 | host = (char*) hostTemp.c_str();
118 | loadConfig();
119 | //loadConfigOld();
120 | Debugln("DEBUG: loadConfig() passed");
121 |
122 | // Connect to WiFi network
123 | Debugln("DEBUG: Entering initWiFi()");
124 | initWiFi();
125 | Debugln("DEBUG: initWiFi() passed");
126 | Debug("iotMode:");
127 | Debugln(iotMode);
128 | Debug("webtypeGlob:");
129 | Debugln(webtypeGlob);
130 | Debug("otaFlag:");
131 | Debugln(otaFlag);
132 | Debugln("DEBUG: Starting the main loop");
133 | }
134 |
135 |
136 | void btn_handle()
137 | {
138 | if(!digitalRead(INPIN)){
139 | ++count; // one count is 50ms
140 | } else {
141 | if (count > 1 && count < HUMANPRESSDELAY/5) { //push between 50 ms and 1 sec
142 | Serial.print("button pressed ");
143 | Serial.print(count*0.05);
144 | Serial.println(" Sec.");
145 |
146 | Serial.print("Light is ");
147 | Serial.println(digitalRead(OUTPIN));
148 |
149 | Serial.print("Switching light to ");
150 | Serial.println(!digitalRead(OUTPIN));
151 | digitalWrite(OUTPIN, !digitalRead(OUTPIN));
152 | state = digitalRead(OUTPIN);
153 | if(iotMode==1 && mqttClient.connected()){
154 | toPub=1;
155 | Debugln("DEBUG: toPub set to 1");
156 | }
157 | } else if (count > (RESTARTDELAY/0.05) && count <= (RESETDELAY/0.05)){ //pressed 3 secs (60*0.05s)
158 | Serial.print("button pressed ");
159 | Serial.print(count*0.05);
160 | Serial.println(" Sec. Restarting!");
161 | setOtaFlag(!otaFlag);
162 | ESP.reset();
163 | } else if (count > (RESETDELAY/0.05)){ //pressed 20 secs
164 | Serial.print("button pressed ");
165 | Serial.print(count*0.05);
166 | Serial.println(" Sec.");
167 | Serial.println(" Clear settings and resetting!");
168 | configToClear=1;
169 | }
170 | count=0; //reset since we are at high
171 | }
172 | }
173 |
174 |
175 |
176 | //-------------------------------- Main loop ---------------------------
177 | void loop() {
178 | //Debugln("DEBUG: loop() begin");
179 | if(configToClear==1){
180 | //Debugln("DEBUG: loop() clear config flag set!");
181 | clearConfig()? Serial.println("Config cleared!") : Serial.println("Config could not be cleared");
182 | delay(1000);
183 | ESP.reset();
184 | }
185 | //Debugln("DEBUG: config reset check passed");
186 | if (WiFi.status() == WL_CONNECTED && otaFlag){
187 | if(otaCount<=1) {
188 | Serial.println("OTA mode time out. Reset!");
189 | setOtaFlag(0);
190 | ESP.reset();
191 | delay(100);
192 | }
193 | server.handleClient();
194 | delay(1);
195 | } else if (WiFi.status() == WL_CONNECTED || webtypeGlob == 1){
196 | //Debugln("DEBUG: loop() wifi connected & webServer ");
197 | if (iotMode==0 || webtypeGlob == 1){
198 | //Debugln("DEBUG: loop() Web mode requesthandling ");
199 | server.handleClient();
200 | delay(1);
201 | } else if (iotMode==1 && webtypeGlob != 1 && otaFlag !=1){
202 | //Debugln("DEBUG: loop() MQTT mode requesthandling ");
203 | if (!connectMQTT()){
204 | delay(200);
205 | }
206 | if (mqttClient.connected()){
207 | //Debugln("mqtt handler");
208 | mqtt_handler();
209 | } else {
210 | Debugln("mqtt Not connected!");
211 | }
212 | }
213 | } else{
214 | Debugln("DEBUG: loop - WiFi not connected");
215 | delay(1000);
216 | initWiFi(); //Try to connect again
217 | }
218 | //Debugln("DEBUG: loop() end");
219 | }
220 |
--------------------------------------------------------------------------------
/ElectronicDesignAutomation/Gerber/WifiSwitch-Edge_Cuts.gbr:
--------------------------------------------------------------------------------
1 | G04 #@! TF.FileFunction,Profile,NP*
2 | %FSLAX46Y46*%
3 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
4 | G04 Created by KiCad (PCBNEW (after 2015-mar-04 BZR unknown)-product) date 15/07/2015 23:29:12*
5 | %MOMM*%
6 | G01*
7 | G04 APERTURE LIST*
8 | %ADD10C,0.100000*%
9 | G04 APERTURE END LIST*
10 | D10*
11 | X140208000Y-118872000D02*
12 | X140208000Y-118364000D01*
13 | X103632000Y-118872000D02*
14 | X140208000Y-118872000D01*
15 | X103632000Y-118618000D02*
16 | X103632000Y-118872000D01*
17 | X140208000Y-77216000D02*
18 | X140208000Y-118618000D01*
19 | X139192000Y-77216000D02*
20 | X140208000Y-77216000D01*
21 | X139192000Y-77216000D02*
22 | X139700000Y-77216000D01*
23 | X103632000Y-77216000D02*
24 | X104902000Y-77216000D01*
25 | X103632000Y-118618000D02*
26 | X103632000Y-77216000D01*
27 | X104394000Y-77216000D02*
28 | X139446000Y-77216000D01*
29 | M02*
30 |
--------------------------------------------------------------------------------
/ElectronicDesignAutomation/Gerber/WifiSwitch-NPTH.drl:
--------------------------------------------------------------------------------
1 | M48
2 | ;DRILL file {kicad (after 2015-mar-04 BZR unknown)-product} date 15/07/2015 23:29:06
3 | ;FORMAT={-:-/ absolute / inch / decimal}
4 | FMAT,2
5 | INCH,TZ
6 | T1C0.150
7 | %
8 | G90
9 | G05
10 | M72
11 | T1
12 | X4.61Y-3.25
13 | T0
14 | M30
15 |
--------------------------------------------------------------------------------
/ElectronicDesignAutomation/Gerber/WifiSwitch.drl:
--------------------------------------------------------------------------------
1 | M48
2 | ;DRILL file {kicad (after 2015-mar-04 BZR unknown)-product} date 15/07/2015 23:29:06
3 | ;FORMAT={-:-/ absolute / inch / decimal}
4 | FMAT,2
5 | INCH,TZ
6 | T1C0.016
7 | T2C0.030
8 | T3C0.031
9 | T4C0.039
10 | T5C0.040
11 | T6C0.049
12 | %
13 | G90
14 | G05
15 | M72
16 | T1
17 | X4.7Y-4.12
18 | X4.72Y-4.02
19 | X4.82Y-3.59
20 | X4.88Y-3.67
21 | X4.89Y-3.59
22 | X4.89Y-4.1
23 | X5.03Y-3.83
24 | X5.22Y-3.83
25 | X5.26Y-3.72
26 | X5.35Y-3.68
27 | X5.42Y-3.81
28 | X5.42Y-3.86
29 | T2
30 | X4.1985Y-3.1341
31 | X4.1985Y-4.6144
32 | X4.3009Y-3.1341
33 | T3
34 | X4.3009Y-4.6144
35 | T4
36 | X4.51Y-3.91
37 | X4.61Y-3.91
38 | X4.71Y-3.91
39 | T5
40 | X5.39Y-3.92
41 | X5.39Y-4.02
42 | X5.39Y-4.12
43 | X5.39Y-4.22
44 | X5.39Y-4.32
45 | T6
46 | X4.7224Y-4.49
47 | X4.92Y-4.49
48 | X5.1176Y-4.49
49 | T0
50 | M30
51 |
--------------------------------------------------------------------------------
/ElectronicDesignAutomation/Schematic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/biohazardxxx/ESP_WiFiSwitch/1c642fe2b00fbf83324e2228826ad341f687ce45/ElectronicDesignAutomation/Schematic.png
--------------------------------------------------------------------------------
/ElectronicDesignAutomation/WifiSwitch-cache.dcm:
--------------------------------------------------------------------------------
1 | EESchema-DOCLIB Version 2.0
2 | #
3 | $CMP MOC3031M
4 | D MOC3031M, DIP6, Zero Cross Opto-Triac, Vdrm 250V, Ift 15mA
5 | K Opto-Triac Opto Triac Zero Cross
6 | F http://www.fairchildsemi.com/ds/MO/MOC3031M.pdf
7 | $ENDCMP
8 | #
9 | $CMP MOC3032M
10 | D MOC3032M, DIP6, Zero Cross Opto-Triac, Vdrm 250V, Ift 10mA
11 | K Opto-Triac Opto Triac Zero Cross
12 | F http://www.fairchildsemi.com/ds/MO/MOC3031M.pdf
13 | $ENDCMP
14 | #
15 | $CMP MOC3033M
16 | D MOC3033M, DIP6, Zero Cross Opto-Triac, Vdrm 250V, Ift 5mA
17 | K Opto-Triac Opto Triac Zero Cross
18 | F http://www.fairchildsemi.com/ds/MO/MOC3031M.pdf
19 | $ENDCMP
20 | #
21 | $CMP MOC3041M
22 | D MOC3041M, DIP6, Zero Cross Opto-Triac, Vdrm 400V, Ift 15mA
23 | K Opto-Triac Opto Triac Zero Cross
24 | F http://www.fairchildsemi.com/ds/MO/MOC3031M.pdf
25 | $ENDCMP
26 | #
27 | $CMP MOC3042M
28 | D MOC3042M, DIP6, Zero Cross Opto-Triac, Vdrm 400V, Ift 10mA
29 | K Opto-Triac Opto Triac Zero Cross
30 | F http://www.fairchildsemi.com/ds/MO/MOC3031M.pdf
31 | $ENDCMP
32 | #
33 | $CMP MOC3043M
34 | D MOC3043M, DIP6, Zero Cross Opto-Triac, Vdrm 400V, Ift 5mA
35 | K Opto-Triac Opto Triac Zero Cross
36 | F http://www.fairchildsemi.com/ds/MO/MOC3031M.pdf
37 | $ENDCMP
38 | #
39 | #End Doc Library
40 |
--------------------------------------------------------------------------------
/ElectronicDesignAutomation/WifiSwitch-cache.lib:
--------------------------------------------------------------------------------
1 | EESchema-LIBRARY Version 2.3
2 | #encoding utf-8
3 | #
4 | # +3V3
5 | #
6 | DEF +3V3 #PWR 0 0 Y Y 1 F P
7 | F0 "#PWR" 0 -150 50 H I C CNN
8 | F1 "+3V3" 0 140 50 H V C CNN
9 | F2 "" 0 0 60 H V C CNN
10 | F3 "" 0 0 60 H V C CNN
11 | ALIAS +3.3V
12 | DRAW
13 | P 2 0 1 0 -30 50 0 100 N
14 | P 2 0 1 0 0 0 0 100 N
15 | P 2 0 1 0 0 100 30 50 N
16 | X +3V3 1 0 0 0 U 50 50 1 1 W N
17 | ENDDRAW
18 | ENDDEF
19 | #
20 | # AC_to_DC_convertor
21 | #
22 | DEF AC_to_DC_convertor C 0 40 Y Y 1 F N
23 | F0 "C" 100 -100 60 H V C CNN
24 | F1 "AC_to_DC_convertor" 0 250 60 H V C CNN
25 | F2 "" 100 0 60 H V C CNN
26 | F3 "" 100 0 60 H V C CNN
27 | DRAW
28 | T 0 -100 50 20 0 0 0 SW~AC~to~DC~Conv. Normal 0 C C
29 | S -450 150 400 -50 0 0 10 N
30 | X +3V3 1 -650 100 200 R 50 50 1 1 I
31 | X GND 2 -650 0 200 R 50 50 1 1 I
32 | X AC_240V 3 600 100 200 L 50 50 1 1 I
33 | X AC_240V 4 600 0 200 L 50 50 1 1 I
34 | ENDDRAW
35 | ENDDEF
36 | #
37 | # CONN_01X03
38 | #
39 | DEF CONN_01X03 P 0 40 Y N 1 F N
40 | F0 "P" 0 200 50 H V C CNN
41 | F1 "CONN_01X03" 100 0 50 V V C CNN
42 | F2 "" 0 0 60 H V C CNN
43 | F3 "" 0 0 60 H V C CNN
44 | $FPLIST
45 | Pin_Header_Straight_1X03
46 | Pin_Header_Angled_1X03
47 | Socket_Strip_Straight_1X03
48 | Socket_Strip_Angled_1X03
49 | $ENDFPLIST
50 | DRAW
51 | S -50 -95 10 -105 0 1 0 N
52 | S -50 5 10 -5 0 1 0 N
53 | S -50 105 10 95 0 1 0 N
54 | S -50 150 50 -150 0 1 0 N
55 | X P1 1 -200 100 150 R 50 50 1 1 P
56 | X P2 2 -200 0 150 R 50 50 1 1 P
57 | X P3 3 -200 -100 150 R 50 50 1 1 P
58 | ENDDRAW
59 | ENDDEF
60 | #
61 | # CONN_01X05
62 | #
63 | DEF CONN_01X05 P 0 40 Y N 1 F N
64 | F0 "P" 0 300 50 H V C CNN
65 | F1 "CONN_01X05" 100 0 50 V V C CNN
66 | F2 "" 0 0 60 H V C CNN
67 | F3 "" 0 0 60 H V C CNN
68 | $FPLIST
69 | Pin_Header_Straight_1X05
70 | Pin_Header_Angled_1X05
71 | Socket_Strip_Straight_1X05
72 | Socket_Strip_Angled_1X05
73 | $ENDFPLIST
74 | DRAW
75 | S -50 -195 10 -205 0 1 0 N
76 | S -50 -95 10 -105 0 1 0 N
77 | S -50 5 10 -5 0 1 0 N
78 | S -50 105 10 95 0 1 0 N
79 | S -50 205 10 195 0 1 0 N
80 | S -50 250 50 -250 0 1 0 N
81 | X P1 1 -200 200 150 R 50 50 1 1 P
82 | X P2 2 -200 100 150 R 50 50 1 1 P
83 | X P3 3 -200 0 150 R 50 50 1 1 P
84 | X P4 4 -200 -100 150 R 50 50 1 1 P
85 | X P5 5 -200 -200 150 R 50 50 1 1 P
86 | ENDDRAW
87 | ENDDEF
88 | #
89 | # ESP8266_ESP3
90 | #
91 | DEF ESP8266_ESP3 U 0 40 Y Y 1 F N
92 | F0 "U" 250 -350 60 H V C CNN
93 | F1 "ESP8266_ESP3" 0 500 60 H V C CNN
94 | F2 "" 0 0 60 H V C CNN
95 | F3 "" 0 0 60 H V C CNN
96 | DRAW
97 | S -350 400 300 -300 0 1 0 N
98 | X GND 1 500 -250 200 L 50 50 1 1 I
99 | X NC 2 500 -150 200 L 50 50 1 1 I
100 | X TX 3 500 -50 200 L 50 50 1 1 I
101 | X RX 4 500 50 200 L 50 50 1 1 I
102 | X GPIO16 5 500 150 200 L 50 50 1 1 I
103 | X CH_PD 6 500 250 200 L 50 50 1 1 I
104 | X ANT 7 500 350 200 L 50 50 1 1 I
105 | X VCC 8 -550 350 200 R 50 50 1 1 I
106 | X GPIO14 9 -550 250 200 R 50 50 1 1 I
107 | X GPIO12 10 -550 150 200 R 50 50 1 1 I
108 | X GPIO13 11 -550 50 200 R 50 50 1 1 I
109 | X GPIO15 12 -550 -50 200 R 50 50 1 1 I
110 | X GPIO2 13 -550 -150 200 R 50 50 1 1 I
111 | X GPIO0 14 -550 -250 200 R 50 50 1 1 I
112 | ENDDRAW
113 | ENDDEF
114 | #
115 | # GND
116 | #
117 | DEF GND #PWR 0 0 Y Y 1 F P
118 | F0 "#PWR" 0 -250 50 H I C CNN
119 | F1 "GND" 0 -150 50 H V C CNN
120 | F2 "" 0 0 60 H V C CNN
121 | F3 "" 0 0 60 H V C CNN
122 | DRAW
123 | P 6 0 1 0 0 0 0 -50 50 -50 0 -100 -50 -50 0 -50 N
124 | X GND 1 0 0 0 D 50 50 1 1 W N
125 | ENDDRAW
126 | ENDDEF
127 | #
128 | # MOC3031S
129 | #
130 | DEF MOC3031S U 0 40 Y Y 1 F N
131 | F0 "U" 0 -200 50 H V L CNN
132 | F1 "MOC3031S" 0 200 50 H V L CNN
133 | F2 "" -200 -200 50 H V L CIN
134 | F3 "" -35 0 50 H V L CNN
135 | $FPLIST
136 | SMD-6*
137 | $ENDFPLIST
138 | DRAW
139 | C 90 -100 5 0 1 0 N
140 | C 90 100 5 0 1 0 N
141 | S -200 150 200 -150 0 1 10 N
142 | P 2 0 1 10 -150 -25 -100 -25 N
143 | P 2 0 1 0 5 -45 5 100 N
144 | P 2 0 1 0 5 100 90 100 N
145 | P 2 0 1 10 75 25 145 25 N
146 | P 2 0 1 0 90 -100 50 -100 N
147 | P 2 0 1 0 90 -100 90 -25 N
148 | P 2 0 1 0 90 -100 200 -100 N
149 | P 2 0 1 0 90 100 90 25 N
150 | P 2 0 1 0 90 100 200 100 N
151 | P 2 0 1 10 105 -25 35 -25 N
152 | P 3 0 1 0 -200 100 -125 100 -125 25 N
153 | P 3 0 1 0 -125 -25 -125 -100 -200 -100 N
154 | P 3 0 1 0 75 -25 60 -55 50 -55 N
155 | P 4 0 1 10 -125 -25 -150 25 -100 25 -125 -25 F
156 | P 4 0 1 0 -75 10 -54 30 -54 10 -24 40 N
157 | P 4 0 1 0 -25 -60 -10 -60 -25 -100 -10 -100 N
158 | P 4 0 1 0 -24 40 -44 30 -34 20 -24 40 N
159 | P 4 0 1 0 0 -65 5 -60 10 -60 15 -65 N
160 | P 4 0 1 10 60 -25 85 25 35 25 60 -25 F
161 | P 4 0 1 10 120 25 95 -25 145 -25 120 25 F
162 | P 5 0 1 0 -35 -45 -35 -115 50 -115 50 -45 -35 -45 N
163 | P 5 0 1 0 15 -95 10 -100 5 -100 0 -95 0 -65 N
164 | P 7 0 1 0 -75 -30 -54 -10 -54 -30 -24 0 -44 -10 -34 -20 -24 0 N
165 | P 7 0 1 0 25 -60 25 -100 35 -100 40 -95 40 -65 35 -60 25 -60 N
166 | X ~ 1 -300 100 100 R 50 50 1 1 P
167 | X ~ 2 -300 -100 100 R 50 50 1 1 P
168 | X ~ 4 300 -100 100 L 50 50 1 1 P
169 | X ~ 6 300 100 100 L 50 50 1 1 P
170 | ENDDRAW
171 | ENDDEF
172 | #
173 | # R
174 | #
175 | DEF R R 0 0 N Y 1 F N
176 | F0 "R" 80 0 50 V V C CNN
177 | F1 "R" 0 0 50 V V C CNN
178 | F2 "" -70 0 30 V V C CNN
179 | F3 "" 0 0 30 H V C CNN
180 | $FPLIST
181 | R_*
182 | Resistor_*
183 | $ENDFPLIST
184 | DRAW
185 | S -40 -100 40 100 0 1 10 N
186 | X ~ 1 0 150 50 D 60 60 1 1 P
187 | X ~ 2 0 -150 50 U 60 60 1 1 P
188 | ENDDRAW
189 | ENDDEF
190 | #
191 | # TRIAC
192 | #
193 | DEF TRIAC U 0 10 Y Y 1 F N
194 | F0 "U" -250 350 50 H V C CNN
195 | F1 "TRIAC" -300 -250 50 H V C CNN
196 | F2 "" 0 0 60 H V C CNN
197 | F3 "" 0 0 60 H V C CNN
198 | DRAW
199 | P 2 0 1 0 -300 -50 0 -50 N
200 | P 2 0 1 0 -150 -50 -300 -200 N
201 | P 2 0 1 0 0 200 300 200 N
202 | P 3 0 1 0 -300 200 -150 -50 0 200 F
203 | P 3 0 1 0 150 200 0 -50 300 -50 F
204 | X ~ 1 0 -250 200 U 70 70 1 1 P
205 | X ~ 2 0 400 200 D 70 70 1 1 P
206 | X ~ 3 -500 -200 200 R 70 70 1 1 I
207 | ENDDRAW
208 | ENDDEF
209 | #
210 | #End Library
211 |
--------------------------------------------------------------------------------
/ElectronicDesignAutomation/WifiSwitch.cmp:
--------------------------------------------------------------------------------
1 | Cmp-Mod V01 Created by Cvpcb (after 2015-mar-04 BZR unknown)-product date = 22/04/2015 21:58:14
2 |
3 | BeginCmp
4 | TimeStamp = /5537CAC0;
5 | Reference = C1;
6 | ValeurCmp = AC_to_DC_convertor;
7 | IdModule = WifiSwitch:AC_DC_Conv;
8 | EndCmp
9 |
10 | BeginCmp
11 | TimeStamp = /5537CFE5;
12 | Reference = P1;
13 | ValeurCmp = CONN_01X05;
14 | IdModule = Pin_Headers:Pin_Header_Angled_1x05;
15 | EndCmp
16 |
17 | BeginCmp
18 | TimeStamp = /5537D049;
19 | Reference = P2;
20 | ValeurCmp = CONN_01X03;
21 | IdModule = WifiSwitch:WirePad_3x-5mmDrill;
22 | EndCmp
23 |
24 | BeginCmp
25 | TimeStamp = /55380183;
26 | Reference = R1;
27 | ValeurCmp = 220R;
28 | IdModule = Resistors_SMD:R_1206_HandSoldering;
29 | EndCmp
30 |
31 | BeginCmp
32 | TimeStamp = /5537CF64;
33 | Reference = R2;
34 | ValeurCmp = 10K;
35 | IdModule = Resistors_SMD:R_1206_HandSoldering;
36 | EndCmp
37 |
38 | BeginCmp
39 | TimeStamp = /5537CF81;
40 | Reference = R3;
41 | ValeurCmp = 330R;
42 | IdModule = Resistors_SMD:R_1206_HandSoldering;
43 | EndCmp
44 |
45 | BeginCmp
46 | TimeStamp = /553681EC;
47 | Reference = U1;
48 | ValeurCmp = ESP8266_ESP3;
49 | IdModule = WifiSwitch:ESP8266-ESP-03;
50 | EndCmp
51 |
52 | BeginCmp
53 | TimeStamp = /5537C87E;
54 | Reference = U2;
55 | ValeurCmp = MOC3031S;
56 | IdModule = WifiSwitch:DIP-6_SMD;
57 | EndCmp
58 |
59 | BeginCmp
60 | TimeStamp = /5537D078;
61 | Reference = U3;
62 | ValeurCmp = TRIAC;
63 | IdModule = Transistors_TO-220:TO-220_Neutral123_Horizontal_LargePads;
64 | EndCmp
65 |
66 | EndListe
67 |
--------------------------------------------------------------------------------
/ElectronicDesignAutomation/WifiSwitch.csv:
--------------------------------------------------------------------------------
1 | Reference, Value, Footprint, Datasheet
2 | U1,ESP8266_ESP3,WifiSwitch:ESP8266-ESP-03,
3 | U2,MOC3031S,WifiSwitch:DIP-6_SMD,
4 | C1,AC_to_DC_convertor,WifiSwitch:AC_DC_Conv,
5 | R2,10K,Resistors_SMD:R_1206_HandSoldering,
6 | R3,330R,Resistors_SMD:R_1206_HandSoldering,
7 | P1,CONN_01X05,Pin_Headers:Pin_Header_Angled_1x05,
8 | P2,CONN_01X03,WifiSwitch:WirePad_3x-5mmDrill,
9 | U3,TRIAC,Transistors_TO-220:TO-220_Neutral123_Horizontal_LargePads,
10 | R1,220R,Resistors_SMD:R_1206_HandSoldering,
11 |
--------------------------------------------------------------------------------
/ElectronicDesignAutomation/WifiSwitch.dcm:
--------------------------------------------------------------------------------
1 | EESchema-DOCLIB Version 2.0
2 | #
3 | $CMP MOC3031M
4 | D MOC3031M, DIP6, Zero Cross Opto-Triac, Vdrm 250V, Ift 15mA
5 | K Opto-Triac Opto Triac Zero Cross
6 | F http://www.fairchildsemi.com/ds/MO/MOC3031M.pdf
7 | $ENDCMP
8 | #
9 | $CMP MOC3031S
10 | D MOC3031S
11 | K Opto-Triac Opto Triac Zero Cross
12 | F http://www.fairchildsemi.com/ds/MO/MOC3031M.pdf
13 | $ENDCMP
14 | #
15 | $CMP MOC3032M
16 | D MOC3032M, DIP6, Zero Cross Opto-Triac, Vdrm 250V, Ift 10mA
17 | K Opto-Triac Opto Triac Zero Cross
18 | F http://www.fairchildsemi.com/ds/MO/MOC3031M.pdf
19 | $ENDCMP
20 | #
21 | $CMP MOC3033M
22 | D MOC3033M, DIP6, Zero Cross Opto-Triac, Vdrm 250V, Ift 5mA
23 | K Opto-Triac Opto Triac Zero Cross
24 | F http://www.fairchildsemi.com/ds/MO/MOC3031M.pdf
25 | $ENDCMP
26 | #
27 | $CMP MOC3041M
28 | D MOC3041M, DIP6, Zero Cross Opto-Triac, Vdrm 400V, Ift 15mA
29 | K Opto-Triac Opto Triac Zero Cross
30 | F http://www.fairchildsemi.com/ds/MO/MOC3031M.pdf
31 | $ENDCMP
32 | #
33 | $CMP MOC3042M
34 | D MOC3042M, DIP6, Zero Cross Opto-Triac, Vdrm 400V, Ift 10mA
35 | K Opto-Triac Opto Triac Zero Cross
36 | F http://www.fairchildsemi.com/ds/MO/MOC3031M.pdf
37 | $ENDCMP
38 | #
39 | $CMP MOC3043M
40 | D MOC3043M, DIP6, Zero Cross Opto-Triac, Vdrm 400V, Ift 5mA
41 | K Opto-Triac Opto Triac Zero Cross
42 | F http://www.fairchildsemi.com/ds/MO/MOC3031M.pdf
43 | $ENDCMP
44 | #
45 | #End Doc Library
46 |
--------------------------------------------------------------------------------
/ElectronicDesignAutomation/WifiSwitch.kicad_pcb:
--------------------------------------------------------------------------------
1 | (kicad_pcb (version 4) (host pcbnew "(after 2015-mar-04 BZR unknown)-product")
2 |
3 | (general
4 | (links 22)
5 | (no_connects 0)
6 | (area 96.00957 68.778 162.178 121.021001)
7 | (thickness 1.6)
8 | (drawings 12)
9 | (tracks 102)
10 | (zones 0)
11 | (modules 9)
12 | (nets 18)
13 | )
14 |
15 | (page A4)
16 | (layers
17 | (0 F.Cu signal)
18 | (31 B.Cu signal hide)
19 | (32 B.Adhes user)
20 | (33 F.Adhes user)
21 | (34 B.Paste user)
22 | (35 F.Paste user)
23 | (36 B.SilkS user)
24 | (37 F.SilkS user)
25 | (38 B.Mask user)
26 | (39 F.Mask user)
27 | (40 Dwgs.User user)
28 | (41 Cmts.User user)
29 | (42 Eco1.User user)
30 | (43 Eco2.User user)
31 | (44 Edge.Cuts user)
32 | (45 Margin user)
33 | (46 B.CrtYd user)
34 | (47 F.CrtYd user)
35 | (48 B.Fab user)
36 | (49 F.Fab user)
37 | )
38 |
39 | (setup
40 | (last_trace_width 0.25)
41 | (user_trace_width 0.25)
42 | (user_trace_width 1)
43 | (trace_clearance 0.2)
44 | (zone_clearance 0.508)
45 | (zone_45_only no)
46 | (trace_min 0.2)
47 | (segment_width 0.2)
48 | (edge_width 0.1)
49 | (via_size 0.6)
50 | (via_drill 0.4)
51 | (via_min_size 0.4)
52 | (via_min_drill 0.3)
53 | (uvia_size 0.3)
54 | (uvia_drill 0.1)
55 | (uvias_allowed no)
56 | (uvia_min_size 0.2)
57 | (uvia_min_drill 0.1)
58 | (pcb_text_width 0.3)
59 | (pcb_text_size 1.5 1.5)
60 | (mod_edge_width 0.15)
61 | (mod_text_size 1 1)
62 | (mod_text_width 0.15)
63 | (pad_size 2 1)
64 | (pad_drill 0)
65 | (pad_to_mask_clearance 0)
66 | (aux_axis_origin 0 0)
67 | (visible_elements 7FFFFFFF)
68 | (pcbplotparams
69 | (layerselection 0x010f0_80000001)
70 | (usegerberextensions true)
71 | (excludeedgelayer true)
72 | (linewidth 0.100000)
73 | (plotframeref false)
74 | (viasonmask false)
75 | (mode 1)
76 | (useauxorigin false)
77 | (hpglpennumber 1)
78 | (hpglpenspeed 20)
79 | (hpglpendiameter 15)
80 | (hpglpenoverlay 2)
81 | (psnegative false)
82 | (psa4output false)
83 | (plotreference true)
84 | (plotvalue true)
85 | (plotinvisibletext false)
86 | (padsonsilk false)
87 | (subtractmaskfromsilk false)
88 | (outputformat 1)
89 | (mirror false)
90 | (drillshape 0)
91 | (scaleselection 1)
92 | (outputdirectory Gerber/))
93 | )
94 |
95 | (net 0 "")
96 | (net 1 GND)
97 | (net 2 "Net-(P1-Pad2)")
98 | (net 3 "Net-(P1-Pad3)")
99 | (net 4 "Net-(P1-Pad4)")
100 | (net 5 "Net-(C1-Pad4)")
101 | (net 6 "Net-(C1-Pad3)")
102 | (net 7 "Net-(R1-Pad1)")
103 | (net 8 "Net-(R1-Pad2)")
104 | (net 9 "Net-(R2-Pad1)")
105 | (net 10 "Net-(R3-Pad1)")
106 | (net 11 "Net-(U1-Pad10)")
107 | (net 12 "Net-(U1-Pad9)")
108 | (net 13 "Net-(U1-Pad2)")
109 | (net 14 "Net-(U1-Pad5)")
110 | (net 15 "Net-(U1-Pad7)")
111 | (net 16 "Net-(P2-Pad1)")
112 | (net 17 +3V3)
113 |
114 | (net_class Default "This is the default net class."
115 | (clearance 0.2)
116 | (trace_width 0.25)
117 | (via_dia 0.6)
118 | (via_drill 0.4)
119 | (uvia_dia 0.3)
120 | (uvia_drill 0.1)
121 | (add_net +3V3)
122 | (add_net GND)
123 | (add_net "Net-(C1-Pad3)")
124 | (add_net "Net-(C1-Pad4)")
125 | (add_net "Net-(P1-Pad2)")
126 | (add_net "Net-(P1-Pad3)")
127 | (add_net "Net-(P1-Pad4)")
128 | (add_net "Net-(P2-Pad1)")
129 | (add_net "Net-(R1-Pad1)")
130 | (add_net "Net-(R1-Pad2)")
131 | (add_net "Net-(R2-Pad1)")
132 | (add_net "Net-(R3-Pad1)")
133 | (add_net "Net-(U1-Pad10)")
134 | (add_net "Net-(U1-Pad2)")
135 | (add_net "Net-(U1-Pad5)")
136 | (add_net "Net-(U1-Pad7)")
137 | (add_net "Net-(U1-Pad9)")
138 | )
139 |
140 | (net_class Power ""
141 | (clearance 2.54)
142 | (trace_width 0.75)
143 | (via_dia 0.6)
144 | (via_drill 0.4)
145 | (uvia_dia 0.3)
146 | (uvia_drill 0.1)
147 | )
148 |
149 | (module WifiSwitch:DIP-6_SMD (layer F.Cu) (tedit 55A65CF6) (tstamp 5537ECDF)
150 | (at 116.967 88.9 90)
151 | (descr "DIP-8_300 smd shape")
152 | (tags "smd cms 8dip")
153 | (path /5537C87E)
154 | (attr smd)
155 | (fp_text reference U2 (at -1.016 -1.27 90) (layer F.SilkS)
156 | (effects (font (size 1 1) (thickness 0.15)))
157 | )
158 | (fp_text value MOC3031S (at -0.762 0.762 90) (layer F.Fab)
159 | (effects (font (size 1 1) (thickness 0.15)))
160 | )
161 | (fp_line (start -5.08 -2.54) (end 2.54 -2.54) (layer F.SilkS) (width 0.15))
162 | (fp_line (start 2.54 -2.54) (end 2.54 2.54) (layer F.SilkS) (width 0.15))
163 | (fp_line (start 2.54 2.54) (end -5.08 2.54) (layer F.SilkS) (width 0.15))
164 | (fp_line (start -5.08 -2.54) (end -5.08 2.54) (layer F.SilkS) (width 0.15))
165 | (fp_line (start -5.08 -1.27) (end -3.81 -1.27) (layer F.SilkS) (width 0.15))
166 | (fp_line (start -3.81 -1.27) (end -3.81 1.27) (layer F.SilkS) (width 0.15))
167 | (fp_line (start -3.81 1.27) (end -5.08 1.27) (layer F.SilkS) (width 0.15))
168 | (pad 1 smd rect (at -3.81 3.81 90) (size 1.524 2.032) (layers F.Cu F.Paste F.Mask)
169 | (net 7 "Net-(R1-Pad1)"))
170 | (pad 2 smd rect (at -1.27 3.81 90) (size 1.524 2.032) (layers F.Cu F.Paste F.Mask)
171 | (net 1 GND))
172 | (pad 3 smd rect (at 1.27 3.81 90) (size 1.524 2.032) (layers F.Cu F.Paste F.Mask))
173 | (pad 4 smd rect (at 1.27 -3.81 90) (size 1.524 2.032) (layers F.Cu F.Paste F.Mask)
174 | (net 10 "Net-(R3-Pad1)"))
175 | (pad 5 smd rect (at -1.27 -3.81 90) (size 1.524 2.032) (layers F.Cu F.Paste F.Mask))
176 | (pad 6 smd rect (at -3.81 -3.81 90) (size 1.524 2.032) (layers F.Cu F.Paste F.Mask)
177 | (net 5 "Net-(C1-Pad4)"))
178 | (model SMD_Packages.3dshapes/DIP-8_SMD.wrl
179 | (at (xyz 0 0 0))
180 | (scale (xyz 1 0.5 0.8))
181 | (rotate (xyz 0 0 0))
182 | )
183 | )
184 |
185 | (module Pin_Headers:Pin_Header_Angled_1x05 (layer F.Cu) (tedit 5538D1C2) (tstamp 5537ECAA)
186 | (at 136.906 99.568)
187 | (descr "Through hole pin header")
188 | (tags "pin header")
189 | (path /5537CFE5)
190 | (fp_text reference P1 (at -8.255 -3.937) (layer F.SilkS)
191 | (effects (font (size 1 1) (thickness 0.15)))
192 | )
193 | (fp_text value CONN_01X05 (at -2.413 5.461 90) (layer F.Fab)
194 | (effects (font (size 1 1) (thickness 0.15)))
195 | )
196 | (fp_line (start -1.5 -1.75) (end -1.5 11.95) (layer F.CrtYd) (width 0.05))
197 | (fp_line (start 10.65 -1.75) (end 10.65 11.95) (layer F.CrtYd) (width 0.05))
198 | (fp_line (start -1.5 -1.75) (end 10.65 -1.75) (layer F.CrtYd) (width 0.05))
199 | (fp_line (start -1.5 11.95) (end 10.65 11.95) (layer F.CrtYd) (width 0.05))
200 | (fp_line (start -1.3 -1.55) (end -1.3 0) (layer F.SilkS) (width 0.15))
201 | (fp_line (start 0 -1.55) (end -1.3 -1.55) (layer F.SilkS) (width 0.15))
202 | (fp_line (start 4.191 -0.127) (end 10.033 -0.127) (layer F.SilkS) (width 0.15))
203 | (fp_line (start 10.033 -0.127) (end 10.033 0.127) (layer F.SilkS) (width 0.15))
204 | (fp_line (start 10.033 0.127) (end 4.191 0.127) (layer F.SilkS) (width 0.15))
205 | (fp_line (start 4.191 0.127) (end 4.191 0) (layer F.SilkS) (width 0.15))
206 | (fp_line (start 4.191 0) (end 10.033 0) (layer F.SilkS) (width 0.15))
207 | (fp_line (start 1.524 -0.254) (end 1.143 -0.254) (layer F.SilkS) (width 0.15))
208 | (fp_line (start 1.524 0.254) (end 1.143 0.254) (layer F.SilkS) (width 0.15))
209 | (fp_line (start 1.524 2.286) (end 1.143 2.286) (layer F.SilkS) (width 0.15))
210 | (fp_line (start 1.524 2.794) (end 1.143 2.794) (layer F.SilkS) (width 0.15))
211 | (fp_line (start 1.524 4.826) (end 1.143 4.826) (layer F.SilkS) (width 0.15))
212 | (fp_line (start 1.524 5.334) (end 1.143 5.334) (layer F.SilkS) (width 0.15))
213 | (fp_line (start 1.524 7.366) (end 1.143 7.366) (layer F.SilkS) (width 0.15))
214 | (fp_line (start 1.524 7.874) (end 1.143 7.874) (layer F.SilkS) (width 0.15))
215 | (fp_line (start 1.524 10.414) (end 1.143 10.414) (layer F.SilkS) (width 0.15))
216 | (fp_line (start 1.524 9.906) (end 1.143 9.906) (layer F.SilkS) (width 0.15))
217 | (fp_line (start 4.064 1.27) (end 4.064 -1.27) (layer F.SilkS) (width 0.15))
218 | (fp_line (start 10.16 0.254) (end 4.064 0.254) (layer F.SilkS) (width 0.15))
219 | (fp_line (start 10.16 -0.254) (end 10.16 0.254) (layer F.SilkS) (width 0.15))
220 | (fp_line (start 4.064 -0.254) (end 10.16 -0.254) (layer F.SilkS) (width 0.15))
221 | (fp_line (start 1.524 1.27) (end 4.064 1.27) (layer F.SilkS) (width 0.15))
222 | (fp_line (start 1.524 -1.27) (end 1.524 1.27) (layer F.SilkS) (width 0.15))
223 | (fp_line (start 1.524 -1.27) (end 4.064 -1.27) (layer F.SilkS) (width 0.15))
224 | (fp_line (start 1.524 3.81) (end 4.064 3.81) (layer F.SilkS) (width 0.15))
225 | (fp_line (start 1.524 3.81) (end 1.524 6.35) (layer F.SilkS) (width 0.15))
226 | (fp_line (start 1.524 6.35) (end 4.064 6.35) (layer F.SilkS) (width 0.15))
227 | (fp_line (start 4.064 4.826) (end 10.16 4.826) (layer F.SilkS) (width 0.15))
228 | (fp_line (start 10.16 4.826) (end 10.16 5.334) (layer F.SilkS) (width 0.15))
229 | (fp_line (start 10.16 5.334) (end 4.064 5.334) (layer F.SilkS) (width 0.15))
230 | (fp_line (start 4.064 6.35) (end 4.064 3.81) (layer F.SilkS) (width 0.15))
231 | (fp_line (start 4.064 3.81) (end 4.064 1.27) (layer F.SilkS) (width 0.15))
232 | (fp_line (start 10.16 2.794) (end 4.064 2.794) (layer F.SilkS) (width 0.15))
233 | (fp_line (start 10.16 2.286) (end 10.16 2.794) (layer F.SilkS) (width 0.15))
234 | (fp_line (start 4.064 2.286) (end 10.16 2.286) (layer F.SilkS) (width 0.15))
235 | (fp_line (start 1.524 3.81) (end 4.064 3.81) (layer F.SilkS) (width 0.15))
236 | (fp_line (start 1.524 1.27) (end 1.524 3.81) (layer F.SilkS) (width 0.15))
237 | (fp_line (start 1.524 1.27) (end 4.064 1.27) (layer F.SilkS) (width 0.15))
238 | (fp_line (start 1.524 8.89) (end 4.064 8.89) (layer F.SilkS) (width 0.15))
239 | (fp_line (start 1.524 8.89) (end 1.524 11.43) (layer F.SilkS) (width 0.15))
240 | (fp_line (start 1.524 11.43) (end 4.064 11.43) (layer F.SilkS) (width 0.15))
241 | (fp_line (start 4.064 9.906) (end 10.16 9.906) (layer F.SilkS) (width 0.15))
242 | (fp_line (start 10.16 9.906) (end 10.16 10.414) (layer F.SilkS) (width 0.15))
243 | (fp_line (start 10.16 10.414) (end 4.064 10.414) (layer F.SilkS) (width 0.15))
244 | (fp_line (start 4.064 11.43) (end 4.064 8.89) (layer F.SilkS) (width 0.15))
245 | (fp_line (start 4.064 8.89) (end 4.064 6.35) (layer F.SilkS) (width 0.15))
246 | (fp_line (start 10.16 7.874) (end 4.064 7.874) (layer F.SilkS) (width 0.15))
247 | (fp_line (start 10.16 7.366) (end 10.16 7.874) (layer F.SilkS) (width 0.15))
248 | (fp_line (start 4.064 7.366) (end 10.16 7.366) (layer F.SilkS) (width 0.15))
249 | (fp_line (start 1.524 8.89) (end 4.064 8.89) (layer F.SilkS) (width 0.15))
250 | (fp_line (start 1.524 6.35) (end 1.524 8.89) (layer F.SilkS) (width 0.15))
251 | (fp_line (start 1.524 6.35) (end 4.064 6.35) (layer F.SilkS) (width 0.15))
252 | (pad 1 thru_hole rect (at 0 0) (size 2.032 1.7272) (drill 1.016) (layers *.Cu *.Mask F.SilkS)
253 | (net 1 GND))
254 | (pad 2 thru_hole oval (at 0 2.54) (size 2.032 1.7272) (drill 1.016) (layers *.Cu *.Mask F.SilkS)
255 | (net 2 "Net-(P1-Pad2)"))
256 | (pad 3 thru_hole oval (at 0 5.08) (size 2.032 1.7272) (drill 1.016) (layers *.Cu *.Mask F.SilkS)
257 | (net 3 "Net-(P1-Pad3)"))
258 | (pad 4 thru_hole oval (at 0 7.62) (size 2.032 1.7272) (drill 1.016) (layers *.Cu *.Mask F.SilkS)
259 | (net 4 "Net-(P1-Pad4)"))
260 | (pad 5 thru_hole oval (at 0 10.16) (size 2.032 1.7272) (drill 1.016) (layers *.Cu *.Mask F.SilkS)
261 | (net 17 +3V3))
262 | (model Pin_Headers.3dshapes/Pin_Header_Angled_1x05.wrl
263 | (at (xyz 0 -0.2 0))
264 | (scale (xyz 1 1 1))
265 | (rotate (xyz 0 0 90))
266 | )
267 | )
268 |
269 | (module Resistors_SMD:R_1206_HandSoldering (layer F.Cu) (tedit 5538D1E6) (tstamp 5537ECB7)
270 | (at 128.016 102.108)
271 | (descr "Resistor SMD 1206, hand soldering")
272 | (tags "resistor 1206")
273 | (path /55380183)
274 | (attr smd)
275 | (fp_text reference R1 (at 0 -1.905) (layer F.SilkS)
276 | (effects (font (size 1 1) (thickness 0.15)))
277 | )
278 | (fp_text value 220R (at -5.334 0) (layer F.Fab)
279 | (effects (font (size 1 1) (thickness 0.15)))
280 | )
281 | (fp_line (start -3.3 -1.2) (end 3.3 -1.2) (layer F.CrtYd) (width 0.05))
282 | (fp_line (start -3.3 1.2) (end 3.3 1.2) (layer F.CrtYd) (width 0.05))
283 | (fp_line (start -3.3 -1.2) (end -3.3 1.2) (layer F.CrtYd) (width 0.05))
284 | (fp_line (start 3.3 -1.2) (end 3.3 1.2) (layer F.CrtYd) (width 0.05))
285 | (fp_line (start 1 1.075) (end -1 1.075) (layer F.SilkS) (width 0.15))
286 | (fp_line (start -1 -1.075) (end 1 -1.075) (layer F.SilkS) (width 0.15))
287 | (pad 1 smd rect (at -2 0) (size 2 1.7) (layers F.Cu F.Paste F.Mask)
288 | (net 7 "Net-(R1-Pad1)"))
289 | (pad 2 smd rect (at 2 0) (size 2 1.7) (layers F.Cu F.Paste F.Mask)
290 | (net 8 "Net-(R1-Pad2)"))
291 | (model Resistors_SMD.3dshapes/R_1206_HandSoldering.wrl
292 | (at (xyz 0 0 0))
293 | (scale (xyz 1 1 1))
294 | (rotate (xyz 0 0 0))
295 | )
296 | )
297 |
298 | (module Resistors_SMD:R_1206_HandSoldering (layer F.Cu) (tedit 5538D1E1) (tstamp 5537ECBD)
299 | (at 129.54 105.918)
300 | (descr "Resistor SMD 1206, hand soldering")
301 | (tags "resistor 1206")
302 | (path /5537CF64)
303 | (attr smd)
304 | (fp_text reference R2 (at 0.127 -1.905) (layer F.SilkS)
305 | (effects (font (size 1 1) (thickness 0.15)))
306 | )
307 | (fp_text value 4K7 (at -4.826 0) (layer F.Fab)
308 | (effects (font (size 1 1) (thickness 0.15)))
309 | )
310 | (fp_line (start -3.3 -1.2) (end 3.3 -1.2) (layer F.CrtYd) (width 0.05))
311 | (fp_line (start -3.3 1.2) (end 3.3 1.2) (layer F.CrtYd) (width 0.05))
312 | (fp_line (start -3.3 -1.2) (end -3.3 1.2) (layer F.CrtYd) (width 0.05))
313 | (fp_line (start 3.3 -1.2) (end 3.3 1.2) (layer F.CrtYd) (width 0.05))
314 | (fp_line (start 1 1.075) (end -1 1.075) (layer F.SilkS) (width 0.15))
315 | (fp_line (start -1 -1.075) (end 1 -1.075) (layer F.SilkS) (width 0.15))
316 | (pad 1 smd rect (at -2 0) (size 2 1.7) (layers F.Cu F.Paste F.Mask)
317 | (net 9 "Net-(R2-Pad1)"))
318 | (pad 2 smd rect (at 2 0) (size 2 1.7) (layers F.Cu F.Paste F.Mask)
319 | (net 17 +3V3))
320 | (model Resistors_SMD.3dshapes/R_1206_HandSoldering.wrl
321 | (at (xyz 0 0 0))
322 | (scale (xyz 1 1 1))
323 | (rotate (xyz 0 0 0))
324 | )
325 | )
326 |
327 | (module Resistors_SMD:R_1206_HandSoldering (layer F.Cu) (tedit 5538017D) (tstamp 5537ECC3)
328 | (at 117.221 106.172 180)
329 | (descr "Resistor SMD 1206, hand soldering")
330 | (tags "resistor 1206")
331 | (path /5537CF81)
332 | (attr smd)
333 | (fp_text reference R3 (at 0 1.905 180) (layer F.SilkS)
334 | (effects (font (size 1 1) (thickness 0.15)))
335 | )
336 | (fp_text value 330R (at -0.254 -2.159 180) (layer F.Fab)
337 | (effects (font (size 1 1) (thickness 0.15)))
338 | )
339 | (fp_line (start -3.3 -1.2) (end 3.3 -1.2) (layer F.CrtYd) (width 0.05))
340 | (fp_line (start -3.3 1.2) (end 3.3 1.2) (layer F.CrtYd) (width 0.05))
341 | (fp_line (start -3.3 -1.2) (end -3.3 1.2) (layer F.CrtYd) (width 0.05))
342 | (fp_line (start 3.3 -1.2) (end 3.3 1.2) (layer F.CrtYd) (width 0.05))
343 | (fp_line (start 1 1.075) (end -1 1.075) (layer F.SilkS) (width 0.15))
344 | (fp_line (start -1 -1.075) (end 1 -1.075) (layer F.SilkS) (width 0.15))
345 | (pad 1 smd rect (at -2 0 180) (size 2 1.7) (layers F.Cu F.Paste F.Mask)
346 | (net 10 "Net-(R3-Pad1)"))
347 | (pad 2 smd rect (at 2 0 180) (size 2 1.7) (layers F.Cu F.Paste F.Mask)
348 | (net 16 "Net-(P2-Pad1)"))
349 | (model Resistors_SMD.3dshapes/R_1206_HandSoldering.wrl
350 | (at (xyz 0 0 0))
351 | (scale (xyz 1 1 1))
352 | (rotate (xyz 0 0 0))
353 | )
354 | )
355 |
356 | (module WifiSwitch:ESP8266-ESP-03 (layer F.Cu) (tedit 55A6BF29) (tstamp 5537ECD5)
357 | (at 131.953 89.408)
358 | (descr "ESP8266 ESP-03 wifi module -- Phillip Pearson")
359 | (path /553681EC)
360 | (fp_text reference U1 (at -1.7 -1.8 90) (layer F.SilkS)
361 | (effects (font (size 1 1) (thickness 0.15)))
362 | )
363 | (fp_text value ESP8266_ESP3 (at 1.27 -1.651 90) (layer F.SilkS)
364 | (effects (font (size 1 1) (thickness 0.15)))
365 | )
366 | (fp_line (start -6.1 6.9) (end -6.1 -10.5) (layer F.SilkS) (width 0.15))
367 | (fp_line (start -6.1 -10.5) (end 6.1 -10.5) (layer F.SilkS) (width 0.15))
368 | (fp_line (start 6.1 -10.5) (end 6.1 6.9) (layer F.SilkS) (width 0.15))
369 | (fp_line (start 6.1 6.9) (end -6.1 6.9) (layer F.SilkS) (width 0.15))
370 | (pad 14 smd rect (at -6.1 5.9) (size 2 1) (layers F.Cu F.Paste F.Mask)
371 | (net 4 "Net-(P1-Pad4)"))
372 | (pad 13 smd rect (at -6.1 3.9) (size 2 1) (layers F.Cu F.Paste F.Mask)
373 | (net 17 +3V3))
374 | (pad 12 smd rect (at -6.1 1.9) (size 2 1) (layers F.Cu F.Paste F.Mask)
375 | (net 1 GND))
376 | (pad 11 smd rect (at -6.1 -0.1) (size 2 1) (layers F.Cu F.Paste F.Mask)
377 | (net 8 "Net-(R1-Pad2)"))
378 | (pad 10 smd rect (at -6.1 -2.1) (size 1 1) (layers F.Cu F.Paste F.Mask)
379 | (net 11 "Net-(U1-Pad10)"))
380 | (pad 9 smd rect (at -6.1 -4.1) (size 1 1) (layers F.Cu F.Paste F.Mask)
381 | (net 12 "Net-(U1-Pad9)"))
382 | (pad 8 smd rect (at -6.1 -6.1) (size 2 1) (layers F.Cu F.Paste F.Mask)
383 | (net 17 +3V3))
384 | (pad 1 smd rect (at 6.1 5.9) (size 2 1) (layers F.Cu F.Paste F.Mask)
385 | (net 1 GND))
386 | (pad 2 smd rect (at 6.1 3.9) (size 1 1) (layers F.Cu F.Paste F.Mask)
387 | (net 13 "Net-(U1-Pad2)"))
388 | (pad 3 smd rect (at 6.1 1.9) (size 2 1) (layers F.Cu F.Paste F.Mask)
389 | (net 3 "Net-(P1-Pad3)"))
390 | (pad 4 smd rect (at 6.1 -0.1) (size 2 1) (layers F.Cu F.Paste F.Mask)
391 | (net 2 "Net-(P1-Pad2)"))
392 | (pad 5 smd rect (at 6.1 -2.1) (size 2 1) (layers F.Cu F.Paste F.Mask)
393 | (net 14 "Net-(U1-Pad5)"))
394 | (pad 6 smd rect (at 6.1 -4.1) (size 2 1) (layers F.Cu F.Paste F.Mask)
395 | (net 9 "Net-(R2-Pad1)"))
396 | (pad 7 smd rect (at 6.1 -6.1) (size 1 1) (layers F.Cu F.Paste F.Mask)
397 | (net 15 "Net-(U1-Pad7)"))
398 | )
399 |
400 | (module Transistors_TO-220:TO-220_Neutral123_Horizontal_LargePads (layer F.Cu) (tedit 5538D81A) (tstamp 5537ECE7)
401 | (at 117.094 99.314)
402 | (descr "TO-220, Neutral, Horizontal, Large Pads,")
403 | (tags "TO-220, Neutral, Horizontal, Large Pads,")
404 | (path /5537D078)
405 | (fp_text reference U3 (at 0.254 -20.32) (layer F.SilkS)
406 | (effects (font (size 1 1) (thickness 0.15)))
407 | )
408 | (fp_text value TRIAC (at 0 2.667) (layer F.Fab)
409 | (effects (font (size 1 1) (thickness 0.15)))
410 | )
411 | (fp_line (start -2.54 -3.683) (end -2.54 -2.286) (layer F.SilkS) (width 0.15))
412 | (fp_line (start 0 -3.683) (end 0 -2.286) (layer F.SilkS) (width 0.15))
413 | (fp_line (start 2.54 -3.683) (end 2.54 -2.286) (layer F.SilkS) (width 0.15))
414 | (fp_circle (center 0 -16.764) (end 1.778 -14.986) (layer F.SilkS) (width 0.15))
415 | (fp_line (start 5.334 -12.192) (end 5.334 -20.193) (layer F.SilkS) (width 0.15))
416 | (fp_line (start 5.334 -20.193) (end -5.334 -20.193) (layer F.SilkS) (width 0.15))
417 | (fp_line (start -5.334 -20.193) (end -5.334 -12.192) (layer F.SilkS) (width 0.15))
418 | (fp_line (start 5.334 -3.683) (end 5.334 -12.192) (layer F.SilkS) (width 0.15))
419 | (fp_line (start 5.334 -12.192) (end -5.334 -12.192) (layer F.SilkS) (width 0.15))
420 | (fp_line (start -5.334 -12.192) (end -5.334 -3.683) (layer F.SilkS) (width 0.15))
421 | (fp_line (start 0 -3.683) (end -5.334 -3.683) (layer F.SilkS) (width 0.15))
422 | (fp_line (start 0 -3.683) (end 5.334 -3.683) (layer F.SilkS) (width 0.15))
423 | (pad 2 thru_hole oval (at 0 0 90) (size 3.50012 1.69926) (drill 1.00076) (layers *.Cu *.Mask F.SilkS)
424 | (net 5 "Net-(C1-Pad4)"))
425 | (pad 1 thru_hole oval (at -2.54 0 90) (size 3.50012 1.69926) (drill 1.00076) (layers *.Cu *.Mask F.SilkS)
426 | (net 16 "Net-(P2-Pad1)"))
427 | (pad 3 thru_hole oval (at 2.54 0 90) (size 3.50012 1.69926) (drill 1.00076) (layers *.Cu *.Mask F.SilkS)
428 | (net 10 "Net-(R3-Pad1)"))
429 | (pad "" np_thru_hole circle (at 0 -16.764 90) (size 3.79984 3.79984) (drill 3.79984) (layers *.Cu *.Mask F.SilkS))
430 | (model Transistors_TO-220.3dshapes/TO-220_Neutral123_Horizontal_LargePads.wrl
431 | (at (xyz 0 0 0))
432 | (scale (xyz 0.3937 0.3937 0.3937))
433 | (rotate (xyz 0 0 0))
434 | )
435 | )
436 |
437 | (module WifiSwitch:AC_DC_Conv (layer F.Cu) (tedit 5538D832) (tstamp 5537F7AA)
438 | (at 107.442 98.806 270)
439 | (path /5537CAC0)
440 | (fp_text reference Conv.1 (at 14.732 -0.254 270) (layer F.SilkS)
441 | (effects (font (size 1 1) (thickness 0.15)))
442 | )
443 | (fp_text value "AC to DC convertor 3V3" (at -1.143 -0.254 270) (layer F.Fab)
444 | (effects (font (size 1 1) (thickness 0.15)))
445 | )
446 | (fp_line (start -20.4 -2.8) (end 19.6 -2.8) (layer F.SilkS) (width 0.15))
447 | (fp_line (start 19.6 -2.8) (end 19.6 1.8) (layer F.SilkS) (width 0.15))
448 | (fp_line (start 19.6 1.8) (end -20 1.8) (layer F.SilkS) (width 0.15))
449 | (fp_line (start -20 1.8) (end -20.4 1.8) (layer F.SilkS) (width 0.15))
450 | (fp_line (start -20.4 1.8) (end -20.4 -2.8) (layer F.SilkS) (width 0.15))
451 | (pad 3 thru_hole oval (at 18.4 -1.8 270) (size 1.524 1.524) (drill 0.8) (layers *.Cu *.Mask F.SilkS)
452 | (net 6 "Net-(C1-Pad3)"))
453 | (pad 4 thru_hole circle (at 18.4 0.8 270) (size 1.524 1.524) (drill 0.762) (layers *.Cu *.Mask F.SilkS)
454 | (net 5 "Net-(C1-Pad4)"))
455 | (pad 1 thru_hole circle (at -19.2 -1.8 270) (size 1.524 1.524) (drill 0.762) (layers *.Cu *.Mask F.SilkS)
456 | (net 17 +3V3))
457 | (pad 2 thru_hole circle (at -19.2 0.8 270) (size 1.524 1.524) (drill 0.762) (layers *.Cu *.Mask F.SilkS)
458 | (net 1 GND))
459 | )
460 |
461 | (module WifiSwitch:WirePad_3x-5mmDrill (layer F.Cu) (tedit 55A6C80A) (tstamp 5537FD93)
462 | (at 124.968 114.046)
463 | (path /5537D049)
464 | (fp_text reference P2 (at 2.54 -2.54) (layer F.SilkS)
465 | (effects (font (size 1 1) (thickness 0.15)))
466 | )
467 | (fp_text value CONN_01X03 (at -1.524 -3.81) (layer F.Fab)
468 | (effects (font (size 1 1) (thickness 0.15)))
469 | )
470 | (pad 1 thru_hole circle (at -5.02 0) (size 4 4) (drill 1.25) (layers *.Cu *.Mask F.SilkS)
471 | (net 16 "Net-(P2-Pad1)"))
472 | (pad 2 thru_hole circle (at 0 0) (size 4 4) (drill 1.25) (layers *.Cu *.Mask F.SilkS)
473 | (net 5 "Net-(C1-Pad4)"))
474 | (pad 3 thru_hole circle (at 5.02 0) (size 4 4) (drill 1.25) (layers *.Cu *.Mask F.SilkS)
475 | (net 6 "Net-(C1-Pad3)"))
476 | )
477 |
478 | (gr_text "Wifi\nSwitch" (at 136.144 114.554) (layer F.SilkS)
479 | (effects (font (size 1.5 1.5) (thickness 0.3)))
480 | )
481 | (dimension 41.656 (width 0.3) (layer Dwgs.User)
482 | (gr_text "41,656 mm" (at 155.528 98.044 270) (layer Dwgs.User)
483 | (effects (font (size 1.5 1.5) (thickness 0.3)))
484 | )
485 | (feature1 (pts (xy 140.208 118.872) (xy 156.878 118.872)))
486 | (feature2 (pts (xy 140.208 77.216) (xy 156.878 77.216)))
487 | (crossbar (pts (xy 154.178 77.216) (xy 154.178 118.872)))
488 | (arrow1a (pts (xy 154.178 118.872) (xy 153.591579 117.745496)))
489 | (arrow1b (pts (xy 154.178 118.872) (xy 154.764421 117.745496)))
490 | (arrow2a (pts (xy 154.178 77.216) (xy 153.591579 78.342504)))
491 | (arrow2b (pts (xy 154.178 77.216) (xy 154.764421 78.342504)))
492 | )
493 | (dimension 36.576 (width 0.3) (layer Dwgs.User)
494 | (gr_text "36,576 mm" (at 121.92 70.278) (layer Dwgs.User)
495 | (effects (font (size 1.5 1.5) (thickness 0.3)))
496 | )
497 | (feature1 (pts (xy 140.208 77.216) (xy 140.208 68.928)))
498 | (feature2 (pts (xy 103.632 77.216) (xy 103.632 68.928)))
499 | (crossbar (pts (xy 103.632 71.628) (xy 140.208 71.628)))
500 | (arrow1a (pts (xy 140.208 71.628) (xy 139.081496 72.214421)))
501 | (arrow1b (pts (xy 140.208 71.628) (xy 139.081496 71.041579)))
502 | (arrow2a (pts (xy 103.632 71.628) (xy 104.758504 72.214421)))
503 | (arrow2b (pts (xy 103.632 71.628) (xy 104.758504 71.041579)))
504 | )
505 | (gr_line (start 140.208 118.872) (end 140.208 118.364) (angle 90) (layer Edge.Cuts) (width 0.1))
506 | (gr_line (start 103.632 118.872) (end 140.208 118.872) (angle 90) (layer Edge.Cuts) (width 0.1))
507 | (gr_line (start 103.632 118.618) (end 103.632 118.872) (angle 90) (layer Edge.Cuts) (width 0.1))
508 | (gr_line (start 140.208 77.216) (end 140.208 118.618) (angle 90) (layer Edge.Cuts) (width 0.1))
509 | (gr_line (start 139.192 77.216) (end 140.208 77.216) (angle 90) (layer Edge.Cuts) (width 0.1))
510 | (gr_line (start 139.192 77.216) (end 139.7 77.216) (angle 90) (layer Edge.Cuts) (width 0.1))
511 | (gr_line (start 103.632 77.216) (end 104.902 77.216) (angle 90) (layer Edge.Cuts) (width 0.1))
512 | (gr_line (start 103.632 118.618) (end 103.632 77.216) (angle 90) (layer Edge.Cuts) (width 0.1))
513 | (gr_line (start 104.394 77.216) (end 139.446 77.216) (angle 90) (layer Edge.Cuts) (width 0.1))
514 |
515 | (segment (start 138.053 95.308) (end 138.053 96.389) (width 0.25) (layer F.Cu) (net 1))
516 | (via (at 137.668 96.774) (size 0.6) (layers F.Cu B.Cu) (net 1))
517 | (segment (start 138.053 96.389) (end 137.668 96.774) (width 0.25) (layer F.Cu) (net 1) (tstamp 5538D62D))
518 | (segment (start 136.906 99.568) (end 136.906 98.806) (width 0.25) (layer F.Cu) (net 1))
519 | (segment (start 136.906 98.806) (end 137.668 98.044) (width 0.25) (layer F.Cu) (net 1) (tstamp 5538D5C8))
520 | (via (at 137.668 98.044) (size 0.6) (layers F.Cu B.Cu) (net 1))
521 | (segment (start 120.777 90.17) (end 121.412 90.17) (width 0.25) (layer F.Cu) (net 1))
522 | (segment (start 121.412 90.17) (end 122.428 91.186) (width 0.25) (layer F.Cu) (net 1) (tstamp 5538D374))
523 | (via (at 122.428 91.186) (size 0.6) (layers F.Cu B.Cu) (net 1))
524 | (segment (start 125.853 91.308) (end 124.328 91.308) (width 0.25) (layer F.Cu) (net 1))
525 | (via (at 124.206 91.186) (size 0.6) (layers F.Cu B.Cu) (net 1))
526 | (segment (start 124.328 91.308) (end 124.206 91.186) (width 0.25) (layer F.Cu) (net 1) (tstamp 5538D345))
527 | (segment (start 135.636 102.108) (end 134.62 101.092) (width 0.25) (layer F.Cu) (net 2) (tstamp 55A6BF98))
528 | (segment (start 134.62 101.092) (end 134.62 90.424) (width 0.25) (layer F.Cu) (net 2) (tstamp 55A6BF9A))
529 | (segment (start 134.62 90.424) (end 135.736 89.308) (width 0.25) (layer F.Cu) (net 2) (tstamp 55A6BF9C))
530 | (segment (start 135.736 89.308) (end 138.053 89.308) (width 0.25) (layer F.Cu) (net 2) (tstamp 55A6BF9E))
531 | (segment (start 136.906 102.108) (end 135.636 102.108) (width 0.25) (layer F.Cu) (net 2))
532 | (segment (start 136.906 104.648) (end 135.89 104.648) (width 0.25) (layer F.Cu) (net 3))
533 | (segment (start 135.89 104.648) (end 133.604 102.362) (width 0.25) (layer F.Cu) (net 3) (tstamp 5538D66B))
534 | (segment (start 133.604 102.362) (end 133.604 94.488) (width 0.25) (layer F.Cu) (net 3) (tstamp 5538D66F))
535 | (via (at 133.604 94.488) (size 0.6) (layers F.Cu B.Cu) (net 3))
536 | (segment (start 133.604 94.488) (end 134.62 93.472) (width 0.25) (layer B.Cu) (net 3) (tstamp 5538D67D))
537 | (segment (start 134.62 93.472) (end 135.89 93.472) (width 0.25) (layer B.Cu) (net 3) (tstamp 5538D67E))
538 | (via (at 135.89 93.472) (size 0.6) (layers F.Cu B.Cu) (net 3))
539 | (segment (start 135.89 93.472) (end 138.053 91.309) (width 0.25) (layer F.Cu) (net 3) (tstamp 5538D683))
540 | (segment (start 138.053 91.309) (end 138.053 91.308) (width 0.25) (layer F.Cu) (net 3) (tstamp 5538D684))
541 | (segment (start 125.853 95.308) (end 125.853 95.373) (width 0.25) (layer F.Cu) (net 4))
542 | (segment (start 125.853 95.373) (end 127.762 97.282) (width 0.25) (layer F.Cu) (net 4) (tstamp 5538C0FF))
543 | (via (at 127.762 97.282) (size 0.6) (layers F.Cu B.Cu) (net 4))
544 | (segment (start 127.762 97.282) (end 132.588 97.282) (width 0.25) (layer B.Cu) (net 4) (tstamp 5538C105))
545 | (via (at 132.588 97.282) (size 0.6) (layers F.Cu B.Cu) (net 4))
546 | (segment (start 132.588 97.282) (end 132.842 97.536) (width 0.25) (layer F.Cu) (net 4) (tstamp 5538C10A))
547 | (segment (start 132.842 97.536) (end 132.842 103.124) (width 0.25) (layer F.Cu) (net 4) (tstamp 5538C10B))
548 | (segment (start 132.842 103.124) (end 136.906 107.188) (width 0.25) (layer F.Cu) (net 4) (tstamp 5538C110))
549 | (segment (start 122.174 107.95) (end 122.174 111.252) (width 1) (layer F.Cu) (net 5))
550 | (segment (start 121.666 107.442) (end 121.666 104.394) (width 1) (layer F.Cu) (net 5) (tstamp 5538BE09))
551 | (segment (start 121.666 104.394) (end 120.65 103.378) (width 1) (layer F.Cu) (net 5) (tstamp 5538BE0D))
552 | (segment (start 120.65 103.378) (end 118.11 103.378) (width 1) (layer F.Cu) (net 5) (tstamp 5538BE10))
553 | (segment (start 118.11 103.378) (end 117.094 102.362) (width 1) (layer F.Cu) (net 5) (tstamp 5538BE13))
554 | (segment (start 117.094 99.314) (end 117.094 102.362) (width 1) (layer F.Cu) (net 5) (tstamp 5538BE17))
555 | (segment (start 122.174 107.95) (end 121.666 107.442) (width 1) (layer F.Cu) (net 5) (tstamp 5538BE01))
556 | (segment (start 122.174 111.252) (end 124.968 114.046) (width 1) (layer F.Cu) (net 5) (tstamp 55A6C81A))
557 | (segment (start 106.642 117.206) (end 106.642 115.862) (width 0.25) (layer F.Cu) (net 5))
558 | (segment (start 106.642 115.862) (end 106.934 115.57) (width 0.25) (layer F.Cu) (net 5) (tstamp 55A6C7BF))
559 | (segment (start 106.934 115.57) (end 109.982 115.57) (width 0.25) (layer F.Cu) (net 5) (tstamp 55A6C7C2))
560 | (segment (start 109.982 115.57) (end 110.998 116.586) (width 0.25) (layer F.Cu) (net 5) (tstamp 55A6C7C6))
561 | (segment (start 110.998 116.586) (end 122.428 116.586) (width 0.25) (layer F.Cu) (net 5) (tstamp 55A6C7C8))
562 | (segment (start 122.428 116.586) (end 124.968 114.046) (width 0.25) (layer F.Cu) (net 5) (tstamp 55A6C7D2))
563 | (segment (start 106.642 117.206) (end 107.076 117.206) (width 0.25) (layer F.Cu) (net 5))
564 | (segment (start 117.094 99.314) (end 117.094 96.647) (width 0.25) (layer F.Cu) (net 5))
565 | (segment (start 117.094 96.647) (end 113.157 92.71) (width 0.25) (layer F.Cu) (net 5) (tstamp 55A65E59))
566 | (segment (start 109.242 117.206) (end 128.666 117.206) (width 0.25) (layer F.Cu) (net 6))
567 | (segment (start 128.666 117.206) (end 129.988 115.884) (width 0.25) (layer F.Cu) (net 6) (tstamp 55A6C7AC))
568 | (segment (start 129.988 115.884) (end 129.988 114.046) (width 0.25) (layer F.Cu) (net 6) (tstamp 55A6C7BA))
569 | (segment (start 126.016 102.108) (end 124.206 102.108) (width 0.25) (layer F.Cu) (net 7))
570 | (segment (start 120.777 95.631) (end 120.777 92.71) (width 0.25) (layer F.Cu) (net 7) (tstamp 5538D06A))
571 | (segment (start 122.428 97.282) (end 120.777 95.631) (width 0.25) (layer F.Cu) (net 7) (tstamp 5538D066))
572 | (segment (start 122.428 100.33) (end 122.428 97.282) (width 0.25) (layer F.Cu) (net 7) (tstamp 5538D064))
573 | (segment (start 124.206 102.108) (end 122.428 100.33) (width 0.25) (layer F.Cu) (net 7) (tstamp 5538D063))
574 | (segment (start 130.016 102.108) (end 130.016 99.79) (width 0.25) (layer F.Cu) (net 8))
575 | (segment (start 123.344 89.308) (end 125.853 89.308) (width 0.25) (layer F.Cu) (net 8) (tstamp 5538D05D))
576 | (segment (start 123.19 89.154) (end 123.344 89.308) (width 0.25) (layer F.Cu) (net 8) (tstamp 5538D058))
577 | (segment (start 123.19 96.012) (end 123.19 89.154) (width 0.25) (layer F.Cu) (net 8) (tstamp 5538D057))
578 | (segment (start 126.238 99.06) (end 123.19 96.012) (width 0.25) (layer F.Cu) (net 8) (tstamp 5538D055))
579 | (segment (start 129.286 99.06) (end 126.238 99.06) (width 0.25) (layer F.Cu) (net 8) (tstamp 5538D054))
580 | (segment (start 130.016 99.79) (end 129.286 99.06) (width 0.25) (layer F.Cu) (net 8) (tstamp 5538D053))
581 | (segment (start 125.953 89.408) (end 125.853 89.308) (width 0.25) (layer F.Cu) (net 8) (tstamp 5538BEF1))
582 | (segment (start 127.54 105.918) (end 128.016 105.918) (width 0.25) (layer F.Cu) (net 9))
583 | (segment (start 127.54 104.362) (end 128.016 103.886) (width 0.25) (layer F.Cu) (net 9) (tstamp 55A6BFF1))
584 | (segment (start 128.016 103.886) (end 131.826 103.886) (width 0.25) (layer F.Cu) (net 9) (tstamp 55A6BFF3))
585 | (segment (start 131.826 103.886) (end 132.08 103.632) (width 0.25) (layer F.Cu) (net 9) (tstamp 55A6BFF9))
586 | (segment (start 132.08 103.632) (end 132.08 99.822) (width 0.25) (layer F.Cu) (net 9) (tstamp 55A6BFFC))
587 | (segment (start 132.08 99.822) (end 131.318 99.06) (width 0.25) (layer F.Cu) (net 9) (tstamp 55A6C000))
588 | (segment (start 131.318 99.06) (end 131.318 90.17) (width 0.25) (layer F.Cu) (net 9) (tstamp 55A6C005))
589 | (segment (start 131.318 90.17) (end 136.18 85.308) (width 0.25) (layer F.Cu) (net 9) (tstamp 55A6C00C))
590 | (segment (start 136.18 85.308) (end 138.053 85.308) (width 0.25) (layer F.Cu) (net 9) (tstamp 55A6C012))
591 | (segment (start 127.54 105.918) (end 127.54 104.362) (width 0.25) (layer F.Cu) (net 9))
592 | (segment (start 119.634 99.314) (end 119.634 96.266) (width 0.25) (layer F.Cu) (net 10))
593 | (segment (start 115.57 87.63) (end 113.157 87.63) (width 0.25) (layer F.Cu) (net 10) (tstamp 55A6C220))
594 | (segment (start 118.11 90.17) (end 115.57 87.63) (width 0.25) (layer F.Cu) (net 10) (tstamp 55A6C218))
595 | (segment (start 118.11 94.742) (end 118.11 90.17) (width 0.25) (layer F.Cu) (net 10) (tstamp 55A6C215))
596 | (segment (start 119.634 96.266) (end 118.11 94.742) (width 0.25) (layer F.Cu) (net 10) (tstamp 55A6C212))
597 | (segment (start 119.221 106.172) (end 119.221 104.807) (width 0.25) (layer F.Cu) (net 10))
598 | (segment (start 119.634 101.854) (end 119.634 99.314) (width 0.25) (layer F.Cu) (net 10) (tstamp 5538BEAD))
599 | (segment (start 119.888 102.108) (end 119.634 101.854) (width 0.25) (layer F.Cu) (net 10) (tstamp 5538BEAC))
600 | (via (at 119.888 102.108) (size 0.6) (layers F.Cu B.Cu) (net 10))
601 | (segment (start 119.888 104.14) (end 119.888 102.108) (width 0.25) (layer B.Cu) (net 10) (tstamp 5538BEA9))
602 | (segment (start 119.38 104.648) (end 119.888 104.14) (width 0.25) (layer B.Cu) (net 10) (tstamp 5538BEA8))
603 | (via (at 119.38 104.648) (size 0.6) (layers F.Cu B.Cu) (net 10))
604 | (segment (start 119.221 104.807) (end 119.38 104.648) (width 0.25) (layer F.Cu) (net 10) (tstamp 5538BEA0))
605 | (segment (start 114.554 99.314) (end 114.554 105.505) (width 1) (layer F.Cu) (net 16))
606 | (segment (start 114.554 105.505) (end 115.221 106.172) (width 1) (layer F.Cu) (net 16) (tstamp 55A6CC36))
607 | (segment (start 115.221 106.172) (end 115.221 109.319) (width 1) (layer F.Cu) (net 16))
608 | (segment (start 115.221 109.319) (end 119.948 114.046) (width 1) (layer F.Cu) (net 16) (tstamp 55A6C827))
609 | (segment (start 125.853 93.308) (end 124.042 93.308) (width 0.25) (layer F.Cu) (net 17))
610 | (via (at 124.206 104.14) (size 0.6) (layers F.Cu B.Cu) (net 17))
611 | (segment (start 124.206 93.472) (end 124.206 104.14) (width 0.25) (layer B.Cu) (net 17) (tstamp 55A6CFA2))
612 | (segment (start 123.952 93.218) (end 124.206 93.472) (width 0.25) (layer B.Cu) (net 17) (tstamp 55A6CFA1))
613 | (via (at 123.952 93.218) (size 0.6) (layers F.Cu B.Cu) (net 17))
614 | (segment (start 124.042 93.308) (end 123.952 93.218) (width 0.25) (layer F.Cu) (net 17) (tstamp 55A6CF9B))
615 | (segment (start 125.386 93.308) (end 125.853 93.308) (width 0.25) (layer F.Cu) (net 17) (tstamp 5538BF03))
616 | (segment (start 125.853 93.308) (end 126.656 93.308) (width 0.25) (layer F.Cu) (net 17))
617 |
618 | (zone (net 1) (net_name GND) (layer B.Cu) (tstamp 5538D296) (hatch edge 0.508)
619 | (connect_pads (clearance 0.508))
620 | (min_thickness 0.254)
621 | (fill yes (arc_segments 16) (thermal_gap 0.508) (thermal_bridge_width 0.508))
622 | (polygon
623 | (pts
624 | (xy 139.954 118.364) (xy 139.192 118.364) (xy 104.14 118.11) (xy 104.14 77.724) (xy 139.192 77.724)
625 | (xy 139.954 77.724) (xy 139.954 118.364)
626 | )
627 | )
628 | (filled_polygon
629 | (pts
630 | (xy 139.523 118.187) (xy 138.589345 118.187) (xy 138.589345 109.728) (xy 138.475271 109.154511) (xy 138.150415 108.66833)
631 | (xy 137.835634 108.458) (xy 138.150415 108.24767) (xy 138.475271 107.761489) (xy 138.589345 107.188) (xy 138.475271 106.614511)
632 | (xy 138.150415 106.12833) (xy 137.835634 105.918) (xy 138.150415 105.70767) (xy 138.475271 105.221489) (xy 138.589345 104.648)
633 | (xy 138.475271 104.074511) (xy 138.150415 103.58833) (xy 137.835634 103.378) (xy 138.150415 103.16767) (xy 138.475271 102.681489)
634 | (xy 138.589345 102.108) (xy 138.475271 101.534511) (xy 138.150415 101.04833) (xy 138.128219 101.033499) (xy 138.281698 100.969927)
635 | (xy 138.460327 100.791299) (xy 138.557 100.55791) (xy 138.557 100.305291) (xy 138.557 99.85375) (xy 138.557 99.28225)
636 | (xy 138.557 98.830709) (xy 138.557 98.57809) (xy 138.460327 98.344701) (xy 138.281698 98.166073) (xy 138.048309 98.0694)
637 | (xy 137.19175 98.0694) (xy 137.033 98.22815) (xy 137.033 99.441) (xy 138.39825 99.441) (xy 138.557 99.28225)
638 | (xy 138.557 99.85375) (xy 138.39825 99.695) (xy 137.033 99.695) (xy 137.033 99.715) (xy 136.825162 99.715)
639 | (xy 136.825162 93.286833) (xy 136.683117 92.943057) (xy 136.420327 92.679808) (xy 136.076799 92.537162) (xy 135.704833 92.536838)
640 | (xy 135.361057 92.678883) (xy 135.327882 92.712) (xy 134.62 92.712) (xy 134.329161 92.769852) (xy 134.082599 92.934599)
641 | (xy 133.46432 93.552877) (xy 133.418833 93.552838) (xy 133.075057 93.694883) (xy 132.811808 93.957673) (xy 132.669162 94.301201)
642 | (xy 132.668838 94.673167) (xy 132.810883 95.016943) (xy 133.073673 95.280192) (xy 133.417201 95.422838) (xy 133.789167 95.423162)
643 | (xy 134.132943 95.281117) (xy 134.396192 95.018327) (xy 134.538838 94.674799) (xy 134.538878 94.627923) (xy 134.934802 94.232)
644 | (xy 135.327537 94.232) (xy 135.359673 94.264192) (xy 135.703201 94.406838) (xy 136.075167 94.407162) (xy 136.418943 94.265117)
645 | (xy 136.682192 94.002327) (xy 136.824838 93.658799) (xy 136.825162 93.286833) (xy 136.825162 99.715) (xy 136.779 99.715)
646 | (xy 136.779 99.695) (xy 136.779 99.441) (xy 136.779 98.22815) (xy 136.62025 98.0694) (xy 135.763691 98.0694)
647 | (xy 135.530302 98.166073) (xy 135.351673 98.344701) (xy 135.255 98.57809) (xy 135.255 98.830709) (xy 135.255 99.28225)
648 | (xy 135.41375 99.441) (xy 136.779 99.441) (xy 136.779 99.695) (xy 135.41375 99.695) (xy 135.255 99.85375)
649 | (xy 135.255 100.305291) (xy 135.255 100.55791) (xy 135.351673 100.791299) (xy 135.530302 100.969927) (xy 135.68378 101.033499)
650 | (xy 135.661585 101.04833) (xy 135.336729 101.534511) (xy 135.222655 102.108) (xy 135.336729 102.681489) (xy 135.661585 103.16767)
651 | (xy 135.976365 103.378) (xy 135.661585 103.58833) (xy 135.336729 104.074511) (xy 135.222655 104.648) (xy 135.336729 105.221489)
652 | (xy 135.661585 105.70767) (xy 135.976365 105.918) (xy 135.661585 106.12833) (xy 135.336729 106.614511) (xy 135.222655 107.188)
653 | (xy 135.336729 107.761489) (xy 135.661585 108.24767) (xy 135.976365 108.458) (xy 135.661585 108.66833) (xy 135.336729 109.154511)
654 | (xy 135.222655 109.728) (xy 135.336729 110.301489) (xy 135.661585 110.78767) (xy 136.147766 111.112526) (xy 136.721255 111.2266)
655 | (xy 137.090745 111.2266) (xy 137.664234 111.112526) (xy 138.150415 110.78767) (xy 138.475271 110.301489) (xy 138.589345 109.728)
656 | (xy 138.589345 118.187) (xy 133.523162 118.187) (xy 133.523162 97.096833) (xy 133.381117 96.753057) (xy 133.118327 96.489808)
657 | (xy 132.774799 96.347162) (xy 132.402833 96.346838) (xy 132.059057 96.488883) (xy 132.025882 96.522) (xy 128.324462 96.522)
658 | (xy 128.292327 96.489808) (xy 127.948799 96.347162) (xy 127.576833 96.346838) (xy 127.233057 96.488883) (xy 126.969808 96.751673)
659 | (xy 126.827162 97.095201) (xy 126.826838 97.467167) (xy 126.968883 97.810943) (xy 127.231673 98.074192) (xy 127.575201 98.216838)
660 | (xy 127.947167 98.217162) (xy 128.290943 98.075117) (xy 128.324117 98.042) (xy 132.025537 98.042) (xy 132.057673 98.074192)
661 | (xy 132.401201 98.216838) (xy 132.773167 98.217162) (xy 133.116943 98.075117) (xy 133.380192 97.812327) (xy 133.522838 97.468799)
662 | (xy 133.523162 97.096833) (xy 133.523162 118.187) (xy 132.623457 118.187) (xy 132.623457 113.524166) (xy 132.223147 112.555342)
663 | (xy 131.482557 111.813458) (xy 130.514433 111.411458) (xy 129.466166 111.410543) (xy 128.497342 111.810853) (xy 127.755458 112.551443)
664 | (xy 127.477813 113.220085) (xy 127.203147 112.555342) (xy 126.462557 111.813458) (xy 125.494433 111.411458) (xy 125.141162 111.411149)
665 | (xy 125.141162 103.954833) (xy 124.999117 103.611057) (xy 124.966 103.577882) (xy 124.966 93.472) (xy 124.908148 93.181161)
666 | (xy 124.908148 93.18116) (xy 124.88706 93.1496) (xy 124.887162 93.032833) (xy 124.745117 92.689057) (xy 124.482327 92.425808)
667 | (xy 124.138799 92.283162) (xy 123.766833 92.282838) (xy 123.423057 92.424883) (xy 123.159808 92.687673) (xy 123.017162 93.031201)
668 | (xy 123.016838 93.403167) (xy 123.158883 93.746943) (xy 123.421673 94.010192) (xy 123.446 94.020293) (xy 123.446 103.577537)
669 | (xy 123.413808 103.609673) (xy 123.271162 103.953201) (xy 123.270838 104.325167) (xy 123.412883 104.668943) (xy 123.675673 104.932192)
670 | (xy 124.019201 105.074838) (xy 124.391167 105.075162) (xy 124.734943 104.933117) (xy 124.998192 104.670327) (xy 125.140838 104.326799)
671 | (xy 125.141162 103.954833) (xy 125.141162 111.411149) (xy 124.446166 111.410543) (xy 123.477342 111.810853) (xy 122.735458 112.551443)
672 | (xy 122.457813 113.220085) (xy 122.183147 112.555342) (xy 121.442557 111.813458) (xy 121.11863 111.678951) (xy 121.11863 100.261156)
673 | (xy 121.11863 98.366844) (xy 121.005619 97.798701) (xy 120.683792 97.317052) (xy 120.202143 96.995225) (xy 119.634 96.882214)
674 | (xy 119.629359 96.883137) (xy 119.629359 82.047985) (xy 119.244254 81.115959) (xy 118.531792 80.402252) (xy 117.600439 80.015521)
675 | (xy 116.591985 80.014641) (xy 115.659959 80.399746) (xy 114.946252 81.112208) (xy 114.559521 82.043561) (xy 114.558641 83.052015)
676 | (xy 114.943746 83.984041) (xy 115.656208 84.697748) (xy 116.587561 85.084479) (xy 117.596015 85.085359) (xy 118.528041 84.700254)
677 | (xy 119.241748 83.987792) (xy 119.628479 83.056439) (xy 119.629359 82.047985) (xy 119.629359 96.883137) (xy 119.065857 96.995225)
678 | (xy 118.584208 97.317052) (xy 118.364 97.646617) (xy 118.143792 97.317052) (xy 117.662143 96.995225) (xy 117.094 96.882214)
679 | (xy 116.525857 96.995225) (xy 116.044208 97.317052) (xy 115.824 97.646617) (xy 115.603792 97.317052) (xy 115.122143 96.995225)
680 | (xy 114.554 96.882214) (xy 113.985857 96.995225) (xy 113.504208 97.317052) (xy 113.182381 97.798701) (xy 113.06937 98.366844)
681 | (xy 113.06937 100.261156) (xy 113.182381 100.829299) (xy 113.504208 101.310948) (xy 113.985857 101.632775) (xy 114.554 101.745786)
682 | (xy 115.122143 101.632775) (xy 115.603792 101.310948) (xy 115.824 100.981382) (xy 116.044208 101.310948) (xy 116.525857 101.632775)
683 | (xy 117.094 101.745786) (xy 117.662143 101.632775) (xy 118.143792 101.310948) (xy 118.364 100.981382) (xy 118.584208 101.310948)
684 | (xy 119.065857 101.632775) (xy 119.072388 101.634074) (xy 118.953162 101.921201) (xy 118.952838 102.293167) (xy 119.094883 102.636943)
685 | (xy 119.128 102.670117) (xy 119.128 103.740452) (xy 118.851057 103.854883) (xy 118.587808 104.117673) (xy 118.445162 104.461201)
686 | (xy 118.444838 104.833167) (xy 118.586883 105.176943) (xy 118.849673 105.440192) (xy 119.193201 105.582838) (xy 119.565167 105.583162)
687 | (xy 119.908943 105.441117) (xy 120.172192 105.178327) (xy 120.314838 104.834799) (xy 120.314878 104.787923) (xy 120.425401 104.677401)
688 | (xy 120.590147 104.43084) (xy 120.590148 104.430839) (xy 120.647999 104.14) (xy 120.648 104.14) (xy 120.648 102.670462)
689 | (xy 120.680192 102.638327) (xy 120.822838 102.294799) (xy 120.823162 101.922833) (xy 120.681117 101.579057) (xy 120.521635 101.419297)
690 | (xy 120.683792 101.310948) (xy 121.005619 100.829299) (xy 121.11863 100.261156) (xy 121.11863 111.678951) (xy 120.474433 111.411458)
691 | (xy 119.426166 111.410543) (xy 118.457342 111.810853) (xy 117.715458 112.551443) (xy 117.313458 113.519567) (xy 117.312543 114.567834)
692 | (xy 117.712853 115.536658) (xy 118.453443 116.278542) (xy 119.421567 116.680542) (xy 120.469834 116.681457) (xy 121.438658 116.281147)
693 | (xy 122.180542 115.540557) (xy 122.458186 114.871914) (xy 122.732853 115.536658) (xy 123.473443 116.278542) (xy 124.441567 116.680542)
694 | (xy 125.489834 116.681457) (xy 126.458658 116.281147) (xy 127.200542 115.540557) (xy 127.478186 114.871914) (xy 127.752853 115.536658)
695 | (xy 128.493443 116.278542) (xy 129.461567 116.680542) (xy 130.509834 116.681457) (xy 131.478658 116.281147) (xy 132.220542 115.540557)
696 | (xy 132.622542 114.572433) (xy 132.623457 113.524166) (xy 132.623457 118.187) (xy 132.292458 118.187) (xy 110.639242 118.030092)
697 | (xy 110.639242 79.329339) (xy 110.42701 78.815697) (xy 110.03437 78.422371) (xy 109.5211 78.209243) (xy 108.965339 78.208758)
698 | (xy 108.451697 78.42099) (xy 108.058371 78.81363) (xy 107.948568 79.078064) (xy 107.864397 78.874857) (xy 107.622213 78.805392)
699 | (xy 107.442608 78.984997) (xy 107.442608 78.625787) (xy 107.373143 78.383603) (xy 106.849698 78.196856) (xy 106.294632 78.224638)
700 | (xy 105.910857 78.383603) (xy 105.841392 78.625787) (xy 106.642 79.426395) (xy 107.442608 78.625787) (xy 107.442608 78.984997)
701 | (xy 106.821605 79.606) (xy 107.622213 80.406608) (xy 107.864397 80.337143) (xy 107.94231 80.118755) (xy 108.05699 80.396303)
702 | (xy 108.44963 80.789629) (xy 108.9629 81.002757) (xy 109.518661 81.003242) (xy 110.032303 80.79101) (xy 110.425629 80.39837)
703 | (xy 110.638757 79.8851) (xy 110.639242 79.329339) (xy 110.639242 118.030092) (xy 110.358877 118.028061) (xy 110.53266 117.767978)
704 | (xy 110.639 117.233369) (xy 110.639 117.178631) (xy 110.53266 116.644022) (xy 110.229828 116.190803) (xy 109.776609 115.887971)
705 | (xy 109.242 115.781631) (xy 108.707391 115.887971) (xy 108.254172 116.190803) (xy 107.95134 116.644022) (xy 107.941594 116.693014)
706 | (xy 107.82701 116.415697) (xy 107.442608 116.030623) (xy 107.442608 80.586213) (xy 106.642 79.785605) (xy 106.462395 79.96521)
707 | (xy 106.462395 79.606) (xy 105.661787 78.805392) (xy 105.419603 78.874857) (xy 105.232856 79.398302) (xy 105.260638 79.953368)
708 | (xy 105.419603 80.337143) (xy 105.661787 80.406608) (xy 106.462395 79.606) (xy 106.462395 79.96521) (xy 105.841392 80.586213)
709 | (xy 105.910857 80.828397) (xy 106.434302 81.015144) (xy 106.989368 80.987362) (xy 107.373143 80.828397) (xy 107.442608 80.586213)
710 | (xy 107.442608 116.030623) (xy 107.43437 116.022371) (xy 106.9211 115.809243) (xy 106.365339 115.808758) (xy 105.851697 116.02099)
711 | (xy 105.458371 116.41363) (xy 105.245243 116.9269) (xy 105.244758 117.482661) (xy 105.45543 117.992528) (xy 104.317 117.984279)
712 | (xy 104.317 77.901) (xy 104.394 77.901) (xy 104.902 77.901) (xy 139.192 77.901) (xy 139.446 77.901)
713 | (xy 139.523 77.901) (xy 139.523 118.187)
714 | )
715 | )
716 | )
717 | (zone (net 17) (net_name +3V3) (layer F.Cu) (tstamp 5538D4B3) (hatch edge 0.508)
718 | (connect_pads (clearance 0.508))
719 | (min_thickness 0.254)
720 | (fill yes (arc_segments 16) (thermal_gap 0.508) (thermal_bridge_width 0.508))
721 | (polygon
722 | (pts
723 | (xy 139.954 118.364) (xy 139.446 118.364) (xy 139.192 118.364) (xy 133.604 118.364) (xy 133.604 110.49)
724 | (xy 131.064 108.712) (xy 123.444 108.712) (xy 123.444 97.028) (xy 104.14 97.028) (xy 104.14 77.724)
725 | (xy 139.192 77.724) (xy 139.446 77.724) (xy 139.954 77.724) (xy 139.954 118.364)
726 | )
727 | )
728 | (filled_polygon
729 | (pts
730 | (xy 139.523 84.367271) (xy 139.513673 84.353073) (xy 139.30264 84.210623) (xy 139.077577 84.165488) (xy 139.150377 84.05764)
731 | (xy 139.20044 83.808) (xy 139.20044 82.808) (xy 139.153463 82.565877) (xy 139.013673 82.353073) (xy 138.80264 82.210623)
732 | (xy 138.553 82.16056) (xy 137.553 82.16056) (xy 137.310877 82.207537) (xy 137.098073 82.347327) (xy 136.955623 82.55836)
733 | (xy 136.90556 82.808) (xy 136.90556 83.808) (xy 136.952537 84.050123) (xy 137.028238 84.165364) (xy 136.810877 84.207537)
734 | (xy 136.598073 84.347327) (xy 136.462616 84.548) (xy 136.18 84.548) (xy 135.88916 84.605852) (xy 135.642599 84.770599)
735 | (xy 130.780599 89.632599) (xy 130.615852 89.879161) (xy 130.558 90.17) (xy 130.558 99.06) (xy 130.614499 99.344039)
736 | (xy 130.553401 99.252599) (xy 129.823401 98.522599) (xy 129.576839 98.357852) (xy 129.286 98.3) (xy 126.552802 98.3)
737 | (xy 124.67193 96.419128) (xy 124.853 96.45544) (xy 125.860638 96.45544) (xy 126.826877 97.421679) (xy 126.826838 97.467167)
738 | (xy 126.968883 97.810943) (xy 127.231673 98.074192) (xy 127.575201 98.216838) (xy 127.947167 98.217162) (xy 128.290943 98.075117)
739 | (xy 128.554192 97.812327) (xy 128.696838 97.468799) (xy 128.697162 97.096833) (xy 128.555117 96.753057) (xy 128.292327 96.489808)
740 | (xy 127.948799 96.347162) (xy 127.901923 96.347121) (xy 127.477448 95.922646) (xy 127.50044 95.808) (xy 127.50044 94.808)
741 | (xy 127.453463 94.565877) (xy 127.313673 94.353073) (xy 127.249362 94.309662) (xy 127.391327 94.167699) (xy 127.488 93.93431)
742 | (xy 127.488 93.681691) (xy 127.488 93.59375) (xy 127.32925 93.435) (xy 125.98 93.435) (xy 125.98 93.455)
743 | (xy 125.726 93.455) (xy 125.726 93.435) (xy 124.37675 93.435) (xy 124.218 93.59375) (xy 124.218 93.681691)
744 | (xy 124.218 93.93431) (xy 124.314673 94.167699) (xy 124.45615 94.309175) (xy 124.398073 94.347327) (xy 124.255623 94.55836)
745 | (xy 124.20556 94.808) (xy 124.20556 95.808) (xy 124.240407 95.987605) (xy 123.95 95.697198) (xy 123.95 92.092103)
746 | (xy 124.019201 92.120838) (xy 124.299149 92.121081) (xy 124.392327 92.262927) (xy 124.456637 92.306337) (xy 124.314673 92.448301)
747 | (xy 124.218 92.68169) (xy 124.218 92.934309) (xy 124.218 93.02225) (xy 124.37675 93.181) (xy 125.726 93.181)
748 | (xy 125.726 93.161) (xy 125.98 93.161) (xy 125.98 93.181) (xy 127.32925 93.181) (xy 127.488 93.02225)
749 | (xy 127.488 92.934309) (xy 127.488 92.68169) (xy 127.391327 92.448301) (xy 127.249849 92.306824) (xy 127.307927 92.268673)
750 | (xy 127.450377 92.05764) (xy 127.50044 91.808) (xy 127.50044 90.808) (xy 127.453463 90.565877) (xy 127.313673 90.353073)
751 | (xy 127.247471 90.308386) (xy 127.307927 90.268673) (xy 127.450377 90.05764) (xy 127.50044 89.808) (xy 127.50044 88.808)
752 | (xy 127.453463 88.565877) (xy 127.313673 88.353073) (xy 127.10264 88.210623) (xy 126.877577 88.165488) (xy 126.950377 88.05764)
753 | (xy 127.00044 87.808) (xy 127.00044 86.808) (xy 126.953463 86.565877) (xy 126.813673 86.353073) (xy 126.747471 86.308386)
754 | (xy 126.807927 86.268673) (xy 126.950377 86.05764) (xy 127.00044 85.808) (xy 127.00044 84.808) (xy 126.953463 84.565877)
755 | (xy 126.872745 84.443) (xy 126.979309 84.443) (xy 127.212698 84.346327) (xy 127.391327 84.167699) (xy 127.488 83.93431)
756 | (xy 127.488 83.681691) (xy 127.488 83.59375) (xy 127.488 83.02225) (xy 127.488 82.934309) (xy 127.488 82.68169)
757 | (xy 127.391327 82.448301) (xy 127.212698 82.269673) (xy 126.979309 82.173) (xy 126.13875 82.173) (xy 125.98 82.33175)
758 | (xy 125.98 83.181) (xy 127.32925 83.181) (xy 127.488 83.02225) (xy 127.488 83.59375) (xy 127.32925 83.435)
759 | (xy 125.98 83.435) (xy 125.98 83.455) (xy 125.726 83.455) (xy 125.726 83.435) (xy 125.726 83.181)
760 | (xy 125.726 82.33175) (xy 125.56725 82.173) (xy 124.726691 82.173) (xy 124.493302 82.269673) (xy 124.314673 82.448301)
761 | (xy 124.218 82.68169) (xy 124.218 82.934309) (xy 124.218 83.02225) (xy 124.37675 83.181) (xy 125.726 83.181)
762 | (xy 125.726 83.435) (xy 124.37675 83.435) (xy 124.218 83.59375) (xy 124.218 83.681691) (xy 124.218 83.93431)
763 | (xy 124.314673 84.167699) (xy 124.493302 84.346327) (xy 124.726691 84.443) (xy 124.833492 84.443) (xy 124.755623 84.55836)
764 | (xy 124.70556 84.808) (xy 124.70556 85.808) (xy 124.752537 86.050123) (xy 124.892327 86.262927) (xy 124.958528 86.307613)
765 | (xy 124.898073 86.347327) (xy 124.755623 86.55836) (xy 124.70556 86.808) (xy 124.70556 87.808) (xy 124.752537 88.050123)
766 | (xy 124.828238 88.165364) (xy 124.610877 88.207537) (xy 124.398073 88.347327) (xy 124.262616 88.548) (xy 123.624735 88.548)
767 | (xy 123.480839 88.451852) (xy 123.19 88.394) (xy 122.899161 88.451852) (xy 122.652599 88.616599) (xy 122.487852 88.863161)
768 | (xy 122.43 89.154) (xy 122.43 89.354191) (xy 122.393463 89.165877) (xy 122.253673 88.953073) (xy 122.175458 88.900277)
769 | (xy 122.247927 88.852673) (xy 122.390377 88.64164) (xy 122.44044 88.392) (xy 122.44044 86.868) (xy 122.393463 86.625877)
770 | (xy 122.253673 86.413073) (xy 122.04264 86.270623) (xy 121.793 86.22056) (xy 119.761 86.22056) (xy 119.629359 86.246101)
771 | (xy 119.629359 82.047985) (xy 119.244254 81.115959) (xy 118.531792 80.402252) (xy 117.600439 80.015521) (xy 116.591985 80.014641)
772 | (xy 115.659959 80.399746) (xy 114.946252 81.112208) (xy 114.559521 82.043561) (xy 114.558641 83.052015) (xy 114.943746 83.984041)
773 | (xy 115.656208 84.697748) (xy 116.587561 85.084479) (xy 117.596015 85.085359) (xy 118.528041 84.700254) (xy 119.241748 83.987792)
774 | (xy 119.628479 83.056439) (xy 119.629359 82.047985) (xy 119.629359 86.246101) (xy 119.518877 86.267537) (xy 119.306073 86.407327)
775 | (xy 119.163623 86.61836) (xy 119.11356 86.868) (xy 119.11356 88.392) (xy 119.160537 88.634123) (xy 119.300327 88.846927)
776 | (xy 119.378541 88.899722) (xy 119.306073 88.947327) (xy 119.163623 89.15836) (xy 119.11356 89.408) (xy 119.11356 90.932)
777 | (xy 119.160537 91.174123) (xy 119.300327 91.386927) (xy 119.378541 91.439722) (xy 119.306073 91.487327) (xy 119.163623 91.69836)
778 | (xy 119.11356 91.948) (xy 119.11356 93.472) (xy 119.160537 93.714123) (xy 119.300327 93.926927) (xy 119.51136 94.069377)
779 | (xy 119.761 94.11944) (xy 120.017 94.11944) (xy 120.017 95.574198) (xy 118.87 94.427198) (xy 118.87 90.17)
780 | (xy 118.821746 89.927413) (xy 118.812148 89.879161) (xy 118.812148 89.87916) (xy 118.647401 89.632599) (xy 116.107401 87.092599)
781 | (xy 115.860839 86.927852) (xy 115.57 86.87) (xy 114.82044 86.87) (xy 114.82044 86.868) (xy 114.773463 86.625877)
782 | (xy 114.633673 86.413073) (xy 114.42264 86.270623) (xy 114.173 86.22056) (xy 112.141 86.22056) (xy 111.898877 86.267537)
783 | (xy 111.686073 86.407327) (xy 111.543623 86.61836) (xy 111.49356 86.868) (xy 111.49356 88.392) (xy 111.540537 88.634123)
784 | (xy 111.680327 88.846927) (xy 111.758541 88.899722) (xy 111.686073 88.947327) (xy 111.543623 89.15836) (xy 111.49356 89.408)
785 | (xy 111.49356 90.932) (xy 111.540537 91.174123) (xy 111.680327 91.386927) (xy 111.758541 91.439722) (xy 111.686073 91.487327)
786 | (xy 111.543623 91.69836) (xy 111.49356 91.948) (xy 111.49356 93.472) (xy 111.540537 93.714123) (xy 111.680327 93.926927)
787 | (xy 111.89136 94.069377) (xy 112.141 94.11944) (xy 113.491638 94.11944) (xy 116.273198 96.901) (xy 114.648443 96.901)
788 | (xy 114.554 96.882214) (xy 114.459556 96.901) (xy 110.651144 96.901) (xy 110.651144 79.813698) (xy 110.623362 79.258632)
789 | (xy 110.464397 78.874857) (xy 110.222213 78.805392) (xy 110.042608 78.984997) (xy 110.042608 78.625787) (xy 109.973143 78.383603)
790 | (xy 109.449698 78.196856) (xy 108.894632 78.224638) (xy 108.510857 78.383603) (xy 108.441392 78.625787) (xy 109.242 79.426395)
791 | (xy 110.042608 78.625787) (xy 110.042608 78.984997) (xy 109.421605 79.606) (xy 110.222213 80.406608) (xy 110.464397 80.337143)
792 | (xy 110.651144 79.813698) (xy 110.651144 96.901) (xy 110.042608 96.901) (xy 110.042608 80.586213) (xy 109.242 79.785605)
793 | (xy 109.062395 79.96521) (xy 109.062395 79.606) (xy 108.261787 78.805392) (xy 108.019603 78.874857) (xy 107.941689 79.093244)
794 | (xy 107.82701 78.815697) (xy 107.43437 78.422371) (xy 106.9211 78.209243) (xy 106.365339 78.208758) (xy 105.851697 78.42099)
795 | (xy 105.458371 78.81363) (xy 105.245243 79.3269) (xy 105.244758 79.882661) (xy 105.45699 80.396303) (xy 105.84963 80.789629)
796 | (xy 106.3629 81.002757) (xy 106.918661 81.003242) (xy 107.432303 80.79101) (xy 107.825629 80.39837) (xy 107.935431 80.133935)
797 | (xy 108.019603 80.337143) (xy 108.261787 80.406608) (xy 109.062395 79.606) (xy 109.062395 79.96521) (xy 108.441392 80.586213)
798 | (xy 108.510857 80.828397) (xy 109.034302 81.015144) (xy 109.589368 80.987362) (xy 109.973143 80.828397) (xy 110.042608 80.586213)
799 | (xy 110.042608 96.901) (xy 104.317 96.901) (xy 104.317 77.901) (xy 104.394 77.901) (xy 104.902 77.901)
800 | (xy 139.192 77.901) (xy 139.446 77.901) (xy 139.523 77.901) (xy 139.523 84.367271)
801 | )
802 | )
803 | (filled_polygon
804 | (pts
805 | (xy 139.523 118.187) (xy 138.513358 118.187) (xy 138.513358 110.087026) (xy 138.392217 109.855) (xy 137.033 109.855)
806 | (xy 137.033 111.068924) (xy 137.267913 111.213184) (xy 137.82032 111.019954) (xy 138.256732 110.630036) (xy 138.510709 110.102791)
807 | (xy 138.513358 110.087026) (xy 138.513358 118.187) (xy 136.779 118.187) (xy 136.779 111.068924) (xy 136.779 109.855)
808 | (xy 135.419783 109.855) (xy 135.298642 110.087026) (xy 135.301291 110.102791) (xy 135.555268 110.630036) (xy 135.99168 111.019954)
809 | (xy 136.544087 111.213184) (xy 136.779 111.068924) (xy 136.779 118.187) (xy 133.731 118.187) (xy 133.731 110.423877)
810 | (xy 133.175 110.034676) (xy 133.175 106.89431) (xy 133.175 106.641691) (xy 133.175 106.20375) (xy 133.01625 106.045)
811 | (xy 131.667 106.045) (xy 131.667 107.24425) (xy 131.82575 107.403) (xy 132.666309 107.403) (xy 132.899698 107.306327)
812 | (xy 133.078327 107.127699) (xy 133.175 106.89431) (xy 133.175 110.034676) (xy 131.413 108.801276) (xy 131.413 107.24425)
813 | (xy 131.413 106.045) (xy 130.06375 106.045) (xy 129.905 106.20375) (xy 129.905 106.641691) (xy 129.905 106.89431)
814 | (xy 130.001673 107.127699) (xy 130.180302 107.306327) (xy 130.413691 107.403) (xy 131.25425 107.403) (xy 131.413 107.24425)
815 | (xy 131.413 108.801276) (xy 131.104033 108.585) (xy 123.571 108.585) (xy 123.571 102.547802) (xy 123.668599 102.645401)
816 | (xy 123.915161 102.810148) (xy 124.206 102.868) (xy 124.36856 102.868) (xy 124.36856 102.958) (xy 124.415537 103.200123)
817 | (xy 124.555327 103.412927) (xy 124.76636 103.555377) (xy 125.016 103.60544) (xy 127.016 103.60544) (xy 127.258123 103.558463)
818 | (xy 127.289052 103.538145) (xy 127.002599 103.824599) (xy 126.837852 104.071161) (xy 126.78 104.362) (xy 126.78 104.42056)
819 | (xy 126.54 104.42056) (xy 126.297877 104.467537) (xy 126.085073 104.607327) (xy 125.942623 104.81836) (xy 125.89256 105.068)
820 | (xy 125.89256 106.768) (xy 125.939537 107.010123) (xy 126.079327 107.222927) (xy 126.29036 107.365377) (xy 126.54 107.41544)
821 | (xy 128.54 107.41544) (xy 128.782123 107.368463) (xy 128.994927 107.228673) (xy 129.137377 107.01764) (xy 129.18744 106.768)
822 | (xy 129.18744 105.068) (xy 129.140463 104.825877) (xy 129.022302 104.646) (xy 130.063974 104.646) (xy 130.001673 104.708301)
823 | (xy 129.905 104.94169) (xy 129.905 105.194309) (xy 129.905 105.63225) (xy 130.06375 105.791) (xy 131.413 105.791)
824 | (xy 131.413 105.771) (xy 131.667 105.771) (xy 131.667 105.791) (xy 133.01625 105.791) (xy 133.175 105.63225)
825 | (xy 133.175 105.194309) (xy 133.175 104.94169) (xy 133.078327 104.708301) (xy 132.899698 104.529673) (xy 132.666309 104.433)
826 | (xy 132.349035 104.433) (xy 132.363401 104.423401) (xy 132.617401 104.169401) (xy 132.695586 104.052388) (xy 135.323618 106.68042)
827 | (xy 135.222655 107.188) (xy 135.336729 107.761489) (xy 135.661585 108.24767) (xy 135.971069 108.45446) (xy 135.555268 108.825964)
828 | (xy 135.301291 109.353209) (xy 135.298642 109.368974) (xy 135.419783 109.601) (xy 136.779 109.601) (xy 136.779 109.581)
829 | (xy 137.033 109.581) (xy 137.033 109.601) (xy 138.392217 109.601) (xy 138.513358 109.368974) (xy 138.510709 109.353209)
830 | (xy 138.256732 108.825964) (xy 137.84093 108.45446) (xy 138.150415 108.24767) (xy 138.475271 107.761489) (xy 138.589345 107.188)
831 | (xy 138.475271 106.614511) (xy 138.150415 106.12833) (xy 137.835634 105.918) (xy 138.150415 105.70767) (xy 138.475271 105.221489)
832 | (xy 138.589345 104.648) (xy 138.475271 104.074511) (xy 138.150415 103.58833) (xy 137.835634 103.378) (xy 138.150415 103.16767)
833 | (xy 138.475271 102.681489) (xy 138.589345 102.108) (xy 138.475271 101.534511) (xy 138.150415 101.04833) (xy 138.134632 101.037784)
834 | (xy 138.164123 101.032063) (xy 138.376927 100.892273) (xy 138.519377 100.68124) (xy 138.56944 100.4316) (xy 138.56944 98.7044)
835 | (xy 138.522463 98.462277) (xy 138.512816 98.447592) (xy 138.602838 98.230799) (xy 138.603162 97.858833) (xy 138.461117 97.515057)
836 | (xy 138.35529 97.409045) (xy 138.460192 97.304327) (xy 138.602838 96.960799) (xy 138.602884 96.907718) (xy 138.755148 96.67984)
837 | (xy 138.755148 96.679839) (xy 138.799784 96.45544) (xy 139.053 96.45544) (xy 139.295123 96.408463) (xy 139.507927 96.268673)
838 | (xy 139.523 96.246343) (xy 139.523 118.187)
839 | )
840 | )
841 | )
842 | )
843 |
--------------------------------------------------------------------------------
/ElectronicDesignAutomation/WifiSwitch.lib:
--------------------------------------------------------------------------------
1 | EESchema-LIBRARY Version 2.3
2 | #encoding utf-8
3 | #
4 | # AC_to_DC_convertor
5 | #
6 | DEF AC_to_DC_convertor C 0 40 Y Y 1 F N
7 | F0 "C" 100 -100 60 H V C CNN
8 | F1 "AC_to_DC_convertor" 0 250 60 H V C CNN
9 | F2 "" 100 0 60 H V C CNN
10 | F3 "" 100 0 60 H V C CNN
11 | DRAW
12 | T 0 -100 50 20 0 0 0 SW~AC~to~DC~Conv. Normal 0 C C
13 | S -450 150 400 -50 0 0 10 N
14 | X +3V3 1 -650 100 200 R 50 50 1 1 I
15 | X GND 2 -650 0 200 R 50 50 1 1 I
16 | X AC_240V 3 600 100 200 L 50 50 1 1 I
17 | X AC_240V 4 600 0 200 L 50 50 1 1 I
18 | ENDDRAW
19 | ENDDEF
20 | #
21 | # ESP8266_ESP3
22 | #
23 | DEF ESP8266_ESP3 U 0 40 Y Y 1 F N
24 | F0 "U" 250 -350 60 H V C CNN
25 | F1 "ESP8266_ESP3" 0 500 60 H V C CNN
26 | F2 "" 0 0 60 H V C CNN
27 | F3 "" 0 0 60 H V C CNN
28 | DRAW
29 | S -350 400 300 -300 0 1 0 N
30 | X GND 1 500 -250 200 L 50 50 1 1 I
31 | X NC 2 500 -150 200 L 50 50 1 1 I
32 | X TX 3 500 -50 200 L 50 50 1 1 I
33 | X RX 4 500 50 200 L 50 50 1 1 I
34 | X GPIO16 5 500 150 200 L 50 50 1 1 I
35 | X CH_PD 6 500 250 200 L 50 50 1 1 I
36 | X ANT 7 500 350 200 L 50 50 1 1 I
37 | X VCC 8 -550 350 200 R 50 50 1 1 I
38 | X GPIO14 9 -550 250 200 R 50 50 1 1 I
39 | X GPIO12 10 -550 150 200 R 50 50 1 1 I
40 | X GPIO13 11 -550 50 200 R 50 50 1 1 I
41 | X GPIO15 12 -550 -50 200 R 50 50 1 1 I
42 | X GPIO2 13 -550 -150 200 R 50 50 1 1 I
43 | X GPIO0 14 -550 -250 200 R 50 50 1 1 I
44 | ENDDRAW
45 | ENDDEF
46 | #
47 | # MOC3031M
48 | #
49 | DEF MOC3031M U 0 40 Y Y 1 F N
50 | F0 "U" -200 200 50 H V L CNN
51 | F1 "MOC3031M" 0 200 50 H V L CNN
52 | F2 "DIP-6" -200 -200 50 H V L CIN
53 | F3 "" -35 0 50 H V L CNN
54 | ALIAS MOC3032M MOC3033M MOC3041M MOC3042M MOC3043M
55 | $FPLIST
56 | DIP-6*
57 | SMD-6*
58 | $ENDFPLIST
59 | DRAW
60 | C 90 -100 5 0 1 0 N
61 | C 90 100 5 0 1 0 N
62 | S -200 150 200 -150 0 1 10 f
63 | P 2 0 1 10 -150 -25 -100 -25 N
64 | P 2 0 1 0 5 -45 5 100 N
65 | P 2 0 1 0 5 100 90 100 N
66 | P 2 0 1 10 75 25 145 25 N
67 | P 2 0 1 0 90 -100 50 -100 N
68 | P 2 0 1 0 90 -100 90 -25 N
69 | P 2 0 1 0 90 -100 200 -100 N
70 | P 2 0 1 0 90 100 90 25 N
71 | P 2 0 1 0 90 100 200 100 N
72 | P 2 0 1 10 105 -25 35 -25 N
73 | P 3 0 1 0 -200 100 -125 100 -125 25 N
74 | P 3 0 1 0 -125 -25 -125 -100 -200 -100 N
75 | P 3 0 1 0 75 -25 60 -55 50 -55 N
76 | P 4 0 1 10 -125 -25 -150 25 -100 25 -125 -25 F
77 | P 4 0 1 0 -75 10 -54 30 -54 10 -24 40 N
78 | P 4 0 1 0 -25 -60 -10 -60 -25 -100 -10 -100 N
79 | P 4 0 1 0 -24 40 -44 30 -34 20 -24 40 N
80 | P 4 0 1 0 0 -65 5 -60 10 -60 15 -65 N
81 | P 4 0 1 10 60 -25 85 25 35 25 60 -25 F
82 | P 4 0 1 10 120 25 95 -25 145 -25 120 25 F
83 | P 5 0 1 0 -35 -45 -35 -115 50 -115 50 -45 -35 -45 N
84 | P 5 0 1 0 15 -95 10 -100 5 -100 0 -95 0 -65 N
85 | P 7 0 1 0 -75 -30 -54 -10 -54 -30 -24 0 -44 -10 -34 -20 -24 0 N
86 | P 7 0 1 0 25 -60 25 -100 35 -100 40 -95 40 -65 35 -60 25 -60 N
87 | X ~ 1 -300 100 100 R 50 50 1 1 P
88 | X ~ 2 -300 -100 100 R 50 50 1 1 P
89 | X ~ 4 300 -100 100 L 50 50 1 1 P
90 | X ~ 6 300 100 100 L 50 50 1 1 P
91 | ENDDRAW
92 | ENDDEF
93 | #
94 | # MOC3031S
95 | #
96 | DEF MOC3031S U 0 40 Y Y 1 F N
97 | F0 "U" 0 -200 50 H V L CNN
98 | F1 "MOC3031S" 0 200 50 H V L CNN
99 | F2 "" -200 -200 50 H V L CIN
100 | F3 "" -35 0 50 H V L CNN
101 | $FPLIST
102 | SMD-6*
103 | $ENDFPLIST
104 | DRAW
105 | C 90 -100 5 0 1 0 N
106 | C 90 100 5 0 1 0 N
107 | S -200 150 200 -150 0 1 10 N
108 | P 2 0 1 10 -150 -25 -100 -25 N
109 | P 2 0 1 0 5 -45 5 100 N
110 | P 2 0 1 0 5 100 90 100 N
111 | P 2 0 1 10 75 25 145 25 N
112 | P 2 0 1 0 90 -100 50 -100 N
113 | P 2 0 1 0 90 -100 90 -25 N
114 | P 2 0 1 0 90 -100 200 -100 N
115 | P 2 0 1 0 90 100 90 25 N
116 | P 2 0 1 0 90 100 200 100 N
117 | P 2 0 1 10 105 -25 35 -25 N
118 | P 3 0 1 0 -200 100 -125 100 -125 25 N
119 | P 3 0 1 0 -125 -25 -125 -100 -200 -100 N
120 | P 3 0 1 0 75 -25 60 -55 50 -55 N
121 | P 4 0 1 10 -125 -25 -150 25 -100 25 -125 -25 F
122 | P 4 0 1 0 -75 10 -54 30 -54 10 -24 40 N
123 | P 4 0 1 0 -25 -60 -10 -60 -25 -100 -10 -100 N
124 | P 4 0 1 0 -24 40 -44 30 -34 20 -24 40 N
125 | P 4 0 1 0 0 -65 5 -60 10 -60 15 -65 N
126 | P 4 0 1 10 60 -25 85 25 35 25 60 -25 F
127 | P 4 0 1 10 120 25 95 -25 145 -25 120 25 F
128 | P 5 0 1 0 -35 -45 -35 -115 50 -115 50 -45 -35 -45 N
129 | P 5 0 1 0 15 -95 10 -100 5 -100 0 -95 0 -65 N
130 | P 7 0 1 0 -75 -30 -54 -10 -54 -30 -24 0 -44 -10 -34 -20 -24 0 N
131 | P 7 0 1 0 25 -60 25 -100 35 -100 40 -95 40 -65 35 -60 25 -60 N
132 | X ~ 1 -300 100 100 R 50 50 1 1 P
133 | X ~ 2 -300 -100 100 R 50 50 1 1 P
134 | X ~ 4 300 -100 100 L 50 50 1 1 P
135 | X ~ 6 300 100 100 L 50 50 1 1 P
136 | ENDDRAW
137 | ENDDEF
138 | #
139 | #End Library
140 |
--------------------------------------------------------------------------------
/ElectronicDesignAutomation/WifiSwitch.net:
--------------------------------------------------------------------------------
1 | (export (version D)
2 | (design
3 | (source C:/Users/islkh/Documents/_Private/Bastleni/KiCad/WifiSwitch/WifiSwitch.sch)
4 | (date "15/07/2015 22:23:43")
5 | (tool "Eeschema (after 2015-mar-04 BZR unknown)-product")
6 | (sheet (number 1) (name /) (tstamps /)
7 | (title_block
8 | (title)
9 | (company)
10 | (rev)
11 | (date)
12 | (source WifiSwitch.sch)
13 | (comment (number 1) (value ""))
14 | (comment (number 2) (value ""))
15 | (comment (number 3) (value ""))
16 | (comment (number 4) (value "")))))
17 | (components
18 | (comp (ref U1)
19 | (value ESP8266_ESP3)
20 | (footprint WifiSwitch:ESP8266-ESP-03)
21 | (libsource (lib WifiSwitch) (part ESP8266_ESP3))
22 | (sheetpath (names /) (tstamps /))
23 | (tstamp 553681EC))
24 | (comp (ref U2)
25 | (value MOC3031S)
26 | (footprint WifiSwitch:DIP-6_SMD)
27 | (libsource (lib WifiSwitch) (part MOC3031S))
28 | (sheetpath (names /) (tstamps /))
29 | (tstamp 5537C87E))
30 | (comp (ref C1)
31 | (value AC_to_DC_convertor)
32 | (footprint WifiSwitch:AC_DC_Conv)
33 | (libsource (lib WifiSwitch) (part AC_to_DC_convertor))
34 | (sheetpath (names /) (tstamps /))
35 | (tstamp 5537CAC0))
36 | (comp (ref R2)
37 | (value 4K7)
38 | (footprint Resistors_SMD:R_1206_HandSoldering)
39 | (libsource (lib device) (part R))
40 | (sheetpath (names /) (tstamps /))
41 | (tstamp 5537CF64))
42 | (comp (ref R3)
43 | (value 330R)
44 | (footprint Resistors_SMD:R_1206_HandSoldering)
45 | (libsource (lib device) (part R))
46 | (sheetpath (names /) (tstamps /))
47 | (tstamp 5537CF81))
48 | (comp (ref P1)
49 | (value CONN_01X05)
50 | (footprint Pin_Headers:Pin_Header_Angled_1x05)
51 | (libsource (lib conn) (part CONN_01X05))
52 | (sheetpath (names /) (tstamps /))
53 | (tstamp 5537CFE5))
54 | (comp (ref P2)
55 | (value CONN_01X03)
56 | (footprint WifiSwitch:WirePad_3x-5mmDrill)
57 | (libsource (lib conn) (part CONN_01X03))
58 | (sheetpath (names /) (tstamps /))
59 | (tstamp 5537D049))
60 | (comp (ref U3)
61 | (value TRIAC)
62 | (footprint Transistors_TO-220:TO-220_Neutral123_Horizontal_LargePads)
63 | (libsource (lib device) (part TRIAC))
64 | (sheetpath (names /) (tstamps /))
65 | (tstamp 5537D078))
66 | (comp (ref R1)
67 | (value 220R)
68 | (footprint Resistors_SMD:R_1206_HandSoldering)
69 | (libsource (lib device) (part R))
70 | (sheetpath (names /) (tstamps /))
71 | (tstamp 55380183)))
72 | (libparts
73 | (libpart (lib WifiSwitch) (part AC_to_DC_convertor)
74 | (fields
75 | (field (name Reference) C)
76 | (field (name Value) AC_to_DC_convertor))
77 | (pins
78 | (pin (num 1) (name +3V3) (type input))
79 | (pin (num 2) (name GND) (type input))
80 | (pin (num 3) (name AC_240V) (type input))
81 | (pin (num 4) (name AC_240V) (type input))))
82 | (libpart (lib WifiSwitch) (part ESP8266_ESP3)
83 | (fields
84 | (field (name Reference) U)
85 | (field (name Value) ESP8266_ESP3))
86 | (pins
87 | (pin (num 1) (name GND) (type input))
88 | (pin (num 2) (name NC) (type input))
89 | (pin (num 3) (name TX) (type input))
90 | (pin (num 4) (name RX) (type input))
91 | (pin (num 5) (name GPIO16) (type input))
92 | (pin (num 6) (name CH_PD) (type input))
93 | (pin (num 7) (name ANT) (type input))
94 | (pin (num 8) (name VCC) (type input))
95 | (pin (num 9) (name GPIO14) (type input))
96 | (pin (num 10) (name GPIO12) (type input))
97 | (pin (num 11) (name GPIO13) (type input))
98 | (pin (num 12) (name GPIO15) (type input))
99 | (pin (num 13) (name GPIO2) (type input))
100 | (pin (num 14) (name GPIO0) (type input))))
101 | (libpart (lib WifiSwitch) (part MOC3031S)
102 | (description MOC3031S)
103 | (docs http://www.fairchildsemi.com/ds/MO/MOC3031M.pdf)
104 | (footprints
105 | (fp SMD-6*))
106 | (fields
107 | (field (name Reference) U)
108 | (field (name Value) MOC3031S))
109 | (pins
110 | (pin (num 1) (name ~) (type passive))
111 | (pin (num 2) (name ~) (type passive))
112 | (pin (num 4) (name ~) (type passive))
113 | (pin (num 6) (name ~) (type passive))))
114 | (libpart (lib device) (part R)
115 | (description Resistor)
116 | (footprints
117 | (fp R_*)
118 | (fp Resistor_*))
119 | (fields
120 | (field (name Reference) R)
121 | (field (name Value) R))
122 | (pins
123 | (pin (num 1) (name ~) (type passive))
124 | (pin (num 2) (name ~) (type passive))))
125 | (libpart (lib device) (part TRIAC)
126 | (fields
127 | (field (name Reference) U)
128 | (field (name Value) TRIAC))
129 | (pins
130 | (pin (num 1) (name ~) (type passive))
131 | (pin (num 2) (name ~) (type passive))
132 | (pin (num 3) (name ~) (type input))))
133 | (libpart (lib conn) (part CONN_01X05)
134 | (footprints
135 | (fp Pin_Header_Straight_1X05)
136 | (fp Pin_Header_Angled_1X05)
137 | (fp Socket_Strip_Straight_1X05)
138 | (fp Socket_Strip_Angled_1X05))
139 | (fields
140 | (field (name Reference) P)
141 | (field (name Value) CONN_01X05))
142 | (pins
143 | (pin (num 1) (name P1) (type passive))
144 | (pin (num 2) (name P2) (type passive))
145 | (pin (num 3) (name P3) (type passive))
146 | (pin (num 4) (name P4) (type passive))
147 | (pin (num 5) (name P5) (type passive))))
148 | (libpart (lib conn) (part CONN_01X03)
149 | (footprints
150 | (fp Pin_Header_Straight_1X03)
151 | (fp Pin_Header_Angled_1X03)
152 | (fp Socket_Strip_Straight_1X03)
153 | (fp Socket_Strip_Angled_1X03))
154 | (fields
155 | (field (name Reference) P)
156 | (field (name Value) CONN_01X03))
157 | (pins
158 | (pin (num 1) (name P1) (type passive))
159 | (pin (num 2) (name P2) (type passive))
160 | (pin (num 3) (name P3) (type passive)))))
161 | (libraries
162 | (library (logical conn)
163 | (uri "C:\\Program Files\\KiCad\\share\\kicad\\library\\conn.lib"))
164 | (library (logical device)
165 | (uri "C:\\Program Files\\KiCad\\share\\kicad\\library\\device.lib"))
166 | (library (logical WifiSwitch)
167 | (uri C:\Users\islkh\Documents\_Private\Bastleni\KiCad\WifiSwitch\WifiSwitch.lib)))
168 | (nets
169 | (net (code 1) (name "Net-(P1-Pad3)")
170 | (node (ref U1) (pin 3))
171 | (node (ref P1) (pin 3)))
172 | (net (code 2) (name "Net-(R1-Pad2)")
173 | (node (ref U1) (pin 11))
174 | (node (ref R1) (pin 2)))
175 | (net (code 3) (name "Net-(R1-Pad1)")
176 | (node (ref R1) (pin 1))
177 | (node (ref U2) (pin 1)))
178 | (net (code 4) (name GND)
179 | (node (ref U2) (pin 2))
180 | (node (ref U1) (pin 1))
181 | (node (ref C1) (pin 2))
182 | (node (ref P1) (pin 1))
183 | (node (ref U1) (pin 12)))
184 | (net (code 5) (name +3V3)
185 | (node (ref R2) (pin 2))
186 | (node (ref C1) (pin 1))
187 | (node (ref P1) (pin 5))
188 | (node (ref U1) (pin 13))
189 | (node (ref U1) (pin 8)))
190 | (net (code 6) (name "Net-(R3-Pad1)")
191 | (node (ref U3) (pin 3))
192 | (node (ref R3) (pin 1))
193 | (node (ref U2) (pin 4)))
194 | (net (code 7) (name "Net-(C1-Pad3)")
195 | (node (ref C1) (pin 3))
196 | (node (ref P2) (pin 3)))
197 | (net (code 8) (name "Net-(C1-Pad4)")
198 | (node (ref C1) (pin 4))
199 | (node (ref P2) (pin 2))
200 | (node (ref U3) (pin 2))
201 | (node (ref U2) (pin 6)))
202 | (net (code 9) (name "Net-(P1-Pad2)")
203 | (node (ref U1) (pin 4))
204 | (node (ref P1) (pin 2)))
205 | (net (code 10) (name "Net-(P1-Pad4)")
206 | (node (ref P1) (pin 4))
207 | (node (ref U1) (pin 14)))
208 | (net (code 11) (name "Net-(P2-Pad1)")
209 | (node (ref R3) (pin 2))
210 | (node (ref P2) (pin 1))
211 | (node (ref U3) (pin 1)))
212 | (net (code 12) (name "Net-(U1-Pad10)")
213 | (node (ref U1) (pin 10)))
214 | (net (code 13) (name "Net-(U1-Pad9)")
215 | (node (ref U1) (pin 9)))
216 | (net (code 14) (name "Net-(U1-Pad7)")
217 | (node (ref U1) (pin 7)))
218 | (net (code 15) (name "Net-(R2-Pad1)")
219 | (node (ref R2) (pin 1))
220 | (node (ref U1) (pin 6)))
221 | (net (code 16) (name "Net-(U1-Pad5)")
222 | (node (ref U1) (pin 5)))
223 | (net (code 17) (name "Net-(U1-Pad2)")
224 | (node (ref U1) (pin 2)))))
--------------------------------------------------------------------------------
/ElectronicDesignAutomation/WifiSwitch.pro:
--------------------------------------------------------------------------------
1 | update=15/07/2015 22:19:06
2 | version=1
3 | last_client=kicad
4 | [cvpcb]
5 | version=1
6 | NetIExt=net
7 | [general]
8 | version=1
9 | [eeschema]
10 | version=1
11 | LibDir=../WifiSwitch
12 | [eeschema/libraries]
13 | LibName1=power
14 | LibName2=device
15 | LibName3=transistors
16 | LibName4=conn
17 | LibName5=linear
18 | LibName6=regul
19 | LibName7=74xx
20 | LibName8=cmos4000
21 | LibName9=adc-dac
22 | LibName10=memory
23 | LibName11=xilinx
24 | LibName12=special
25 | LibName13=microcontrollers
26 | LibName14=dsp
27 | LibName15=microchip
28 | LibName16=analog_switches
29 | LibName17=motorola
30 | LibName18=texas
31 | LibName19=intel
32 | LibName20=audio
33 | LibName21=interface
34 | LibName22=digital-audio
35 | LibName23=philips
36 | LibName24=display
37 | LibName25=cypress
38 | LibName26=siliconi
39 | LibName27=opto
40 | LibName28=atmel
41 | LibName29=contrib
42 | LibName30=valves
43 | LibName31=WifiSwitch
44 | [schematic_editor]
45 | version=1
46 | PageLayoutDescrFile=
47 | PlotDirectoryName=
48 | SubpartIdSeparator=0
49 | SubpartFirstId=65
50 | NetFmtName=
51 | SpiceForceRefPrefix=0
52 | SpiceUseNetNumbers=0
53 | RptD_X=0
54 | RptD_Y=100
55 | RptLab=1
56 | LabSize=60
57 | [pcbnew]
58 | version=1
59 | PageLayoutDescrFile=
60 | LastNetListRead=
61 | UseCmpFile=1
62 | PadDrill=0
63 | PadDrillOvalY=0
64 | PadSizeH=2
65 | PadSizeV=1
66 | PcbTextSizeV=1.5
67 | PcbTextSizeH=1.5
68 | PcbTextThickness=0.3
69 | ModuleTextSizeV=1
70 | ModuleTextSizeH=1
71 | ModuleTextSizeThickness=0.15
72 | SolderMaskClearance=0
73 | SolderMaskMinWidth=0
74 | DrawSegmentWidth=0.2
75 | BoardOutlineThickness=0.09999999999999999
76 | ModuleOutlineThickness=0.15
77 |
--------------------------------------------------------------------------------
/ElectronicDesignAutomation/WifiSwitch.sch:
--------------------------------------------------------------------------------
1 | EESchema Schematic File Version 2
2 | LIBS:power
3 | LIBS:device
4 | LIBS:transistors
5 | LIBS:conn
6 | LIBS:linear
7 | LIBS:regul
8 | LIBS:74xx
9 | LIBS:cmos4000
10 | LIBS:adc-dac
11 | LIBS:memory
12 | LIBS:xilinx
13 | LIBS:special
14 | LIBS:microcontrollers
15 | LIBS:dsp
16 | LIBS:microchip
17 | LIBS:analog_switches
18 | LIBS:motorola
19 | LIBS:texas
20 | LIBS:intel
21 | LIBS:audio
22 | LIBS:interface
23 | LIBS:digital-audio
24 | LIBS:philips
25 | LIBS:display
26 | LIBS:cypress
27 | LIBS:siliconi
28 | LIBS:opto
29 | LIBS:atmel
30 | LIBS:contrib
31 | LIBS:valves
32 | LIBS:WifiSwitch
33 | LIBS:WifiSwitch-cache
34 | EELAYER 25 0
35 | EELAYER END
36 | $Descr A4 11693 8268
37 | encoding utf-8
38 | Sheet 1 1
39 | Title ""
40 | Date ""
41 | Rev ""
42 | Comp ""
43 | Comment1 ""
44 | Comment2 ""
45 | Comment3 ""
46 | Comment4 ""
47 | $EndDescr
48 | $Comp
49 | L ESP8266_ESP3 U1
50 | U 1 1 553681EC
51 | P 4300 3700
52 | F 0 "U1" H 4550 3350 60 0000 C CNN
53 | F 1 "ESP8266_ESP3" H 4300 4200 60 0000 C CNN
54 | F 2 "WifiSwitch:ESP8266-ESP-03" H 4300 3700 60 0001 C CNN
55 | F 3 "" H 4300 3700 60 0000 C CNN
56 | 1 4300 3700
57 | 1 0 0 -1
58 | $EndComp
59 | $Comp
60 | L MOC3031S U2
61 | U 1 1 5537C87E
62 | P 5500 2700
63 | F 0 "U2" H 5500 2500 50 0000 L CNN
64 | F 1 "MOC3031S" H 5500 2900 50 0000 L CNN
65 | F 2 "WifiSwitch:DIP-6_SMD" H 5300 2500 50 0001 L CIN
66 | F 3 "" H 5465 2700 50 0000 L CNN
67 | 1 5500 2700
68 | 1 0 0 -1
69 | $EndComp
70 | $Comp
71 | L R R2
72 | U 1 1 5537CF64
73 | P 5500 3650
74 | F 0 "R2" V 5580 3650 50 0000 C CNN
75 | F 1 "4K7" V 5500 3650 50 0000 C CNN
76 | F 2 "Resistors_SMD:R_1206_HandSoldering" V 5430 3650 30 0001 C CNN
77 | F 3 "" H 5500 3650 30 0000 C CNN
78 | 1 5500 3650
79 | 1 0 0 -1
80 | $EndComp
81 | $Comp
82 | L R R3
83 | U 1 1 5537CF81
84 | P 6100 3300
85 | F 0 "R3" V 6180 3300 50 0000 C CNN
86 | F 1 "330R" V 6100 3300 50 0000 C CNN
87 | F 2 "Resistors_SMD:R_1206_HandSoldering" V 6030 3300 30 0001 C CNN
88 | F 3 "" H 6100 3300 30 0000 C CNN
89 | 1 6100 3300
90 | 1 0 0 -1
91 | $EndComp
92 | $Comp
93 | L CONN_01X05 P1
94 | U 1 1 5537CFE5
95 | P 4300 4750
96 | F 0 "P1" H 4300 5050 50 0000 C CNN
97 | F 1 "CONN_01X05" V 4400 4750 50 0000 C CNN
98 | F 2 "Pin_Headers:Pin_Header_Angled_1x05" H 4300 4750 60 0001 C CNN
99 | F 3 "" H 4300 4750 60 0000 C CNN
100 | 1 4300 4750
101 | 0 1 1 0
102 | $EndComp
103 | $Comp
104 | L CONN_01X03 P2
105 | U 1 1 5537D049
106 | P 7750 2650
107 | F 0 "P2" H 7750 2850 50 0000 C CNN
108 | F 1 "CONN_01X03" V 7850 2650 50 0000 C CNN
109 | F 2 "WifiSwitch:WirePad_3x-5mmDrill" H 7750 2650 60 0001 C CNN
110 | F 3 "" H 7750 2650 60 0000 C CNN
111 | 1 7750 2650
112 | 1 0 0 -1
113 | $EndComp
114 | $Comp
115 | L TRIAC U3
116 | U 1 1 5537D078
117 | P 6900 2750
118 | F 0 "U3" H 6650 3100 50 0000 C CNN
119 | F 1 "TRIAC" H 6600 2500 50 0000 C CNN
120 | F 2 "Transistors_TO-220:TO-220_Neutral123_Horizontal_LargePads" H 6900 2750 60 0001 C CNN
121 | F 3 "" H 6900 2750 60 0000 C CNN
122 | 1 6900 2750
123 | 1 0 0 -1
124 | $EndComp
125 | $Comp
126 | L GND #PWR01
127 | U 1 1 5537D847
128 | P 2900 5400
129 | F 0 "#PWR01" H 2900 5150 50 0001 C CNN
130 | F 1 "GND" H 2900 5250 50 0000 C CNN
131 | F 2 "" H 2900 5400 60 0000 C CNN
132 | F 3 "" H 2900 5400 60 0000 C CNN
133 | 1 2900 5400
134 | 1 0 0 -1
135 | $EndComp
136 | Wire Wire Line
137 | 2900 5400 2900 5250
138 | Wire Wire Line
139 | 5200 2800 5200 5250
140 | Connection ~ 5200 5250
141 | Connection ~ 5200 3950
142 | Wire Wire Line
143 | 3750 3750 3500 3750
144 | Wire Wire Line
145 | 3500 3750 3500 5250
146 | Connection ~ 3500 5250
147 | Wire Wire Line
148 | 4800 3450 5500 3450
149 | Wire Wire Line
150 | 6900 2350 6900 1900
151 | Wire Wire Line
152 | 6250 1900 8050 1900
153 | Wire Wire Line
154 | 6900 3000 6900 3600
155 | Wire Wire Line
156 | 6100 3600 7350 3600
157 | Wire Wire Line
158 | 8050 1900 8050 4200
159 | Wire Wire Line
160 | 6100 3450 6100 3600
161 | Connection ~ 6900 3600
162 | Wire Wire Line
163 | 6400 2950 6100 2950
164 | Connection ~ 6100 2950
165 | Wire Wire Line
166 | 5800 2600 6250 2600
167 | Wire Wire Line
168 | 6250 2600 6250 1900
169 | Connection ~ 6900 1900
170 | Wire Wire Line
171 | 6300 4200 6050 4200
172 | Wire Wire Line
173 | 3600 4100 6300 4100
174 | Wire Wire Line
175 | 3750 3350 3600 3350
176 | $Comp
177 | L R R1
178 | U 1 1 55380183
179 | P 4550 2600
180 | F 0 "R1" V 4630 2600 50 0000 C CNN
181 | F 1 "220R" V 4550 2600 50 0000 C CNN
182 | F 2 "Resistors_SMD:R_1206_HandSoldering" V 4480 2600 30 0001 C CNN
183 | F 3 "" H 4550 2600 30 0000 C CNN
184 | 1 4550 2600
185 | 0 1 1 0
186 | $EndComp
187 | Wire Wire Line
188 | 5200 2600 4700 2600
189 | Wire Wire Line
190 | 4400 2600 3500 2600
191 | Wire Wire Line
192 | 3500 2600 3500 3650
193 | Wire Wire Line
194 | 3500 3650 3750 3650
195 | Wire Wire Line
196 | 3700 3850 3750 3850
197 | Wire Wire Line
198 | 3600 3350 3600 4550
199 | Wire Wire Line
200 | 4500 4550 4500 4400
201 | Wire Wire Line
202 | 4500 4400 4700 4400
203 | Wire Wire Line
204 | 4700 4400 4700 5250
205 | Connection ~ 4700 5250
206 | Wire Wire Line
207 | 3600 4550 4100 4550
208 | Connection ~ 3600 4100
209 | Wire Wire Line
210 | 3750 3950 3700 3950
211 | Wire Wire Line
212 | 3700 3950 3700 4450
213 | Wire Wire Line
214 | 4800 3950 5200 3950
215 | Wire Wire Line
216 | 5500 3800 5500 4100
217 | Connection ~ 5500 4100
218 | Wire Wire Line
219 | 4800 3750 4900 3750
220 | Wire Wire Line
221 | 4300 4200 4300 4550
222 | Wire Wire Line
223 | 4800 3650 5000 3650
224 | Wire Wire Line
225 | 5000 3650 5000 4300
226 | Wire Wire Line
227 | 3700 4450 4200 4450
228 | Wire Wire Line
229 | 4200 4450 4200 4550
230 | Wire Wire Line
231 | 5000 4300 4400 4300
232 | Wire Wire Line
233 | 4400 4300 4400 4550
234 | Wire Wire Line
235 | 4300 4200 4900 4200
236 | Wire Wire Line
237 | 4900 4200 4900 3750
238 | Wire Wire Line
239 | 5200 5250 2900 5250
240 | $Comp
241 | L GND #PWR02
242 | U 1 1 55382AE7
243 | P 6050 5400
244 | F 0 "#PWR02" H 6050 5150 50 0001 C CNN
245 | F 1 "GND" H 6050 5250 50 0000 C CNN
246 | F 2 "" H 6050 5400 60 0000 C CNN
247 | F 3 "" H 6050 5400 60 0000 C CNN
248 | 1 6050 5400
249 | 1 0 0 -1
250 | $EndComp
251 | Wire Wire Line
252 | 6050 4200 6050 5400
253 | Wire Wire Line
254 | 8050 4200 7550 4200
255 | Wire Wire Line
256 | 7550 2750 7550 4100
257 | Wire Wire Line
258 | 7550 2550 7350 2550
259 | Wire Wire Line
260 | 7350 2550 7350 3600
261 | Wire Wire Line
262 | 7550 2650 7450 2650
263 | Wire Wire Line
264 | 7450 2650 7450 1900
265 | Connection ~ 7450 1900
266 | $Comp
267 | L +3V3 #PWR03
268 | U 1 1 5538D308
269 | P 6100 4000
270 | F 0 "#PWR03" H 6100 3850 50 0001 C CNN
271 | F 1 "+3V3" H 6100 4140 50 0000 C CNN
272 | F 2 "" H 6100 4000 60 0000 C CNN
273 | F 3 "" H 6100 4000 60 0000 C CNN
274 | 1 6100 4000
275 | 1 0 0 -1
276 | $EndComp
277 | Wire Wire Line
278 | 6100 4000 6100 4100
279 | Connection ~ 6100 4100
280 | Wire Wire Line
281 | 6100 2800 6100 3150
282 | Wire Wire Line
283 | 6100 2800 5800 2800
284 | Wire Wire Line
285 | 3700 3850 3700 3350
286 | Connection ~ 3700 3350
287 | Wire Wire Line
288 | 5500 3450 5500 3500
289 | $Comp
290 | L AC_to_DC_convertor C1
291 | U 1 1 5537CAC0
292 | P 6950 4200
293 | F 0 "C1" H 7050 4100 60 0000 C CNN
294 | F 1 "AC_to_DC_convertor" H 6950 4450 60 0000 C CNN
295 | F 2 "WifiSwitch:AC_DC_Conv" H 7050 4200 60 0001 C CNN
296 | F 3 "" H 7050 4200 60 0000 C CNN
297 | 1 6950 4200
298 | 1 0 0 -1
299 | $EndComp
300 | $EndSCHEMATC
301 |
--------------------------------------------------------------------------------
/ElectronicDesignAutomation/WifiSwitch.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | C:/Users/isaxs/Documents/GitHub/ESP_WiFiSwitch/ElectronicDesignAutomation/WifiSwitch.sch
5 | 06.07.2015 23:57:02
6 | Eeschema (after 2015-mar-04 BZR unknown)-product
7 |
8 |
9 |
10 |
11 |
12 |
13 | WifiSwitch.sch
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | ESP8266_ESP3
24 | WifiSwitch:ESP8266-ESP-03
25 |
26 |
27 | 553681EC
28 |
29 |
30 | MOC3031S
31 | WifiSwitch:DIP-6_SMD
32 |
33 |
34 | 5537C87E
35 |
36 |
37 | AC_to_DC_convertor
38 | WifiSwitch:AC_DC_Conv
39 |
40 |
41 | 5537CAC0
42 |
43 |
44 | 10K
45 | Resistors_SMD:R_1206_HandSoldering
46 |
47 |
48 | 5537CF64
49 |
50 |
51 | 330R
52 | Resistors_SMD:R_1206_HandSoldering
53 |
54 |
55 | 5537CF81
56 |
57 |
58 | CONN_01X05
59 | Pin_Headers:Pin_Header_Angled_1x05
60 |
61 |
62 | 5537CFE5
63 |
64 |
65 | CONN_01X03
66 | WifiSwitch:WirePad_3x-5mmDrill
67 |
68 |
69 | 5537D049
70 |
71 |
72 | TRIAC
73 | Transistors_TO-220:TO-220_Neutral123_Horizontal_LargePads
74 |
75 |
76 | 5537D078
77 |
78 |
79 | 220R
80 | Resistors_SMD:R_1206_HandSoldering
81 |
82 |
83 | 55380183
84 |
85 |
86 |
87 |
88 | Resistor
89 |
90 | R_*
91 | Resistor_*
92 |
93 |
94 | R
95 | R
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 | U
105 | TRIAC
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 | Pin_Header_Straight_1X03
116 | Pin_Header_Angled_1X03
117 | Socket_Strip_Straight_1X03
118 | Socket_Strip_Angled_1X03
119 |
120 |
121 | P
122 | CONN_01X03
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 | Pin_Header_Straight_1X05
133 | Pin_Header_Angled_1X05
134 | Socket_Strip_Straight_1X05
135 | Socket_Strip_Angled_1X05
136 |
137 |
138 | P
139 | CONN_01X05
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 | C
152 | AC_to_DC_convertor
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 | U
164 | ESP8266_ESP3
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 | MOC3031S
185 | http://www.fairchildsemi.com/ds/MO/MOC3031M.pdf
186 |
187 | SMD-6*
188 |
189 |
190 | U
191 | MOC3031S
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 | C:\Program Files\KiCad\share\kicad\library\device.lib
204 |
205 |
206 | C:\Program Files\KiCad\share\kicad\library\conn.lib
207 |
208 |
209 | C:\Users\isaxs\Documents\GitHub\ESP_WiFiSwitch\ElectronicDesignAutomation\WifiSwitch.lib
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 | {one line to give the program's name and a brief idea of what it does.}
635 | Copyright (C) {year} {name of author}
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | {project} Copyright (C) {year} {fullname}
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
676 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ESP WiFiSwitch
2 | ## General info
3 | This sketch is for a WiFi enabled wall light switch with focus to reliable pushbutton switch.
4 | In the beginning or (if no WiFi connection) it is running a web server to configure WiFI (and MQTT if desired).
5 | Each second start up switch will load into OTA mode. By this you can upload a new firmware (compiled *.bin file) via web browser. The OTA mode will end after set timeout and restart into desired mode.
6 | The operation mode can be web server or MQTT to change the state of the light.
7 | The push button have to switch to ground.
8 | ## Button functions
9 | * Normal press less than 1 sec but more than 50ms-> Switch light.
10 | * Restart press: 3 sec -> Restart the module.
11 | * Reset press: 20 sec -> Clear the settings in EEPROM
12 |
13 | ## URL adresses
14 | * While a WiFi config is not set or can't connect:
15 | * http://server_ip
16 | *-> Gives a WiFi config page
17 |
18 | * While a WiFi config is set and in Web control mode (iotMode==0):
19 | * http://server_ip/gpio
20 | * Will display the GIPIO state and a switch form for it
21 |
22 | * http://server_ip/gpio?state=0
23 | * Will change the GPIO directly and display the above aswell
24 |
25 | * http://server_ip/cleareeprom
26 | * Will reset the WiFi setting and rest to configure mode as AP
27 | *
28 | * While in OTA mode each second start:
29 | * http://server_ip
30 | *-> Gives a WiFi config page
31 |
32 | server_ip is the IP address of the ESP8266 module, will be printed to Serial when the module is connected.
33 |
34 | ## Hardware setup
35 | Your WiFi switch should be connected like this
36 |
37 | 
38 |
39 | You can reorder the working PCB here: https://oshpark.com/shared_projects/xoEZ3PnV or get it from any where else from the KiCad design files "ElectronicDesignAutomation" folder.
40 |
41 | ## Parts list
42 | * ESP8266-03 module
43 | * AC to DC Power Module Supply Isolation Input: AC90-240V Output: 3.3V 500mA like this * http://www.ebay.com/itm/271636529720?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
44 | * Resistor 220 Ohm SMD 1206 1x
45 | * Resistor 330 Ohm SMD 1206 1x
46 | * Resistor 4k7 SMD 1206 1x
47 | * Optocuppler MOC3040 SMD 1x
48 | * Tryac BT136D 1x
49 |
50 | ## Usage
51 | For default usage you can use the pre build firmware and flash it with NodeMcu flasher.
52 |
53 | After fresh flash please restart the module manualy (power Off & On) otherwise software restart will not work and sometimes WiFi connect does not work.
54 |
55 | When manually compile and flash with Arduino IDE please make sure to have this flash settings: 
56 |
57 | Open the modules page after entering config mode (Press button >20secs if you want to enter again) via http://server_ip there you can setup to be MQTT controled or Web controled.
58 |
59 | ## Credits
60 | For several snippets used the credit goes to:
61 | - https://github.com/esp8266
62 | - https://github.com/chriscook8/esp-arduino-apboot
63 | - https://github.com/knolleary/pubsubclient
64 | - https://github.com/vicatcu/pubsubclient <- Currently this needs to be used instead of the origin
65 | - https://gist.github.com/igrr/7f7e7973366fc01d6393
66 | - http://www.esp8266.com/viewforum.php?f=25
67 | - http://www.esp8266.com/viewtopic.php?f=29&t=2745
68 | - And the whole Arduino and ESP8266 comunity
69 |
--------------------------------------------------------------------------------
/helperFunctions.ino:
--------------------------------------------------------------------------------
1 | //-------------------------------- Help functions ---------------------------
2 |
3 |
4 | String macToStr(const uint8_t* mac)
5 | {
6 | String result;
7 | for (int i = 3; i < 6; ++i) {
8 | result += String(mac[i], 16);
9 | if (i < 5)
10 | result += ':';
11 | }
12 | return result;
13 | }
14 |
15 |
16 | void otaCountown(){
17 | if(otaCount>0 && otaFlag==1) {
18 | otaCount--;
19 | Serial.println(otaCount);
20 | }
21 | }
22 | #ifdef WEBOTA
23 | void ota(){
24 | //Debugln("OTA.");
25 | if (OTA.parsePacket()) {
26 | IPAddress remote = OTA.remoteIP();
27 | int cmd = OTA.parseInt();
28 | int port = OTA.parseInt();
29 | int size = OTA.parseInt();
30 |
31 | Serial.print("Update Start: ip:");
32 | Serial.print(remote);
33 | Serial.printf(", port:%d, size:%d\n", port, size);
34 | uint32_t startTime = millis();
35 |
36 | WiFiUDP::stopAll();
37 |
38 | if(!Update.begin(size)){
39 | Serial.println("Update Begin Error");
40 | return;
41 | }
42 |
43 | WiFiClient clientWiFi;
44 | if (clientWiFi.connect(remote, port)) {
45 |
46 | uint32_t written;
47 | while(!Update.isFinished()){
48 | written = Update.write(clientWiFi);
49 | if(written > 0) clientWiFi.print(written, DEC);
50 | }
51 | Serial.setDebugOutput(false);
52 |
53 | if(Update.end()){
54 | clientWiFi.println("OK");
55 | Serial.printf("Update Success: %u\nRebooting...\n", millis() - startTime);
56 | ESP.restart();
57 | } else {
58 | Update.printError(clientWiFi);
59 | Update.printError(Serial);
60 | }
61 | } else {
62 | Serial.printf("Connect Failed: %u\n", millis() - startTime);
63 | }
64 | }
65 | //IDE Monitor (connected to Serial)
66 | if (TelnetServer.hasClient()){
67 | if (!Telnet || !Telnet.connected()){
68 | if(Telnet) Telnet.stop();
69 | Telnet = TelnetServer.available();
70 | } else {
71 | WiFiClient toKill = TelnetServer.available();
72 | toKill.stop();
73 | }
74 | }
75 | if (Telnet && Telnet.connected() && Telnet.available()){
76 | while(Telnet.available())
77 | Serial.write(Telnet.read());
78 | }
79 | if(Serial.available()){
80 | size_t len = Serial.available();
81 | uint8_t * sbuf = (uint8_t *)malloc(len);
82 | Serial.readBytes(sbuf, len);
83 | if (Telnet && Telnet.connected()){
84 | Telnet.write((uint8_t *)sbuf, len);
85 | yield();
86 | }
87 | free(sbuf);
88 | }
89 | }
90 | #endif
91 |
--------------------------------------------------------------------------------
/mqttFunctions.ino:
--------------------------------------------------------------------------------
1 | boolean connectMQTT(){
2 | if (mqttClient.connected()){
3 | return true;
4 | }
5 |
6 | Serial.print("Connecting to MQTT server ");
7 | Serial.print(mqttServer);
8 | Serial.print(" as ");
9 | Serial.println(host);
10 |
11 | if (mqttClient.connect(host)) {
12 | Serial.println("Connected to MQTT broker");
13 | if(mqttClient.subscribe((char*)subTopic.c_str())){
14 | Serial.println("Subsribed to topic.");
15 | } else {
16 | Serial.println("NOT subsribed to topic!");
17 | }
18 | return true;
19 | }
20 | else {
21 | Serial.println("MQTT connect failed! ");
22 | return false;
23 | }
24 | }
25 |
26 | void disconnectMQTT(){
27 | mqttClient.disconnect();
28 | }
29 |
30 | void mqtt_handler(){
31 | if (toPub==1){
32 | Debugln("DEBUG: Publishing state via MWTT");
33 | if(pubState()){
34 | toPub=0;
35 | }
36 | }
37 | mqttClient.loop();
38 | delay(100); //let things happen in background
39 | }
40 |
41 | void mqtt_arrived(char* subTopic, byte* payload, unsigned int length) { // handle messages arrived
42 | int i = 0;
43 | Serial.print("MQTT message arrived: topic: " + String(subTopic));
44 | // create character buffer with ending null terminator (string)
45 | for(i=0; i";
66 | st +=i + 1;
67 | st += ": ";
68 | st += WiFi.SSID(i);
69 | st += " (";
70 | st += WiFi.RSSI(i);
71 | st += ")";
72 | st += (WiFi.encryptionType(i) == ENC_TYPE_NONE)?" (OPEN)":"*";
73 | st += "";
74 | delay(10);
75 | }
76 | st += "";
77 | }
78 | Serial.println("");
79 | WiFi.disconnect();
80 | delay(100);
81 | WiFi.mode(WIFI_AP);
82 |
83 |
84 | WiFi.softAP(host);
85 | WiFi.begin(host); // not sure if need but works
86 | Serial.print("Access point started with name ");
87 | Serial.println(host);
88 | inApMode=1;
89 | launchWeb(1);
90 | }
91 |
92 | void launchWeb(int webtype) {
93 | Serial.println("");
94 | Serial.println("WiFi connected");
95 | //Start the web server or MQTT
96 | if(otaFlag==1 && !inApMode){
97 | Serial.println("Starting OTA mode.");
98 | Serial.printf("Sketch size: %u\n", ESP.getSketchSize());
99 | Serial.printf("Free size: %u\n", ESP.getFreeSketchSpace());
100 | MDNS.begin(host);
101 | server.on("/", HTTP_GET, [](){
102 | server.sendHeader("Connection", "close");
103 | server.sendHeader("Access-Control-Allow-Origin", "*");
104 | server.send(200, "text/html", otaServerIndex);
105 | });
106 | server.on("/update", HTTP_POST, [](){
107 | server.sendHeader("Connection", "close");
108 | server.sendHeader("Access-Control-Allow-Origin", "*");
109 | server.send(200, "text/plain", (Update.hasError())?"FAIL":"OK");
110 | setOtaFlag(0);
111 | ESP.restart();
112 | },[](){
113 | HTTPUpload& upload = server.upload();
114 | if(upload.status == UPLOAD_FILE_START){
115 | //Serial.setDebugOutput(true);
116 | WiFiUDP::stopAll();
117 | Serial.printf("Update: %s\n", upload.filename.c_str());
118 | otaCount=300;
119 | uint32_t maxSketchSpace = (ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000;
120 | if(!Update.begin(maxSketchSpace)){//start with max available size
121 | Update.printError(Serial);
122 | }
123 | } else if(upload.status == UPLOAD_FILE_WRITE){
124 | if(Update.write(upload.buf, upload.currentSize) != upload.currentSize){
125 | Update.printError(Serial);
126 | }
127 | } else if(upload.status == UPLOAD_FILE_END){
128 | if(Update.end(true)){ //true to set the size to the current progress
129 | Serial.printf("Update Success: %u\nRebooting...\n", upload.totalSize);
130 | } else {
131 | Update.printError(Serial);
132 | }
133 | Serial.setDebugOutput(false);
134 | }
135 | yield();
136 | });
137 | server.begin();
138 | Serial.printf("Ready! Open http://%s.local in your browser\n", host);
139 | MDNS.addService("http", "tcp", 80);
140 | otaTickLoop.attach(1, otaCountown);
141 | } else {
142 | //setOtaFlag(1);
143 | if (webtype==1 || iotMode==0){ //in config mode or WebControle
144 | if (webtype==1) {
145 | webtypeGlob == 1;
146 | Serial.println(WiFi.softAPIP());
147 | server.on("/", webHandleConfig);
148 | server.on("/a", webHandleConfigSave);
149 | } else {
150 | //setup DNS since we are a client in WiFi net
151 | if (!MDNS.begin(host)) {
152 | Serial.println("Error setting up MDNS responder!");
153 | } else {
154 | Serial.println("mDNS responder started");
155 | MDNS.addService("http", "tcp", 80);
156 | }
157 | Serial.println(WiFi.localIP());
158 | server.on("/", webHandleRoot);
159 | server.on("/cleareeprom", webHandleClearRom);
160 | server.on("/gpio", webHandleGpio);
161 | }
162 | //server.onNotFound(webHandleRoot);
163 | server.begin();
164 | Serial.println("Web server started");
165 | webtypeGlob=webtype; //Store global to use in loop()
166 | } else if(webtype!=1 && iotMode==1){ // in MQTT and not in config mode
167 | mqttClient.setBrokerDomain((char*) mqttServer.c_str());
168 | mqttClient.setPort(1883);
169 | mqttClient.setCallback(mqtt_arrived);
170 | mqttClient.setClient(wifiClient);
171 | if (WiFi.status() == WL_CONNECTED){
172 | if (!connectMQTT()){
173 | delay(2000);
174 | if (!connectMQTT()){
175 | Serial.println("Could not connect MQTT.");
176 | Serial.println("Starting web server instead.");
177 | iotMode=0;
178 | launchWeb(0);
179 | webtypeGlob=webtype;
180 | }
181 | }
182 | }
183 | }
184 | }
185 | }
186 |
187 | void webHandleConfig(){
188 | IPAddress ip = WiFi.softAPIP();
189 | String ipStr = String(ip[0]) + '.' + String(ip[1]) + '.' + String(ip[2]) + '.' + String(ip[3]);
190 | String s;
191 |
192 | s = "Configuration of " + hostName + " at ";
193 | s += ipStr;
194 | s += "";
195 | s += st;
196 | s += "
";
204 | s += "\r\n\r\n";
205 | Serial.println("Sending 200");
206 | server.send(200, "text/html", s);
207 | }
208 |
209 | void webHandleConfigSave(){
210 | // /a?ssid=blahhhh&pass=poooo
211 | String s;
212 | s = "Settings saved to eeprom and reset to boot into new settings
\r\n\r\n";
213 | server.send(200, "text/html", s);
214 | Serial.println("clearing EEPROM.");
215 | clearConfig();
216 | String qsid;
217 | qsid = server.arg("ssid");
218 | qsid.replace("%2F","/");
219 | Serial.println("Got SSID: " + qsid);
220 | esid = (char*) qsid.c_str();
221 |
222 | String qpass;
223 | qpass = server.arg("pass");
224 | qpass.replace("%2F","/");
225 | Serial.println("Got pass: " + qpass);
226 | epass = (char*) qpass.c_str();
227 |
228 | String qiot;
229 | qiot= server.arg("iot");
230 | Serial.println("Got iot mode: " + qiot);
231 | qiot=="0"? iotMode = 0 : iotMode = 1 ;
232 |
233 | String qsubTop;
234 | qsubTop = server.arg("subtop");
235 | qsubTop.replace("%2F","/");
236 | Serial.println("Got subtop: " + qsubTop);
237 | subTopic = (char*) qsubTop.c_str();
238 |
239 | String qpubTop;
240 | qpubTop = server.arg("pubtop");
241 | qpubTop.replace("%2F","/");
242 | Serial.println("Got pubtop: " + qpubTop);
243 | pubTopic = (char*) qpubTop.c_str();
244 |
245 | mqttServer = (char*) server.arg("host").c_str();
246 | Serial.print("Got mqtt Server: ");
247 | Serial.println(mqttServer);
248 |
249 | Serial.print("Settings written ");
250 | saveConfig()? Serial.println("sucessfully.") : Serial.println("not succesfully!");;
251 | Serial.println("Restarting!");
252 | delay(1000);
253 | ESP.reset();
254 | }
255 |
256 | void webHandleRoot(){
257 | String s;
258 | s = "Hello from ESP8266";
259 | s += "
";
260 | s += "Controle GPIO
";
261 | s += "Clear settings an boot into Config mode
";
262 | s += "\r\n\r\n";
263 | Serial.println("Sending 200");
264 | server.send(200, "text/html", s);
265 | }
266 |
267 | void webHandleClearRom(){
268 | String s;
269 | s = "Clearing the config and reset to configure new wifi
";
270 | s += "