These are chat archives for esp8266/Arduino

29th
May 2015
Michael Miller
@Makuna
May 29 2015 06:16
I was at a friends when he tried to install using the Arduino IDE using " http://arduino.esp8266.com/package_esp8266com_index.json" but it never showed an install in the Board Manager. Restarted IDE, Rebooted, nothing appeared.
Did this change and the Readme wasn't updated?
Ivan Grokhotkov
@igrr
May 29 2015 06:51

@Links2004

in the platform.txt from the board manager the runtime.tools.xtensa-lx106-elf-gcc.path= and runtime.tools.esptool.path= is missing ?

those values are supplied by the board manager when it has installed the "xtensa-lx106-elf-gcc" and "esptool" tools. i think this doesn't play well with Visual Micro, but i don't use is so no idea if this can be done portably

@Makuna just opened 1.6.4, opened the board manager — the board is there. not sure what was the issue...
@fmgomes can you try with a different wifi AP? i have seen some APs which do not play nice with EPSs
but that's just a wild guess. i haven't seen such a behaviour yet.
Michael Miller
@Makuna
May 29 2015 07:08
@igrr did you try a fresh install (remove what you have and try the install again?) It shows in mine also, but then, I have had it installed for a week.
@igrr I investigated esp8266/Arduino#352, I pulled down an implementation of strtok_r and after some testing I will put out a pull (in 8 hours, my morning).
Markus
@Links2004
May 29 2015 07:13

its eclipse not Visual Micro, but yes may the board manager support is not the best yet.
is it possible to add relative paths like:

runtime.tools.xtensa-lx106-elf-gcc.path={runtime.platform.path}/../../../tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9
runtime.tools.esptool.path={runtime.platform.path}/../../../tools/esptool/0.4.4

automatically in release process?
the arduino IDE is working fine with this change.

