These are chat archives for esp8266/Arduino

31st
Mar 2016
tzapu
@tzapu
Mar 31 2016 03:47
@martinayotte thank you for all the data. got one more question, in the p chan example, where there is a transistor, is that needed? and R3 amd R2? will it not work with just a pullled up gpio straight to q2?
btw, my AO3401 ’s just shipped :P
Michael Miller
@Makuna
Mar 31 2016 06:51
@igrr Can ICACHE_FLASH_ATTR be applied to class methods?
Ivan Grokhotkov
@igrr
Mar 31 2016 09:04
you mean ICACHE_RAM_ATTR? ICACHE_FLASH_ATTR is the default.
I think this is done somewhere in the Servo library (in ServoTimers.h), so i suppose the answer is yes.
Martin Ayotte
@martinayotte
Mar 31 2016 12:30
@tzapu , the Q2 NPN is required to short the R2 to GND during turn ON, but it can be replaced by an N-Channel MSOFET. The R2 value shown as 2K2 is OK, but can be higher, like 4K7. The R3 is in fact consider as the Load ...
tzapu
@tzapu
Mar 31 2016 12:55
yeah, sorry about R3
so, positive switching will always need 2 mosfets or npn and mosfet?
or is that just so it keeps a pulldown during boot
?
sorry if i misunderstood
Martin Ayotte
@martinayotte
Mar 31 2016 13:03
Lets remember that the P-Chan here provide some 12V to the Load, it is normally turned OFF by it gate pullup R2. To make it turned ON, the gate needs to be bring to GND, but the GPIO can't tolerate this 12V directly, so the N-Chan (or NPN) is used to bring that gate to GND, and is also acting like an logic inverter, so in the current case, the gate of this N-Chan needs a HIGH level from the GPIO to bring the whole thing ON, perfect candidate for GPIO15 with it normal pulldown !
tzapu
@tzapu
Mar 31 2016 13:17
but, since i m only running 3.3v, does that change anything?
and load also 3v3
btw, i can t tahnk you enough for all the info, so much to learn :D
Martin Ayotte
@martinayotte
Mar 31 2016 13:26
In the case of 3.3V, you can avoid this N-Chan inverter by connecting the gate of the P-Chan directly to GPIO2 or GPIO0 since they both need pullups at boot time.
(As long as you remember that GPIO state is inverted, here a LOW will turn ON the P-Chan)
Harrison Mclean
@h4rm0n1c
Mar 31 2016 13:36

Before I go all in on an insane quest to write a “web interface to end all web interfaces” you know, that ideal IoT interface that switches between AP and STA, using me-no-dev’s async web server, I have one question:

I am using a timer0 in DMD2, I’ve tried every variation of software timer I am aware of at my amateur level of knowledge and it’s just not going to work, the display needs to be refreshed constantly to work and any timing gliches will show up on the display.

Currently, this cannot co-exist with anything that blocks execution (obviously), and I’d really REALLY like to be able to have a web interface on this thing that is always available and will smartly manage wifi in much the way that wifimanager does.

Is there something surprisingly simple that I’m missing? Some safety check for ISRs that I can wrap around it that will prevent execution of the ISR for the fraction of a second or so that the ESP is doing other vital things such as the various housekeeping functions that I assume I’m falling afoul of?

I’m kind of at my wit’s end here, I probably don’t have the full knowledge and expertise required to write this monster of an ideal web interface that can be always available and co-exist with one annoying timer interrupt… I’m just really not sure where to go from here.

I’m starting to think I should have offloaded the display stuff to a separate micro, even though I think that’s a copout and would basically make this project of mine a complete waste of time so far.

