universam1 / iSpindel

electronic Hydrometer
http://www.ispindel.de
Other
827 stars 322 forks source link

Bricks support #509

Closed BernhardSchlegel closed 3 years ago

BernhardSchlegel commented 3 years ago

This enables the iSpindle to be added as a "Brick" in BierBot Bricks allowing you to "attach" the temperature sensor and (more importantly) the gravity measurement to your fermenter by drag and dropping!

Screenshot of Fermentation Tracking.

pr_inspindel

Questions:

  1. I've bumped the version to 7.1.0. (feature added) and not 7.0.1. (minor, bugfix) - is that OK?
  2. I've also added the 7.0.0 to the README.MD in the root dir - is that OK?
  3. How is the order of supported transmission protocols determined (dropdown in the configuration portal)?
  4. I've noticed that the iSpindel sometimes reports "0.0°P" readings to my backend. I've opened a issue in that mattter. Hints appreciated!

Let me know what you think! Happy to incorporate your feedback.

Thanks in advance!

BernhardSchlegel commented 3 years ago

Hi ! I've removed the unnecessary code and added documentation how to set up. Question 3 remains (how is the order of services in the captive portal defined). Despite that: I'm ready to merge if you want :)

Big thanks for the awesome project!

Fun fact: I've used the iSpindel you built back from Dez 2016 to test & develop. :)

BernhardSchlegel commented 3 years ago

Decreased StaticJsonDocument to 512 to mitigate memory issues.

pppedrillo commented 3 years ago

Have you tried to use low level API from WifiClient to send >1KB payload, without HTTPClient? There is info on Arduino forums that this is working well, while HTTPClient does not. POST pretty much the same way as in bool SenderClass::sendUbidots(String token, String name) for example?

BernhardSchlegel commented 3 years ago

Nope, I did not since Ubidots is using HTTP - do you think it works for HTTPS?

And again, quoting from the issue: The already existing HTTPS Post service option (as offered by the iSpindel today) is not working using the 1024 Byte large buffer.

BernhardSchlegel commented 3 years ago

I have (unsucessfully) tested it, see this branch - I'm unable to connect to my server. Presumably the WiFiClientSecure cannot handle HTTPS redirects. If someone can provide guidance I happy to try it again (I really like the simplicity!). If not, lowering the StaticJsonDocument buffer to 512 is IMHO our best option (also fixing the "default HTTPS POST not working"-Bug).

lbussy commented 3 years ago

I'm on my work laptop at the moment, but in the ESP32 core, there's a "follow redirects" option. I further remember that being added to match the ESP8266 so I'd check the HTTPClient lib and see if it's there.

BernhardSchlegel commented 3 years ago

Hi @lbussy , any update would be highly appreciated! I looked at the WiFiClientSecure source and was not able to find anything "forward" or "redirect" related. I'd really love to merge the Bricks support! (And this PR is theoretically ready for merge (and also fixes the HTTP POST Bug))

lbussy commented 3 years ago

I don't do as much with the esp8266, but the code in HTTPClient for the ESP32 is here.