Michael Miller
@Makuna
May 29 2015 07:20
@igrr Ok, I tested on a computer that has never seen a esp8266, but has had an old Arduino IDE on it, upgraded Arduino IDE, and everything works fine. So its his machine.
Ivan Grokhotkov
@igrr
May 29 2015 07:37
@Links2004 actually those paths are there by default and I remove them when I build the board manager package
because the board manager provides some different paths
if you build the IDE from source, you will see those paths in the boards.text
Markus
@Links2004
May 29 2015 07:38
yes in the git version is working fine.
Ivan Grokhotkov
@igrr
May 29 2015 07:39
@Makuna thanks for investigating, I'll try to merge everything today. was preoccupied with the new flash layout and new bootloader...
Markus
@Links2004
May 29 2015 07:40
bootloader sounds nice, how its going?
Ivan Grokhotkov
@igrr
May 29 2015 07:43
good. I've simplified it a lot, compared to the one from espressif and rboot. just one segment of code, no .data and .rodata, no extra build step for extracting the code like in rboot. almost ready to merge...
Markus
@Links2004
May 29 2015 07:43
sounds good
Ivan Grokhotkov
@igrr
May 29 2015 07:45
right now it just loads the app, nothing more, but then it will be just a few lines of code to add OTA
also now we need to flash just one binary, it is not split into two parts
so this simplifies memory layout and "size used by the sketch" calculation
Markus
@Links2004
May 29 2015 07:48
but this will also mean all code is forced to flash? and we loos the option to put some functions in ram?
Ivan Grokhotkov
@igrr
May 29 2015 07:49
no the iram segment is still there. it just follows the irom0 now
because it doesn't matter where it will be located in flash — it will be copied into ram anyway
so the bootloader skips over irom0 and loads three other segments
Markus
@Links2004
May 29 2015 07:51
ok, will take a look when its done :)
alon24
@alon24
May 29 2015 08:09
a few days ago, this image was loaded here https://files.gitter.im/esp8266/Arduino/Lqkg/SPIFFS_WebServer.png
what are all the screens (what is the esp editor)??
fmgomes
@fmgomes
May 29 2015 08:11
@igrr, thanks for your reply, after sending my last message here and going to sleep (this must be the biggest problem, not enough sleeping time :-)), it made sense to change the only things I didn't changed before - the AP and the PC. I just made a quick test this morning and the access from a Linux device (other router running OpenWRT that I have in my network) gave me very good ping results (always below 5ms, no losses), and using my android phone browser gave me consistent access to the web pages on the ESP webserver, without long timeouts as I observed with my PC. I don't have time now to make deeper tests, I will try to make additional tests later today using the same PC with Linux instead of Windows, to check if this is a hardware or software problem with the PC, but it seems that the ESP is OK! :-) So, sorry for all the 'noise' here, the problem seems to not be related with the ESP nor with the Arduino framework for the ESP.
Ivan Grokhotkov
@igrr
May 29 2015 08:26
great! :)
ficeto
@ficeto
May 29 2015 08:34
@alon24 it was an example I had created and loaded while we had spiffs. When we have spiffs again, probably the example will be there also. What you see, runs on the ESP from SPIFFS.
IanWalker
@IanWalker
May 29 2015 08:42
Including the ESP Editor screen ? What exactly is the function of that?
ficeto
@ficeto
May 29 2015 08:46
Its a small webpage for managing the files on spiffs. Similar thing should be in the SD server example
Ivan Grokhotkov
@igrr
May 29 2015 08:46
you can run the same from an SD card right now by the way
chad cormier roussel
@chadouming
May 29 2015 08:46
Ok, so that bootloader thing, it sounds amazing
ficeto
@ficeto
May 29 2015 08:54
I got my DSO yesterday and gotto look at some I2C pulses last night
the best pullup seems to be the 1K resistor
gave the closest to sqware pulses
today I plan to see why the ssd13.. fails when lots is going on
Ivan Grokhotkov
@igrr
May 29 2015 08:57
which model did you get?
ficeto
@ficeto
May 29 2015 08:58
DQ5202 ... they all the same... :D
this one is the 200MHz version
chad cormier roussel
@chadouming
May 29 2015 09:10
I can have access to a professionnal oscilloscope if you need test to be made
ficeto
@ficeto
May 29 2015 09:12
pic_6_1.bmp
@chadouming we would need it if someone wants to investigate the radio. Which would be really cool...
Markus
@Links2004
May 29 2015 09:16
i have access to an network analyzer at work, if some to test with tell me.
chad cormier roussel
@chadouming
May 29 2015 09:17
This message was deleted
image.jpg
ficeto
@ficeto
May 29 2015 09:24
yeah :) mine is a shitty chineese DSO that I imagine costs a fraction of what those cost
unfortuantelly I have no clue how to use network analizer..
Markus
@Links2004
May 29 2015 09:27
in basic it shows the raw "data" of the frequencies in the air. like an oscilloscope for radio.
ficeto
@ficeto
May 29 2015 09:28
a good use for it is to see what power actually comes out of our modules
Markus
@Links2004
May 29 2015 09:28
yes for example
ficeto
@ficeto
May 29 2015 09:29
with the different antennas and settings
as we are not yet managing those
i saw a youtube video with a guy that had 300+ meters range with the trace antennas
Markus
@Links2004
May 29 2015 09:30
free line?
ficeto
@ficeto
May 29 2015 09:30
yup
Markus
@Links2004
May 29 2015 09:30
and may not in the city to many noise therer
ficeto
@ficeto
May 29 2015 09:30
netgear router on the other end
they were on a highway
it was rural but not that much
the other amazing thing is that he used an antenna from a router on another module
and got close to 500 meters
and using a directional mimo adapter, he got 3km +!
I can fly my RC things with that range no problem
Markus
@Links2004
May 29 2015 09:35
as long no other 2,4Ghz stuff is there it is possible, but most of the time there is to many noise there.
unless you go to the Country.
ficeto
@ficeto
May 29 2015 09:36
if the ESP really outputs 20dB, my FrSky gear outputs the same...
we all use 2.4 gear for RC :)
slightly different freqs
if there is any 2.4GHz noise, it's coming from other RC guys and the WiFi will be off of that
so might just work :D
Markus
@Links2004
May 29 2015 09:38
next week i have holidays but after that i can check the ESP12 module output :) may the order ESP7 also be there then i can hook an antenna there.
ficeto
@ficeto
May 29 2015 09:38
beter try esp-201
it does not have an integrated antenna
i imagine that would change things
well... you can cut the trace to the chip antenna and get the same result
Markus
@Links2004
May 29 2015 09:40
the ESP-07 has an chip antenna and an connector the chip antenna an be solderer easy :)
ficeto
@ficeto
May 29 2015 09:40
yeah I have those
wonder if the left over trace would matter
maybe unsolder the cap
Markus
@Links2004
May 29 2015 09:41
yes shut be better
ficeto
@ficeto
May 29 2015 09:43
good time to check if wifi would crap the PWM
if that works, i see no reason not to hack a quick TX-RX and give it a shot this weekend
btw... why does this fail? Am I stupid?
WiFiClient client;
  if (!client.connect("www.google.com", 80)) {
    Serial.println("client failed");
    goToSleep(10);
    return;
  }
  client.print("GET / HTTP/1.1\r\nConnection: close\r\n\r\n");
  delay(10);
  size_t len = client.available();
  uint8_t buf[len];
  client.read(buf, len);
  Serial.write(buf, len);
  client.stop();
  uint16_t maxWait = 2000;
  while(client.connected() && maxWait--) {
    delay(1);
  }
