-->
Page 8 of 13

Re: analogread won't work

PostPosted: Sat Jun 13, 2015 4:15 pm
by cal
This adc stuff is somewhat strange.
It seems to be related to RF.
Maybe the difference between working/not working is disabled/enabled wifi.
If you have auto-reconnect enabled on boot it may make a difference.

Cal

Re: analogread won't work

PostPosted: Sat Jun 13, 2015 4:32 pm
by Tawhiz20
cal wrote:This adc stuff is somewhat strange.
It seems to be related to RF.
Cal

Strange is the correct word.. :
I had it working... broke it again.. now its working.. here is what happened:
after I first flashed my ESP i tryed the analogToSerial-program... it gave correct stable values... YEEHHH!! (the problem seemed solved)
I setup some other sensor on my board: DS18-temperature sensor.. with a little program.. it worked..
I setup my DHT22 with a little program.. it worked..
made a little program to connect it to Thingspeak.. worked also..
now... i wanted to report temperatur, humidity AND LDR-value... BANG!.. the same errors as before.. the ADC reported values that were incorrect!!

So I flashed my ESP again..
I tried the analogToSerial-programm... correct stream of values from the ADC!
then I went straight to my Thingspeak-program to see if the ADC-values would show up correct.. and they were just fine!

Somehow the routine of reading the ADC-values (in the firmware?) gets broken...

as you said: Strange!!!

Re: analogread won't work

PostPosted: Sat Jun 13, 2015 4:50 pm
by cal
Can you try disabling wifi when reading adc?

Re: analogread won't work

PostPosted: Sun Jun 14, 2015 10:52 am
by Tawhiz20
cal wrote:Can you try disabling wifi when reading adc?

I will try... but for now on my ESP-201... I am running a program that is reporting the value of the LDR on the ADC to thingspeak... and it has bin working correctly for 12 hours straight... so far so good..

on my Olimex : https://www.olimex.com/Products/IoT/MOD ... e-hardware
under lua ADC works... under C... I have the same bug: 1 or 2 correct values and a RESET (and again and again)

so I tried flashing the Olimex... same result... it resets the whole time!
(since I am a noob: can I flash the Olimex with the same parameters as the generic ESP's?? -since its memory is much larger-)

not moving forward very fast.... :( :!: