Espruino WiFi Tv Support remote using WeMos D1 Mini Pro ESP8266 #6046
Replies: 1 comment
-
Posted at 2017-04-18 by @gfwilliams I'd try specifying a massive Float32Array of bit times to digitalPulse, which includes all 38kHz pulses - it seems like it could work for you? Either that or use an external 38kHz oscillator Posted at 2017-04-18 by 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 .. ) Posted at 2017-04-26 by stephaneAG Hi there ! :) Now back, I was glad to receive 2 Espruino WiFI boards :D ( @gfwilliams #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 ? 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*:
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 Attachments: Posted at 2017-04-27 by stephaneAG little update:
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 :/ ). 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 " .. Posted at 2017-04-28 by stephaneAG back Nb: other point, but I think my above drawing is completely wrong ( .. ) 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 .. ) 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 .. ):
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 :/ .. Posted at 2017-05-18 by LeoWang Hi, What is test result? I'm also trying to do IR transmit on ESP8266 recently. Posted at 2017-05-19 by arthurmoises Hi stephaneAG and Gordon! I've became very interested in both of your approaches. I've studied a little about IR Transmission and found those great resources: http://www.ece.ucsb.edu/Faculty/rodwell/Classes/ece2c/labs/Lab4_2C_2009.pdf http://www.ti.com/lit/an/slaa644b/slaa644b.pdf http://www.remotecentral.com/features/irdisp3.htm http://forum.espruino.com/conversations/297428/ I don't know how, yet, but I've managed to output 38kHz wave using
on my Wemos D1 Mini. Using the IRReceiver module, I could even see the binary data printed on the console terminal. I was wondering if it's possible to implement only one port to create an IR transmitter. I've already soldered a prototype PCB with a TIP 122 and 4 IR LEDs in parallel (nothing serious, that I can't add another transistor later), but for the sake of the high optimization (I intend to get better each day with Javascript), I will continue with the quest of only using one uC port. By reading those resources above, I found that the IR Transmission protocol that I'm implementing (or trying to do reverse engineering...) uses ASK Modulation, by the variation of the "on" pulse width to differentiate between zeros and ones. So, a "ON" signal must have 48x 38kHz pulses and 24x off pulses (which I can just extend the 48º time length to cover that area, saving array space) and an "OFF" signal must have 24x 38kHz pulses and another 24x off pulses (which again I can extend the time duration of the 24º pulse, so I can save space on the array) I've tried to do this, but got "Out of memory" limitations. I'll try to use your examples here to try to create an array "on the go" or iterate through lots of "digitalPulse" calls, in a for loop, so I don't need to use arrays. Thanks a lot for your colaboration! EDIT: Finished paragraph. EDIT2: Changed the mistyped "380000" to "38000" in code snippet. Posted at 2017-05-19 by Wilberforce See here https://www.espruino.com/pronto Posted at 2017-05-20 by arthurmoises Hi Wilberforce! Thanks for the reply! I've saw this tutorial, and I have the setup for using 2 pins, but I ask if it's possible to do the IR Transmission by using just one pin (discarding the carrier part of 38kHz, and just outputting the signal, in the 38kHz frequency, but for the time required to represent the 0's and 1's). If it's impossible (due to the event loop and timing approach), I'll switch to the approach on the link that you shared, using two GPIOs and two transistors. Posted at 2018-09-14 by stephaneAG Hi there ! If it helps on this topic & while what I'm about ot say is a little aside, I had success on another project sniffing what was received on the IR receiver pin & then controlling that pin using a NPN or PNP transistor ( can't remember if the IR receiver rested HIGH & the signal was inverted or not ). I plan on trying to do so in the coming weeks & as usual 'll post back updates on thee :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2017-04-18 by 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_tests/blob/master/tvSupportRemote/WemosD1MiniPro_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 )
Beta Was this translation helpful? Give feedback.
All reactions