Discuss here different C compiler set ups, and compiling executables for the ESP8266

User avatar
By Necromant
#2520 Another small update. Environment arrived. You can now set/reset/get environment vriables with appropriate cmds and save environment to SPI flash, protected by a CRC.
Network configuration now done via environment, both static and DHCP supported for STA mode. Remember to reboot after saving new environment with your network config.

Code: Select allFrankenstein ESP8266 Firmware
Powered by Antares 0.2-rc1, Insane Mushroom
(c) Andrew 'Necromant' Andrianov 2014 <andrew@ncrmnt.org>
This is free software (where possible), published under the terms of GPLv2

Memory Layout:
data  : 0x3ffe8000 ~ 0x3ffe8ae8, len: 2792
rodata: 0x3ffe8af0 ~ 0x3ffea72c, len: 7228
bss   : 0x3ffea730 ~ 0x3fff1bf8, len: 29896
heap  : 0x3fff1bf8 ~ 0x3fffc000, len: 41992
env: Environment @ 0x0007c000 size 0x00001000 bytes (0x00000ffc real)
=== Current environment ===
sta-mode    dhcp
sta-ip      192.168.0.123
sta-mask    255.255.255.0
sta-gw      192.168.0.1
ap-ip       192.168.1.1
ap-mask     255.255.255.0
ap-gw       192.168.1.1
bootdelay   5
=== 147/4092 bytes used ===

 === Press enter to activate this console ===

blackblade > setenv Hello ESP8266.com

blackblade > printenv
=== Current environment ===
sta-mode    dhcp
sta-ip      192.168.0.123
sta-mask    255.255.255.0
sta-gw      192.168.0.1
ap-ip       192.168.1.1
ap-mask     255.255.255.0
ap-gw       192.168.1.1
bootdelay   5
Hello       ESP8266.com
=== 165/4092 bytes used ===

blackblade > saveenv
Writing environment to flash...DONE

blackblade >

User avatar
By igrr
#2534
Necromant wrote:At 0x7C000 I can only see zeros. this area has't definetely been touched by any of my code on this module.

Well, the config is there, it's just all zeroes for your module (40M crystal, 40MHz spi clock, 4Mbit flash, QSPI mode).
Other modules may have different settings. If you want your firmware to run on any esp8266-based board, you might want to refrain from wiping those settings.
User avatar
By bedenko
#2539
Necromant wrote:
alonewolfx2 wrote:listen function alittle buggy. firstly it cant stop, second it cant comunicate with android app. i tried 3 apps. apps connect and i am getting connect on serial but i cant recieve data. i tried sockettest3 on windows and it can connect and recieve data.


Yep. Turns out espconn_disconnect/espconn_delete can't properly terminate once a server started listening (sic!). For testing - use netcat, e.g.

Code: Select allecho hello | nc 192.168.1.234 8080


Line break terminates connection.


i too have the same issue. Tried with netcat, and sniffed with wireshark. No reply from esp8266.

I also do not see any SSID in AP mode. From command line i can tell, that AP mode is configured, but no SSID is broadcasted.
Also, is there a way to change SSID?

EDIT: ok, found problem for first issue: if in AP/STA mode, it appears that enc8266 listens on sta0 interface, not ap0.
switching modes solves the problem and module receives packets.
User avatar
By Necromant
#2548
bedenko wrote:I also do not see any SSID in AP mode. From command line i can tell, that AP mode is configured, but no SSID is broadcasted.
Also, is there a way to change SSID?


See apconfig command. e.g.

iwmode AP
apconfig ssid WPA2_PSK password

bedenko wrote:EDIT: ok, found problem for first issue: if in AP/STA mode, it appears that enc8266 listens on sta0 interface, not ap0.
switching modes solves the problem and module receives packets.


I'll look if there's a way to specify the interface in espconn. But I'm afraid there's none (sic!).... Hm (looking at nodemcu firmware), and looks like I was a bit too late to hack in a lua interpreter, which was on my TODO list after I figure out and clean most things.