Web interface problems V2.1 mainboard

Discussion about various user interfaces such as web interface, displays and apps
purplespark
Posts: 52
Joined: Fri Feb 15, 2019 10:22 am
Location: United Kingdom

Web interface problems V2.1 mainboard

Post by purplespark »

Hello,
I'm not sure where the problem lies , but the esp8266 connects ok but drops out after a short time .
power light on mainboard is always on , but no green led ? I have followed Johannes' instructions on installing easy php
and I think thats ok . Before this started happening I tried to update the web interface and it seemed to go ok, but then the
drop outs started . Don't know where to go from here , hopefully someone can suggest a way forward.
Thanks .
ps As you may have guessed , I'm no computer whizz !
User avatar
johu
Site Admin
Posts: 5681
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 959 times
Contact:

Re: Web interface problems V2.1 mainboard

Post by johu »

Does the green LED flash when the wifi board is not connected?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
purplespark
Posts: 52
Joined: Fri Feb 15, 2019 10:22 am
Location: United Kingdom

Re: Web interface problems V2.1 mainboard

Post by purplespark »

No , it doesn't . I'm guessing the failed update has mangled the firmware. Is there a way around this ?
I have checked the voltage at the reset button , that seems right, but on pressing the reset Iseem to remember the power led
would dip in brightness , but now it stays light constantly.
User avatar
johu
Site Admin
Posts: 5681
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 959 times
Contact:

Re: Web interface problems V2.1 mainboard

Post by johu »

Ok, you need to establish a stable connection to the wifi module. Just observe the green LED on the module. It gives a short pulse when the module restarts (which it might do because it can't talk to the firmware). Do not press any button while waiting. Once the LED stops flashing every 10s or so, try rerunning the update. After hitting the upload button, press reset on the STM32-H103 board (small button)
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
purplespark
Posts: 52
Joined: Fri Feb 15, 2019 10:22 am
Location: United Kingdom

Re: Web interface problems V2.1 mainboard

Post by purplespark »

Thanks ! I'll try it tomorrow.
purplespark
Posts: 52
Joined: Fri Feb 15, 2019 10:22 am
Location: United Kingdom

Re: Web interface problems V2.1 mainboard

Post by purplespark »

Ok, I followed your instructions and yes it worked ! So I thought I'd be clever and update
the loader to avoid this happening again and Hey Presto ! - back to square one and
now I cant connect to the 8266 at all !
purplespark
Posts: 52
Joined: Fri Feb 15, 2019 10:22 am
Location: United Kingdom

Re: Web interface problems V2.1 mainboard

Post by purplespark »

My pc does see the esp8266 , but it won't connect and ,apart from at switch on, there is no green light .
Same on stm 32. Is it terminal ,doctor?
User avatar
dima
Posts: 157
Joined: Sun Dec 09, 2018 9:35 pm
Location: Canada

Re: Web interface problems V2.1 mainboard

Post by dima »

Follow soldering instructions for GPIO0 viewtopic.php?f=5&t=8 and use UART to re-flash the loader.
purplespark
Posts: 52
Joined: Fri Feb 15, 2019 10:22 am
Location: United Kingdom

Re: Web interface problems V2.1 mainboard

Post by purplespark »

Thanks Dima .
Forgive me ,but just to clarify, can I use method 2 and do I then upload the stm32 loader .bin ?
Are any other files required - I need to understand what is stored in the 8266 as opposed to the stm 32.
Remember , you are talking to a dummy !
User avatar
dima
Posts: 157
Joined: Sun Dec 09, 2018 9:35 pm
Location: Canada

Re: Web interface problems V2.1 mainboard

Post by dima »

It sounds like you cannot use method 2 because you cannot connect to WiFi and get an IP address.

Two thing are stored in 8266.

1) firmware
2) files ...called spiffs (web pages)
purplespark
Posts: 52
Joined: Fri Feb 15, 2019 10:22 am
Location: United Kingdom

Re: Web interface problems V2.1 mainboard

Post by purplespark »

