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

User avatar
By Roffey
#2362 With your most obvious skills and ease at which your attack your tasks, I wonder if I may ask a sort of related question?
Myself and others who are in the stages of employing this great little beast, are finding a flaw when it comes to data being sent from it.( or in response to)
Appearing quite at random comes the dreaded 'busy s' lockout, only sorted by a hard reset. This defeats what I believe to be its real capabilities.

With your investigations and manipulations can you / have you seen any reason for this, and maybe any steps that could make a sensible recovery from this situation?

with respect, 'I am not worthy' etc :)

Dave.
User avatar
By Necromant
#2363 I had a quick look at their AT code... Well, fixing it is a far more difficult task than rewriting from scratch. It's even hard to use it as a reference. That's why I've started writing alternative firmware without any hesitation - I would spend way more time struggling with their bugs. And a clean and hackable codebase available to everyone looks like a way better solution.

Okay, here goes another update with more awesome commands. Binaries are updated as well. The firmware's now officially called 'Frankenstein', since it's hacked togather of different bits and pieces that somehow, surprisingly work. I've made some more verbose help messages as well.

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 if GPLv2

Memory Layout:
data  : 0x3ffe8000 ~ 0x3ffe8a90, len: 2704
rodata: 0x3ffe8a90 ~ 0x3ffe9f38, len: 5288
bss   : 0x3ffe9f38 ~ 0x3fff1378, len: 29760
heap  : 0x3fff1378 ~ 0x3fffc000, len: 44168

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

blackblade > help

help       - 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
reset      - Soft-reboot the device
meminfo    - Display memory information
version    - Display version information and copyright

blackblade >



Apart from rebooting, meminfo and version you can now display/set IP address information, connect to wireless stations and set up access point parameters.
It looks like SDK blobs code store parameters somewhere in flash and bad AP settings can cause exception when parameters are loaded and infinite reboots. For that not to happen Frankenstein now boots with wireless offline. (For now).

Quick receipe. Connect to an AP:
Code: Select allblackblade > iwmode STA
Wireless mode change: NONE -> STA
blackblade > iwconnect frostgate somepassword

blackblade > ifconfig sta0
sta0: WiFi Client Interface
    inet addr:192.168.1.131 Mask:255.255.255.0 Gateway:192.168.1.2

blackblade >



At this point you may ping your station from any device on the network.
TODO:
Questions to be answered
    Any way to disable built-in DHCP client and set IP manually
    Any way to supply a hostname along with DHCP request
    Where do AP parameters get stored in flash? How?

Anyway, network support is on the way. ping already somewhat works, the rest is just asking to be done.
Last edited by Necromant on Sun Nov 09, 2014 11:06 am, edited 1 time in total.
User avatar
By alonewolfx2
#2368 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);
}
User avatar
By Necromant
#2369
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.