EightByEight - error uploading demo sketch from Arduino IDE: espcomm_open failed

Hi,
I just got by EightByEight this weekend and I'm eager to start playing. It seems like a really rad little piece of hardware!

I was able to get PatternPaint working with it, but when I tried to upload one of the example sketches, I get the errors:
warning: espcomm_sync failed error: espcomm_open failed error: espcomm_upload_mem failed

I followed the instructions in the Getting Started Guide to load the ESP8266 Board info.

I am pretty new to Arduino, so I could be making some newbie mistake that's just not documented in the 8x8 docs.

Here is the full set of steps I've gone through so far:
Basic Connection

  • downloaded and installed arduino IDE for Mac v1.8.4
  • followed instructions to Install the ESP8266 Board
  • configured the Tools > Board configs according to the screencap in the Getting Started guide (also set Tools > Port to /dev/cu.usbmodem1421
  • at this point I could open the Serial Port monitor and it shows debug info when you hold the button down (mac & IP address, accelerometer info)

Pattern Paint

  • downloaded the app from http://blinkinlabs.com/blinkytape/patternpaint/
  • quit out of the arduino app and restarted the pattern paint app to get the "save to blinky" button to be enabled
  • I also had to do "tools > restore firmware" to get the 8x8 to respond to pattern paint
  • after that it worked to preview the patterns on the device, and when i "saved" the patterns to the blinky and unplugged it, they were added to the end of the pre-loaded demos.

Next I tried loading an Arduino sketch, starting with the BlinkyDemo from the EightByEight repo
but I get an error whenever I try to upload a sketch. I tried out some of the example arduino sketches too, and they're giving the same error.

Here's the full output when I try to upload a sketch:
Archiving built core (caching) in: /var/folders/8l/s03hdskd4xv2jskdlwyrk66c0000gn/T/arduino_cache_708934/core/core_esp8266_esp8266_generic_CpuFrequency_80,FlashFreq_40,FlashMode_qio,UploadSpeed_460800,FlashSize_2M,ResetMethod_nodemcu,Debug_Disabled,DebugLevel_None_____c9d37bcc24a4e4f34f6c8352a98fda97.a Sketch uses 275877 bytes (26%) of program storage space. Maximum is 1044464 bytes. Global variables use 35848 bytes (43%) of dynamic memory, leaving 46072 bytes for local variables. Maximum is 81920 bytes. warning: serialport_set_baudrate: baud rate 460800 may not work warning: espcomm_send_command: wrong direction/command: 0x01 0x00, expected 0x01 0x08 warning: espcomm_send_command: wrong direction/command: 0x01 0x00, expected 0x01 0x08 warning: espcomm_sync failed error: espcomm_open failed error: espcomm_upload_mem failed error: espcomm_upload_mem failed

Do I need to reset the firmware again to upload a sketch from the Arduino IDE?
If so, is the "Updating the ARM Firmware" link from the Getting Started guide the one I should follow?

Thanks in advance!

Comments

  • Hi Benjamin, thanks! It sounds like you're doing everything correctly here. The critical setting in the Arduino tools menu is 'Reset Method' : 'nodemcu', however if you've followed the guide than that should be set already.

    We've seen this issue a few times (though mostly with Windows machines), and it's possible that it's a timing problem between the Arduino serial reset procedure and the USB firmware on the EightByEight. For reference, what kind of Mac are you using? If you happen to have a USB hub you could plug the EightByEight into, that would be worth a try (or if you're already using a hub, try plugging it in directly). Otherwise, we can try to make an ARM firmware update with less sensitive reset timing.

  • Thanks, Matt!

    I'm using a MacBook Air (13-inch, Mid 2013) running OS 10.12.6.
    I was not using a USB hub, but tried putting one in between and got the same errors.

    I set up Arduino, ESP8266 via Board Manager, etc. on a MacBook Pro (13-inch, 2016, Two Thunderbolt 3 ports) running OS 10.12.5, and got the same errors the first time, then tried uploading again a minute later and it was successful.
    I made a minor tweak and tried uploading again and got 6 errors before a successful upload.

    Having seen this success, I went back to the Macbook Air and tried uploading again, and it worked the first time. Go fig.

  • My buddy has a Macbook Pro (15-inch, Mid 2010) running OS X 10.10.5 and has not been able to get this to work at all - he gets similar errors:
    warning: espcomm_sync failed
    error: espcomm_open failed
    error: espcomm_upload_mem failed
    error: espcomm_upload_mem failed

    and has not been able to get these no matter how many times he tries the upload.

    When he tries to "Restore Firmware" in PatternPaint, after a few seconds he gets the error "Command SyncFrame timed out".

    Should we try the ARM firmware update you suggest or is something else (not) going on here?

  • It sounds like the solution is probably an ARM firmware upgrade, then. I'll try to isolate that error here and get an upgrade out soon

  • Also- if you want to know the specifics, I believe it is in the way we implemented the reset procedure for the ESP. We're emulating the nodeMCU reset method:
    https://tttapa.github.io/ESP8266/Chap06 - Uploading.html

    using a small bit of software on the ARM part:
    https://github.com/Blinkinlabs/EightByEight/blob/master/firmware/usb_dev.c#L331

    The software expects to receive multiple CDC_SET_CONTROL_LINE_STATE messages from the host computer, and I believe whats happening is that that host computer is either filtering out those requests, or sending them either too slowly or too quickly for the ARM part to generate the reset signal properly.

    I added a routine to check for this error and automatically retry to PatternPaint, and that seemed to be work ok on my systems (a 2012 macbook air, 2016 dell laptop, and Raspberry Pi 3), but since the procedure is time sensitive I can imagine that it might have issues on other systems. I'm going to start by looking at the USB transfers that recent Arduino versions on macOs send to the badge, and go from there.

  • Cool, thanks for your support!

  • Ok, I finally got a chance to sit down with this. Here's a test update (v1.0.1) that fixes the above reset bug, and also slows down the upload speed just a bit (from 460kbps to 350kbps). With the original firmware, it was taking 2-3 retries before uploading successfully through Arduino, and now it seems to work on the first try.

    Here are the update instructions (macOs only):
    1. Download this file and extract it to the 'Downloads' folder:
    https://software.blinkinlabs.com/EightByEight Firmware update 1.0.1.tar.gz
    3. Plug in the EightByEight badge.
    4. Open a Terminal
    5. Change to the Downloads directory:
    cd ~/Downloads/"EightByEight Firmware update 1.0.1"
    6. Plug in the EightByEight badge
    7. Run the updater:
    ./do_upgrade.sh

    If all went well, it should show an update progress bar. Please let me know if this helps with the issue, and if it does we'll wrap it up into the next PatternPaint release.

  • Rad. We'll try it out and let you know the results. Thanks!

  • Matt, good work! After flashing the new firmware, I'm getting 100% success uploading sketches on my MacBook Air (13-inch, Mid 2013). I'll have my buddy try it on his older Macbook Pro (15-inch, Mid 2010).

    One thing - not sure if this is related - I'm only getting garbage in the serial monitor in the Arduino IDE now. I tried all the different baud rate settings and got the same thing. Similar "garbage" on both a custom sketch as well as from the MegaDemo and BlinkyDemo.

  • Ok, the first part is great!

    The second one is definitely related- you'll need to modify your sketch to use the baud rate 350000 instead of the current 460800. In Badge.cpp, try changing the line:

    Serial.begin ( 460800 );
    

    to:

    Serial.begin ( 350000 );
    

    I'll see if i can tweak the ARM firmware to use a baud rate that's close enough to the original setting not to modify it- it will be a small pain to have to keep track of updating both the ARM firmware and the ESP firmware. In the meantime, the above workaround should do the trick.

  • cool, that worked.

  • I tried this on the MacBook Pro (15-inch, Mid 2010) and the dfu-util command gave the error "Illegal instruction: 4". Thinking this might be a CPU mismatch, I tried downloading dfu-util from sourceforge and compiling it, but the ./configure ended with the error Required libusb-1.0 >= 1.0.0 not installed which didn't change after installing libusb via homebrew. Its running a 2.4 GHz Intel Core i5 processor.

  • It looks like there is a package for dfu-util on homebrew, can you try installing them both from there?
    https://github.com/Homebrew/homebrew-core/blob/master/Formula/dfu-util.rb

    Since the ARM firmware only needs to be updated once, you could also just update them both using the 2013 macbook.

  • yeah, after I left his place last night, I realized that we could just update the firmware from another computer. I should have just brought him my board so we could swap out. TBD.

  • Hey Matt,
    After uploading the new firmware, I'm getting this error message when trying to save an active animation to the EightByEight directly from PatternPaint:

    Error updating blinky- please try again.
    Error Message: Command getFirmwareVersion timed out

    It does seem to download successfully, but some of the pixel colors are messed up.

  • On the older Macbook Pro (15-inch, Mid 2010), we're still getting the espcomm_upload_mem failed errors, even with the new firmware. We noticed that the computer has a USB 2.0 (not 3.0) port, could that be the issue?

Sign In or Register to comment.