Thanks , clearer now !
purplespark
Posts: 52
Joined: Fri Feb 15, 2019 10:22 am
Location: United Kingdom

Re: Web interface problems V2.1 mainboard

Post by purplespark »

Right , I have just received a new 8266 ,and a usb-serial cable , but before I try again can someone confirm which file(s) is the firmware - it should be a .bin file -right?
Can I use the Arduino ide for this or should I use the esptool ?
Assuming I can flash the firmware ,do I then flash the spiffs on Johannes github page " 8266 web interface" ?
Sorry for so many questions - old dogs , new tricks etc !
User avatar
johu
Site Admin
Posts: 5681
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 959 times
Contact:

Re: Web interface problems V2.1 mainboard

Post by johu »

Find the FSBrowser.ino file on my github and upload to esp8266 using the Arduino IDE. Before that you need to add the esp8266 package to Arduino (follow instructions on that page).

So usually I set Wifi Access point info (SSID and secret) using the original firmware. Therefor it is not in the code. Not sure what it defaults to. To make sure find the line that says "Wifi.begin()" and change it to "Wifi.begin("inverter", "somepassword")". Downside: you won't be able to change this in the web interface anymore.

There is also a facility for uploading the spiffs via serial cable but I have never tried this (Dima has).
Instead I use curl to upload. You can get curl for Windows also. Make sure you have downloaded all files from the web interface repo and are connected to the ESP module via wifi then run these commands:

Code: Select all

curl -F 'data=@index.js' http://192.168.4.1/edit
curl -F 'data=@inverter.js' http://192.168.4.1/edit
curl -F 'data=@index.html' http://192.168.4.1/edit
curl -F 'data=@wifi.html' http://192.168.4.1/edit
curl -F 'data=@wifi-updated.html' http://192.168.4.1/edit
curl -F 'data=@ajax-loader.gif' http://192.168.4.1/edit
curl -F 'data=@refresh.png' http://192.168.4.1/edit
curl -F 'data=@style.css' http://192.168.4.1/edit
curl -F 'data=@gauges.html' http://192.168.4.1/edit
curl -F 'data=@gauges.js' http://192.168.4.1/edit
curl -F 'data=@gauge.min.js.gz' http://192.168.4.1/edit
curl -F 'data=@chart.min.js.gz' http://192.168.4.1/edit
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
purplespark
Posts: 52
Joined: Fri Feb 15, 2019 10:22 am
Location: United Kingdom

Re: Web interface problems V2.1 mainboard

Post by purplespark »

Thanks Johannes, but I've run into problems on the first line !
I have the esp8266 libraries installed , but when I try to compile the FSBrowser.ino
there are some errors. I've tried this more than once including using the latest Arduino IDE and reloading the
libraries .
8266errors.txt
(80.76 KiB) Downloaded 225 times
User avatar
dima
Posts: 157
Joined: Sun Dec 09, 2018 9:35 pm
Location: Canada

Re: Web interface problems V2.1 mainboard

Post by dima »

  1. Arduino/File -> Preferences -> Additional Boards Manager URLs: http://arduino.esp8266.com/stable/packa ... index.json
  2. Tools -> Boards -> Board Manager -> esp8266 -> Install
  3. Tools -> Boards -> Olimex MOD-WIFI-ESP8266-DEV -> Flash Size -> 2M (1M SPIFFS)
purplespark
Posts: 52
Joined: Fri Feb 15, 2019 10:22 am
Location: United Kingdom

Re: Web interface problems V2.1 mainboard

Post by purplespark »

That's exactly what I've done !
usb -serial cable is from Olimex,with their driver.
port is set to not use fifo buffer- not sure about that. Flow control set to none.
Oh - I've copied and pasted the code into the IDE , could that be a problem ?

Could be Brexit Gremlins - I voted remain!
User avatar
dima
Posts: 157
Joined: Sun Dec 09, 2018 9:35 pm
Location: Canada

Re: Web interface problems V2.1 mainboard

Post by dima »

Don't know what to suggest. Try this code https://github.com/dimecho/Huebner-Inve ... SP8266.ino It is a bit different from Johannes, but see if you can flash it. You can get SPIFFS from here https://github.com/dimecho/Huebner-Inve ... SP8266.zip

