ESP8266 and MacOSX
Mike Green
Posts: 23,101
I thought I'd experiment with an ESP8266 (SparkFun's ESP8266 Thing) as the WiFi interface for a Propeller. I use a Mac desktop with Mac OS 10.11 so some of the tools aren't available. There's an add-on for the Arduino IDE and a Python download tool (esptool.py) for NodeMCU (Lua) that are supposed to work. You need to install pyserial for serial I/O but none of the installation suggestions I found seemed to work. I found out that the version of Python installed on the Mac OS is only 2.5 while the current version 2 is 2.7. Once I downloaded and installed 2.7 from python.org, I was able to install pyserial and esptool.py worked as described to install NodeMCU.
I haven't had any luck yet with ESP-Basic. The flasher is for Windows only and the official website doesn't have a precompiled binary. I tried compiling it from source using the Arduino IDE, but I keep running into errors with the libraries. If anyone has had luck with this under Mac OS, let me know.
I haven't had any luck yet with ESP-Basic. The flasher is for Windows only and the official website doesn't have a precompiled binary. I tried compiling it from source using the Arduino IDE, but I keep running into errors with the libraries. If anyone has had luck with this under Mac OS, let me know.
Comments
I haven't tried ESP-Basic but I have been working with an ESP8266-01 module for loading a Propeller. Here is a link to my code in github:
https://github.com/dbetz/esp8266-loader
I'm doing this work on the Mac and have had pretty good luck with the ESP8266 Arduino tools. Is ESP-Basic available in source form or just as a binary installer?
David
There is no standard that anyone adheres to. Bit like Forth.
Even after installing all of the libraries included with the ESP Basic git sources, I could not compile with Arduino IDE 1.6.6. Many functions show up as "not declared in scope", though the project includes the function sources. Not sure if it is a difference in the Arduino IDE version used by the project owner than I did or what. Perhaps the README needs to contain more useful information for those that want to build their own.
Also: Including versions of actual Arduino libraries in a git project is not really a good idea. The owner of the project should use links (git sub-modules?) for the libraries to make sure that git cloners are getting the libraries from their original source. Who knows what version of these libraries the project owner has included.
All-in-all, I think the project is rather immature (of course, this is just my thinking at this point of frustration)...
dgately
Plan B would be to use NodeMCU ... more work on my part and more to learn.
I was able to build on Mac OS X 10.11.2 with the Arduino IDE (v1.6.6 & v1.6.7) after placing prototypes of all the following functions into the top of the ESP8266Basic.ino file. I also resolved all of the libraries issues, by copying the git project's versions of the libs into my Arduino libraries directory (Hopefully, my other Arduino projects will still build):
Not sure why the Arduino IDE is not seeing the function prototypes "as-is", but the above fix allows the build to complete. I did read that the IDE tends to not see declarations that include more than one argument, but many of these functions include 1 or no arguments.
Another EDIT: BTW, I used XCode to help find the missing prototypes. I just opened all of the .ino files in XCode to do multi-searching. It sure helps having a 'real' IDE to edit large projects. I know that the Propeller community has been interested in all of the "simple" editing solutions, but a full-featured IDE can sure make these kinds of task easier...
dgately
Thanks for the prototypes. I was able to get ESP8266Basic to compile and download, but it doesn't seem to work. The ESP8266 creates an access point which I can access, but no data is transmitted to the browser (either Safari or Chrome). Off to Plan B.
I'll also give it a try on an ESP8266-11, if I can get a chance.
What's your plan B?
dgately
After building the ESP8266 Basic project with Arduino IDE, I was not able to upload within the IDE. I found the built "ESP8266Basic.ino.bin" file deep inside the /var/folders/.. directory and uploaded it with esptool.py. I used CoolTerm to connect the esp8266-11 and on reset, I get the above output.
dgately
Yeah, I didn't mention that I had tried that. The "ESP" AP shows up and I can connect to that as a network, but the webpage never appears at "http://192.168.4.1/edit". Must be something about the binary built via the Arduino IDE...
dgately
I hope you have not been discouraged by the results so far.
The precompiled working binaries are available for download from
https://github.com/esp8266/Basic/tree/master/Flasher/Build
You must take care and use the proper one for your devices memory size.
The esp-12 modules normally have a 4m size.
The esp-01 can vary from 512k (blue ones) to 1m (black ones).
I have never tested the basic personally on any other flash sizes.
If you have connected to the device via wifi the http://192..168.4.1/edit link should work and bring up the editor page. It might take a little while while saving programs but it should finish. I have done most of my testing with google chrome and the browsers on android phones. Because chrome and safari both use the web kit engine i would see no complications arising with usage on a mac.
If you are compiling from source you may have some trouble if you are not using the same version of the esp8266 arduino package. I am using an older staging version. Have not moved to the latest but still am not using the "stable" one.
Hopefully the precompile bins from the git hub repository will help.
Thanks for the precompiled binaries... Should make this easier for Linux & Mac users!
BTW: If you put the Flasher source up on github, interested Linux or Mac users just might create versions for those computers (hint, hint) :cool:
dgately
Thanks for the precompiled binaries. Are the sizes you indicate in terms of bits or bytes? The SparkFun Thing uses a 25SF041 which is 4Mbit. I downloaded the 4M binary and the save button doesn't work properly. It indicates "saved" in the small window below the text window, but nothing runs and opening the default file shows a blank window.
I found the thing board to be a bit lack luster. It only has half a meg of flash. The node mcu boards available on line for less than 10$ with built in usb to serial converter come with 4 megs of flash.
The source code for every thing else is available in the repository.
Thanks. The 512K version of the interpreter downloaded with esptool and worked fine with my iPad
Ah, good to know! With the binaries now available, esptool.py works just fine on Linux & Mac OS X boxes.
Oh, and look what just showed up in my mailbox:
It's a 'Bee' format ESP8266 board from Itead Studio (http://wiki.iteadstudio.com/Wee_Serial_WIFI_Module)
purchase: https://www.itead.cc/wee-serial-wifi-module.html
Not sure how much flash memory is available (looks like a Winbond 25Q808VSIG). Anyone know how to decode that ID?
Thanks,
dgately
Thanks Mike!
Dave Betz: Which GPIO pin on the ESP8266 will you be using to reset the prop?
dgately