orithena / Lamp_Simple1Button

Animated Rainbow LED Lamp w/ WS2812b LED stripes, Arduino and 1 Button.
MIT License
18 stars 2 forks source link

Setting up Arduino IDE #1

Open luckydonald opened 5 years ago

luckydonald commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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
orithena commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 ^^