HOWTO: Flashing ESP8266

Discussion about various user interfaces such as web interface, displays and apps
MattsAwesomeStuff
Posts: 898
Joined: Fri Apr 26, 2019 5:40 pm
Has thanked: 291 times
Been thanked: 177 times

Re: HOWTO: Flashing ESP8266

Post by MattsAwesomeStuff »

As a separate issue from previous post..

I'm also wanting to try out Dima's alternative web interface (what I think this thread was originally about), but despite all the options, I can't figure any of them out. I'm going by the ReadMe.txt and am stumped.

1 - I have tried installing via Windows, downloaded the windows zip, unzipped, and then ran the batch file. It downloaded 2 or 3 things but then I wasn't sure which COM port to select or how to find out what COM port I want. It defaulted to COM1. I think it was COM13 last time, so I tried editing the serial.json file as it suggests (it doesn't tell you where to find it, it's in the /Web/js/ folder). I edited it and changed COM1 to COM13, saved, but on reloading the .bat file it still presumes Com1.

I think I need a TTL converter and this is supposed to plug the Blue Pill directly into the computer through that converter? I can't use the WeMOS D1 MIni?


2 - I tried installing directly onto the WeMOS D1 Mini from the Arduino IDE Setup. I downloaded the ESP8266.zip file. Unzipped. I see an flash-sketch-Olimex.bin and a flash-sketch-WeMosD1.bin , so presuming the WeMos one but can't find out how to upload that. There's no batch file or any description of what to connect or how.

I think this might be if I'm using the ST-LINK, which I don't know how to connect the WeMosD1 to.

I'm not sure if the next bit is a continuation of the above instructions or instructions of a different method, but the Readme says to run ./data.sh (data.bat Windows). There is no Data.bat file, and I don't have a linux computer (which is what I presume the .sh is for?). Looking through the data.sh file (I'm not familiar with Linux, but it's not too far off DOS syntax to see if I could just rewrite it as a .bat myself), it wants to create some directories and copy some files from ../web/blah but, there is no ../web/ anywhere when you download the ESP8266 zip, that only exists on the main GITHUB. And then it wants to do some filename conversions and do some file compressions and I got lost in the pasta. Looks like the ESP8266 zip file does not have enough of what is needed to make this work regardless, but, my ignorance limits me.

If I try sketching or uploading I get errors about "no such file or directory", presumably because I didn't run the data.bat file to create it, because that file doesn't exist.


3 - I tried installing via Johannes' web interface already on the WeMosD1 by logging in and using the Update function. The instructions are vague as to whether I can use Johanne's interface to change the interface itself, or whether this only works if you already have Dima's interface, but I tried anyway.

You can only pick one file at a time, and I don't know what file to pick. I tried picking the sketch.sh and spiffs.sh and it says updated, but resetting does nothing different, still in Johannes' interface. Tried uploading the 8266's .bin for the WeMosD1... no change.


I have a feeling on all 3 methods the instructions are 95% complete and I'm just missing a single critical step of what I'm supposed to be doing.

Again I'm happy to create some wiki pages and document these in a more beginner-friendly way once I myself understand how to make them work, if that saves anyone some time.
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: HOWTO: Flashing ESP8266

Post by arber333 »

First you have to install bootloader so the chip knows through which port it will receive updates. Then while you are at it you flash the actual firmware also. You do this by STLINK connected to PC. I recommend you do not get creative untill you are able to install the firmware. Just follow our instructions.

Good job installing Wifi gizmo. Now connect it to your inverter core so you are able to actiually run a motor without resolver in debug mode.
When you connect Wifi gizmo to STM32 chip (be it Bluepill or Olimex) you have to reset STM32 chip first so Wifi starts with fresh RX. Then you can leave it connected, everytime it starts it will synchronise itself.

I didnt choose Dimas Wifi because Johannes seemed more fit to Arduino and windows. But later Dima prepared files for windows too.
You need to give orders from the CMD console in folder position.

Later on you can go exploring...
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: HOWTO: Flashing ESP8266

Post by arber333 »

OK again i went and made some photos