it goes to client failed every time
Markus
@Links2004
May 29 2015 09:47
no wifi?
ficeto
@ficeto
May 29 2015 09:47
i just got NTP before that and it works fine
this runs if wifi is connected only
Markus
@Links2004
May 29 2015 09:47
is uint8_t buf[len]; really working?
ficeto
@ficeto
May 29 2015 09:47
it never gets to that
it never connects
Markus
@Links2004
May 29 2015 09:48
the connect looks ok for me is the dns working, can you try an ip.
ficeto
@ficeto
May 29 2015 09:49
surely
same
Markus
@Links2004
May 29 2015 09:57
its the same when you define WiFiClient client; globaly?
ficeto
@ficeto
May 29 2015 09:58
load 0x40100000, len 29692, room 16 
tail 12
chksum 0x35
ho 0 tail 12 room 4
load 0x3ffe8000, len 1564, room 12 
tail 0
chksum 0x13
load 0x3ffe8620, len 2792, room 8 
tail 0
chksum 0xd8
csum 0xd8

�scandone
scandone
add 0
aid 4
cnt 

connected with nbis-test, channel 11
dhcp client start...
ip:192.168.254.184,mask:255.255.255.0,gw:192.168.254.5
192.168.254.184
NTP:29/05/2015 12:57:35
LmacRxBlk:1
client failed
LmacRxBlk:1
LmacRxBlk:1
Markus
@Links2004
May 29 2015 09:59
the os has some data but you dont get it strange.
ficeto
@ficeto
May 29 2015 09:59
same with global client
i never get that it's connected
Markus
@Links2004
May 29 2015 10:00
can it be some strange interaction with the NTP code?
ficeto
@ficeto
May 29 2015 10:00
not checking for success yields exception
will kill nTP and try
yup....
with NTP after the client:
�scandone
scandone
add 0
aid 3
cnt 

connected with nbis-test, channel 11
dhcp client start...
ip:192.168.254.184,mask:255.255.255.0,gw:192.168.254.5
192.168.254.184
HTTP/1.1 400 Bad Request
Server: nginx/1.4.6 (Ubuntu)
Date: Fri, 29 May 2015 10:07:49 GMT
Content-Type: text/html
Content-Length: 181
Connection: close

<html>
<head><title>400 Bad Request</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx/1.4.6 (Ubuntu)</center>
</body>
</html>
NTP:29/05/2015 13:02:09
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
the NTP code:
udp.begin(localPort);
  sendNTPpacket(timeServer);
  int cb = udp.parsePacket();
  while(!cb){
    sendNTPpacket(timeServer);
    cb = udp.parsePacket();
    yield();
  }
  udp.read(packetBuffer, NTP_PACKET_SIZE);
Markus
@Links2004
May 29 2015 10:04
some idea: the UDP and TCP share the same event to the "android task" and you still getting UDP packets, what brings the connect to fail.
so may try to close the udp
ficeto
@ficeto
May 29 2015 10:08
did not expect such behaviour from UDP
Markus
@Links2004
May 29 2015 10:10
it not a problem of the UDP protokoll its the wifiClient stuff, but have no time to confirm this.
have some other task to do for today.
ficeto
@ficeto
May 29 2015 10:10
yup
udp.close did it
maybe should be added to the example
as that is what I used
Markus
@Links2004
May 29 2015 10:11
yes
ficeto
@ficeto
May 29 2015 12:29
really funky thing with Adafruit_SSD1306
sends the setup packet
and that's it... no more talking to the LCD
Russ Mathis
@RussMathis
May 29 2015 12:52
Is there a way to sleep but keep pwm running ?
Or a certain level of sleep that will still keep the pwm running ?
alon24
@alon24
May 29 2015 13:21
So ssd1306 still not working here?
tzapu
@tzapu
May 29 2015 14:13
i ve got a ssd1306 that works just fine
i couldn t get it to work with @ficeto pull request, but it worked just fine with the adafruit1306 lib he modified before
this is what i use
ficeto
@ficeto
May 29 2015 14:47
will find what's wrong, now that I can see it :)
there is nothing in the code that suggests the behavior I'm seeing
ficeto
@ficeto
May 29 2015 14:58
actually that was dumb on my end... should call lcd.display()
the lib as it is in the repo is working fine on my end
ficeto
@ficeto
May 29 2015 15:07
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 lcd(-1);

void setup() {
  lcd.begin(SSD1306_SWITCHCAPVCC, 0x3C);
}

