diff --git a/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/README.md b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/README.md index 7c5dd77..50a3712 100644 --- a/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/README.md +++ b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/README.md @@ -66,7 +66,7 @@ In this Archive you will find a 3d printable .stl file that will allow you to pr ## Software In this Archive you will find an Arduino sketch for the ESP8266 wireless chip. - +In the Software folder ### Prerequisites @@ -137,36 +137,36 @@ If you have soldered all components together and your ESP12f won't boot, you mig You need to desolder two IC's/ chips following the (visual) guide below. The electronics and coil are sandwiched between two layers of foil. To peel the foil away look for an opening near the lightning connector. -![picture](https://git.vvvvvvaria.org/then/opencoil-paracity/raw/branch/master/electronics/coil-mod/001-coil.jpg) +![picture](electronics/coil-mod/001-coil.jpg) -![picture](https://git.vvvvvvaria.org/then/opencoil-paracity/raw/branch/master/electronics/coil-mod/002-peel.jpg) +![picture](electronics/coil-mod/002-peel.jpg) You are then left over with the bare coil and flexible pcb. Here I already desoldered the lightning connector flex pcb. -![picture](https://git.vvvvvvaria.org/then/opencoil-paracity/raw/branch/master/electronics/coil-mod/003-bare-coil.jpg) +![picture](electronics/coil-mod/003-bare-coil.jpg) Remove the following chips indicated by the following silkscreen printing: * Q3 (chip markings: p7) * Q4 (chip markings: wsc7) -![picture](https://git.vvvvvvaria.org/then/opencoil-paracity/raw/branch/master/electronics/coil-mod/004-q3.jpg) -![picture](https://git.vvvvvvaria.org/then/opencoil-paracity/raw/branch/master/electronics/coil-mod/005-q4.jpg) +![picture](electronics/coil-mod/004-q3.jpg) +![picture](electronics/coil-mod/005-q4.jpg) A hot air reworking station + tweezers will make quick work of that (settings: 1 second on 320deg, moderate airflow). Without hot-air you could try a soldering iron or fine wire-cutters to simply cut away the chips. The flexible PCB is very fragile though. -![picture](https://git.vvvvvvaria.org/then/opencoil-paracity/raw/branch/master/electronics/coil-mod/006-hotair.jpg) +![picture](electronics/coil-mod/006-hotair.jpg) Step 1 completed! -![picture](https://git.vvvvvvaria.org/then/opencoil-paracity/raw/branch/master/electronics/coil-mod/007-hotair-done.jpg) +![picture](electronics/coil-mod/007-hotair-done.jpg) ##### Step 2 With both chips removed, you have to bridge two of the three (now) bare connections of the transistor Q4. I could not find a datasheet on this transistor so please refer to the photo's to see which pins. -![picture](https://git.vvvvvvaria.org/then/opencoil-paracity/raw/branch/master/electronics/coil-mod/008-bridge.jpg) +![picture](electronics/coil-mod/008-bridge.jpg) Done! -![picture](https://git.vvvvvvaria.org/then/opencoil-paracity/raw/branch/master/electronics/coil-mod/009-done.jpg) \ No newline at end of file +![picture](electronics/coil-mod/009-done.jpg) \ No newline at end of file diff --git a/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/001-coil.jpg b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/001-coil.jpg new file mode 100644 index 0000000..0179b62 Binary files /dev/null and b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/001-coil.jpg differ diff --git a/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/002-peel.jpg b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/002-peel.jpg new file mode 100644 index 0000000..7e94ffb Binary files /dev/null and b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/002-peel.jpg differ diff --git a/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/003-bare-coil.jpg b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/003-bare-coil.jpg new file mode 100644 index 0000000..0a37af4 Binary files /dev/null and b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/003-bare-coil.jpg differ diff --git a/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/004-q3.jpg b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/004-q3.jpg new file mode 100644 index 0000000..ce2b6ea Binary files /dev/null and b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/004-q3.jpg differ diff --git a/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/005-q4.jpg b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/005-q4.jpg new file mode 100644 index 0000000..12b0eb9 Binary files /dev/null and b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/005-q4.jpg differ diff --git a/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/006-hotair.jpg b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/006-hotair.jpg new file mode 100644 index 0000000..33585c8 Binary files /dev/null and b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/006-hotair.jpg differ diff --git a/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/007-hotair-done.jpg b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/007-hotair-done.jpg new file mode 100644 index 0000000..6b3946f Binary files /dev/null and b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/007-hotair-done.jpg differ diff --git a/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/008-bridge.jpg b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/008-bridge.jpg new file mode 100644 index 0000000..77aca10 Binary files /dev/null and b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/008-bridge.jpg differ diff --git a/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/009-done.jpg b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/009-done.jpg new file mode 100644 index 0000000..38cd6fb Binary files /dev/null and b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/electronics/coil-mod/009-done.jpg differ diff --git a/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/flash_this_code_on_esp/README.md b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/flash_this_code_on_esp/README.md deleted file mode 100644 index b19f878..0000000 --- a/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/flash_this_code_on_esp/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# opencoil-paracity: code - -### Prerequisites - -This guide assumes you have a 4MB ESP12F microcontroller and use Arduino IDE. - -* Board Manager: You will need to add the support for this board to your IDE (Arduino in this case), see: https://github.com/esp8266/Arduino -* SPIFFS: You will need to add SPIFFS file upload support to Arduino if you want to upload files to the ESP12F, see: https://github.com/esp8266/arduino-esp8266fs-plugin - - - -### Uploading Code -For ESP12F use the following settings in Arduino IDE - -* Board: Generic ESP8266 Module -* Builtin Led: 2 -* Upload Speed: 921600 -* CPU Frequency: 80 MHz -* Crystal Frequency: 26MHz -* Flash Size: 4MB (FS:3MB OTA: ~512KB) -* Flash Mode: DOUT -* Flash Frequency: 40MHz -* Reset Method: dtr (aka nodemcu) -* Debug port: Disabled -* Debug Level: none -* LwIP Variant: v2 Lower Memory -* VTables: Flash -* Exceptions: Legacy (new can return nullptr) -* Erase Flash: depends on if you want to change SSID, Files, or only Sketch -* Espressif FW: nonos-sdk 2.2.1+100 (190703) -* SSL Support: All SSL ciphers (most compatible) -* Port: depend if u are uploading Over The Air, or using a cable -* Programmer: AVRISP mkII - - -These settings give you about 2.471 KB of SPIFFS storage space for files and ~512KB sketch size - - -### Over The Air (OTA) Uploading - -* Connect to the hotspot created by the ESP12F. -* Launch Arduino, choose "esp at 192.168.4.1" as the port. -* If you don't see the port listed in Arduino (Tools > Port), restart Arduino IDE. - -You can upload your sketch and files wirelessly, there is one caveat: SPIFFS file uploads don't work with password protected uploads (line 42). Workaround: flash your sketch with line 42 commented out. Upload your files to SPIFFS, then uncomment the line and Upload the code. \ No newline at end of file diff --git a/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/flash_this_code_on_esp/paracity_gallery_v041/DNSServer.cpp b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/flash_this_code_on_esp/paracity_gallery_v041/DNSServer.cpp deleted file mode 100644 index 6552bec..0000000 --- a/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/flash_this_code_on_esp/paracity_gallery_v041/DNSServer.cpp +++ /dev/null @@ -1,166 +0,0 @@ -#include "./DNSServer.h" -#include -#include - -#define DEBUG -#define DEBUG_OUTPUT Serial - -DNSServer::DNSServer() -{ - _ttl = htonl(60); - _errorReplyCode = DNSReplyCode::NonExistentDomain; -} - -bool DNSServer::start(const uint16_t &port, const String &domainName, - const IPAddress &resolvedIP) -{ - _port = port; - _domainName = domainName; - _resolvedIP[0] = resolvedIP[0]; - _resolvedIP[1] = resolvedIP[1]; - _resolvedIP[2] = resolvedIP[2]; - _resolvedIP[3] = resolvedIP[3]; - downcaseAndRemoveWwwPrefix(_domainName); - return _udp.begin(_port) == 1; -} - -void DNSServer::setErrorReplyCode(const DNSReplyCode &replyCode) -{ - _errorReplyCode = replyCode; -} - -void DNSServer::setTTL(const uint32_t &ttl) -{ - _ttl = htonl(ttl); -} - -void DNSServer::stop() -{ - _udp.stop(); -} - -void DNSServer::downcaseAndRemoveWwwPrefix(String &domainName) -{ - domainName.toLowerCase(); - domainName.replace("www.", ""); - domainName.replace("https://", ""); -} - -void DNSServer::processNextRequest() -{ - _currentPacketSize = _udp.parsePacket(); - if (_currentPacketSize) - { - _buffer = (unsigned char*)malloc(_currentPacketSize * sizeof(char)); - _udp.read(_buffer, _currentPacketSize); - _dnsHeader = (DNSHeader*) _buffer; - - if (_dnsHeader->QR == DNS_QR_QUERY && - _dnsHeader->OPCode == DNS_OPCODE_QUERY && - requestIncludesOnlyOneQuestion() && - (_domainName == "*" || getDomainNameWithoutWwwPrefix() == _domainName) - ) - - { - replyWithIP(); - } - else if (_dnsHeader->QR == DNS_QR_QUERY) - { - replyWithCustomCode(); - } - - free(_buffer); - } -} - -bool DNSServer::requestIncludesOnlyOneQuestion() -{ - return ntohs(_dnsHeader->QDCount) == 1 && - _dnsHeader->ANCount == 0 && - _dnsHeader->NSCount == 0 && - _dnsHeader->ARCount == 0; -} - -String DNSServer::getDomainNameWithoutWwwPrefix() -{ - String parsedDomainName = ""; - unsigned char *start = _buffer + 12; - if (*start == 0) - { - return parsedDomainName; - } - int pos = 0; - while(true) - { - unsigned char labelLength = *(start + pos); - for(int i = 0; i < labelLength; i++) - { - pos++; - parsedDomainName += (char)*(start + pos); - } - pos++; - if (*(start + pos) == 0) - { - downcaseAndRemoveWwwPrefix(parsedDomainName); - return parsedDomainName; - } - else - { - parsedDomainName += "."; - } - } -} - -void DNSServer::replyWithIP() -{ - _dnsHeader->QR = DNS_QR_RESPONSE; - _dnsHeader->ANCount = _dnsHeader->QDCount; - _dnsHeader->QDCount = _dnsHeader->QDCount; - //_dnsHeader->RA = 1; - - _udp.beginPacket(_udp.remoteIP(), _udp.remotePort()); - _udp.write(_buffer, _currentPacketSize); - - _udp.write((uint8_t)192); // answer name is a pointer - _udp.write((uint8_t)12); // pointer to offset at 0x00c - - _udp.write((uint8_t)0); // 0x0001 answer is type A query (host address) - _udp.write((uint8_t)1); - - _udp.write((uint8_t)0); //0x0001 answer is class IN (internet address) - _udp.write((uint8_t)1); - - _udp.write((unsigned char*)&_ttl, 4); - - // Length of RData is 4 bytes (because, in this case, RData is IPv4) - _udp.write((uint8_t)0); - _udp.write((uint8_t)4); - _udp.write(_resolvedIP, sizeof(_resolvedIP)); - _udp.endPacket(); - - - - #ifdef DEBUG - DEBUG_OUTPUT.print("DNS responds: "); - DEBUG_OUTPUT.print(_resolvedIP[0]); - DEBUG_OUTPUT.print("."); - DEBUG_OUTPUT.print(_resolvedIP[1]); - DEBUG_OUTPUT.print("."); - DEBUG_OUTPUT.print(_resolvedIP[2]); - DEBUG_OUTPUT.print("."); - DEBUG_OUTPUT.print(_resolvedIP[3]); - DEBUG_OUTPUT.print(" for "); - DEBUG_OUTPUT.println(getDomainNameWithoutWwwPrefix()); - #endif -} - -void DNSServer::replyWithCustomCode() -{ - _dnsHeader->QR = DNS_QR_RESPONSE; - _dnsHeader->RCode = (unsigned char)_errorReplyCode; - _dnsHeader->QDCount = 0; - - _udp.beginPacket(_udp.remoteIP(), _udp.remotePort()); - _udp.write(_buffer, sizeof(DNSHeader)); - _udp.endPacket(); -} diff --git a/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/flash_this_code_on_esp/paracity_gallery_v041/DNSServer.h b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/flash_this_code_on_esp/paracity_gallery_v041/DNSServer.h deleted file mode 100755 index 2bade4b..0000000 --- a/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/flash_this_code_on_esp/paracity_gallery_v041/DNSServer.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef DNSServer_h -#define DNSServer_h -#include - -#define DNS_QR_QUERY 0 -#define DNS_QR_RESPONSE 1 -#define DNS_OPCODE_QUERY 0 - -enum class DNSReplyCode -{ - NoError = 0, - FormError = 1, - ServerFailure = 2, - NonExistentDomain = 3, - NotImplemented = 4, - Refused = 5, - YXDomain = 6, - YXRRSet = 7, - NXRRSet = 8 -}; - -struct DNSHeader -{ - uint16_t ID; // identification number - unsigned char RD : 1; // recursion desired - unsigned char TC : 1; // truncated message - unsigned char AA : 1; // authoritive answer - unsigned char OPCode : 4; // message_type - unsigned char QR : 1; // query/response flag - unsigned char RCode : 4; // response code - unsigned char Z : 3; // its z! reserved - unsigned char RA : 1; // recursion available - uint16_t QDCount; // number of question entries - uint16_t ANCount; // number of answer entries - uint16_t NSCount; // number of authority entries - uint16_t ARCount; // number of resource entries -}; - -class DNSServer -{ - public: - DNSServer(); - void processNextRequest(); - void setErrorReplyCode(const DNSReplyCode &replyCode); - void setTTL(const uint32_t &ttl); - - // Returns true if successful, false if there are no sockets available - bool start(const uint16_t &port, - const String &domainName, - const IPAddress &resolvedIP); - // stops the DNS server - void stop(); - - private: - WiFiUDP _udp; - uint16_t _port; - String _domainName; - unsigned char _resolvedIP[4]; - int _currentPacketSize; - unsigned char* _buffer; - DNSHeader* _dnsHeader; - uint32_t _ttl; - DNSReplyCode _errorReplyCode; - - void downcaseAndRemoveWwwPrefix(String &domainName); - String getDomainNameWithoutWwwPrefix(); - bool requestIncludesOnlyOneQuestion(); - void replyWithIP(); - void replyWithCustomCode(); -}; -#endif - diff --git a/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/flash_this_code_on_esp/paracity_gallery_v041/data/index.html b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/flash_this_code_on_esp/paracity_gallery_v041/data/index.html deleted file mode 100644 index c061527..0000000 --- a/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/flash_this_code_on_esp/paracity_gallery_v041/data/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - -hi - - - \ No newline at end of file diff --git a/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/flash_this_code_on_esp/paracity_gallery_v041/data/pic.jpg b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/flash_this_code_on_esp/paracity_gallery_v041/data/pic.jpg deleted file mode 100644 index f42774e..0000000 Binary files a/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/flash_this_code_on_esp/paracity_gallery_v041/data/pic.jpg and /dev/null differ diff --git a/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/flash_this_code_on_esp/paracity_gallery_v041/paracity_gallery_v041.ino b/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/flash_this_code_on_esp/paracity_gallery_v041/paracity_gallery_v041.ino deleted file mode 100644 index b786dc5..0000000 --- a/works/Dennis de Bel & Anton Jehle/paracity_gallery_v041/flash_this_code_on_esp/paracity_gallery_v041/paracity_gallery_v041.ino +++ /dev/null @@ -1,98 +0,0 @@ - // Captive portal with (arduino) OTA + SPIFFS - - #include - #include - #include - #include - #include // Over-the-Air updates - #include - #include "./DNSServer.h" // Dns server - #include // SPIFFS - - DNSServer dnsServer; - const byte DNS_PORT = 53; - - ESP8266WebServer server(80); - - #ifndef STASSID - #define STASSID "\xF0\x9F\x9B\xB4 UNFLASHED" - //#define STASPSK "mypassword" - #endif - - IPAddress apIP(192, 168, 4, 1); - const char* ssid = STASSID; - //const char* password = STAPSK; - - void setup() { - Serial.begin(115200); - Serial.println("Booting"); - - WiFi.mode(WIFI_AP); - WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0)); - WiFi.softAP(ssid); - dnsServer.start(DNS_PORT, "*", apIP); // redirect dns request to AP ip - - MDNS.begin("esp8266", WiFi.softAPIP()); - Serial.println("Ready"); - Serial.print("IP address: "); - Serial.println(WiFi.softAPIP()); - - //Over-the-Air updates - ArduinoOTA.setHostname("ESP8266"); - //ArduinoOTA.setPassword("change-me"); //disabled to allow data uploads - ArduinoOTA.begin(); - SPIFFS.begin(); - - //redirect all traffic to index.html - server.onNotFound([]() { - if(!handleFileRead(server.uri())){ - const char *metaRefreshStr = "

