Lamp_Simple1Button icon indicating copy to clipboard operation
Lamp_Simple1Button copied to clipboard

Setting up Arduino IDE

Open luckydonald opened this issue 5 years ago • 5 comments

Hello, I'm having trouble compiling the example.

Via "Manage Libraries" I got the FastLED (3.2.6) and Button (1.0.0) Library. The ESP8266wifi.h header I got by following https://github.com/esp8266/Arduino#installing-with-boards-manager. The boolean related error I get resolved by changing it (in the Tools > Board > Bords Manager) back to version 2.4.2. I set my board to Generic ESP8266, as I couldn't find any better.

I tried compiling, but it complains about the D3 and D6 constants being undefined.

luckydonald avatar Jun 02 '19 11:06 luckydonald

I tried setting the constants manually, as found in various definitions.

static const uint8_t D3   = 0;  // https://github.com/esp8266/Arduino/blob/74819a763bfb6e9890a57411dcea4aba221a778d/variants/d1_mini/pins_arduino.h#L40
static const uint8_t D6   = 12;  // https://github.com/esp8266/Arduino/blob/74819a763bfb6e9890a57411dcea4aba221a778d/variants/nodemcu/pins_arduino.h#L43

But it doesn't upload, failing with

warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed

luckydonald avatar Jun 02 '19 12:06 luckydonald

I tried setting the constants manually, as found in various definitions.

static const uint8_t D3   = 0;  // https://github.com/esp8266/Arduino/blob/74819a763bfb6e9890a57411dcea4aba221a778d/variants/d1_mini/pins_arduino.h#L40
static const uint8_t D6   = 12;  // https://github.com/esp8266/Arduino/blob/74819a763bfb6e9890a57411dcea4aba221a778d/variants/nodemcu/pins_arduino.h#L43

But it doesn't upload, failing with

warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed

luckydonald avatar Jun 02 '19 12:06 luckydonald

Hi, the correct board type would be "WeMos D1 mini": in the board selection of Arduino IDE it's listed as "WeMos D1 R2 & mini" or "LOLIN(WeMos) D1 R2 & mini" (depending on board definition version). This board definition also contains the constants D0..D8 for the pins.

orithena avatar Jun 03 '19 09:06 orithena

Regarding the upload problem: Check if you're allowed to write on the USB-Serial port (after plugging in, the device /dev/ttyUSB0 should be created). Depending on your linux distribution, you need to add yourself to either the group dialout (Debian based distros) or uucp (Arch based distros) and then relogin.

orithena avatar Jun 03 '19 09:06 orithena

Also, don't forget to select the correct port in the board menu after plugging it in :) ... if there is no change in the port list after plugging it in, check your USB cable: some cables omit the data lines (they're only good for charging).

Additionally, you may enable verbose/debug output for compilation and/or uploading in the preferences menu.

If any of this here helps, please answer with the solution ^^

orithena avatar Jun 03 '19 09:06 orithena