This is my setup. Note wire colours. TX goes to RX and vice versa.
IMG_20200107_184940.jpg
Be sure you program D1 module with those settings you see on pic
wifi arduino.jpg
AFTER you program STM32 chip with STLINK you connect Wifi module to setial pins.
Next you apply 12V power to the board and search for wifi module with your phone.
Connect to wifi whitout password for now
Go to phone browser and type http://192.168.4.1/ and enter
If you do not get settings the first time reset STM32 by the button
Then restart the address in blowser again.
New Bitmap Image.jpg
After you get parameters field you search for "wifi settings" and change them.
Reset or reconnect again.... do not forget SSID and password :).
User avatar
dima
Posts: 157
Joined: Sun Dec 09, 2018 9:35 pm
Location: Canada

Re: HOWTO: Flashing ESP8266

Post by dima »

Don't forget about Web flash (.bin files) -> http://inverter/update or http://192.168.4.1/update
MattsAwesomeStuff
Posts: 898
Joined: Fri Apr 26, 2019 5:40 pm
Has thanked: 291 times
Been thanked: 177 times

Re: HOWTO: Flashing ESP8266

Post by MattsAwesomeStuff »

Oops. I completely missed these last 3 posts. Was waiting for advice still.

...

I desoldered the blue pill with my smt heat gun. Made a mess of the old one, blew the STM, crystal, usb, and a handful of other things off with the air jet, ripped out some vias, if it wasn't fried before it's not fixable now.

Resoldered the new blue pill after programming with STM-Link.

WeMOS D1 Mini is programmed via Arduino IDE.

Connect them up. Power up. Lights on.

Webpage hosts fine, but doesn't seem to want to connect to my wifi ever. (When I tell the webpage to look up Parameter Reference, it's supposed to go to Johannes' website but it times out trying to load). Not sure if that's essential, I can connect to the WeMos over wifi and those settings save fine, so, good enough?

When I scroll down I don't see (and never have seen) any actual parameters loaded. Just the header that says Parameters. I've refreshed, reloaded, reset... nadda.

Just for kicks, I've tried swapping TX and RX and I get the same (no) results.


The only things different in my Arduino IDE settings from your most recent screenshot are:

My "Flash Size" is still set to 4MB (FS-1MB) (from your earlier instructions) instead of 4MB (FS-2MB) (as shown in your most recent screenshot). Which is correct?

iWIP Variant: "V2 Lower Memory" instead of "V2 IPv6 Lower Memory". Does this matter?

...

When I download the parameters file, it's just blank curly braces { }.

... What am I doing wrong?

When I used ST-LINK on the Blue Pill, it should have loaded default parameters right? Even if I haven't updated them since?

Far as I can tell, I can't see a difference between the WeMos being connected to the Blue Pill vs. Not being connected to the Blue Pill.

Is there any easy way to test that connection, or to test that anything actually happened when I thought I programmed the blue pill?
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: HOWTO: Flashing ESP8266

Post by arber333 »

Like I said EXACTLY as in the picture. Those are settings that work. I don't vouch for others.

Sometimes you have to reset STM32 so D1 can get in sync with serial.

Rx to TX and vs.

A
MattsAwesomeStuff
Posts: 898
Joined: Fri Apr 26, 2019 5:40 pm
Has thanked: 291 times
Been thanked: 177 times

Re: HOWTO: Flashing ESP8266

Post by MattsAwesomeStuff »

Reflashed the Wemos with exactly the same settings.

RX to TX and TX to RX. And the other way while I was ruling things out.

... still not loading parameters when I load the webpage.

Anything else I'm missing? Is there a missing step like "When you first connect to the Blue Pill, do X"?

Any way to test whether the WeMos is connected to the Blue Pill at all?
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: HOWTO: Flashing ESP8266

Post by arber333 »

MattsAwesomeStuff wrote: Sat Jan 11, 2020 9:47 am Reflashed the Wemos with exactly the same settings.

RX to TX and TX to RX. And the other way while I was ruling things out.

... still not loading parameters when I load the webpage.

Anything else I'm missing? Is there a missing step like "When you first connect to the Blue Pill, do X"?

Any way to test whether the WeMos is connected to the Blue Pill at all?
No, i mean that when you set out to program ESP in Arduino you have to set every parameter like in the pic! If you have a memory set differenty or some IP config you may get different results.
MattsAwesomeStuff
Posts: 898
Joined: Fri Apr 26, 2019 5:40 pm
Has thanked: 291 times
Been thanked: 177 times