void loop() {
  lcd.clearDisplay();
  lcd.setTextSize(1);
  lcd.setTextColor(WHITE);
  lcd.setCursor(0,0);
  lcd.print("Heap: ");
  lcd.println(ESP.getFreeHeap());
  lcd.print("Time: ");
  lcd.println(millis() / 1000);
  lcd.display();
  delay(100);
}
tzapu
@tzapu
May 29 2015 15:09
good to know, thanks
if i m reading and writing eeprom in a lib, what would be a good practice , eeprom.begin and eeprom.end at the start and end of my functions? in case there are other eeprom operations in the main app?
ficeto
@ficeto
May 29 2015 15:15
well... what end does is to commit the data in the buffer to the flash chip. You can open the EEPROM in the beginning of the sketch and just use EEPROM.commit() when you change something.
That will ensure that the data is saved n the flash
Russ Mathis
@RussMathis
May 29 2015 15:20
Can someone help with the reset pin? I'm calling ESP.deepSleep and watching the rst & 16 pin. When awake I blink an led. Sleep for 5 sec Wake for 5 secs.
When I watch the scope it seems to indicate a pwm on rst&16? What is the proper way to wake if I want to override the deepSleep?
I want to sleep for 5 minutes but if the light in a room comes on I want to ake. Do I pull rst down or raise it high? Confused since the scode seems to show a pwm when in sleep mode :worried:
ficeto
@ficeto
May 29 2015 15:22
have no clue what pwm you are seeing, but i have tied pins 16, EN and RST together and pulled UP with resistor
to wake manually, i pull the pins down
tzapu
@tzapu
May 29 2015 15:24
@ficeto i m using eeprom in a lib, what happens if both the main app and the lib do eeprom.begin?
Russ Mathis
@RussMathis
May 29 2015 15:25
Currently I have 16 and reset connected together(No resistor). When the ESP is in sleep mode I put the scope on either the 16 or gnd and see a sinus wave.
Not familiar with scope well enough yet LOL. Just got it and started using it.
ficeto
@ficeto
May 29 2015 15:30
@RussMathis pul those pins UP! EN pin also!
Russ Mathis
@RussMathis
May 29 2015 15:31
What is the EN pin?
ficeto
@ficeto
May 29 2015 15:31
@tzapu if whatever opened the EEPROM first made any changes to it and did not commit(), those will be gone
CH_PD
tzapu
@tzapu
May 29 2015 15:32
cool, cheers
Russ Mathis
@RussMathis
May 29 2015 15:34
I don't see a reference in the PIN table to the EN pin?
ficeto
@ficeto
May 29 2015 15:34
@RussMathis CH_PD is the EN pin
Russ Mathis
@RussMathis
May 29 2015 15:35
remember I'm a newb LOL
OK, thanks, why is it called EN?
ficeto
@ficeto
May 29 2015 15:35
i'm more in question why is it called CH_PD
EN comes from ENABLE
maybe CH_PD is Chip_PowerDown
tzapu
@tzapu
May 29 2015 15:36
or this is hangman and CHPD_
ficeto
@ficeto
May 29 2015 15:36
:D
tzapu
@tzapu
May 29 2015 15:36
hmm, it eat my underscores
Russ Mathis
@RussMathis
May 29 2015 15:36
LOL
tzapu
@tzapu
May 29 2015 15:37
not a very good joke afterwards
:P
(probably not very good before either)
ficeto
@ficeto
May 29 2015 15:37
it was actually good at least to me :D had a laugh
@tzapu I'll probably never look at acronyms with underscores the same way again... it's your fault now! :D
Russ Mathis
@RussMathis
May 29 2015 15:47
So the rst pin goes high when in sleep mode, then goes low while chip is not sleeping... That's what the scope seems to indicate. While sleeping if I connect rst to ground it wakes... cool!
ficeto
@ficeto
May 29 2015 15:49
RST and CH_PD need to always be pulled up by e resistor
i prefere having them tied together and pulled with one resistor
you control their level
should never ever have them floating
Russ Mathis
@RussMathis
May 29 2015 15:50
Currently I'm only connecting 16 & rst and it seems to run ok. Why pull up?
ficeto
@ficeto
May 29 2015 15:50
as that will lead to unpredicable restarts
pulled up because they are active low pins
Russ Mathis
@RussMathis
May 29 2015 15:50
ahhh, OK, with 10K or 1000K
ficeto
@ficeto
May 29 2015 15:51
1K-4.7K
that makes sence to name the CH_PD pin since on low the chip is powered down
and RST on low resets the chip
same thing from my point of view :D
Russ Mathis
@RussMathis
May 29 2015 15:53
k, thanks, so they use 3V ? and 3/1000 = 3mA. Will hat help to reduce overall power consumption too?
yup, this newb found ohms law... LOL
ficeto
@ficeto
May 29 2015 15:53
have not investigated that far :)
use 4.7 on mine
but i imagine the input inmedance is so high
that none of the 3mA will pass through
they are input pins after all
Russ Mathis
@RussMathis
May 29 2015 15:55
currently while in deepsleep I seen a .001-.003 mA on the meter. I'll will tie pullup and pulldowns on all the necessary pins and see if there is a difference.
ficeto
@ficeto
May 29 2015 15:55
sure :)
Russ Mathis
@RussMathis
May 29 2015 15:56
Do you know if there is a sleep mode that will keep pwm going?
ficeto
@ficeto
May 29 2015 15:57
well I have not digged that deep, but there is a mode in which only the modem sleeps (wifi)
apb clock should be up
no clue if it will call the interrupt routines
Russ Mathis
@RussMathis
May 29 2015 15:57
k, thx
ficeto
@ficeto
May 29 2015 15:57
the PWM here is not like in arduino
even though I've read that the pins can do something in particular mode/settings
Russ Mathis
@RussMathis
May 29 2015 15:59
I'm trying to keep a pwm running while sleeping for 60 then wake again to allow the PID to make changes and back to sleep.
Not sure if 60sec is to long to provide enough historiesous but would save lots of power out of a DCell with booster.
ficeto
@ficeto
May 29 2015 16:00
i would use an arduino for PWM generation and the ESP can push the new values through Serial or SPI
I would not trust it that much for proper PWM generation
Russ Mathis
@RussMathis
May 29 2015 16:01
Yes, have a couple ATTiny 45 that could manage that.
Russ Mathis
@RussMathis
May 29 2015 16:17
should the CH_PD be pulled up with a resisitor?
fmgomes
@fmgomes
May 29 2015 16:28
Hi @RussMathis, the Olimex board uses 12k pull up resistor on CH_PD
Russ Mathis
@RussMathis
May 29 2015 16:28
K, thanks
should the 12K be used for all pullup and pulldowns? GPIO-0, 15, RST?
fmgomes
@fmgomes
May 29 2015 16:29
I had today that discussion here, trying to find out the good values
Russ Mathis
@RussMathis
May 29 2015 16:30
Even when pulling pin 0 down for programming?
fmgomes
@fmgomes
May 29 2015 16:30
The olimex board uses 12k for CH_PD and reset
Russ Mathis
@RussMathis
May 29 2015 16:31
cool, thx!
fmgomes
@fmgomes
May 29 2015 16:31
for the remaining pins they use a 2k resistor in series withthe pin, that can be connected to gnd or vcc
And at least for me it is working and stable
ficeto
@ficeto
May 29 2015 16:32
@RussMathis many variations in the size will work
should be great from 1K up to over 10K
fmgomes
@fmgomes
May 29 2015 16:32
Before this board I have some ESP-01 boards, and even using the same resistors and lots of capacitors near the board, I had always stability problems
like WDOG resets, CPU Exceptions, etc.
ficeto
@ficeto
May 29 2015 16:32
when a pin switches the output level and that pin has a pull
i found best to be used 1-2K resistors
they give best curve in both directions
@fmgomes it seems those ESP-01 boards are not very good at all
Russ Mathis
@RussMathis
May 29 2015 16:36
hmmm. so use 1-2K for GPIO-0, GPIO-15 and a 12K for the CH_PD? Sound good?
ficeto
@ficeto
May 29 2015 16:36
yes
Russ Mathis
@RussMathis
May 29 2015 16:37
Thx!
Russ Mathis
@RussMathis
May 29 2015 16:44
Where can I find a good doc describing max currents for pin sinking/sourcing?
Ivan Grokhotkov
@igrr
May 29 2015 16:45
thanks everyone for the pulls, merged everything
Russ Mathis
@RussMathis
May 29 2015 16:46
A new version is available at for Arduino IDE?
Ivan Grokhotkov
@igrr
May 29 2015 16:47
not yet... i have just pushed some major changes (new bootloader), so would like to let people who build this stuff from source to try this first
might have broken something
don't want to affect everyone else :)
Russ Mathis
@RussMathis
May 29 2015 16:48
cool... great job, get some sleep now?
Ivan Grokhotkov
@igrr
May 29 2015 16:49
haha, not yet i'm afraid)
Russ Mathis
@RussMathis
May 29 2015 16:49
LOL
Russ Mathis
@RussMathis
May 29 2015 16:54
Can the IOs be latched between deepSleep sleep/wake states?
I found this in an Espressif Doc:
The digital IO pads are bidirectional, non-inverting and tri-state. It includes input and an output
buffer with tristate control inputs. Besides this, for low power operations, the IO can also be set
to hold. For instance, when we power down the chip, all output enable signals can be set to hold
low.
Optional hold functionality can be built into the IO if requested. When the IO is not driven by the internal or external circuitry, the hold functionality can be used to hold the state to the last used state.
ficeto
@ficeto
May 29 2015 16:56
I can also say that any pin should be able to be used for wakeup
//GPIO (0-15) PIN Function Bits
#define GPFSOE 0 //Sleep OE
#define GPFSS  1 //Sleep Sel
#define GPFSPD 2 //Sleep Pulldown
#define GPFSPU 3 //Sleep Pullup
#define GPFFS0 4 //Function Select bit 0
#define GPFFS1 5 //Function Select bit 1
#define GPFPD  6 //Pulldown
#define GPFPU  7 //Pullup
#define GPFFS2 8 //Function Select bit 2
//GPIO (0-15) PIN Control Bits
#define GPCWE  10 //WAKEUP_ENABLE (can be 1 only when INT_TYPE is high or low)
#define GPCI   7  //INT_TYPE (3bits) 0:disable,1:rising,2:falling,3:change,4:low,5:high
#define GPCD   2  //DRIVER 0:normal,1:open drain
#define GPCS   0  //SOURCE 0:GPIO_DATA,1:SigmaDelta
Russ Mathis
@RussMathis
May 29 2015 16:59
But you would have to enable or setup the pin(s) before sleeping, right?
ficeto
@ficeto
May 29 2015 16:59
yes
Russ Mathis
@RussMathis
May 29 2015 17:00
I don't know how to do that yet! Guess some bit in a register somewhere?
ficeto
@ficeto
May 29 2015 17:00
:D
which pin do you want to do it for?
Ivan Grokhotkov
@igrr
May 29 2015 17:00
do you guys think that passing arguments to the bootloader through RTC mem is a good idea?
@Links2004 @ficeto
basically the options are: RTC mem or flash
ficeto
@ficeto
May 29 2015 17:01
when is that data populated and when is it read?
Russ Mathis
@RussMathis
May 29 2015 17:01
Would be easier than storing some value in eeprom and reading on wake?
ficeto
@ficeto
May 29 2015 17:01
@RussMathis eeprom is on flash
Russ Mathis
@RussMathis
May 29 2015 17:02
OK, so before sleep could save some var to RTC and on wake have it available quicker than having to read flash?
Ivan Grokhotkov
@igrr
May 29 2015 17:02
say you have a sketch which downloads an OTA update and stores it in the flash somewhere. next it should reboot into the bootloader, passing it a command (like "flash image from 0x50000 to 0x00000")
like they do it in Android :)
almost
so the command has to go either to flash or to RTC
ficeto
@ficeto
May 29 2015 17:04
as a matter of fact, only half a page is used for the init data
so there is plenty of space to store other stuff there, like the status of the update
Ivan Grokhotkov
@igrr
May 29 2015 17:04
the problem with RTC is that it may contain garbage at boot...
init data? like the fourth page from the end of flash?
ficeto
@ficeto
May 29 2015 17:04
yes
Ivan Grokhotkov
@igrr
May 29 2015 17:05
so we need to erase it each time we write something there
ficeto
@ficeto
May 29 2015 17:05
and when written to, only 128 bytes are written
it's a whole 4K block
use it like the eeprom, just offset
Ivan Grokhotkov
@igrr
May 29 2015 17:06
so, the bootloader will read the first 128 bytes, store it somewhere, erase, write 128 bytes back, right?
when it needs to clear the command, that is
ficeto
@ficeto
May 29 2015 17:06
sure
tthough no need to clear, if that command is actually status of a sort
have it a struct with info for what you are flashing
Ivan Grokhotkov
@igrr
May 29 2015 17:07
well you need to clear if you don't want the bootloader to update again after flashing
actually not
ficeto
@ficeto
May 29 2015 17:07
on actuall bott that could be read and known if flash went OK or failed or what
Ivan Grokhotkov
@igrr
May 29 2015 17:07
we can overwrite this with 0xff
ficeto
@ficeto
May 29 2015 17:08
why clear?
if the ststaus byte is update, write the image from the address bytes to 0x0
then set status updated
Ivan Grokhotkov
@igrr
May 29 2015 17:09
when we write to flash, we can only write "1" bits
ficeto
@ficeto
May 29 2015 17:09
yeah...
or erase whole block?
Ivan Grokhotkov
@igrr
May 29 2015 17:10
so then we can make status_update = 0x11 and status_updated=0xff
so you can always overwrite status without erasing
smth like that
and need to erase only when we store new command there
ficeto
@ficeto
May 29 2015 17:12
sure
that block will not live more than the rest anyway :)
so erase each time the rest are erased is fine
Ivan Grokhotkov
@igrr
May 29 2015 17:19
esp8266/Arduino#356
anyone tried PWM with the new SDK?
Russ Mathis
@RussMathis
May 29 2015 17:20
what do you need tried?
Ivan Grokhotkov
@igrr
May 29 2015 17:38
ok, yeah, analogWrite got broken with SDK 1.1.0
goes into WDT reset
ficeto
@ficeto
May 29 2015 18:06
so i digged into GPIO WAKEUP_ENABLE a bit
and here is what it does:
when pin is set as WAKEUP (PULLUP/PULLDOWN)
at the point of calling pinMode(WAKEUP_PULLUP)
if the pin is HIGH, that will cause WDT reset
and sketch will restart
if HIGH, it will continue
Russ Mathis
@RussMathis
May 29 2015 18:10
cool!
ficeto
@ficeto
May 29 2015 18:11
too much HIGH :D one should be LOW
Russ Mathis
@RussMathis
May 29 2015 18:11
So simply calling pinMode(15,WAKEUP_PULLUP);deepSleep(100000000);
The chip will sleep...
Then by externally pulling 15 HIGH will restart the chip before the expiration time sleep arg?
ficeto
@ficeto
May 29 2015 18:12
WAKEUP_PULLUP not in code yet
no
did not say that
Russ Mathis
@RussMathis
May 29 2015 18:13
k...
ficeto
@ficeto
May 29 2015 18:18
void setup() {
  pinMode(14, WAKEUP_PULLUP);
  Serial.begin(115200);
  Serial.println("Booted!");
}
if pin 14 is LOW at the time pinMode is called
wdt will reset and not continue to say "Booted!"
kind of a latest "staging" version
Russ Mathis
@RussMathis
May 29 2015 18:20
cool, I'll try it out now...
Russ Mathis
@RussMathis
May 29 2015 18:27
downloaded and installed via arduino ide 1.6.4 from board manager
from eclipse set Private hardware path to:..packages\esp8266\hardware\esp8266\1.6.4-755-gdb0b8be
and recompiled... Worked for simple sleep test sketch
fmgomes
@fmgomes
May 29 2015 18:27
Is there any example for Spiffs? I would like to store some http / template files to be served by the webserver
Russ Mathis
@RussMathis
May 29 2015 18:28
me too... :)
Ivan Grokhotkov
@igrr
May 29 2015 18:28
Not yet
Check out the SD example though
Russ Mathis
@RussMathis
May 29 2015 18:28
Did any new examples get added for anything? :fire:
Cool, 6 examples under SD! Fantastic!!!!!
Ivan Grokhotkov
@igrr
May 29 2015 18:29
if you have a microSD to SD adapter, you can solder to a few wires and have fun with SD
also be sure to check out the SD example under the ESP8266WebServer library
it shows how you can serve files from the SD card with the web server
Russ Mathis
@RussMathis
May 29 2015 18:30
Have a few SD, can solder directly to the pins on the card! LOL!
Ivan Grokhotkov
@igrr
May 29 2015 18:30
meh
not very good idea
you won't be able to put files on the SD with your computer then
Russ Mathis
@RussMathis
May 29 2015 18:30
Too late... done that already. works good!
However, temperature variances seem to cause the cards to malfunction I'm always having to reformat the SDs.
Maybe lose wire or something ...
Have some nokia 5110, wonder if those will work...?...
Russ Mathis
@RussMathis
May 29 2015 18:36
@ficeto, so when will WAKEUP_PULLUP, be defined?
Has anyone figured out how to implement the lowpower espressif talks about for wearables? Seems they say chip can be woke up on wifi access? incomming? outgoing? Be really nice to create low power devices like Intel's curie..
IanWalker
@IanWalker
May 29 2015 18:54
@iggr - Is the wifio.cc project yours? If so can You tell us more about it ?
Ivan Grokhotkov
@igrr
May 29 2015 18:56
actually I did a small part of this (no longer active) project
it was a pro-mini-compatible board with ESP and atmega328
shielded for FCC compliance
never reached kickstarter though
multiple other esp8266 based projects came faster
IanWalker
@IanWalker
May 29 2015 19:01
Arduino / ESP combo could work as a kickstarter but I suppose its very difficult to hit attractive price point - Only combo i have found so far is the cactus micro.
Me No Dev
@me-no-dev
May 29 2015 19:02
i have an idea for 32u4+ESP over SPI
Ivan Grokhotkov
@igrr
May 29 2015 19:02
well we wanted it to be Arduino-branded (as that would allow for a higher pricing point) but failed to agree on terms with Massimo et al
Me No Dev
@me-no-dev
May 29 2015 19:02
the esp being a slave
Ivan Grokhotkov
@igrr
May 29 2015 19:04
not failed really but rather were unfortunate trying to talk to them while they were in those legal battles
so their interest was elsewhere
IanWalker
@IanWalker
May 29 2015 19:04
I think they are launching a new wifi shield with a Atmel part. Suppose they dont really want cheaper competion.
Ivan Grokhotkov
@igrr
May 29 2015 19:06
yes, could be true. actually they said they wanted as many boards as possible, as long as the pricing points and features are different
IanWalker
@IanWalker
May 29 2015 19:09
@me-no-dev check out the cactus Micro- http://www.aprbrother.com/. Available via ebay and tindie. Have recieved one but have not played with it yet.
What do You all think about the Oak kickstarter ?
Me No Dev
@me-no-dev
May 29 2015 19:12
@IanWalker I'm talking about SPI connectivity. So you can extend and use another serial through the ESP, can exchange data much more quickly and so on. Byte protocol, no string parsing
chad cormier roussel
@chadouming
May 29 2015 19:15
do i need to burn bootloader or eboot will be flashed automatically ?
Ivan Grokhotkov
@igrr
May 29 2015 19:24
eboot is included into the binary
it lives in the first sector
chad cormier roussel
@chadouming
May 29 2015 19:25
cool
hmm, sketch use blah blah adds 38365 bytes that are not uploaded
Me No Dev
@me-no-dev
May 29 2015 19:30
having issues with esptool and the latest git
uload hangs
chad cormier roussel
@chadouming
May 29 2015 19:30
worked fine here tho
also, it seems faster from boot to execution
almost instant
Me No Dev
@me-no-dev
May 29 2015 19:31
Uploading 205696 bytes from /var/folders/b_/2gy4g72944359d2vj4htbtwm0000gn/T/build8969919979364818920.tmp/sketch_may29a.cpp.bin to flash at 0x00000000
    erasing flash
    size: 032380 address: 000000
    first_sector_index: 0
    total_sector_count: 51
    head_sector_count: 16
    adjusted_sector_count: 35
    adjusted_size: 023000
    espcomm_send_command: sending command header
    espcomm_send_command: sending command payload
    setting timeout 10000
    setting character timeout 100
    done
    setting timeout 1
    setting character timeout 1
    done
    espcomm_send_command: receiving 2 bytes of data
    writing flash
