These are chat archives for esp8266/Arduino

18th
Oct 2015
Me No Dev
@me-no-dev
Oct 18 2015 01:08
you should use only the toolchain and the original SDK if you want to compile pure C apps
kathir51
@kathir51
Oct 18 2015 08:26
@me-no-dev that i know . I WANT TO USE ARDUINO IDE WITH XTENSA TOOL CHAIN TO COMPILE SINCE TOOL CHAIN WAS BUILD IN
Me No Dev
@me-no-dev
Oct 18 2015 08:31
@kathir51 no need for CAPS LOCK, I read fine ;) the toolchain is in there but it's it's own thing. You can pull it from the folder and use it on the side.
kathir51
@kathir51
Oct 18 2015 11:06
@Links2004 thanks . I tried allready . but we cannot invoke os related functions such as os_printf ,os_delay_us etc even if we include respective headers os_api.h and os_type.h HOW WE CAN INVOKE SUCH FUNCTIONS
kathir51
@kathir51
Oct 18 2015 11:14
@me-no-dev your suggestion good i already did many using outside with xtensa tool chain. I want to use arduino ide for that that also os related functions only cannot make it use
Markus
@Links2004
Oct 18 2015 11:28
os_delay_us for example is defined as ets_delay_us
https://github.com/esp8266/Arduino/blob/cabb450fc13eefaf35a78b9a911d59efd548b81a/hardware/esp8266com/esp8266/tools/sdk/include/osapi.h#L12
but there is no prototype so until you not add the correct one you can not use it.
and pls no caps in the chat.
the correct prototypes can be found on the SDK documentation but no one has created them in code, even espressif not (not public).
kathir51
@kathir51
Oct 18 2015 12:11
@Links2004 thanks but I included all osapi.h and ets_sys.h in my project Still i cannot succedd
Markus
@Links2004
Oct 18 2015 12:13
yes the prototypes are not created/missing. espressif has them only written in the SDK documentation but not in the SDK source code if you want to use them you need to create the prototypes based on the SDK documentation.
2C-ESP8266__SDK__Programming Guide__EN_v1.3.0.pdf
Markus
@Links2004
Oct 18 2015 12:18
example:
extern void ets_delay_us(uint16_t us);
kathir51
@kathir51
Oct 18 2015 12:24
@Links2004 thanks yes nice help . thanking you very much
kathir51
@kathir51
Oct 18 2015 13:02
@Links2004 where i can find such declaration ? i searched in ets_sys.h
Markus
@Links2004
Oct 18 2015 13:10
they not existing, that is you problem :)
  1. search in the SDK doc the function
  2. read the docu for it
  3. create the prototype for the function in ets_sys.h
  4. test/use the function
  5. make a pull request ;)
Þórhallur Sverrisson
@thorhs
Oct 18 2015 14:58
Hi All, I'm trying to diagnose why my wifi disconnects after 5 minutes and am trying to log output in the ESP8266WiFiClass::_eventCallback function. I'm trying to use the ets_printf function to log the reason to my serial, but I'm not getting any output.
I'm wondering if there is some other better way to log to serial from the .cpp code, or if there are some tricks to getting ets_printf to work.
Or, maybe, the callback isn't called ;)
Markus
@Links2004
Oct 18 2015 15:25
have you used Serial.setDebugOutput(true); ?
Þórhallur Sverrisson
@thorhs
Oct 18 2015 15:36
Nope :) I'll try that now
Þórhallur Sverrisson
@thorhs
Oct 18 2015 16:25
That did the trick, I see now that the reason for my 5 minute disconnects is REASON_ASSOC_EXPIRE
Markus
@Links2004
Oct 18 2015 16:34
unfortunately espressif not release a documentation of the deeper meaning of all the "reasons".
may its linked to the key rotation of WPA/WPA2. can you configure the rotation time in your router?
Þórhallur Sverrisson
@thorhs
Oct 18 2015 16:39
I am communicating with a softAP on another ESP, the only two devices on the network.
I tought it might be they key rotation, so I just tried to have no encryption, and get the same behaviour
state: 5 -> 2 (4a0) rm 0 pm close 7 0 0/301997886 wifi evt: 1
grrr….
state: 5 -> 2 (4a0)
rm 0
pm close 7 0 0/301997886
wifi evt: 1
This is sent on the serial with debug output enabled when I drop the connection, if that rings any bells
Markus
@Links2004
Oct 18 2015 16:43
the state is changed from STATION_GOT_IP (5) to STATION_WRONG_PASSWORD (2)
Þórhallur Sverrisson
@thorhs
Oct 18 2015 16:43
I think the state: part is located in libnet80211.a…. at least that is the only place I can grep ‘state:’ in
hmmm
interesting
seeing there is no password on the SSID
Screen Shot 2015-10-18 at 16.44.26.png
Markus
@Links2004
Oct 18 2015 16:45
espressif sometime make strange thinks
Þórhallur Sverrisson
@thorhs
Oct 18 2015 16:46
hehe, I guess I will just have to live with it having to reconnect every 5 minutes :(
I’m planing to use this for a ‘show’ controlling LEDs, so timeouts would be noticable
Markus
@Links2004
Oct 18 2015 16:47
right now i not have a good idee how to fix it.
have you tried to change the modules?
Þórhallur Sverrisson
@thorhs
Oct 18 2015 16:47
which modules?
ohh, you mean the station oand client?
Markus
@Links2004
Oct 18 2015 16:47
yes
Þórhallur Sverrisson
@thorhs
Oct 18 2015 16:48
Nope, I’ll try that, I have a few to choose from :)
Hmmm, perhaps I should enable the debug output on the softAP as well… that might give me some ideas
Markus
@Links2004
Oct 18 2015 16:50
yes may helps.
a other workaround will be using a chip WiFi router ;)
Þórhallur Sverrisson
@thorhs
Oct 18 2015 16:52
yeah, I swithced from my local WLAN to the softAP since my home WLAN was too jittery.. the softAP is working much better in that regards
Markus
@Links2004
Oct 18 2015 16:54
I also setup a second Wifi for the IoT stuff to many broadcasts on the normal one.
Openwrt can setup Wifis in parallel.
Þórhallur Sverrisson
@thorhs
Oct 18 2015 16:54
ohh, crap, I just realized I can’t use the softAP, it only handles 4 clients :(
hmmm… interesting, I only have airports at home… but one 4G WiFi router that I might hijack :)
I’ll try that
Markus
@Links2004
Oct 18 2015 16:55
this can be extended but then you need to communicate by broadcasts/ multicast (socked limitation)
Þórhallur Sverrisson
@thorhs
Oct 18 2015 16:55
I am using broadcasts today, so that would not be a problem
Þórhallur Sverrisson
@thorhs
Oct 18 2015 16:57
Hmm, FYI, the debug output on the station just says station XXX leave, with rm 1, add 1, aid1, and the station join
I’m going to dig up the other wifi and give it a whirl
br
brb
Þórhallur Sverrisson
@thorhs
Oct 18 2015 17:42
First test indicates the 5 minute issue is related to ESP softAP to ESP client
I have not run the same two ESPs through the huawei router for close to 10 minutes now without issues...