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

User avatar
By Necromant
#6887
ystrem wrote:
Necromant wrote:
admin wrote:SUGGESTION

Should we start a section in WIKI for documenting [DEV][WiP] Frankenstein firmware for ESP8266???? This is getting to be a lot of info!

Anyone want to step up?

Richard,


Could be awesome if someone helped out at least documenting things in a noob-friendly way. I keep brief documentation along in the repository, but it's nowhere complete and/or newbie-friendly. I would prefer to concentrate on implementing new features and writing the actual code.


HI, I can document it. Where do I start, I think on github's there is enough info. Or don't?


So far what's missing is a guide to flashing the firmware (especially for those poor folks stuck in windoze). For all the docs on github suggest that the user is familiar with u-boot and environment variables concept, and can find their way around to flash a firmware file using esptool.py. That's all what I can think of. For me it all looks very simple and the output of 'help' is pretty self-documenting.
User avatar
By Necromant
#6891
ystrem wrote:Do you plan any kind of scripting in close time?


I can easily merge lua from nodelua project into frankenstein now and add something like
fr.run_cmd("iwconfig") to lua environment (to make things quick and dirty). However I'm not really sure it's what's needed. esp8266 doesn't have enough ram to do many things you normally want to do with lua. But I'll have a look what can be done.

Instead, in long-term I think of bringing my own uRPC thingie back to life and porting to esp8266. A few years ago I made a concept, where you write certain functions on an MCU C, 'export' them. And via a transport layer plugin bind them to a remote lua environment. The concept worked, but I didn't have time to polish it to production quality.
So you run lua + lua extension on a host pc (openwrt router, raspberry, whatever), and one lua enviroment hooks to as many hardware nodes as needed. Back at that time I only had 2 usb backends. The code on the host looked like
this.

However bringing this framework back to life will take a while, since I have my daily job to do, and different things to code. This is a mere hobby.
User avatar
By Necromant
#6897 Another update. This time frankenstein gets wireless firmware updates over tftp(yappee!). Stock cloud update can be safely ditched. TFTP is also several times faster compared to flashing it over serial. All you need to do is set up a tftp server, put any firmware file you want there, adjust tftp-server, tftp-path and tftp-file variables, and run tftp. Unlike stock cloud update it can and will flash any file, even if it's not frankenstein firmware. The firmware should assume it will be burned at 0x0000 address. The size restriction is 256KiBs, since we have to buffer all of the firmware in flash. The tftp client is made as a library with a simple interface, so you may use it to get any data you want (See include/lib/tftp.h). It still may need some better error handling in some places, so expect small cosmetic fixes in a day or two.

Example output of a firmware update over tftp:

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 ~ 0x3ffe8f8c, len: 3980
rodata: 0x3ffe8f90 ~ 0x3ffeb4e4, len: 9556
bss   : 0x3ffeb4e8 ~ 0x3fff31c0, len: 31960
heap  : 0x3fff31c0 ~ 0x3fffc000, len: 36416
env: Environment @ 0x0007f000 size 0x00001000 bytes (0x00000ffc real)
=== Current environment ===
sta-mode    dhcp
default-mode  STA
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
hostname    frankenstein
bootdelay   5
dhcps-enable  1
telnet-port  23
telnet-autostart  1
telnet-drop  60
tftp-server  192.168.1.215
tftp-dir    /
tftp-file   antares.rom
=== 309/4092 bytes used ===
dhcpserver: started
telnet: server accepting connections on port 23

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

frankenstein > setenv tftp-server 192.168.1.215

frankenstein > setenv tftp-dir /

frankenstein > setenv tftp-file antares.rom

frankenstein > tftp
TFTP: Downloading tftp://192.168.1.215/antares.rom

 ###################################################
 
 TFTP done, 205228 bytes transferred
Committing update in 2 seconds

Commiting update, 51 sectors 205228 bytes
###################################################
Firmware update completed, rebooting



The binaries are updated as usual.