These are chat archives for esp8266/Arduino

18th
Apr 2016
Clemens Kirchgatterer
@everslick
Apr 18 2016 06:42
is there a way to get the number of bytes sent over a network interface? like e.g. ifconfig ?
LWIP_STATS_DISPLAY is not enabled in lwIP config, so IP_STATS_DISPLAY() functions will not work
Ivan Grokhotkov
@igrr
Apr 18 2016 07:11
ah, my bad. LWIP_STATS is disabled in default build of lwIP
But you can change that line locally and use lwIP built from source.
To do that, you need to be using git version of the core, and select "Core Development Module" board from Tools menu. It will have an additional option to select lwIP variant used.

Just tried that myself, seems to be working fine.
Add

extern "C" {
  #include <lwip/stats.h>
}

to the sketch

Ivan Grokhotkov
@igrr
Apr 18 2016 07:17
lwip_stats.ip.xmit returns something sane, lwip_stats.etharp.xmit and lwip_stats.link.xmit do not seem to work
Clemens Kirchgatterer
@everslick
Apr 18 2016 07:45
thank you very much. any chance that those stats could be made available in the default build? i open a can of worms, if i have to redo those changes every time i update esp8266/Arduino. :-/
IMHO performance measures are painfully missing
with your help i can now track heap memory (with the malloc wrapper) but my cpu load measurment is very cumbersum. i count the number of yield and delay calls and estimate some cpu load from that :-(
it would also be interesting how much cpu time is spent in the core and how much in 'user space'.
or is there something like a 'idle' time (sleeping) ?
Ivan Grokhotkov
@igrr
Apr 18 2016 07:52
First we need to check how much RAM does enabling stats consume... Then, if the value is not huge (or if we can enable just a portion of these stats), we can make this change once we switch to GCC-built lwip as the default one.
#1926
Clemens Kirchgatterer
@everslick
Apr 18 2016 07:53
IC
looks promising. :)
Me No Dev
@me-no-dev
Apr 18 2016 08:25
@igrr see there was a point of adding source build option not just for me :)
Ivan Grokhotkov
@igrr
Apr 18 2016 08:27
@me-no-dev yeah, i see the point :)
since i was building from the command line, it was never actually a trouble for me to do make -C path/to/lwip all install && ./build-sketch.py
but it is good to be able to do that from the IDE :)
Clemens Kirchgatterer
@everslick
Apr 18 2016 08:29
what was the make option to set a define from command line?
Ivan Grokhotkov
@igrr
Apr 18 2016 08:29
make CPPFLAGS=-DLWIP_STATS=1
Clemens Kirchgatterer
@everslick
Apr 18 2016 08:30
or i could use sed to chang that particular define in lwipopts.h
thx, will try this first :)
Ivan Grokhotkov
@igrr
Apr 18 2016 08:31
maybe it needs some quotes around -DLWIP_STATS=1
Mario Mikočević
@mozgy
Apr 18 2016 10:19
@me-no-dev yes, thats a copy and one that do not even work on all OLEDs, I don't like when people put their names in credits for something copied and barely functional
there are several OLED libraries that are way better than this, imnho the best is https://github.com/squix78/esp8266-oled-ssd1306
Ivan Grokhotkov
@igrr
Apr 18 2016 10:21
oh, I wonder why it's not added yet. it's a great library
Mario Mikočević
@mozgy
Apr 18 2016 10:22
none did a PR I suppose
Me No Dev
@me-no-dev
Apr 18 2016 10:22
@mozgy maybe you meant to ping @Makuna ? :)
Mario Mikočević
@mozgy
Apr 18 2016 10:22
crap
one tab too many, apologies :)
Me No Dev
@me-no-dev
Apr 18 2016 10:23
no probs :)
Mario Mikočević
@mozgy
Apr 18 2016 10:23
heck, even my OLED lib is better :) ;)
nice, 2.2.0 release, gz and (beer) to @igrr
Clemens Kirchgatterer
@everslick
Apr 18 2016 10:57
I believe we have to change on line in Arduino/tools/sdk/lwip/src/Makefile:
BUILDDEFINES = -D_ets ...
to
BUILDDEFINES += -D_ets
don't we?
Clemens Kirchgatterer
@everslick
Apr 18 2016 11:44
cd $(SDK_ROOT)/lwip/src ; make BUILD_DEFINES="$(LWIP_DEFINES)" install
works
cd $(SDK_ROOT)/lwip/src ; make CPPFLAGS="-DLWIP_STATS=1" install
does not
but the first has the disadvantage that i have to redefine ALL build defines
LWIPDEFINES = -DLWIPSTATS=1 -Dets -DICACHE_FLASH -U__STRICT_ANSI -DLWIP_OPEN_SRC
Me No Dev
@me-no-dev
Apr 18 2016 11:45
i never intended to change build flags from command line, therefore I wrote it like that
feel free to make changes and PR
Clemens Kirchgatterer
@everslick
Apr 18 2016 11:50
ok, I will play around for some time and make a PR later
Clemens Kirchgatterer
@everslick
Apr 18 2016 12:08
hmm, my own compiled lwip feels much slower
FWeinb
@FWeinb
Apr 18 2016 15:22
Has anyone tried to remove an esp8266 from a nodemcu? (with just a soldering iron)
Me No Dev
@me-no-dev
Apr 18 2016 15:22
yup
mine has qio 4MB module
have hot air?
FWeinb
@FWeinb
Apr 18 2016 15:23
No hot air. Kinda impossible to do it with one iron...
Me No Dev
@me-no-dev
Apr 18 2016 15:23
kinda impossible with just iron
solder goes under the pads also
FWeinb
@FWeinb
Apr 18 2016 15:25
Yeah that will make it impossible to do. To bad.. I just let the magic smoke out on one. To dump to change the multimeter back to voltage...
Me No Dev
@me-no-dev
Apr 18 2016 15:26
well I have a crazy idea since you have no other means of salvaging the rest of the board
FWeinb
@FWeinb
Apr 18 2016 15:26
I would just like to replace the esp on it.
Me No Dev
@me-no-dev
Apr 18 2016 15:27
flux well around the chip, put it on a tray in the oven and set the temp to 220 celsius
monitor the temp and when reached, open the oven and try to pull the module from the board
might need play with the temp, but do not heat too high
FWeinb
@FWeinb
Apr 18 2016 15:28
Yeah. That could work.
Me No Dev
@me-no-dev
Apr 18 2016 15:28
and watch out not to move any other element from the board
FWeinb
@FWeinb
Apr 18 2016 15:29
I hope the nodemcu is still working.
Me No Dev
@me-no-dev
Apr 18 2016 15:29
how did you let the smoke?
FWeinb
@FWeinb
Apr 18 2016 15:31
I did try to measure the voltage on vin to gnd but had the multimeter on current...
Me No Dev
@me-no-dev
Apr 18 2016 15:31
so you shorted the LDO?
wait... VIN?
USB 5V or?
FWeinb
@FWeinb
Apr 18 2016 15:32
Yes.
Me No Dev
@me-no-dev
Apr 18 2016 15:33
if you just shorted those then there should not be any damage to the esp
i also see a diode so your usb-uart should be well also
are you sure you didn't touch another pin than GND with the multimeter?
FWeinb
@FWeinb
Apr 18 2016 15:36
There is like 9V between 3V3 and GND now on the broken one.
Me No Dev
@me-no-dev
Apr 18 2016 15:37
what are you powering it with?
FWeinb
@FWeinb
Apr 18 2016 15:37
Just 5V USB
Me No Dev
@me-no-dev
Apr 18 2016 15:37
then how will there be 9V there?
FWeinb
@FWeinb
Apr 18 2016 15:37
I have no idea.
Me No Dev
@me-no-dev
Apr 18 2016 15:38
your multimeter OK?
FWeinb
@FWeinb
Apr 18 2016 15:38
Just used another one. got 1V now.
Me No Dev
@me-no-dev
Apr 18 2016 15:39
what do you get on VIN?
FWeinb
@FWeinb
Apr 18 2016 15:39
1,75V
Me No Dev
@me-no-dev
Apr 18 2016 15:40
that also does not sound right
power goes like this
USB -> Diode -> VIN -> LDO -> 3.3V
maybe the diode is gone
it's the little black SMD part next to the VIN pin
you can check with the good multimeter between GND and both of it's pins
FWeinb
@FWeinb
Apr 18 2016 15:43
No. That one is wrong
Me No Dev
@me-no-dev
Apr 18 2016 15:43
oh ok...
let me look
FWeinb
@FWeinb
Apr 18 2016 15:44
That one is wrong.
Me No Dev
@me-no-dev
Apr 18 2016 15:47
can not say for sure on this one... I have the Amica one and looks much different
yours seems to have no protection
so USB 5V, LDO and VIN are tied together
FWeinb
@FWeinb
Apr 18 2016 15:48
But it is just strange that I don't get 5V on VIN anymore.
Me No Dev
@me-no-dev
Apr 18 2016 15:50
if you have something that is introducing a low resistance between the pins, then it could cause such drop
did you actually see smoke?
FWeinb
@FWeinb
Apr 18 2016 15:51
Yes saw a little bit of smoke.
Me No Dev
@me-no-dev
Apr 18 2016 15:52
can you tell what gave it? it should be visible
FWeinb
@FWeinb
Apr 18 2016 15:53
That is the problem I can't find anything on the board. Thats way I think it was the esp.
Me No Dev
@me-no-dev
Apr 18 2016 15:54
the esp is well shielded :) i doubt it will let any smoke
any chance you take a high res picture and post it here?
FWeinb
@FWeinb
Apr 18 2016 15:55
Sure, just a sec.
Me No Dev
@me-no-dev
Apr 18 2016 15:55
there is one small diode on the board but I can not tell how it's connected by just looking at the image
if it's used to pass the power and too high of a current have passed through
it could have gone dead
Martin Ayotte
@martinayotte
Apr 18 2016 16:08
I don't see any diode there, at least from the picture. It could be on the bottom side. (I hope your PC USB isn't damage too)
FWeinb
@FWeinb
Apr 18 2016 16:09
USB is fine.
Just stupid to not change the multimeter...
There is nothing on the bottom.
Me No Dev
@me-no-dev
Apr 18 2016 16:12
@martinayotte right next to the LED (on the left)
Martin Ayotte
@martinayotte
Apr 18 2016 16:12
Maybe the VReg itself ... (For example, on the Wemos, there is no diode, so it would be the RT9013 that will come into smoke)
Me No Dev
@me-no-dev
Apr 18 2016 16:13
but he shorted the incomming power
not the 3.3 and GND
so the LDO should be fine
Martin Ayotte
@martinayotte
Apr 18 2016 16:14
Ah ! ... so, you mean the small black near the crystal ? could be it
I've done the quite the same mistake with some STM32 MapleMini, I've purchased such diodes 50 pieces for $2
In mean time getting spare part, simple wire could be placed there, as long as you don't do same mistake, for the health of you PC USB ;-)
FWeinb
@FWeinb
Apr 18 2016 16:18
Yeah. I will not be a little bit more carefull.
Michael Miller
@Makuna
Apr 18 2016 17:09
@mozgy yeah, I wish we could tag a rating system on that list. I wish Arduino would add a rating system to the Library and Board Manager.
tzapu
@tzapu
Apr 18 2016 17:09
or at least the github stars each package has, already there as information ..
Michael Miller
@Makuna
Apr 18 2016 17:11
@FWeinb @me-no-dev Everytime I tried hot air, I ruined the module, as pieces under that shield would "slide" on the slightest movement. I wish you good luck as I didn't have it and figured it was just cheaper to replace it.
Me No Dev
@me-no-dev
Apr 18 2016 17:13
@Makuna I have done it :) patience helps
decapped many modules as well without any damage to the internals
FWeinb
@FWeinb
Apr 18 2016 17:14
The good thing is that these esps are as cheap as it gets so no worry. Thanks for the help!
Martin Ayotte
@martinayotte
Apr 18 2016 17:26
@FWeinb , did you tried to replace temporarily the diode with a simple wire ?
Keith Andrew Hill
@vic10us
Apr 18 2016 19:19
Looks like there is a little damage on the left J3Y
FWeinb
@FWeinb
Apr 18 2016 19:28
@martinayotte that isn't helping. @vic10us that was just some dirt...
Mario Mikočević
@mozgy
Apr 18 2016 19:29
@Makuna very good idea
Martin Ayotte
@martinayotte
Apr 18 2016 19:30
@FWeinb did you check if the USB cable is still good ? (because it can have been damaged by the short)
FWeinb
@FWeinb
Apr 18 2016 19:31
Did test with another cable.
marksev1
@marksev1
Apr 18 2016 21:32
So pubsubclient lib anyone worked with that. I tried to mash the mqtt example with the gesture sensor example but im not sure how to do the mqtt publish thing
Stavros Korokithakis
@skorokithakis
Apr 18 2016 23:36
@marksev1 i have some code
this is platformio's 89 lib
Stavros Korokithakis
@skorokithakis
Apr 18 2016 23:43
does anyone have a handy stub or some code that shows how to write a library?
i want to have a main file and then some hooks that will be called, on a separate file