Re: HOWTO: Flashing ESP8266

Post by MattsAwesomeStuff »

No, i mean that when you set out to program ESP in Arduino you have to set every parameter like in the pic! If you have a memory set differenty or some IP config you may get different results.
I think we're saying the same thing.

I disconnected the WeMos, changed the settings in the tools menu to match your settings in the image, plugged the WeMos back into the computer's USB, uploaded the sketch from the Sketch menu, uploaded the sketch data from the Tools menu, plugged the WeMos back into the Blue Pill on the Control Board, powered up the Blue Pill, reset the Blue Pill via the reset switch, logged into the inverter's wifi... still no parameters visible.
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: HOWTO: Flashing ESP8266

Post by arber333 »

MattsAwesomeStuff wrote: Sat Jan 11, 2020 11:14 am
No, i mean that when you set out to program ESP in Arduino you have to set every parameter like in the pic! If you have a memory set differenty or some IP config you may get different results.
I think we're saying the same thing.

I disconnected the WeMos, changed the settings in the tools menu to match your settings in the image, plugged the WeMos back into the computer's USB, uploaded the sketch from the Sketch menu, uploaded the sketch data from the Tools menu, plugged the WeMos back into the Blue Pill on the Control Board, powered up the Blue Pill, reset the Blue Pill via the reset switch, logged into the inverter's wifi... still no parameters visible.
Darn!
I must confess i didnt try serial with Bluepill exactly. I just use my Olimex H103.
I tried with Bluepill. I cant seem to get parameters.
So schematic is the same that Damien uses on his github? Because i dont have his board i connected to STM32 pins directly.
I reloaded my D1 with the correct firmware so that is not the issue here.
I even tried with H103. I can get parameters from my Olimex board.

Johannes, any thoughts? Maybe you adressed TX RX differently? To program my Bluepill i used the last code from this thread.
viewtopic.php?f=3&t=220&start=60#p3121

EDIT: I even tried to supply bluepill from different 5V source so USB connector wouldnt interfere with serial, still no joy.
MattsAwesomeStuff
Posts: 898
Joined: Fri Apr 26, 2019 5:40 pm
Has thanked: 291 times
Been thanked: 177 times

Re: HOWTO: Flashing ESP8266

Post by MattsAwesomeStuff »

So schematic is the same that Damien uses on his github? Because i dont have his board i connected to STM32 pins directly.
I've changed nothing in the schematic.

Quicklinks if it helps anyone, from Damien's Github:

Schematic: https://github.com/damienmaguire/Prius- ... %20PCB.pdf
PCB: https://github.com/damienmaguire/Prius- ... %20PCB.pdf
I even tried to supply bluepill from different 5V source so USB connector wouldnt interfere with serial, still no joy.
I've also tried wiring the WeMos D1 Mini to a different power source than the BluePill/Control Board. No change.

...

Damien has gotten this to work (Blue Pill + Olimex Mod ESP8266). So, has anyone gotten it to work with the WeMos D1 Mini yet?

Breaking things down, I don't have any other UART-USB control. I technically don't even know if the Blue PIll is working properly. Is there a way to figure that out on its own?

I could try soldering the TX and RX lines straight to the TX and RX pins on the Blue PIll, just in case there's some issue with the Control Board, but, considering my rate of screwing things up I thought I'd leave that alone until I try other things.
User avatar
dima
Posts: 157
Joined: Sun Dec 09, 2018 9:35 pm
Location: Canada

Re: HOWTO: Flashing ESP8266

Post by dima »

In my opinion "Blue-Pill" is a bad idea. It was great to see developers explore different options, but when Johannes discovered "cross-talk" ....do you really want to put safety and reliability into this "cheap" component? I recommend start with V2.1 learn how-to bootloader/firmware and then move into ESP8266.
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: HOWTO: Flashing ESP8266

Post by arber333 »