..
i'm on a Mac
chad cormier roussel
@chadouming
May 29 2015 19:31
i didn't have that much information
i'm on pc xD
Me No Dev
@me-no-dev
May 29 2015 19:32
i have debug enabled in preferences
chad cormier roussel
@chadouming
May 29 2015 19:32
ah, didn't have the upload debug nabled
Me No Dev
@me-no-dev
May 29 2015 19:33
it usually shows a bunch of dots while flashing
Ivan Grokhotkov
@igrr
May 29 2015 19:33
you have a scope now... can you take a look at uart?
works fine for me on a Mac...
Me No Dev
@me-no-dev
May 29 2015 19:35
maybe it's something else
i killed all esptool processes that were hanging
and restarted the IDE
now hangs before the esptool debug
the last line is the execution command
if I unplug the uart it errors fine
will do old fashioned reboot
update nagges from a few days now anyways
brb
Ivan Grokhotkov
@igrr
May 29 2015 19:40
re extra 38365 bytes:
accidentally added .bss to the regex
recipe.size.regex=^(?:.irom0.text|.text|.data|.rodata|.bss|)\s+([0-9]+).*
chad cormier roussel
@chadouming
May 29 2015 19:46
yay, i'm not crazy :D
Me No Dev
@me-no-dev
May 29 2015 20:01
reboot fixed the flashing issue
Me No Dev
@me-no-dev
May 29 2015 20:16
same thing again
and I have an unkillable esptool
Russ Mathis
@RussMathis
May 29 2015 20:29
@ficeto, the esp goes in the fishing bob/cork and wakes via a spring loaded weight when the fish bites?
Michael Miller
@Makuna
May 29 2015 20:39
Servo library Pull out for review, supports the new Timer0 and the already present Timer1, based on the Servo library that comes with Arduino
chad cormier roussel
@chadouming
May 29 2015 21:04
Wifi enabled fishing, brilliant :D
chad cormier roussel
@chadouming
May 29 2015 21:27
Since i've started trying to get my esp crashing, it won't -_-'
Ivan Grokhotkov
@igrr
May 29 2015 23:12
@chadouming try analogWrite