These are chat archives for esp8266/Arduino

15th
Mar 2016
Michael Miller
@Makuna
Mar 15 2016 07:29
My NeoPixelBus library was redesigned so it could work across platforms and support easily switching between Dma, Uart, and BitBang for Esp8266.
\github\makuna\neopixelbus\
marksev1
@marksev1
Mar 15 2016 08:23
cool :). I'm thinking about a ws2812 and esp8266 being controlled by mqtt by the home automation controller
andig
@andig
Mar 15 2016 12:09
lwip
andig
@andig
Mar 15 2016 12:15
@andig i have no idea. sent a message on Espressif bbs: http://bbs.espressif.com/viewtopic.php?f=7&t=1781
Keith Andrew Hill
@vic10us
Mar 15 2016 13:12
Has anyone got WPA2 Enterprise (username+password) with esp8266?
Aditya Tannu
@AdySan
Mar 15 2016 15:48
@marksev1 pretty much exactly what I'm doing here https://gist.github.com/AdySan/bd23f7be5ca5a6a4563f
Michael Miller
@Makuna
Mar 15 2016 17:22
@AdySan Last I heard the Adafruit library has issues with Wifi features as they only support a bitbang model (they were using my bitbang code). This is due to requirement of bitbang needing NoInterrupts(); the same issues my bitbang method has.
The default "method" for my library is Dma.
Aditya Tannu
@AdySan
Mar 15 2016 17:24
yes I was actually trying out several RGB lights at home, this one happened to be Adafruit, the others have I2S over DMA using your library
I remember your HSV scaling was somewhat different from the HSV support I had to add here.
Michael Miller
@Makuna
Mar 15 2016 17:28
HSV or HSL? My HSL using 0.0 - 1.0 for the Hue rather than 0-360, and like normal if saturation is at 1.0, Lightness only needs to be 0.5. HSV is different.
My library only has HSB, similar to HSV.
Aditya Tannu
@AdySan
Mar 15 2016 17:30
yes HSL
Michael Miller
@Makuna
Mar 15 2016 17:31
At some point the HSL/HSB used Ints by default, but I found to much loss of detail due to provided other routines would cause color issues. I switched them all to floats to get rid of problems/support issues.
Keith Andrew Hill
@vic10us
Mar 15 2016 20:07
Really. So nobody has used WPA2 Enterprise with esp8266? Wow
Victor Tseng
@Palatis
Mar 15 2016 20:09
cuz enterprice ppl got money for a real mcu i guess...
Keith Andrew Hill
@vic10us
Mar 15 2016 20:09
Lol. It's not just for enterprises. It's a standard in non PSK installs.
Victor Tseng
@Palatis
Mar 15 2016 20:11
duno, i find esps lack many important modern wifi features...
consider the price you paid, well...
"it connects!" would be pretty much "worthy" i guess.
Keith Andrew Hill
@vic10us
Mar 15 2016 20:12
The thing is that it's supported in the SDK. Strange that no one has implemented it in either Arduino or nodemcu.
Victor Tseng
@Palatis
Mar 15 2016 20:13
i was convinced to accept the nutered functionalities.
ohh yeah?
Aditya Tannu
@AdySan
Mar 15 2016 20:15
esp8266/Arduino#1633 the PR is merged and this seems to be an example: https://github.com/joostd/esp8266-eduroam/blob/master/Arduino/eduroam/eduroam.ino
Victor Tseng
@Palatis
Mar 15 2016 20:16
typedef enum _auth_mode {
AUTH_OPEN = 0,
AUTH_WEP,
AUTH_WPA_PSK,
AUTH_WPA2_PSK,
AUTH_WPA_WPA2_PSK,
AUTH_MAX
} AUTH_MODE;
Aditya Tannu
@AdySan
Mar 15 2016 20:17
maybe not then
Victor Tseng
@Palatis
Mar 15 2016 20:18
int wifi_station_set_cert_key(uint8 client_cert, int client_cert_len,
uint8
private_key, int private_key_len,
uint8 private_key_passwd, int private_key_passwd_len);
void wifi_station_clear_cert_key(void);
int wifi_station_set_username(unsigned char
, int);
void wifi_station_clear_username(void);
hmm it does have these functions
Keith Andrew Hill
@vic10us
Mar 15 2016 20:19
Nice. I guess it's just not well documented.
I think this warrants a good blog post.
d-anders
@d-anders
Mar 15 2016 21:54
if i have a lib that includes avr/pgmspace.h etc should i change it and add checks to make it include pgmspace.h instead or is there a better way of doing it (arduino ide)?
(if i change nothing the include will fail)
Michael Miller
@Makuna
Mar 15 2016 22:42
@d-anders @igrr I thought we were going to put a avr\pgmspace.h somewhere that was going to include the right one, this way libs would still work? There might be an old issue for this?
d-anders
@d-anders
Mar 15 2016 22:44
im not using the latest version i think
anyway, it turned out the max6675 lib that i downloaded through the ide is somewhat silly anyway
so i modified it
it was using _delay_ms(1) for spi which cant be needed
i will just skip it all together
but for other cases the question is still valid. modifying a lib isnt optimal if it is also beeing updated
i meant skip the lib
sticilface
@sticilface
Mar 15 2016 23:38

Need a hand from some C++ gurus... trying to have a class that can call a variety of its own functions depending on which one is 'set'...
example

class foo {
public:
  typedef std::function<void(int)> Callback; // define callback
  void setcallback(Callback Fn) { _Callback = Fn; }  //  function used to set which function to call
  void runcallback(int a)  // function  that calls what ever function is set by setcallback
  {
    _Callback(a); 
  } 
  void thefunction(int value)  //  one of any number of functions that can be called.... 
  {
    Serial.printf("yes %u\n", value); 
  }

  void randomfunction()   //  random function that sets the callback function... 
  { 
    setcallback(thefunction); 
  }
private:
  Callback _Callback;  // stores the current function... 

};

error

/Users/amelvin/Dropbox/Sketchbook/nah/nah.ino: In member function 'void foo::randomfunction()':
nah:18: error: no matching function for call to 'foo::setcallback(<unresolved overloaded function type>)'
     setcallback(thefunction); 
                            ^
/Users/amelvin/Dropbox/Sketchbook/nah/nah.ino:18:28: note: candidate is:
/Users/amelvin/Dropbox/Sketchbook/nah/nah.ino:6:8: note: void foo::setcallback(foo::Callback)
   void setcallback(Callback Fn) { _Callback = Fn; }  //  function used to set which function to call
        ^
/Users/amelvin/Dropbox/Sketchbook/nah/nah.ino:6:8: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to 'foo::Callback {aka std::function<void(int)>}'
exit status 1
no matching function for call to 'foo::setcallback(<unresolved overloaded function type>)'

tried for a few hours... just missing some C++ spice.. to get it right any ideas?

sticilface
@sticilface
Mar 15 2016 23:48
ok.. so the issue seems to be that i want to call the function with parameters.. as this works..
using namespace std::placeholders;

class foo {
public:
  typedef std::function<void(int)> Callback; // define callback
  void setcallback(Callback Fn) { _Callback = Fn; }  //  function used to set which function to call
  void runcallback(int a)  // function  that calls what ever function is set by setcallback
  {
    _Callback(a); 
  } 
  void thefunction(int a)  //  one of any number of functions that can be called.... 
  {
    Serial.printf("yes \n"); 
  }

  void randomfunction()   //  random function that sets the callback function... 
  { 
    setcallback(std::bind(&foo::thefunction, this, _1)); 
  }
private:
  Callback _Callback;  // stores the current function... 

};