Shameless self promotion 8-)
purplespark
Posts: 52
Joined: Fri Feb 15, 2019 10:22 am
Location: United Kingdom

Re: Web interface problems V2.1 mainboard

Post by purplespark »

Thanks Dima , but I get even more errors with this ! There are also other libraries required and Ive tried commenting them out
but it gets too involved for me ! Would you or someone else try compiling Johannes code from FSBrowser.ino and see what you get ,please- cos this is
driving me nuts - it shouldn't be this difficult .
Thanks
User avatar
dima
Posts: 157
Joined: Sun Dec 09, 2018 9:35 pm
Location: Canada

Re: Web interface problems V2.1 mainboard

Post by dima »

Yes looks like Arduino IDE 1.8.7 has problem compiling FSBrowser.ino

change line 309 from Serial.write(buffer, sizeof(buffer));

to

Code: Select all

Serial.write((uint8_t*)buffer, sizeof(buffer));
and line 314 from Serial.write((char*)&crc, sizeof(uint32_t));

to

Code: Select all

Serial.write((uint8_t*)crc, sizeof(uint32_t));
purplespark
Posts: 52
Joined: Fri Feb 15, 2019 10:22 am
Location: United Kingdom

Re: Web interface problems V2.1 mainboard

Post by purplespark »

Thank you dima - I'm not going mad after all !
Will give it a try tommorrow.
purplespark
Posts: 52
Joined: Fri Feb 15, 2019 10:22 am
Location: United Kingdom

Re: Web interface problems V2.1 mainboard

Post by purplespark »

The continuing saga !
Got to flash the FS Browser file ! My PC can see it and it says it's connected - but the ssid is eps_F52560 ? Also no password asked for .
I followed Johnannes instructions to change the line beginning "WiFi begin " and put inverter as the ssid and a password, but they don't appear to have worked.
So I moved on and tried curl to flash the spiffs. I downloaded the web interface files to my pc . then I cd to that file and tried the curl commands
as in the post above . All I got was " unable to open /read local files " . I must be missing something ?
User avatar
dima
Posts: 157
Joined: Sun Dec 09, 2018 9:35 pm
Location: Canada

Re: Web interface problems V2.1 mainboard

Post by dima »

A bit strange that SSID is set to default. Maybe try erasing WiFi settings?
Screenshot_2.png
purplespark
Posts: 52
Joined: Fri Feb 15, 2019 10:22 am
Location: United Kingdom

Re: Web interface problems V2.1 mainboard

Post by purplespark »

Chapter 3 !
After a lot of trial and error experiments with different versions of Arduino ide and esp8266 boards, I got to the point where
I could compile FSbrowser.ino . So I exported the .bin file and tried to flash it to the esp8266 , using esptool . After that my pc still sees"esp_56520",
but asked me for a password !, same source code ,different flashing procedure ! Will keep experimenting , somethings got to work soon !
User avatar
dima
Posts: 157
Joined: Sun Dec 09, 2018 9:35 pm
Location: Canada

Re: Web interface problems V2.1 mainboard

Post by dima »

Are you sure you soldered GPIO0 to 0? After done flashing solder it back to 1.

Post your result screenshots.
purplespark
Posts: 52
Joined: Fri Feb 15, 2019 10:22 am
Location: United Kingdom

Re: Web interface problems V2.1 mainboard

Post by purplespark »

Yes , I did. I have three 8266's now and I'm starting to think it must be the usb-serial cable . If I try putty to communicate with it I get no response from two of the 8266s . The 3rd responds with version no. etc. But I haven't tried to flash this one ,so I'm not sure .Maybe my attempts to flash the other two have mangled any code that was there ?
I think I will ask Johannes to send me a pre-flashed 8266 so that i can move this project further on . I have a friend visiting soon who knows a lot more than me ,computer and code wise so hopefully he will be able to figure it out.
Dima , thanks for your help so far , I'm sure i'll need more soon !
Will keep you posted !
Post Reply