MattsAwesomeStuff wrote: Sat Jan 11, 2020 5:28 pm [I could try soldering the TX and RX lines straight to the TX and RX pins on the Blue PIll, just in case there's some issue with the Control Board, but, considering my rate of screwing things up I thought I'd leave that alone until I try other things.
I tried that.. no change.
MattsAwesomeStuff
Posts: 898
Joined: Fri Apr 26, 2019 5:40 pm
Has thanked: 291 times
Been thanked: 177 times

Re: HOWTO: Flashing ESP8266

Post by MattsAwesomeStuff »

In my opinion "Blue-Pill" is a bad idea.
Mmm.. possibly yes.

But, regardless of that, this has worked, and the long-term viability doesn't explain why this isn't working for me. Even if it's a poor choice, I should still be able to make it work.
do you really want to put safety and reliability into this "cheap" component?
Well, everything is as cheap as possible. No one makes things more expensive on purpose. And no one makes things broken on purpose. So, the trick is to make it cheap enough that it's not too cheap. You don't know that until you try it sometimes. And the Blue Pill isn't much more than a glorified breakout board for STM32 pins and some support components, is it? So, where does the safety and reliability concern come from?

I wanted something that I could test my motor and driveline with, get driving with basically, etc... for as cheap as possible. There wasn't anything else out there even remotely in the same cost ballpark. Ruling out my own mistakes, I'm only into this inverter controller for maybe $150.

It was made plain that this is a development board and not a finished product. It looked like a lot of people were looking forward to it but no one had actually built anything yet and I was happy to be part of that process and making it more accessible and being a test rig for Prius inverters.
I recommend start with V2
Depending on what those cost, I might.

However, I've come this far, I'd like to get it working if for no reason other than to have a backup and something I can use to bench test.

...

Anyone have any other ideas for me to try?

- We know the WeMos D1 Mini boards work, some of you have got them working.
- We know the Blue Pill works, Damien got his working the first time on his board, in multiple videos.
- I seem to have gotten both boards to at least accept their bootloaders without error.

Any reason I'm not seeing them talking to each other? Or a way to test them?
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: HOWTO: Flashing ESP8266

Post by arber333 »

MattsAwesomeStuff wrote: Sun Jan 12, 2020 9:29 pm Any reason I'm not seeing them talking to each other? Or a way to test them?
I will try and test Bluepill connection with original Olimex ESP8266 MOD tomorrow. I think it should.
I am having problems connecting to another D1 which i programmed the same as the first one. Very strange, keeps refusing connection from my phone, but it connects to PC fine.

A
MattsAwesomeStuff
Posts: 898
Joined: Fri Apr 26, 2019 5:40 pm
Has thanked: 291 times
Been thanked: 177 times

Re: HOWTO: Flashing ESP8266

Post by MattsAwesomeStuff »

I am having problems connecting to another D1 which i programmed the same as the first one.
Dima says they used the D1, page 2 of this this.
Very strange, keeps refusing connection from my phone, but it connects to PC fine.
Odd, haven't had that issue.

One issue I do have with Johu's interface is when trying to change wifi, sometimes the "modify" button is greyed out and won't let me click it. Either for the AP or the source wifi. And it's consistent, I can refresh and reload in that browser over and over and never get it to show up. Reboot the D1, same. But switch to another device or another browser, sometimes it'll show up then. I have no idea why.
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: HOWTO: Flashing ESP8266

Post by arber333 »

Hm... see here this problem...
viewtopic.php?f=7&t=234

Would it be possible that bluepill does not have the TTL capability on the side outputs and needs additional interface like FTDI to communicate on that pins?
I will see with scope where i see any traffic and how i can use the pins available with D1.
Also i can use my Linux interface with Bluepill to connect. I see by the flashing led serial is working.
MattsAwesomeStuff
Posts: 898
Joined: Fri Apr 26, 2019 5:40 pm
Has thanked: 291 times
Been thanked: 177 times

Re: HOWTO: Flashing ESP8266

Post by MattsAwesomeStuff »

Damien definitely got it working with the Olimex MOD 8266 and his Blue Pill board. He has videos of it in the Prius Gen 2 thread. But I think you said you can't get it working with either the D1 or the Olimex?

I wish I was more help, but, most of this is still greek to me.
User avatar
dima
Posts: 157
Joined: Sun Dec 09, 2018 9:35 pm
Location: Canada

Re: HOWTO: Flashing ESP8266

Post by dima »

Blue-pill has x3 different TTL UART pins... I believe you need USART#3

USART3 TX PB10
USART3 RX PB11
USART2 TX PA2
USART2 RX PA3
USART1 TX PA9
USART1 RX PA10
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: HOWTO: Flashing ESP8266

Post by arber333 »

dima wrote: Thu Jan 16, 2020 5:23 am Blue-pill has x3 different TTL UART pins... I believe you need USART#3

USART3 TX PB10
USART3 RX PB11
USART2 TX PA2
USART2 RX PA3
USART1 TX PA9
USART1 RX PA10
Yes i tried to get Wifi Working through serial 3.
Now i only used D1 mini. I need to make a new cable to hook up Olimex wifi gizmo, but i will try this also.
MattsAwesomeStuff
Posts: 898
Joined: Fri Apr 26, 2019 5:40 pm
Has thanked: 291 times
Been thanked: 177 times

Re: HOWTO: Flashing ESP8266

Post by MattsAwesomeStuff »

dima wrote: Thu Jan 16, 2020 5:23 am Blue-pill has x3 different TTL UART pins... I believe you need USART#3
USART3 TX PB10
USART3 RX PB11
Yep, that's where Damien put it in the circuit.

You can see it on the circuitboard: https://github.com/damienmaguire/Prius- ... %20PCB.pdf

And you can see here that those pins are labelled as USART RX/TX: https://github.com/damienmaguire/Prius- ... ematic.pdf

Damien definitely got it working, presumably using the same code and components.

Part of this is that I don't know what a sign of life looks like from the Blue Pill or the D1 with respect to talking. Like, is the web interface interfacing poorly and just not sending or receiving? Is the Blue PIll not listening? Are they both trying to but something in between is stopping them? Is it getting part way through the process and stopping before the point where I'd see a result?

My only measure of "Yes they're talking" I guess is if the parameters start to show up.
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: HOWTO: Flashing ESP8266

Post by arber333 »

MattsAwesomeStuff wrote: Thu Jan 16, 2020 7:48 am
dima wrote: Thu Jan 16, 2020 5:23 am Blue-pill has x3 different TTL UART pins... I believe you need USART#3
USART3 TX PB10
USART3 RX PB11
Yep, that's where Damien put it in the circuit.

You can see it on the circuitboard: https://github.com/damienmaguire/Prius- ... %20PCB.pdf

And you can see here that those pins are labelled as USART RX/TX: https://github.com/damienmaguire/Prius- ... ematic.pdf

Damien definitely got it working, presumably using the same code and components.

Part of this is that I don't know what a sign of life looks like from the Blue Pill or the D1 with respect to talking. Like, is the web interface interfacing poorly and just not sending or receiving? Is the Blue PIll not listening? Are they both trying to but something in between is stopping them? Is it getting part way through the process and stopping before the point where I'd see a result?

My only measure of "Yes they're talking" I guess is if the parameters start to show up.
No the board is definitely talking. Steady blinking green LED is proof of that. I just dont know what is the port that this thing is sending data to.
doobedoobedo
Posts: 260
Joined: Sat Jan 12, 2019 12:39 am
Location: UK

Re: HOWTO: Flashing ESP8266

Post by doobedoobedo »

Can you get an oscilloscope on to the UART pins of the D1 mini?
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: HOWTO: Flashing ESP8266

Post by arber333 »

doobedoobedo wrote: Thu Jan 16, 2020 11:34 am Can you get an oscilloscope on to the UART pins of the D1 mini?
D1 is not the problem, it works on other stuff. I think all Bluepills are not created the same. That is a pun, sorry. :D

Yup i dont find any traffic on TX and RX if i dont connect Wifi module. D1 by itself is sending signal.
However i did see clear PWM on B3 pin at 17khz.

Hm...
I tried installing the first firmware and i got different config. I am not sure what to do with this one...
MattsAwesomeStuff
Posts: 898
Joined: Fri Apr 26, 2019 5:40 pm
Has thanked: 291 times
Been thanked: 177 times

Re: HOWTO: Flashing ESP8266

Post by MattsAwesomeStuff »

I think all Bluepills are not created the same.
I'm semi-sure mine aren't corner-cutting crap.

I ordered locally-ish, the guy runs a small shop supplying stuff to people in Canada. A business built on reputation and word-of-mouth. I ordered from his Amazon store, but still. Not some Chinese popup clearance company that'll be gone before the boards arrive.

Still, could be the case.

So, looks like the problem is on the blue-pill side?
Post Reply