Chat freely about anything...

User avatar
By Edocecrous
#7104 Ok,

so the 'latest' AT firmware i downloaded from the link provided.

The bin folder is full with .bin files, and i know they should go to different addresses.

1, I have a windows flasher (esp8266_flasher.exe) that accepts only one file at a time, so i need the location for these files. (plus this tool is buggy and gives division by 0 for some .bin files)
2, Tried a fancy chinese GUI flasher (ESP8266Flasher-x64-v0.9.2.3.exe), again, where to flash the stuff? I managed to use this tool to automagically flash some recent stuff, ended up with a module that didn't respond to any AT command) despite the flasher showed a little green ok sign, and it read the MAC, and generated some pretty scan codes...
3, The link where you pointed has a windows FLASH_DOWNLOAD_TOOLS_v0.9.3.1, the flasher here starts up with CreateActCtx failed with error debug log..., the graphical interface points to some VM (that i could still not download...), and i can only select COM ports from 1-9 (mine is on COM12...)

So yes, it seems not that easy to just 'flash the device'. I won't even mention, what if someone wants a simple AT firmware, no dual user parts and no cloud updating.

So now downloading Python, etc, and trying the command line stuff, hopefully that will work.
User avatar
By BitBanger
#7145 Hi Edocecrous,

It looks like you and I have been heading down parallel paths. I too am an old assembly language programmer hobbyist just starting to play with these ESP radio modules. I initially learned 8080 assembly language programming running on the CP/M operating system. It was a tough move for me going to DOS from CP/M but now but DOS is my friend. I keep hearing about this Linux thing but I don’t think it’s here to stay! :lol:

I have an existing network of microprocessor devices in my house hooked together via RS-485 in a hub and spoke network. I would like to replace the hardwire RS-485 connections with ESPs.

Like you, I picked up a few ESP-01 modules and began trying to figure out how they work by talking to them directly using TeraTerm through FTDI serial modules. It’s been an arduous process. Before I started modifying my microprocessor assembly code I wanted to get a feel for how these radios work and what happens when things are working and then something fails or reboots. What will I need to do to detect the failure and what does it take to restart the connections on the fly? I want to initially start with a standalone AP with 3 STA nodes connected. I’ll share my experience:

My modules came preloaded with V0.9.2.2. After making sure the modules worked the next thing I did was try to burn new code into my modules. Like you I downloaded the ESP8266_flasher.exe downloader software. I too had the issue that my FTDI modules were assigned COM ports > 10. I was able to Google and find out how to manually go in and edit the registry to swap around COM number assignments in order to get these four FTDI modules to be assigned to COM < 10.

I then discovered that more than one file had to be burned into the ESP and the files had to be located at specific addresses. The downloader loaded the first file at 0x00000 just fine. Wow, that was easy. Cool! I went to load the next file and the software wouldn’t load it. I could only load files with the file location set to 0x00000. So, I used my handy dandy hex file editor and manually pasted the two files together at the appropriate memory locations then filled the locations between the two data locations with 0xFF. That worked. But wait, there’s more! I found there was a third location that needed to be blanked with 0xFF so I once again turned to the hex editor to solve the problem. I was able to successfully burn this single file image into the ESP. Hey, when the only tool you have is a hammer, make all your problems look like a nail.

OK, now I have working modules with the latest greatest software revision. I figured out pretty quickly that I had to use AT+CIPMUX=1. I thought I could set one radio as an AP using AT+CWMODE=2 and the other radios as STA using AT+CWMODE=1. I could get the radios to connect, IP addresses got assigned but I was never able to get the CIPSTART command on the AP to succeed when trying to connect to the STA nodes. I can only get CIPSTART to work if both radios are in CWMODE=3. This bugs me because I don’t want to see ( and I’d prefer all my neighbors not see) every module when I use CWLAP. I really only want to see the single hub AP. But I digress…

Moving forward… Setting each radio to CWMODE=3, I can get them connected and successfully perform AT+CWSTART from the hub radio (this node being the AP if mode 2 would work) to the other two nodes (which would be in mode 1 if I could get them to work that way).

