probonopd / ESP8266HueEmulator

Emulate a Philips Hue bridge running on an ESP8266 using the Arduino IDE.
MIT License
411 stars 93 forks source link

Mods for DMA NeoPixel on GPIO3 and classic wifi connect #46

Open krulkip opened 7 years ago

krulkip commented 7 years ago

Mods for DMA NeoPixel on GPIO3 and classic wifi connect

probonopd commented 7 years ago

Thanks @krulkip unfortunately it's not building:

In file included from ESP8266HueEmulator.ino:10:0:

/home/travis/arduino_ide/libraries/NeoPixelBus/src/NeoPixelBus.h:78:5: note: NeoPixelBus<T_COLOR_FEATURE, T_METHOD>::NeoPixelBus(uint16_t, uint8_t) [with T_COLOR_FEATURE = NeoRgbFeature; T_METHOD = NeoEsp8266DmaMethodBase<NeoEsp8266DmaSpeed800Kbps>; uint16_t = short unsigned int; uint8_t = unsigned char]

     NeoPixelBus(uint16_t countPixels, uint8_t pin) :

     ^

/home/travis/arduino_ide/libraries/NeoPixelBus/src/NeoPixelBus.h:78:5: note:   candidate expects 2 arguments, 1 provided

/home/travis/arduino_ide/libraries/NeoPixelBus/src/NeoPixelBus.h:72:61: note: constexpr NeoPixelBus<NeoRgbFeature, NeoEsp8266DmaMethodBase<NeoEsp8266DmaSpeed800Kbps> >::NeoPixelBus(const NeoPixelBus<NeoRgbFeature, NeoEsp8266DmaMethodBase<NeoEsp8266DmaSpeed800Kbps> >&)

 template<typename T_COLOR_FEATURE, typename T_METHOD> class NeoPixelBus

/home/travis/arduino_ide/libraries/NeoPixelBus/src/NeoPixelBus.h:72:61: note:   no known conversion for argument 1
krulkip commented 7 years ago

I use arduino IDE 1.6.8 and esp8266 version 2.3.0 and latest makuna NeoPixel. krulkip

On Sunday, November 20, 2016 5:59 PM, probonopd <notifications@github.com> wrote:

Thanks @krulkip unfortunately it's not building:In file included from ESP8266HueEmulator.ino:10:0:

/home/travis/arduino_ide/libraries/NeoPixelBus/src/NeoPixelBus.h:78:5: note: NeoPixelBus<T_COLOR_FEATURE, T_METHOD>::NeoPixelBus(uint16_t, uint8_t) [with T_COLOR_FEATURE = NeoRgbFeature; T_METHOD = NeoEsp8266DmaMethodBase; uint16_t = short unsigned int; uint8_t = unsigned char]

 NeoPixelBus(uint16_t countPixels, uint8_t pin) :

 ^

/home/travis/arduino_ide/libraries/NeoPixelBus/src/NeoPixelBus.h:78:5: note: candidate expects 2 arguments, 1 provided

/home/travis/arduino_ide/libraries/NeoPixelBus/src/NeoPixelBus.h:72:61: note: constexpr NeoPixelBus<NeoRgbFeature, NeoEsp8266DmaMethodBase >::NeoPixelBus(const NeoPixelBus<NeoRgbFeature, NeoEsp8266DmaMethodBase >&)

template<typename T_COLOR_FEATURE, typename T_METHOD> class NeoPixelBus

/home/travis/arduino_ide/libraries/NeoPixelBus/src/NeoPixelBus.h:72:61: note: no known conversion for argument 1 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

probonopd commented 7 years ago

Thanks @krulkip please check the build log at https://travis-ci.org/probonopd/ESP8266HueEmulator/builds/177455181

If needed, feel free to change the .travis.yml

krulkip commented 7 years ago

blockquote, div.yahoo_quoted { margin-left: 0 !important; border-left:1px #715FFA solid !important; padding-left:1ex !important; background-color:white !important; } Sorry not sure how to do that. Pretty sure it is in the neopixelbus version. Do you have the 2.2.4 version.Please allow me some comments.Why are you using the animation in the neopixel. It makes the code more complex.My aim is to make the hue emulator talk to milight bulbs using a NRF24L01.I have done quite a bit of work on this as you can see here.http://arduino-projects4u.com/milight-rf-control/ What do you think could that be interesting or is it too far away from your ideas. Krulkip

On Monday, November 21, 2016, 10:21, probonopd notifications@github.com wrote:

Thanks @krulkip please check the build log at https://travis-ci.org/probonopd/ESP8266HueEmulator/builds/177455181

If needed, feel free to change the .travis.yml

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

probonopd commented 7 years ago

@krulkip great work on using the NRF24L01. I will accept pull requests that don't break existing functionality and Travis CI builds.

krulkip commented 7 years ago

Yes its the makuna Neopixel version. You are using 2.1.4 and you need to update to 2.2.4

probonopd commented 7 years ago

I get "This branch has conflicts that must be resolved" - can you send a new PR that does not have the conflicts? Thanks

krulkip commented 7 years ago

Sorry i am not used to travis. Lot of messing around. now it works.

probonopd commented 7 years ago

@krulkip thanks for your valuable contribution. Can you please open a new Pull Request with all of your changes in one go? I hope that this way, your new Pull Request will not show the "This branch has conflicts that must be resolved" error and will build on Travis CI just fine, in which case I will be happy to merge it.

krulkip commented 7 years ago

Hope this finally works

opticron commented 7 years ago

Hey, just my review of the changes: The SPI.h include shouldn't be necessary in the .ino.

The strip now consumes the RX pin interfering with serial I/O over USB, but to be fair the base project doesn't accept serial input anyway (this is likely to confuse people trying to play with this example project). The modified strip configuration doesn't use DMA which slows things down and is setup for RGB WS2812 color ordering instead of the much more common (unless you have a stockpile of old strips) GRB WS2812 color ordering.

The wifi changes are probably a net improvement in that the example won't stick itself if it doesn't connect fast enough.

The ArduinoOTA handler is probably a bit out of place.

In README.md, the initial link shouldn't be modified to point to @krulkip's repository, but the text update should be incorporated (tweaked based on what is decided on the above).

All in all, it looks like most of these changes are focused on making sacrifices to this generic example project to adapt to a highly constrained board and should probably just live in @krulkip's fork.

krulkip commented 7 years ago

The idea of using dma is that the timings of the neopixel data is controlled by hardware and hence more accurate and also consuming less cpu power. RGB or GRB does not matter you can use either. The dma is only available on the later releases of makuna neopixelbus, i use 2.2.4. On my system it was only possible to compile this by adding SPI.h. Maybe we should be able to select either method. The ArduinoOTA was already incorporated and OTA will not work without it. README.md agree. Just wanted to show it now compiles on travis. 😀

probonopd commented 7 years ago

How do we want to proceed with this?