These are chat archives for esp8266/Arduino

20th
Nov 2016
marwijn
@marwijn
Nov 20 2016 13:02
I'm building a balancing robot based on the esp. To improve the time of the balancing algorithm I'm trying to run the balacing loop inside an ISR. This routine runs every 5 ms. and takes about 750 us (due to reading of mpu6050 sensor over I2C). It seems that this prevents the wifi from working properly. Am I missing anything or is 750 us inside an ISR just too long. Would there be another way to get a steady timing on a 5ms interrupt ?
Holger Lembke
@holgerlembke
Nov 20 2016 13:38
If I look into httpupdate.ino-example, as far as I see, there is no version control, the sketch simply updates every time it finds the file.
has anyone some smart idea how to do a version checking concept?
I think about somethign without fiddeling around in variouse files. I would prefere like checking the datetime of the update file or have some counter in the filename
Michael Miller
@Makuna
Nov 20 2016 16:56
@marwijn I forget the max safe time, but I thought it was around 12us max inside a "no interrupts" sandwich. Do you sepecifically stop interrupts inside your ISR?
Generally, I think your best approach is leave it in the loop and code without using delay and use micros to time the loop update to apply to calculations rather than code for a constant 5ms.
Clemens Kirchgatterer
@everslick
Nov 20 2016 16:57
@holgerlembke the version checking is done server side. httpUpdater send its version, mac and some other info to the server, which then has to decide which and if file to send to the ESP8266
Holger Lembke
@holgerlembke
Nov 20 2016 17:11
@everslick I know.
The question was more about how to have a concept about version management... If I create some server side solution (what this example lacks of) I need to come up with a plan how to tell the server which version it has and so one.
my current implementation works like this: arduino-ide copys the compiled bin file on the update-server and the client does a date-size-check of the update file every once in a while with client side data stored in a spiffs-file. works nice.
I just want to have some sort of "rapid development"-tool where I don't have to do much repeatativ handwork
Holger Lembke
@holgerlembke
Nov 20 2016 17:18
better solution would be if the IDE create some sort of version numering stuff I can export to the update server and into the update file. like in (windows) ressources.
Mehrdad K
@mkeyno
Nov 20 2016 17:25
@Makuna you mean for every interrupt have 12us or it is just for "no interrupts" sandwich
Clemens Kirchgatterer
@everslick
Nov 20 2016 17:28
ah IC. i just name the files with an version postfix. directly from the make based build.
Holger Lembke
@holgerlembke
Nov 20 2016 17:30
@everslick how to you manage the version postfix?
Clemens Kirchgatterer
@everslick
Nov 20 2016 17:31
i have a file (Makefile.version) that has the version number in it, that is included in the main Makefile...
VERSION = 2.1.4
when its time for a new release i edit the file by hand. but i could easily automat it with sed and have make target for incrementing the version
Michael Miller
@Makuna
Nov 20 2016 17:44
@mkeyno its more complex, but in general nointerrupts sandwhich. Some ISRs are already blocking interrupts that are at the same priority level. BUT; I believe the important WiFi interrupt is only blocked by noInterrupts.
Holger Lembke
@holgerlembke
Nov 20 2016 17:46
so you dont use the IDE...
Mehrdad K
@mkeyno
Nov 20 2016 17:47
is there a datasheet for ESP8266 just like Atmel chip which is shows all ISR register table and its priorities
Clemens Kirchgatterer
@everslick
Nov 20 2016 18:15
@holgerlembke no, i don't use it. i can't do without my vim and make.
Holger Lembke
@holgerlembke
Nov 20 2016 18:46
hmm. is there a smart way to make x.y.z.255 from x.y.z.a?
hmm2. not sure that this always gives the broadcast adress....
Holger Lembke
@holgerlembke
Nov 20 2016 18:59
IPAddress broadcastIp(WiFi.localIP() | ( ~WiFi.subnetMask()));
karlp @karlp wonders if WiFi.subnetMask() handles non-8/16/24 bit netmasks properly