More ESP8266–The Linux Compilation

I’m getting further – I’ve scoured the web and no-one as yet has made significant improvements to the ESP8266 code or if they have, they’ve hidden it – but at least now I can compile the code.  For Windows users out there who are about to pull out their last hairs, I hope this is helpful.

I tried the compile-in-windows versions and got no-where – either the MAKE file was wrong or SOMETHING –  SO I went back to the LINUX version much as I HATE Linux and command lines.

So in my previous blog it tells you how to get Virtualbox running (trivial – it just works) – and how to then add the relevant image…

This video  is very helpful and in particular OSCAR has been MORE than helpful – but I could not get that to work as such – Oscar helped me.

So I didn’t quite do it the same way as his video – I grabbed the two files, put them in a directory call ESP on my desktop (after unzipping them.

esp There it is sitting on my desktop – and inside it looks like the second image…. so you need to replicate this exactly.




That’s it – the VirtualBox, the image file as per previous blog or indeed Oscar’s video – this lot and NOTHING ELSE – well apart form Windows (I’m using Windows 8 made to look like Windows 7 but that’s it – oh and I use Notepad++ to edit files.

First attempts at doing anything with this failed miserably – either I didn’t have permissions of the directory could not be found… so we went through various iterations and eventually came up with this – and this is repeatable on my system (the laptop shut down so I had to start from scratch.

So open linux – with the ESP folder on the desktop – SHARED – go into the settings for the image – and share that ESP directory – if it has another shared directory scrap that.

sudomount -t vboxsf esp /mnt/Share
cd /mnt/Share

You’ll get asked for the password it is espressif.

All of that should work. us ls and you should see the two directories…I KNOW – what’s wrong with DIR…

cp -R at_v0.19_on_SDKv0.9.2/* esp_iot_sdk_v0.9.2/app
cd esp_iot_sdk_v0.9.2/app

These two commands above merely make a copy of the AT demo directory (into the SDK directory under a subdir called APP. You could do that in Windows really – the second command merely moves you to the app directory.

Now you are cookling…


Those two commands will compile and prepare the files and generate some BIN files… here in my case (I’m Peter)


I have NO idea why the BIN files don’t end up in the same directory as the app itself but never mind… the point of this is to get you to the point where you can successfully generate bin files. And at that point on my PC indeed the files ARE generated.

The bit I have not done yet is blow the chip – but there are plenty of Windows Tools to do that including ESP FLASH DOWNLOAD TOOL which is a windows EXE with a load of support files and has a nice pretty interface to allow you to send multiple BIN files to multiple locations. Here’s where they go. 0x00000 0x40000
esp_init_data_default.bin 0x7c000
blank.bin 0x7e000

And that is as far as I’ve gotten – at the weekend hopefully these will blow into my ESP-01 board, the baud rate will revert back to 9600 and I can then use the AT+CWMODE=115200 to shift it back to 115,00 baud (it stays that way once programmed).  That should hopefully take me to the same point as everyone else – at which point I can start looking at the BUSY S problem unless someone else has beaten me to it by then – oh and to change that awful NO IS FUN into “ERROR” – also there’s a READY which needs to be turned into an OK – THEN we might start doing something useful with this little board.

If any of the above was clear as mud, let me know. Better still if you’re way ahead of me and have this working all in Windows – please do a video ensuring you make NO assumptions – and we can all benefit from that.

Oh, one last thing, the compile process outputs a LOT OF STUFF which might get boring if you’re testing changes… I’ve no idea if you miss anything important by this but you can get rid off much of the output as follows..

type “make > /dev/null” and “./ > /dev/null”


6 thoughts on “More ESP8266–The Linux Compilation

  1. Hi Peter

    I have been following your ESP8266 blog avidly.

    I see that expressif released a code update that includes ‘Add uart data receiving time out’. This is to fix known issue: ‘Data transmission through AT may cause watchdog reset’.

    Does this address your reported bug?

    I also see that for people like me, who do not have the time or the gear to use the SDK, they have today, Nov 7th, released ‘the AT bin compiled from source code above that support upgrade’

    See :-

    I hope this helps.

    All I need is for my devices to turn up.


    • I have two problems with that and THANK you for bringing this news here. The download version is 4 bin files and I’ve not QUIET figured out how to use those – but I will.. and the online update fails miserable – the unit ends up just firing out a continual series of characters after it’s been updated… even after a reset. I have seen that happen before so I’ve no problem with that as you can always re-blow the firmware – but the online update as it stands late on Friday night does not work.


  2. After I posted I looked again at the readme file in the .zip.

    It lists the 4 bin files then tells you to do an online update!

    Either I am missing something, or there is a lack of ‘joined-up’ thinking by whoever put the ‘upgrade’ together.

    Hey Ho!

  3. Note, you have a json based webserver ( user_webserver.c )
    user_webserver_init(uint32 port)
    that should respond to this


    Might be useful !?
    void wifi_promiscuous_enable(uint8 promiscuous);
    typedef void (* wifi_promiscuous_cb_t)(uint8 *buf, uint16 len);
    void wifi_set_promiscuous_rx_cb(wifi_promiscuous_cb_t cb);


  4. Doooh… yes I do have a bust chip thanks to the online update not working – testing might’ve been good! Still, no harm done. I’m now sitting here trying to get the Windows based FLASH_DOWNLOAD_TOOLS_v0.9.2 to work so I can blow the chip using the 5 ROM files in that package… worked on my little laptop when I was away on business (Windows 8) but copying via Dropbox to my Windows 7 work machine – the file won’t run – complains about directories – as soon as I can actually blow the chip I’ll report back in here.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s