vitotai / BrewPiLess

Use an ESP8266 to replace RPI and Arduino. Running BrewPi without Pi, therefore, BrewPi-Less
358 stars 135 forks source link

New version breaks BPL #59

Open allthepies opened 6 years ago

allthepies commented 6 years ago

Hi Vito,

Just tried the new version and it doesn't work for me.

The latest libs version just goes into a reboot loop, the legacy libs version "works" but the LCD web screen can't connect to the controller. Have cleared browser cache multiple times.

image

allthepies commented 6 years ago

OK, tracked down the LCD update issue.

I had an existing logging session going on when I upgraded and that seems to have caused an infinite loop in the resumeSession() method in Brewlogger.h.

It was spinning round the "while(totalRead < fsize){" loop constantly writing out :

Move 2 bytes, read:0 process:0

So I wiped SPIFFS and attempted again. Both the new libs and legacy libs variants of 2.5 now work but with the new async libs version the Device Setup page wouldn't load, the browser never got a response. All other pages were OK.

Reverted back the the legacy libs variant and all pages working OK.

vitotai commented 6 years ago

I am sorry. v2.5 is not really ready. Especially for the latest libraries with latest framework.

The latest Async libraries seems to have issue with 1.5 framework. The README.md of ESPAsyncWebServer states that latest framework "might" be necessary. I've tested different combinations for a while but couldn't draw a conclusion.

One big issue about latest framework is that it is 25.5k bigger than release 1.5. BPL is almost near the boundary of 512k. The image size built with latest 1.6 framework is too big, which might break the flash layout and result in unpredictable condition. In the best case, you will lost OTA function after that. This is exact the reason why I keep using the legacy version.

There are some fixes and some revision so I think a release before migrating to latest framework is necessary.

vitotai commented 6 years ago

Some information for you: http://vito.tw/?p=895

allthepies commented 6 years ago

Thanks.

There does seem to be a bug in resumeSession() method in Brewlogger.h though if you get time to look at that.

The fact that resumeSession() was looping reporting "Move 2 bytes, read:0 process:0" constantly would tend to indicate that processSavedData() has performed a "rewind" at some point and subtracted 2 from the log position. That then causes resumeSession to get out of step with bytes remaining vs the actual log file size.

Also, the signature of processSavedData is size_t processSavedData(char *buffer,size_t size) but it never uses the "buffer" param but accesses _logBuffer directly instead. It works as _logBuffer is the address passed in, but it's messy.

vitotai commented 6 years ago

I will look into it.

BTW, I am trying 2M sketch space with 2M SPIFFS configuration. It works fine, but I found one thing weird. After I flashed the 2M version onto the originally running 1M sketch space version, I expected that the SPIFFS will be created at different address on the flash. However, there were files left. so, SPIFFS might not work as what I have thought.

allthepies commented 6 years ago

A new version Vito! platformio.ini file mentions a new flash script ? What do I need to do in order to build/flash the latest version ?

"you will need to add the flash layout script" is the comment which has me asking what I need to do

vitotai commented 6 years ago

Check: https://github.com/vitotai/BrewPiLess/wiki/2M-sketch-Space

allthepies commented 6 years ago

Thanks!

v2.5 now running with latest libs :)

I'm using an OLED and have added the reduce memory directive in my build, seems to slow the OLED refresh down slightly but no crazy flickering or any other issues. I wonder if there is a text-only OLED library ? Libraries are great but they often contain lots of baggage which just might not be required for a specific application.

vitotai commented 6 years ago

The OLED is basically graphics based. It seems to me that font is necessary since there is no font rom built-in. During linking phase, the compiler(linker, to be precise) will eliminate unused functions and global variables. We don't need to worry about that.

We do, however, can reduce the font library by selecting the characters that we need instead of full character set.

Updated: This library might do the job, but no SH1106 support. https://github.com/greiman/SSD1306Ascii