These are chat archives for esp8266/Arduino

7th
Jul 2015
probonopd
@probonopd
Jul 07 2015 06:36
Hi, I am looking to increase performance of my sketch. @Makuna mentioned he has a task library that "helps" manage non-preemptive tasks, but it would require that HTTP.handleClient() and/or SSDP.update() be modified to do less in a loop at one time. @me-no-dev would you be interested to consider supporting to thread off the networking stuff?
Me No Dev
@me-no-dev
Jul 07 2015 07:51
tasks or no tasks, you need to have a streamlined sketch to be fast
@probonopd I think the answer lies somewhere else for you
either way you can handle only that much stuff at once
Ivan Grokhotkov
@igrr
Jul 07 2015 07:53
@probonopd performance improvement starts with profiling. you really need to identify execution bottlenecks before you start optimizing
M0ebiu5
@M0ebiu5
Jul 07 2015 12:23
Hi! How can i try out the latest version from github, if i use arduino 1.6.4 with board manager?
Ivan Grokhotkov
@igrr
Jul 07 2015 12:32
You can generate the boards manager package yourself... if you have python installed, you can run build_boards_manager_package.sh script in build directory
this will generate the package and start a local web server
then you can add new boards manager url in IDE settings
M0ebiu5
@M0ebiu5
Jul 07 2015 12:34
Thanks!
i have only tested this script on a Mac
if you are on Linux, replace gsed calls with sed
if on windows, replace them as well, and use MinGW/Cygwin
M0ebiu5
@M0ebiu5
Jul 07 2015 12:38
i will try on windows
Ivan Grokhotkov
@igrr
Jul 07 2015 12:39
also you might need to tweak this line:
sha=`shasum -a 256 $outdir.zip | cut -f 1 -d ' '`
shasum on Mac and Linux (and Cygwin) have different output formats
sticilface
@sticilface
Jul 07 2015 13:22
Is a bit odd, i just followed your instructions and it worked. tried it again (uninstalling the package ) and now i get CRC doesn't match file corrupted, when i try and re-install it. (I'm on a mac)
Ivan Grokhotkov
@igrr
Jul 07 2015 13:24
currently IDE doesn't handle the case when an installed version is no longer present in the json file. you need to go to your ~/Library/Arduino15/staging/packages/ directory and remove files manually
and also from ~/Library/Arduino15/packages/ i think
there is a feature recently merged into mainline Arduino git, which will give us some support for frequent core updates (nightly builds)
it should be available by the time Adruino 1.6.7 comes out
sticilface
@sticilface
Jul 07 2015 13:28
That worked cheers. Was just testing how easy it was to do an update...
fmgomes
@fmgomes
Jul 07 2015 16:04
How can I confirm if i have the latest esp8266 version installed on Arduino? In the board manager it indicates 1.6.5-804-g2d340c7
Ivan Grokhotkov
@igrr
Jul 07 2015 16:11
you are using version based on commit 2d340c7
if you want absolutely latest (git trunk)
so depending on what kind of latest you need...
you may use the method I outlined a few posts above (local webserver)
fmgomes
@fmgomes
Jul 07 2015 16:17
is there any 'rule' for having a new build available vs having to build it ourselves? Do you build it periodically?
Ivan Grokhotkov
@igrr
Jul 07 2015 17:36
I build it when new features are added, and when there are no major issues which have to be resolved
when IDE 1.6.7 arrives, we will have support for nightly updates
currently the issue to be resolved is Windows toolchain update — I need to change link to point to the new package
Russ Mathis
@RussMathis
Jul 07 2015 17:59
As of 1hr ago I started getting this error: warning: espcomm_send_command: wrong direction/command: 0x00 0x08, expected 0x01 0x08
Anyone have idea?
I've tried on several modules 4 and get the same issue...
I've also removed the ESP package and reinstalled from arduino ide environment
Ivan Grokhotkov
@igrr
Jul 07 2015 18:16
I haven't pushed new package today
perhaps you got OS updated?
sticilface
@sticilface
Jul 07 2015 18:16
I've got a slightly different problem. My sketch that compiles just fine usually does not on the latest IDE, pulled from the hub!
I get the following, right at the end (I think this is linking part..)
Build options changed, rebuilding all
Melvana.cpp.o: In function `operator()':
/Users/amelvin/c_ws2812.ino:1353: undefined reference to `__cxa_guard_acquire'
/Users/amelvin/c_ws2812.ino:1353: undefined reference to `__cxa_guard_release'
Melvana.cpp.o: In function `_M_invoke':
/Users/amelvin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9/xtensa-lx106-elf/include/c++/4.8.2/functional:2073: undefined reference to `__cxa_guard_acquire'
Melvana.cpp.o: In function `Manipulate_Hue(RgbColor, float)':
/Users/amelvin/c_ws2812.ino:2637: undefined reference to `__cxa_guard_release'
collect2: error: ld returned 1 exit status
Error compiling.
Ivan Grokhotkov
@igrr
Jul 07 2015 18:17
that's a known issue (someone filed it on github already)
I'll fix that
sticilface
@sticilface
Jul 07 2015 18:19
ah ok... i'll stop breaking things trying to fix it then. thank you
Ivan Grokhotkov
@igrr
Jul 07 2015 18:19
you have some local static variables in your sketch?
sticilface
@sticilface
Jul 07 2015 18:29
yes quite a few...i googled and saw that it was related to that, but the main things it is complaining about don't..
Ivan Grokhotkov
@igrr
Jul 07 2015 18:36
check this one for possible workaround: esp8266/Arduino#500
sticilface
@sticilface
Jul 07 2015 18:43
it would be quite a task to make them all global, its quite a sketch now.. getting on for 3-4K lines, and i'd have to rename all the variables... How come it has just started doing it with this latest one? I was using the #495 branch and it was working fine. It literally just started doing it 1hr ago!
Ivan Grokhotkov
@igrr
Jul 07 2015 18:50
I suppose the error started happening for you after you switched from the boards manager package to latest git version?
sticilface
@sticilface
Jul 07 2015 18:51
ah you know what... i've figured it out!
sticilface
@sticilface
Jul 07 2015 18:58

I went back to the #495 IDE... and it didn't work either. Then i remembered the thing before in #500 .. and the only addition to the code I had was this...
static uint32_t espcyclecount = ESP.getCycleCount();
I changed it to this

      static uint32_t espcyclecount = 0 ; 
      espcyclecount = ESP.getCycleCount();

and it compile again fine, and with the latest as well. so it is purely related to using the ESP class functions and statics, as i've got a lot of other statics!

Ivan Grokhotkov
@igrr
Jul 07 2015 19:05
not exactly. statics which don't require code to be initialized do not trigger this error
when you init it with a constant compiler simple
simply puts this constant into data segment
whereas when initialization has to happen at runtime (by calling a function like in your case), compiler will generate guard objects to ensure thread-safe initialization
which leads to an error because I didn't implement guard object handling functions
this error will also occur if you have non-POD local static variables
Russ Mathis
@RussMathis
Jul 07 2015 19:12
@igrr, is there a way to catch two pin interrupts if they happen at the same time?
sticilface
@sticilface
Jul 07 2015 19:12
ah ok.. thank you for ur help, as always!
Ivan Grokhotkov
@igrr
Jul 07 2015 19:15
@RussMathis if you have interrupts attached for both pins, then both of them will be called
or do you want to detect this particular case somehow, as opposed to the case when only one interrupt happens?
Russ Mathis
@RussMathis
Jul 07 2015 19:19
ok, during testing I've tied pins 14 and 2 to a single wire and hit ground. Then from the isrs i print "p14" or "p2", well I'm sometimes seeing multiple p14 after each other or p2s after each other, I'm not seeing p2, p14, p2, p14, etc, etc.:
Also, after 100 or so tests the WTD fires
Ivan Grokhotkov
@igrr
Jul 07 2015 19:22
you print from ISR?!
Russ Mathis
@RussMathis
Jul 07 2015 19:23
Yes, just to see if the ISRs were correctly asserted
Ivan Grokhotkov
@igrr
Jul 07 2015 19:23
like, really? :)
i mean, about every microcontroller programming tutorial will tell you not to print from ISRs.
Russ Mathis
@RussMathis
Jul 07 2015 19:24
I should just record the microseconds and display in a loop you suggest... :)
Ivan Grokhotkov
@igrr
Jul 07 2015 19:24
but never mind, i'll take a look
Markus
@Links2004
Jul 07 2015 19:24
if the serial buffer is full you will fail in isr
Russ Mathis
@RussMathis
Jul 07 2015 19:24
thx
Ivan Grokhotkov
@igrr
Jul 07 2015 19:24
perhaps something is really wrong when multiple pin interrupts happen
Russ Mathis
@RussMathis
Jul 07 2015 19:25
Ohh and I can't trap some of the pins with and ISR only 2 and 14 are working at the time.
Well, I have not tried all of them yet...
Ivan Grokhotkov
@igrr
Jul 07 2015 19:27
you mean, your interrupt handler doesn't get called when you attach it to some of the pins?
Russ Mathis
@RussMathis
Jul 07 2015 19:28
I'm verifying which pins now and if my code is correct... give me a few minutes.
when servicing and esp does the isr disable further isrs?
Ivan Grokhotkov
@igrr
Jul 07 2015 19:34
gpio interrupts will not happen while your handler runs
Me No Dev
@me-no-dev
Jul 07 2015 19:38
put a resistor to vcc and 100nf cap to GND and it will stop happening
what you get is totally normal
since you are human, you can't just give 0/1 to the mcu touching the wires
that is why you get those
you will actually touch many times in the first microsecond
Russ Mathis
@RussMathis
Jul 07 2015 19:41
so it is possible to mis a simultaneous interrupt if an isr is running at the same time?
Me No Dev
@me-no-dev
Jul 07 2015 19:41
no
if it really is at the same time
both will be called
Russ Mathis
@RussMathis
Jul 07 2015 19:41
How does that happen? are the interrupts some how latched?
Me No Dev
@me-no-dev
Jul 07 2015 19:41
read my previous comment
its a port interrupt
not pin
its separated by pin in the isr
Russ Mathis
@RussMathis
Jul 07 2015 19:42
ahhh, that's why you get all the big money. LOL thanks!
Me No Dev
@me-no-dev
Jul 07 2015 19:42
so comes in as mask
have no clue what big money you are talking about
Russ Mathis
@RussMathis
Jul 07 2015 19:43
How do I learn about this stuff, have pointer to book or documents?
Me No Dev
@me-no-dev
Jul 07 2015 19:43
that is how i do it :)
Russ Mathis
@RussMathis
Jul 07 2015 19:44
LOL, thx!
Me No Dev
@me-no-dev
Jul 07 2015 19:47
you can also read the core source
functions are not large
Russ Mathis
@RussMathis
Jul 07 2015 20:07
@me-no-dev thx
Rahul Thakoor
@rahul-thakoor
Jul 07 2015 23:18
This message was deleted

Hey there.. First thanks for your awesome library, really got me going on arduino and esp8266 iot projects particularly as a beginner.. I need your help with something if its not too much to ask..
I want to use esp8266 standalone as an access point and start an http webserver on it.. then use iphone to connect to server via blynk app(check it out at blynk.cc) to trigger actions such as set a gpio HIGH etc.. I know this is possible through a web browser on device connected to AP set up by esp, but I want to use the blynk app given its awesome grraphics interface.. could you help me plz? here is what I came up with so far:

include <ESP8266WiFi.h>
include <WiFiClient.h>
include <ESP8266WebServer.h>
include <BlynkSimpleEsp8266.h>
/ Create a WiFi access point and provide a web server on it. /
/ Set these to your desired credentials. /
const char ssid = "ESPap";
const char password = "thereisnospoon";
char auth[] = "8d8269cxxxxxxxxxxxxxxxxxxxxxx8";
ESP8266WebServer server(80); /* Just a little test message. Go to http://192.168.4.1 in a web browser connected to this access point to see it. */ void handleRoot() { server.send(200, "text/html", "<h1>You are connected</h1>"); }
void setup() { delay(1000); Serial.begin(115200); Serial.println(); WiFi.mode(WIFI_AP_STA); Serial.println("mode is ap and station"); Serial.println("Configuring access point..."); / You can remove the password parameter if you want the AP to be open. / WiFi.softAP(ssid, password); IPAddress myIP = WiFi.softAPIP(); Serial.print("AP IP address: "); Serial.println(myIP); server.on("/", handleRoot); server.begin(); Serial.println("begin wifi..."); WiFi.begin(ssid, password); Serial.println("HTTP server started"); Serial.println("blynking..."); Blynk.begin(auth, ssid, password, "192.68.4.1", 80); Serial.println("blynking done..."); }
void loop() { server.handleClient(); Blynk.run(); }

Im told by blynk community that" Arduino for ESP has only TCP server as of writing"
but the blynk app uses SSL connection.. any way to work around this?