Page 1 of 2

Web interface problems V2.1 mainboard

Posted: Fri Mar 08, 2019 11:18 pm
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 !

Re: Web interface problems V2.1 mainboard

Posted: Sun Mar 10, 2019 3:33 pm
by johu
Does the green LED flash when the wifi board is not connected?

Re: Web interface problems V2.1 mainboard

Posted: Sun Mar 10, 2019 8:21 pm
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.

Re: Web interface problems V2.1 mainboard

Posted: Sun Mar 10, 2019 9:14 pm
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)

Re: Web interface problems V2.1 mainboard

Posted: Sun Mar 10, 2019 11:41 pm
by purplespark
Thanks ! I'll try it tomorrow.

Re: Web interface problems V2.1 mainboard

Posted: Tue Mar 12, 2019 1:13 pm
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 !

Re: Web interface problems V2.1 mainboard

Posted: Wed Mar 13, 2019 3:55 pm
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?

Re: Web interface problems V2.1 mainboard

Posted: Wed Mar 13, 2019 7:13 pm
by dima
Follow soldering instructions for GPIO0 viewtopic.php?f=5&t=8 and use UART to re-flash the loader.

Re: Web interface problems V2.1 mainboard

Posted: Wed Mar 13, 2019 8:53 pm
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 !

Re: Web interface problems V2.1 mainboard

Posted: Thu Mar 14, 2019 4:12 pm
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)

Re: Web interface problems V2.1 mainboard

Posted: Thu Mar 14, 2019 8:41 pm
by purplespark
Thanks , clearer now !

Re: Web interface problems V2.1 mainboard

Posted: Sat Mar 30, 2019 6:08 pm
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 !

Re: Web interface problems V2.1 mainboard

Posted: Sat Mar 30, 2019 9:59 pm
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

Re: Web interface problems V2.1 mainboard

Posted: Sun Mar 31, 2019 10:56 pm
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 229 times

Re: Web interface problems V2.1 mainboard

Posted: Mon Apr 01, 2019 4:14 pm
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)

Re: Web interface problems V2.1 mainboard

Posted: Tue Apr 02, 2019 12:01 am
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!

Re: Web interface problems V2.1 mainboard

Posted: Tue Apr 02, 2019 2:17 am
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-)

Re: Web interface problems V2.1 mainboard

Posted: Tue Apr 02, 2019 6:39 pm
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

Re: Web interface problems V2.1 mainboard

Posted: Tue Apr 02, 2019 7:43 pm
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));

Re: Web interface problems V2.1 mainboard

Posted: Tue Apr 02, 2019 10:14 pm
by purplespark
Thank you dima - I'm not going mad after all !
Will give it a try tommorrow.

Re: Web interface problems V2.1 mainboard

Posted: Thu Apr 04, 2019 9:29 am
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 ?

Re: Web interface problems V2.1 mainboard

Posted: Thu Apr 04, 2019 3:33 pm
by dima
A bit strange that SSID is set to default. Maybe try erasing WiFi settings?
Screenshot_2.png

Re: Web interface problems V2.1 mainboard

Posted: Sun Apr 07, 2019 4:50 pm
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 !

Re: Web interface problems V2.1 mainboard

Posted: Mon Apr 08, 2019 2:02 am
by dima
Are you sure you soldered GPIO0 to 0? After done flashing solder it back to 1.

Post your result screenshots.

Re: Web interface problems V2.1 mainboard

Posted: Wed Apr 10, 2019 8:49 am
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 !