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

User avatar
By alonewolfx2
#2373 Can you add powersave functions like deepsleep or sleep


Necromant wrote:
alonewolfx2 wrote:Maybe it help.

Code: Select all wifi_set_ip_info, please call it in user_init.

Example:

    {
struct ip_info info;

IP4_ADDR(&info.ip, 10, 10, 10, 1);
IP4_ADDR(&info.gw, 10, 10, 10, 1);
IP4_ADDR(&info.netmask, 255, 255, 255, 0);
wifi_set_ip_info(SOFTAP_IF, &info);
}


Yep, they expect it to be called in user_init() and any subsequent calls will NOT work for STA mode.
For AP, if you set wireless mode to none in user_init() you can configure IP once and then set mode to AP.
However the command line interface is fired aftter user_init, so we have to either store IP somewhere in flash and apply on boot. Still looking for proper spi flash layout map.
User avatar
By Necromant
#2376
alonewolfx2 wrote:Can you add powersave functions like deepsleep or sleep


Done, check the git repo. Binaries are updated as well. I've added gpio command, so you can read/write GPIO from commandline. So far only GPIO0 and GPIO2 are MUXed as GPIO on startup. We need a proper GPIOMUX command.
ifconfig now only displays info on active interfaces and displays iface state as well.
Regarding deep sleep - my modules don't seem to exit correctly out of deep sleep. I can see they get reset after the timeout, but instead of booting I get garbage that looks like as if my module has entered bootloader mode.
I found no references to 'normal' sleep in the doc, so I suggest you can just bring down the wireless interface with 'iwmode NONE' and that should be sufficient. It will disconnect from your base station.

The summary of current commands is below:
Code: Select allhelp       - Show this message
apconfig   - Setup Access Point.
             apconfig name OPEN/WEP/WPA_PSK/WPA2_PSK/WPA_WPA2_PSK [password]
iwconnect  - Join a network/Display connection status.
             iwconnect ssid password
iwmode     - Get/set wireless mode. Available modes: NONE, STA, AP, APSTA
             iwmode STA
iwscan     - Scan for available stations
ifconfig   - Show/setup network interfaces
             ifconfig [iface] [ipaddr] [netmask] [gateway]
             ifconfig sta0 192.168.0.1 255.255.255.0 192.168.0.8
argtest    - Print out argc/argv
deepsleep  - Enter deep sleep for some microseconds
             deepsleep 10000
reset      - Soft-reboot the device
meminfo    - Display memory information
version    - Display version information and copyright
gpio       - Control gpio lines. gpio mode line [value]
             gpio in 0
             gpio out 0 1
User avatar
By Allex
#2381 Hello Necromant
I've just loaded the new bin and wanted to try
I get an endless loop with this error message:

Frankenstein 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 ~ 0x3ffe8aa4, len: 2724
rodata: 0x3ffe8ab0 ~ 0x3ffea158, len: 5800
bss : 0x3ffea158 ~ 0x3fff1580, len: 29736
heap : 0x3fff1580 ~ 0x3fffc000, len: 43648

=== Press enter to activate this console ===
Fatal exception (29):
epc1=0x40241122, epc2=0x00000000, epc3=0x00000000, excvaddr=0x000000a8, depc=0x00000000

ets Jan 8 2013,rst cause:4, boot mode:(3,7)

wdt reset
load 0x40100000, len 27520, room 16
tail 0
chksum 0x18
load 0x3ffe8000, len 2724, room 8
tail 12
chksum 0x84
ho 0 tail 12 room 4
load 0x3ffe8ab0, len 5800, room 12
tail 12
chksum 0x19
csum 0x19



My board is ESP-2
I think your working class
regards Allex
User avatar
By alonewolfx2
#2382 deep sleep mode a little different from other mcu's. if we want to sleep and auto wake up after some microsecond, we must connect gpio16 with rst pin. but i have just esp-01 module and i cant try this.
gpio0 control bootloader status when power up module. so maybe we cant use for gpio out before disabling this mode.
one more thing. can we set auto send data to the website with tcp connection and maybe can set time interval for this.