{"action":"created","issue":{"url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/issues/2344","repository_url":"https://api.github.com/repos/arendst/Sonoff-Tasmota","labels_url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/issues/2344/labels{/name}","comments_url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/issues/2344/comments","events_url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/issues/2344/events","html_url":"https://github.com/arendst/Sonoff-Tasmota/issues/2344","id":310895250,"number":2344,"title":"Can't flash Tasmota on Sonoff Basic","user":{"login":"bachya","id":47216,"avatar_url":"https://avatars3.githubusercontent.com/u/47216?v=4","gravatar_id":"","url":"https://api.github.com/users/bachya","html_url":"https://github.com/bachya","followers_url":"https://api.github.com/users/bachya/followers","following_url":"https://api.github.com/users/bachya/following{/other_user}","gists_url":"https://api.github.com/users/bachya/gists{/gist_id}","starred_url":"https://api.github.com/users/bachya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bachya/subscriptions","organizations_url":"https://api.github.com/users/bachya/orgs","repos_url":"https://api.github.com/users/bachya/repos","events_url":"https://api.github.com/users/bachya/events{/privacy}","received_events_url":"https://api.github.com/users/bachya/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-04-03T15:52:18Z","updated_at":"2018-04-23T20:49:06Z","closed_at":"2018-04-04T16:14:57Z","author_association":"NONE","body":"Hi all – apologies for yet another \"I can't flash\" issue thread, but I've tried everything I can think of (and everything I've read in various other issues) and I just can't get it to work. I'm 99.9% certain this isn't a Tasmota issue, but given the expertise of everyone here, I'm hoping I can post everything I have and get your advice on how to proceed. I'm used to smashing through issues, so this is irking me. 😎 \r\n\r\nThanks in advance for stomaching all this; again, I offer it for completeness and in the hope that someone smarter than I can offer advice.\r\n\r\n# Hardware\r\n\r\n## Sonoff\r\n\r\nI'm using a [Sonoff Basic](https://www.aliexpress.com/item/ITEAD-Sonoff-Wireless-Wifi-Switch-For-Smart-Home-Automation-Relay-Module-10A-90-250V-220V-Support/32829067852.html). For reasons I'll share shortly, I assume this unit is using a firmware higher than 1.6.\r\n\r\n![img_8664](https://user-images.githubusercontent.com/47216/38258585-20dc588c-3720-11e8-94f3-be4f786cc7ab.JPG)\r\n\r\n## FTDI Converter\r\n\r\nI'm using a [FT232RL FT232 FTDI USB to TTL 3.3V 5.5V Serial Adapter Module Download Cable for Mini Port](https://www.aliexpress.com/item/FT232RL-FT232-USB-TO-TTL-5V-3-3V-Download-Cable-To-Serial-Adapter-Module-For-USB/32634246159.html) (a mouthful!). I've confirmed that connecting a Mini USB port provides 3.3v across VCC and GND.\r\n\r\n![img_3542](https://user-images.githubusercontent.com/47216/38258704-678762fe-3720-11e8-812e-b15eafd61f5b.JPG)\r\n\r\n## Computer\r\n\r\nI'm using a MacBook Pro (13-inch, 2017, Four Thunderbolt 3 Ports) running macOS High Sierra 10.13.4. I've installed [the VCP drivers for FTDI devices](http://www.ftdichip.com/Drivers/VCP.htm) (per this [comment](https://github.com/arendst/Sonoff-Tasmota/issues/957#issuecomment-338779258)) and can confirm (via `Apple > System Report > USB`) that the MacBook recognizes the FTDI adapter when connected:\r\n\r\n<img width=\"863\" alt=\"screen shot 2018-04-03 at 5 11 28 pm\" src=\"https://user-images.githubusercontent.com/47216/38280370-22a2df5a-3762-11e8-8a99-767345dc541c.png\">\r\n\r\nIt also appears as a loaded kext:\r\n\r\n```\r\n$ kextstat | grep FTDI\r\n  165    0 0xffffff7f83700000 0x7000     0x7000     com.FTDI.driver.FTDIUSBSerialDriver (2.4.2) E16D9540-AF63-36AD-94C4-B1164FBD6078 <110 50 5 4 3 1>\r\n```\r\n\r\n## USB Hub\r\n\r\nBecause this generation of MacBook is USB-C-only, I connect the Mini USB cable via a USB-C hub. Can't imagine this matters, but including it for completeness.\r\n\r\n![large-77391-5](https://user-images.githubusercontent.com/47216/38258969-18c3df2a-3721-11e8-9414-3c5bbd67d939.jpg)\r\n\r\n# Hardware Preparation Attempts\r\n\r\n## 1. Via SonOTA\r\n\r\nI first attempted to flash Tasmota via [SonOTA](https://github.com/mirko/SonOTA) (given that I've had success with it before). I got about 90% of the way through the process, but was halted at the last step (i.e., the \"FinalStage\" network). A comment on that project's issues page led me to believe that if I was having troubles, it might mean that I was using a Sonoff firmware higher than 1.6 and would need a manual flash.\r\n\r\nI share this with you not to debug SonOTA, but to let you know that \"something\" was flashed onto the Sonoff during this process. I can tell because the process of holding down the Sonoff button and seeing the green LED flash consistently no longer occurs (indicating, I assume, that the \"flash the firmware\" functionality present in the original Sonoff firmware might be gone?).\r\n\r\nAgain, providing for completeness.\r\n\r\n## 2. Via Serial Connection\r\n\r\nReading around, I deduced that I didn't specifically _need_ to solder header pins onto the Sonoff; rather, I could use [male-to-female Dupont cables](https://www.amazon.com/RioRand-Dupont-Male-Male-Female-Female-Female-Male/dp/B00J5NSOVA):\r\n\r\n* Connect the female ends to the correct pins on the FTDI converter\r\n* Manually hold the male pins in place through the correct holes on the Sonoff\r\n\r\nI attempted flashing via three different tools:\r\n\r\n* The Arduino IDE\r\n* PlatformIO\r\n* `esptool.py`\r\n\r\nFor each tool, I attempted a few different procedures, each with the same result (detailed in the next section). For completeness, these procedures are listed here.\r\n\r\n### Procedure 1\r\n\r\n1. Connect a cable between FTDI GND and Sonoff GND.\r\n2. Connect a cable between FTDI RX and Sonoff TX.\r\n3. Connect a cable between FTDI TX and Sonoff RX.\r\n4. Connect a cable to FTDI VCC and leave the male lead alone.\r\n4. Connect the Micro USB cable between the FTDI converter and the USB-C hub.\r\n5. Hold down the button on the Sonoff (bringing GPIO0 to GND).\r\n6. Insert the VCC male lead to 3v3.\r\n7. Let go of the button after 1-2 seconds.\r\n8. Attempt to flash.\r\n\r\n### Procedure 2\r\n\r\n1. Connect a cable between FTDI GND and Sonoff GND.\r\n2. Connect a cable between FTDI RX and Sonoff TX.\r\n3. Connect a cable between FTDI TX and Sonoff RX.\r\n4. Connect a cable between FTDI VCC and Sonoff 3v3.\r\n5. Hold down the button on the Sonoff (bringing GPIO0 to GND).\r\n6. Connect the Micro USB cable between the FTDI converter and the USB-C hub.\r\n7. Let go of the button after 1-2 seconds.\r\n8. Attempt to flash.\r\n\r\n### Procedure 3\r\n\r\n1. Connect a cable between FTDI GND and Sonoff GND.\r\n2. Connect a cable between FTDI RX and Sonoff TX.\r\n3. Connect a cable between FTDI TX and Sonoff RX.\r\n4. Connect a cable to FTDI VCC and leave the male lead alone.\r\n5. Connect the Micro USB cable between the FTDI converter and the USB-C hub.\r\n6. Hold down the button on the Sonoff (bringing GPIO0 to GND).\r\n7. Insert the VCC male lead to 3v3.\r\n8. Attempt to flash with the button held throughout.\r\n\r\n### Procedure 4\r\n\r\n1. Connect a cable between FTDI GND and Sonoff GND.\r\n2. Connect a cable between FTDI RX and Sonoff TX.\r\n3. Connect a cable between FTDI TX and Sonoff RX.\r\n4. Connect a cable between FTDI VCC and Sonoff 3v3.\r\n5. Hold down the button on the Sonoff (bringing GPIO0 to GND).\r\n6. Connect the Micro USB cable between the FTDI converter and the USB-C hub.\r\n7. Attempt to flash with the button held throughout.\r\n\r\n– – –\r\n\r\nIn all cases, the Sonoff LED never came on (flashing or otherwise). Anecdotally, if I connect only the `VCC -> 3v3` and `GND -> GND` pins, the LED flashes for a bit, goes dark, goes solid for a bit, goes dark, etc.\r\n\r\n# Flashing Attempts\r\n\r\n## 1. Arduino IDE\r\n\r\nFollowed the Tasmota instructions for the Arduino IDE. After 9-10 seconds, the IDE returns the following error:\r\n\r\n```\r\nwarning: espcomm_sync failed\r\nerror: espcomm_open failed\r\nerror: espcomm_upload_mem failed\r\n```\r\n\r\n## 2. PlatformIO\r\n\r\nFollowed the PlatformIO instructions for the Arduino IDE. After 9-10 seconds, the IDE returns the following error:\r\n\r\n```\r\n|   |-- <ESP8266HTTPClient> v1.1\r\n|   |   |-- <ESP8266WiFi> v1.0\r\n|-- <ESP8266WiFi> v1.0\r\n|-- <ESP8266mDNS>\r\n|   |-- <ESP8266WiFi> v1.0\r\n|-- <ESP8266WebServer> v1.0\r\n|   |-- <ESP8266WiFi> v1.0\r\n\r\nCompiling /Users/abach/Git/vsc/Sonoff-Tasmota-5.12.0/.pioenvs/sonoff/src/sonoff.ino.o\r\nLinking /Users/abach/Git/vsc/Sonoff-Tasmota-5.12.0/.pioenvs/sonoff/firmware.elf\r\nChecking program size\r\ntext       data     bss     dec     hex filename\r\n445299    10668   35136  491103   77e5f /Users/abach/Git/vsc/Sonoff-Tasmota-5.12.0/.pioenvs/sonoff/firmware.elf\r\nBuilding /Users/abach/Git/vsc/Sonoff-Tasmota-5.12.0/.pioenvs/sonoff/firmware.bin\r\nLooking for upload port...\r\nAuto-detected: tty.usbserial-00000000\r\nUploading /Users/abach/Git/vsc/Sonoff-Tasmota-5.12.0/.pioenvs/sonoff/firmware.bin\r\nwarning: espcomm_sync failed\r\nerror: espcomm_open failed\r\nerror: espcomm_upload_mem failed\r\n*** [upload] Error -1\r\n [ERROR] Took 17.86 seconds\r\n```\r\n\r\n## 3. `esptool.py` Version 1\r\n\r\n```\r\n$ esptool.py --port /dev/tty.usbserial-00000000 -b 115200 write_flash 0x0 ~/Git/vsc/Sonoff-Tasmota-5.12.0/.pioenvs/sonoff/firmware.bin\r\nesptool.py v2.3.1\r\nConnecting........_____....._____....._____....._____....._____....._____....._____....._____....._____....._____\r\n\r\nA fatal error occurred: Failed to connect to Espressif device: Timed out waiting for packet header\r\n```\r\n\r\n## 4. `esptool.py` Version 2\r\n\r\nUsing an idea I'd read elsewhere, I started `esptool.py`, let it attempt to connect, _then_ connected voltage to the Sonoff. As soon as voltage was connected, the stack trace below occurred.\r\n\r\n```\r\n$ esptool.py --port /dev/tty.usbserial-00000000 -b 115200 write_flash 0x0 ~/Git/vsc/Sonoff-Tasmota-5.12.0/.pioenvs/sonoff/firmware.bin\r\nesptool.py v2.3.1\r\nConnecting........_____....._____....._____.....\r\nTraceback (most recent call last):\r\n  File \"/usr/local/bin/esptool.py\", line 2637, in <module>\r\n    _main()\r\n  File \"/usr/local/bin/esptool.py\", line 2630, in _main\r\n    main()\r\n  File \"/usr/local/bin/esptool.py\", line 2349, in main\r\n    esp = ESPLoader.detect_chip(args.port, initial_baud, args.before, args.trace)\r\n  File \"/usr/local/bin/esptool.py\", line 223, in detect_chip\r\n    detect_port.connect(connect_mode)\r\n  File \"/usr/local/bin/esptool.py\", line 410, in connect\r\n    last_error = self._connect_attempt(mode=mode, esp32r0_delay=True)\r\n  File \"/usr/local/bin/esptool.py\", line 373, in _connect_attempt\r\n    self._port.setDTR(True)   # IO0=LOW\r\n  File \"/Library/Python/2.7/site-packages/serial/serialutil.py\", line 599, in setDTR\r\n    self.dtr = value\r\n  File \"/Library/Python/2.7/site-packages/serial/serialutil.py\", line 469, in dtr\r\n    self._update_dtr_state()\r\n  File \"/Library/Python/2.7/site-packages/serial/serialposix.py\", line 634, in _update_dtr_state\r\n    fcntl.ioctl(self.fd, TIOCMBIS, TIOCM_DTR_str)\r\nIOError: [Errno 6] Device not configured\r\n```\r\n\r\n# Alterations I _Have_ Tried\r\n\r\n* Connecting `TX -> RX` and `RX -> TX`\r\n* Connecting `TX -> TX` and `RX -> RX`\r\n* Different cables\r\n\r\n# Alterations I _Haven't_ Tried\r\n\r\n* Using a different FTDI adapter (I can't imagine the one I have is bad)\r\n* [Using an Arduino _as_ the FTDI adapter](https://www.youtube.com/watch?v=qqSLwK1DP8Q)\r\n* Using a breadboard power supply (even though the FTDI converter shows 3.35v, perhaps it's not pushing enough current?)\r\n* [Using 8285 as the board (instead of 8266)](https://github.com/arendst/Sonoff-Tasmota/issues/639#issuecomment-370972159) – can't imagine this is the issue, since it sounds like mine is more of a general connection issue"},"comment":{"url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/issues/comments/383717886","html_url":"https://github.com/arendst/Sonoff-Tasmota/issues/2344#issuecomment-383717886","issue_url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/issues/2344","id":383717886,"user":{"login":"McAllstar","id":38671364,"avatar_url":"https://avatars1.githubusercontent.com/u/38671364?v=4","gravatar_id":"","url":"https://api.github.com/users/McAllstar","html_url":"https://github.com/McAllstar","followers_url":"https://api.github.com/users/McAllstar/followers","following_url":"https://api.github.com/users/McAllstar/following{/other_user}","gists_url":"https://api.github.com/users/McAllstar/gists{/gist_id}","starred_url":"https://api.github.com/users/McAllstar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/McAllstar/subscriptions","organizations_url":"https://api.github.com/users/McAllstar/orgs","repos_url":"https://api.github.com/users/McAllstar/repos","events_url":"https://api.github.com/users/McAllstar/events{/privacy}","received_events_url":"https://api.github.com/users/McAllstar/received_events","type":"User","site_admin":false},"created_at":"2018-04-23T20:49:06Z","updated_at":"2018-04-23T20:49:06Z","author_association":"NONE","body":"don't put the baud rate in. \r\n esptool.py --port /dev/tty.usbserial-00000000 write_flash 0x0  flash_size=detect ~/Git/vsc/Sonoff-Tasmota-5.12.0/.pioenvs/sonoff/firmware.bin\r\nesptool.py v2.3.1\r\n"}}
{"actor":{"display_login":"McAllstar"}}