Avatar for stephaneAG

stephaneAG

Member since Jun 2014 • Last active Aug 2017
  • 10 conversations
  • 109 comments

'love hackety trick

Most recent activity

  • in ESP8266
    Avatar for stephaneAG

    back

    Nb: other point, but I think my above drawing is completely wrong ( .. )
    'this being said",

    From what I could read, 38kHz is a far reach for the esp8266, if its said max is actually 100Hz ( & I'm not talking about code taking too much time to exec & disrupting the WiFi part .. )
    From the post linked above, it seems using 'gpio_write(pin, 1)' & 'os_delay_us(13)' for HIGH & then for LOW could do the trick on the esp8266 platform - maybe as a tiny module or tweak to the build ?

    I'm also wondering which of the following could best suit the need ( & work as intended, if working at all, on most of the platforms .. ):

    // way A
    var arr38kHz = [0.013,0.013,0.013,0.013, ..]; // huuge array ?
    function sendSig(sigArr){
      digitalPulse(irLed_anodePin, 1, arr38kHz); // start 38kHz
      digitalPulse(irLed_cathodePin, 1, sigArr); // send signal
      digitalPulse(irLed_cathodePin, 1, 0); // wait until signal finished before further code execution
      digitalRead(irLed_anodePin); // stop 38kHz
      // or digitalWrite(irLed_anodePin, 0); // if I'm not wrong ;)
      // or digitalPulse(irLed_anodePin, 0, 0); // as well as above  ;)
    }
    
    // way B
    var interval
    function sendSig(sigArr){
      interval = setInterval(function(){
        digitalPulse(irLed_anodePin, 1, 0.013);
        digitalPulse(irLed_anodePin, 0, 0.013);
      }, 0.026); // start 38kHz
      digitalPulse(irLed_cathodePin, 1, sigArr); // send signal
      digitalPulse(irLed_cathodePin, 1, 0); // wait until signal finished before further code execution
      clearInterval(interval); // stop 38kHz
      digitalRead(irLed_anodePin); // make sure it's off
    }
    
    // way C
    var signal = [.., ..];
    for(var i=0; i< signal.length; i++){
      if( i.isEven() ){ // we need a HIGH
        digitalWrite(irLed_cathodePin, 1);
        for(var j=0; j < signal[i]/2; j++){
          digitalPulse(irLed_anodePin, 1, 0.013);
          digitalPulse(irLed_anodePin, 0, 0.013);
        }
      } else { // we need a LOW
        digitalPulse(irLed_cathodePin, 0, signal[i]); // stay Low for a while
        /* or, but not mandatory since we're LOW anyway ?
        digitalWrite(irLed_cathodePin, 0);
        for(var j=0; j < signal[i]/2; j++){
          digitalPulse(irLed_anodePin, 1, 0.013);
          digitalPulse(irLed_anodePin, 0, 0.013);
        }
        */
      }
    }
    
    // way D - using only one leg of the IR LED & the other to Gnd ?
    var signal = [.., ..];
    for(var i=0; i< signal.length; i++){
      if( i.isEven() ){ // we need a HIGH
        for(var j=0; j < signal[i]/2; j++){
          digitalPulse(irLed_cathodePin, 1, 0.013);
          digitalPulse(irLed_cathodePin, 0, 0.013);
        }
      } else { // we need a LOW
        digitalPulse(irLed_cathodePin, 0, signal[i]); // stay Low for a while
      }
    }
    
    

    I'll test as soon as I can, but sadly I'm surely not as confident in tweaking the esp build or writing a quick module for it for now :/ ..

  • in ESP8266
    Avatar for stephaneAG

    little update:

    • as an cheap alternative to transmitting the actual IR signals, it seems I can use the learn mode to learn other IR signals ( if those are both supported & long enough - like holding a btn on an actual remote until hearing a buzzing sound as confirmation that some IR signal was learned successfully ): after some quick tries, it doesn't seem to be working all the time ( more like 33% ), even using a code that used to work ( one sniffed from the device, not one learned )

    • since the IR signals can be learned, I suppose it'd be a good idea to look for custom IR signals that could be easily transmitted from whatever board ( I plan to test on original Espruino, Pico, EspruinoWiFi, & esp8266 esp-01, esp-12 & Wemos D1 Mini Pro ), although it 'd be awesome to easily support the actual signals of some device :)

    • I gotta digg the following link to experiment with the signals I already have & custom ones - any hint welcome ;) https://internetofhomethings.com/homethi­ngs/?p=899

    • on a related subject, it seems someone has ported /is porting Ken Shirriff's IR remote lib for the esp8266 https://github.com/markszabo/IRremoteESP­8266

    Aside from this, it seems I have troubles with an EspruinoWiFi: "NetworkJS" & 'http' modules not found ? ( though, it seems it can connect but I can't for ex call 'wifi.getIP()' for some reason :/ ).
    The WeMos is ok ( wifi & hosting the UI ) but doesn't yet support sending IR signals, so pretty much useless for now .. ( .I didn't try again using the original Espruino board + esp8266 esp-01 for WiFi, I'll do & hope it works on 1st try ;p )

    Last but not least, I also have to check if the IR signals learnt can be / are reset when plugging off the tv support power supply ( .. )

    On the html/UI side, the code used 'll be published on the github repo later tonight, & I also plan to try using some jsonp to get an html page bigger than can be hosted as is on the Espruino ( nb: my 1st try on the WeMos ran out of memory :/ .. ) - I'll be posting the logic here as well

    "onto the next update " ..

  • in Interfacing
    Avatar for stephaneAG

    @ClearMemory041063 -> nice work !
    I plan to use a LSM9DS0 9-DOF ( from adafruit ) for another project & I wonder how much work it'd be ( & how close it is to the LSM9DS1 ) to adapt you nearly-module-code to handle it ? ( also I'd be willing to help/do so if it's not "too advanced" for me for now ;) )

    this being said, kudos ++ ;)

  • in ESP8266
    Avatar for stephaneAG

    Hi there ! :)

    Now back, I was glad to receive 2 Espruino WiFI boards :D ( @Gordon #keepUpTheGoodWork #supportingEspruino ;P )

    While I didn't have time yet to test my code on the Espruino Wifi or try the external oscillator way, I did a quick visual recap of the idea ( feel free to correct me if I'm wrong - I really may be so :/ .. ) - the attached .pdf file.

    On that a question: when setting a pin to oscillate, it jump-starts HIGH, right ?
    ( since the logic - if I'm not false - is: "when oscillating pin goes LOW & signal pin is HIGH, IR LED is lit", I try that guess using "visual cues" ;) ( .. ) )

    If so, then I'll only have to write code that actually mixes some signal[] to some passed freq of oscillation & return the "mixed" signal ( I guess it'd be better to pre-process the existing one instead of doing so "on the fly" ( .. ) ), then test it out :)

    I plan to test out the aboves in few days & really hope the esp8266-emitted signals 'll do the trick, but now that I have the said Espruino WiFi, I'd really consider pushing the project further, adding*:

    • accel/gyro/mag detection ( LSM9DS0 9-DOF )
    • ble support ( HC-05 )
    • rgb LED ==> to be added anyway ;)
      & maybe opening up the actual tv support to directly interface with its motors ? => 'de be GREAT ( to learn stuff as well as to bypass some limitations of the "available range of positions" to which the tv can be set to ( .. ) )

    Last but not least, if the signals can be sent correctly for the esp8266 while its also handling changing the rgb led colors & the WiFi stuff, I still have to figure out where the troubles came from in my "quick svg ui" for the tv support ( I'll post that as well as an updated version soon ;) ), but I guess this should be the least of the troubles ..

    This being said, whishing any reader a very nice day :)



    *I guess now I'll also have to try interfacing these with the WeMos D1 as well as do so on the Espruino WiFi ( .. ) ;p

  • in ESP8266
    Avatar for stephaneAG

    hi !

    yup, I think it may work ( although I'd have to workout the resulting Float32Array from the signals[] array + 38kHz pulses ) ;)

    For the second option, maybe connecting a 555 'd work ? ( but I'd truly prefer the 1st option .. )

    As said above, I'll investigate more as I get back home ( where all my uCs are .. )
    Nevertheless, thanks for the quick answer ;)

  • in ESP8266
    Avatar for stephaneAG

    Hi
    reading the above, I see I'm not the only one with such troubles ( .. )
    I just ordered 2 Espruino WiFi to support the Espruino project, meanwhile I still wanna figure out a way to make this work on the ESP8266 platforms ( see my latest post: http://forum.espruino.com/conversations/­303540/ )

  • in ESP8266
    Avatar for stephaneAG

    Hi

    I plan to control my tv support using WiFi, and was hoping to make it work on a WeMos D1 Mini Pro ESP8266 board.

    Tests were initially done using the original Espruino board, which was capable of receiving & transmitting IR codes from & to the tv support.

    The wip esp8266 code used for transmitting is available at the following URL:
    https://github.com/stephaneAG/Espruino_t­ests/blob/master/tvSupportRemote/WemosD1­MiniPro_tvSupportRemote.js

    Now, after digging stuff ( and while I'm still digging .. ), it seems IR transmitting is not as quick as I hoped on the ESP8266 (my code currently uses 'analogWrite()' & 'digitalPulse', as in the official IR receive & send tutorials ) ..

    Currently not at home ( :( .. ), I can't quite improve/test stuff out, but I'm posting here anyway, hoping it may help others in finding a way to bypass the involved limitations :)

    Regarding this, the following post(s) may be of interest:
    http://forum.espruino.com/conversations/­291741/#comment13494747

    This being said, wishing yall a very nice day :)
    ( I'll come back as soon as I can try stuff out ;p )

    +

  • in ESP8266
    Avatar for stephaneAG

    Hi there

    I received 3 Wemos D1 Mini Pro few days ago, and flashed one of those using the infos displayed on the esp8266 page ( .. )
    If I recall correctly, adjustements have to be made to the cli command to flash it to be able to use more than 4M ( and maybe not all flash memory 'd be available - I mean, some of it 'd be only usable with 'pages' stuff ? .. )

    Nb: some time ago, I tried upgrading some esp8266 ESP-01 with a 16M flash chip, but I didn't took the time ( and have it ) to investigate how to benefit from most of the flash without considering the 'pages' stuff ( when flashing it / afterwards .. )

    Nb2: I'll be posting about an esp8266-related project in few minutes ;)

    Hoping you did figure out stuff already ;)

  • in Interfacing
    Avatar for stephaneAG

    ;)
    ( 'just checked my DHL status: hardware's coming home :D )

    I'll post tests as soon as I receive & build the stuff ;)

Actions