These are chat archives for esp8266/Arduino

30th
Jan 2017
Akash Ashok
@thehellmaker
Jan 30 2017 04:48
Hi Guys, I have a very wierd problem
My house has 3 repeaters
and esp8266 connected to the repeaters are most of the times not reachable over local network
and they say
TIMEOUT: 5033, state: Established
over mqtt they are reachable
however the ones connected to repeater more often than not time out
mega-hz
@mega-hz
Jan 30 2017 04:50
test the dBm of receive of all 3 repeaters than select the one with the best
Akash Ashok
@thehellmaker
Jan 30 2017 04:56
we connect using ssid right ?
how do i select which repeater to connecct to
mega-hz
@mega-hz
Jan 30 2017 04:59
open connection to 192.168.1.1 , long rssi = WiFi.RSSI();
close connection, open connection to 192.168.1.2, long rssi = WiFi.RSSI();
close, open connection to 192.168.1.3, long rssi = WiFi.RSSI();
close.. select, wich one has the best rssi, than open that one
Akash Ashok
@thehellmaker
Jan 30 2017 04:59
oh yes i printed the rssi
the current one has the highest
iti even shows up in the logs
it had bad signal
somehow its timing out despite that
i added repeater because
adn verified that signal got better post adding repeater
mega-hz
@mega-hz
Jan 30 2017 05:01
maybe it is still too weak, dont know an other reason
Akash Ashok
@thehellmaker
Jan 30 2017 05:01
got it any logs i can enable ot debug
mega-hz
@mega-hz
Jan 30 2017 05:01
never had connection problems, even with a weak signal..
no, but maybe your repeater saves logs?
Akash Ashok
@thehellmaker
Jan 30 2017 05:02
lemme chack
Clemens Kirchgatterer
@everslick
Jan 30 2017 06:33
@INemesisI -l (lower case L) is for the linker to know wich libs to link. -L is the search path for libs. but you need also -I (upper case i) for the include path, to tell the copiler where the header files are.
Benedikt Eliasson
@INemesisI
Jan 30 2017 09:25
@everslick The header file is already in there! Its part of the SDK (espconn.h). I only needed to add the lib.
Clemens Kirchgatterer
@everslick
Jan 30 2017 09:47
@INemesisI but you said: but it seems like, it still uses the old lib includes no?
i understand this as: it does not find those includes a.k.a headers
does it compile and not link?
Benedikt Eliasson
@INemesisI
Jan 30 2017 22:54
I ran platformio with verbosity enabled, to see, which command is executed.
xtensa-lx106-elf-g++ -o .pioenvs/esp12e/firmware.elf -Os -nostdlib -Wl,--no-check-sections -u call_user_start -u _printf_float -u _scanf_float -Wl,-s tatic -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,register_chipv6_phy -Wl,-Tesp8266.flash.4m.ld .pioenvs/esp12e/src/main.o -L/Users/be ne/.platformio/packages/framework-arduinoespressif8266/tools/sdk/lib -L/Users/bene/.platformio/packages/framework-arduinoespressif8266/tools/sdk/libc /xtensa-lx106-elf/lib -L/Users/bene/.platformio/platforms/espressif8266_rysta/ldscripts -L.pioenvs/esp12e -Wl,--start-group .pioenvs/esp12e/libFramew orkArduinoVariant.a .pioenvs/esp12e/libFrameworkArduino.a -lhal -lphy -lpp -lnet80211 -llwip_gcc -lwpa -lcrypto -lmain -lwps -laxtls -lespnow -lsmart config -lmesh -lwpa2 -lstdc++ -lm -lc -lgcc -lc .pioenvs/esp12e/lib/libESP8266WiFi.a -Wl,--end-group is the output. It does not have -lmbedtls, even though I added it right between -laxtls and -lespnow in the platform.txt
Me No Dev
@me-no-dev
Jan 30 2017 22:57
where is the source of mbedtls?
Benedikt Eliasson
@INemesisI
Jan 30 2017 22:57
I added the compiled lib file to the sdk/lib folder
libmbedtls.a
Me No Dev
@me-no-dev
Jan 30 2017 22:58
then question is how to add it to the list of libs
you have the lib, but do you also have the headers?
your code needs to have access to them or it would not know of the methods
but I guess since you get to linking, you have that sorted
Benedikt Eliasson
@INemesisI
Jan 30 2017 22:59
its the espconn.h. That one is surprisingly already in there
Me No Dev
@me-no-dev
Jan 30 2017 23:00
not really :) all headers from the SDK are there
Benedikt Eliasson
@INemesisI
Jan 30 2017 23:00
yeah :D alright
I got mbedtls working with the sdk, now I want to add it to the Arduino platform
thought, it would be easy, but somehow I cannot get platformio to link it
Me No Dev
@me-no-dev
Jan 30 2017 23:02
there has to be a command to do it for sure
Benedikt Eliasson
@INemesisI
Jan 30 2017 23:03
I found some promising code in the platform.txt
compiler.c.elf.libs=-lhal -lphy -lpp -lnet80211 {build.lwip_lib} -lwpa -lcrypto -lmain -lwps -laxtls -lmbedtls -lespnow -lsmartconfig -lmesh -lwpa2 -lstdc++ -lm -lc -lgcc
Me No Dev
@me-no-dev
Jan 30 2017 23:04
do not look at platform.txt
platformio does not use it
Benedikt Eliasson
@INemesisI
Jan 30 2017 23:04
oh. That could explain it
I searched in the whole framework for something like -laxtls, but that was the only hit
Me No Dev
@me-no-dev
Jan 30 2017 23:05
in your platformio.ini you need to add to libs. maybe something like LIBS:="mbedtls" or something similar
pltformio uses python to build and it has it's own config. We will have that over but not ready yet.
Benedikt Eliasson
@INemesisI
Jan 30 2017 23:07
Ah, and I'm not able to change that?
Me No Dev
@me-no-dev
Jan 30 2017 23:07
there must be an option I'm sure
ping @ivankravets
Benedikt Eliasson
@INemesisI
Jan 30 2017 23:10
LIBS:="mbedtls" did not work. But thank you for your help so far! :)
Me No Dev
@me-no-dev
Jan 30 2017 23:10
I though it would not
that is makefile style
Me No Dev
@me-no-dev
Jan 30 2017 23:23
@INemesisI in my platformio folder in platform/[platform]/builder there is a main.py script that controls the build process for pio
you will find the libs listed there
Ivan Kravets
@ivankravets
Jan 30 2017 23:30
@INemesisI @me-no-dev It should be build_flags = -lmbedtls in platformio.ini.
Benedikt Eliasson
@INemesisI
Jan 30 2017 23:33
perfect, thank you guys!