Me No Dev
@me-no-dev
Mar 31 2016 13:39
what is that display that requires such tight timing?
Harrison Mclean
@h4rm0n1c
Mar 31 2016 13:39
It’s a Dot Matrix Display from Freetronics, a.k.a those HUB12 protocol displays you can get from China.
tzapu
@tzapu
Mar 31 2016 13:40
thanks @martinayotte , i now understand.
Harrison Mclean
@h4rm0n1c
Mar 31 2016 13:41
It works on Persistence of Vision in a sense, as only 1/4 of it is lit at any one instant.
Me No Dev
@me-no-dev
Mar 31 2016 13:43
I looked at a library and it does not seem to require any tight timing? is this something that your particular thing requires?
how much of a time difference can you have and how long does it take to draw the screen
Harrison Mclean
@h4rm0n1c
Mar 31 2016 13:48
https://github.com/freetronics/DMD2 - This is what I’m using, I also happened to be the person who added support, with a lot of help from here and combing through the servo timers for clues.
Harrison Mclean
@h4rm0n1c
Mar 31 2016 13:54
Umm, I’m trying to get some idea of that right now, what I do know is you need to do 4 interations of that ISR for one single full screen update and any deviation in the timing tends to introduce flickering, ghost pixels and other irritating nonsense.
Me No Dev
@me-no-dev
Mar 31 2016 14:31
i'm clueless to how it works really :) maybe @projectgus can help you
LotusOttawa
@LotusOttawa
Mar 31 2016 15:31
Anyone tried Arduino 1.6.8 on a Windows machine and been able to upload code on a NodeMCU 1.0? I get some error message very quickly after I click on upload. 1.6.8 works fine on Linux. 1.6.5 works fine on the same Windows machine.
Victor Tseng
@Palatis
Mar 31 2016 15:32
@LotusOttawa works fine with Arduino 1.6.8 over here
@LotusOttawa on windows 10
i'm using a NodeMCU v2 tho
LotusOttawa
@LotusOttawa
Mar 31 2016 15:39
Appologies, I am using NodeMCU v2. Is there a way to completely uninstall the Arduino IDE apart from the standard Windows Uninstall routine? When I try to reinstall 1.6.8 it somehow remembers my boards manager esp8266 selection so I suspect there are some rogue files somewhere. I have removed everything from C:\Arduino
Victor Tseng
@Palatis
Mar 31 2016 15:40
from your Arduino IDE, go File -> Preferences
note the Sketchbook Location
then go to your Windows Explorer, paste that path, remove everything inside that folder.
you might want to keep your project and libraries, tho...
or, you can just remove the hardware folder.
LotusOttawa
@LotusOttawa
Mar 31 2016 15:42
Ok, thanks I will try that. I kept the Sketchbook folder as it had my projects.
Michael Miller
@Makuna
Mar 31 2016 16:55
@LotusOttawa There is two locations you need to nuke to really clean it out. Sometimes it does when it uninstalls, sometimes it doesn't.
C:\Users\<your user name>\AppData\Local\Arduino15 and
C:\Users\<your user name>\AppData\Roaming\Arduino
@igrr yes, ICACHE_RAM_ATTR, late night tracking down why I2S DMA broke
Michael Miller
@Makuna
Mar 31 2016 17:17
@igrr and still tracking it down, it works for about 5-10 seconds and then just quits sending. No rashes, sketch still runs, the i2s DMA just stops sending data and the state shows locked (not advancing through blocks).
d-anders
@d-anders
Mar 31 2016 18:14
i had the same problems lotus, i think that unless you delete some folders manually the tools may not be updated
Me No Dev
@me-no-dev
Mar 31 2016 18:18
@Makuna has the code changed recently for i2s?
@Makuna yeah, only my changes on the core, so it should be working. I have not used it for other than streaming audio, but can confirm it working some time ago (after my latest changes)
Michael Miller
@Makuna
Mar 31 2016 18:24
It was working for me, and for others. About a week ago I had a few people comment about something going wrong. I could not see a problem. Yesterday I cleaned my system down, Uninstalled, found esp8266 board stuff wasn't correctly getting updated yet again, cleared it. Reinstalled everything, and bam, it reproduced without a problem.
Do you have a link to your audio streaming code? I am wondering if I missed something in the DMA setup that worked due to some default that is no longer true.
Also, are you used Esp8266/Arduino Rc or official last good release? My problems are with the current last good release.
Me No Dev
@me-no-dev
Mar 31 2016 18:25
do you use separate intergration of DMA or do you use the one in the core i2s?
Michael Miller
@Makuna
Mar 31 2016 18:28
THANKS!, I will look at that, I do not use that, but my code is similar. It gives me something to compare and evaluate if I should be just using it.
Me No Dev
@me-no-dev
Mar 31 2016 18:40
@Makuna same thing runs on the new ESP as well