Let me digress again ( I’m a pro at that). Actually I have two tools, a hammer and a pry bar! I would be remiss not to give credit here. I got tired of typing, retyping, mistyping AT commands. I discovered Peter Scargill created a neat terminal program that I have used for running these tests. His terminal software allows me to quickly issue/re-issue commands manually to the radio modules for testing. You only have to type a command once then you can select and re-send any previously typed commands. (See his blog for more information). Great tool! Thanks Peter! I have noticed however when using his tool that after sending an AT+CIPSEND command, the radio never returns a “>” prompt . I have verified that Peter’s terminal is sending the command out properly to the radio. I found that once I get the radios to connect I have to switch back over to TeraTerm in order to send the CIPSEND commands. I think the radio needs a time delay between the end of the text of the CIPSEND command and the CR/LF. As I said, I have verified that Pete’s code is sending the command with CRLF just as TeraTerm. It seems to me the only difference is the time factor of a human typing the CIPSEND command with the inevitable delay between characters as they are manually typed into TeraTerm. Peter’s code is probably blasting the data out with no (or little) inter-character delay. When you crank his terminal up you can specify a delay between lines of data that get sent which I have found that useful. But that is the only user defineable delay.

On to the next hurdle. It turns out the problem using Peter’s terminal led me to finding the next issue. If for any reason I get a disconnect between the Hub and a Spoke, I would think I could do a CIPCLOSE=x on the two affected radios then perform the appropriate CIPSTART and restart the affected connection. Nope, Nill, Nada. So I tried resetting the affected STA module using AT+RST. I still can’t get AT+CIPSTART to reestablish the connection. I tried resetting both radios via the AT+RST command. Nope. The only way that I have been able to successfully restart a failed connection is to pull a hardware reset on the hub radio and the spoke radio which also means resetting the other spokes since their connections get blown away when I reset the hub.

Sorry, I didn’t mean to write a thesis. Anyway, that’s my experience. I’ve learned a lot as I’ve gone through this exercise, most of which I don’t really understand. Maybe this will help you and/or others. I know next to nothing about wifi, AP’s, Stations, Clients, Servers, etc. so I’m sure there are some things I’m probably not doing right. Maybe others can shed some light on what we might do differently in order to make this work in a cleaner fashion.

BB
User avatar
By Edocecrous
#7177 Hi BitBanger,

When i can, i go with wired solutions ;-), for me the ESP8266 is needed for a project that i'm working on for a friend. Eventually a very simple interface on Android/PC to set and read temperature of a device is the goal.

Since i can't even get the firmware on the module that has WORKING AT commands, i am pretty far from the solution. :-(
Yes, first i wanted to check the the functionality, before i get into writing my own firmware... ...which i want to do because running a 32bit, 80Mhz chip from let's say an 8Mhz atmel chip over serial seems a dumb thing to do, adds extra hardware and doesn't use the potential of this chip.

I followed the wiki to set up the windows environment, even downloaded the huge visual studio (at that point it was almost midnight, and i didn't notice the project is missing files that VS needs, so it was pointless to install vs 2013)

I'm not sure if this helps you, these are the things i collected so far that could be interesting for guys like us:

- They use a flasher tool written on the Python language. This is a modular language, need to download pyserial module for it, because it uses functions from that to communicate over serial ports. Python can be installed on windows too (or dos). Then run programs with python.exe myprogram.py. If you run into extension .pyc, that is bytecode, like java, still needs the interpreter. Have some utility to generate exe files, but i believe it just shoves the interpreter and the bytecode into an executable. I'm afraid the flasher we use is an old version of the current python flasher tool.

- The new firmware supports code/firmware update over wifi, that's why user1.bin and user2.bin, containing the same code, and running one while the other can be updated and then switch. They call it cloud update, it just means the firmware looks for updates on their server and does the download/flash/switch.

- There is a VM that has a working development environment setup, but i couldn't download it so far.

Edo