redirecting...

"; - server.send(200, "text/html", metaRefreshStr); - } - }); - - server.begin(); - - } - - void loop() { - dnsServer.processNextRequest(); - ArduinoOTA.handle(); - server.handleClient(); - delay(50); - } - - -String getContentType(String filename){ - if(server.hasArg("download")) return "application/octet-stream"; - else if(filename.endsWith(".htm")) return "text/html"; - else if(filename.endsWith(".html")) return "text/html"; - else if(filename.endsWith(".css")) return "text/css"; - else if(filename.endsWith(".js")) return "application/javascript"; - else if(filename.endsWith(".png")) return "image/png"; - else if(filename.endsWith(".gif")) return "image/gif"; - else if(filename.endsWith(".jpg")) return "image/jpeg"; - else if(filename.endsWith(".ico")) return "image/x-icon"; - else if(filename.endsWith(".xml")) return "text/xml"; - else if(filename.endsWith(".mp4")) return "video/mp4"; - else if(filename.endsWith(".pdf")) return "application/x-pdf"; - else if(filename.endsWith(".zip")) return "application/x-zip"; - else if(filename.endsWith(".gz")) return "application/x-gzip"; - return "text/plain"; -} - -//Given a file path, look for it in the SPIFFS file storage. Returns true if found, returns false if not found. -bool handleFileRead(String path){ - if(path.endsWith("/")) path += "index.html"; - String contentType = getContentType(path); - String pathWithGz = path + ".gz"; - if(SPIFFS.exists(pathWithGz) || SPIFFS.exists(path)){ - if(SPIFFS.exists(pathWithGz)) - path += ".gz"; - File file = SPIFFS.open(path, "r"); - size_t sent = server.streamFile(file, contentType); - file.close(); - return true; - } - return false; -}