Skip to content

Remote configuration#5

Open
belangp wants to merge 12 commits intoEverythingSmartHome:masterfrom
belangp:master
Open

Remote configuration#5
belangp wants to merge 12 commits intoEverythingSmartHome:masterfrom
belangp:master

Conversation

@belangp
Copy link
Copy Markdown

@belangp belangp commented Apr 14, 2022

  1. WiFi web server that allows configuration of the device via browser instead of using constants in code
  2. Web server goes into access point mode if it can't connect to a WiFi network
  3. All configurations are saved in a JSON file on the device
  4. Auto discovery for Home Assistant
  5. MQTT topic to adjust the calibration factor via Home Assistant
  6. MQTT topic to reboot the device
  7. Device publishes link to configuration page
  8. Device publishes link to main repo and device IP address in device attributes

@EverythingSmartHome
Copy link
Copy Markdown
Owner

Hello and thanks for the PR, sorry for the delay - took a bit of time to get some time to install it.

It looks like this is for esp32 only since files need to be stored on device, presumably SD card?

@belangp
Copy link
Copy Markdown
Author

belangp commented Apr 25, 2022 via email

@EverythingSmartHome
Copy link
Copy Markdown
Owner

Got it thanks - hadn't heard of that tool before and assumed it used an SD card. All up and running now.

Seems to work well, well done!

I think we need to improve the documentation before it could merge, there are a few additional libraries and steps required to make this work that should be documented.

If you have something already then feel free to add in or I can try soon when I get some time.

Thanks again, this is cool!

@belangp
Copy link
Copy Markdown
Author

belangp commented Apr 26, 2022 via email

@belangp
Copy link
Copy Markdown
Author

belangp commented May 3, 2022

Updated libraries list, hopefully there are no other ones missing.

Also increased wifi connection timeout to avoid cases where the connection doesn't happen fast enough and the device returns back to access point mode.

Allow negative calibration factor value
@ahaverty
Copy link
Copy Markdown

@belangp I'm running on esp32, and have just setup from the original repo.
Very interested in your PR, remotely configuring etc.
I took it for a spin, but can't get beyond compiling for LittleFS.

Bed_Sensor.ino:301:13: error: 'class fs::FS' has no member named 'begin'
   if (!(lfs.begin())) {

Is the intention to support Esp32 still with your PR? If so, I'd be happy to be a tester here.

@belangp
Copy link
Copy Markdown
Author

belangp commented Feb 12, 2023

@ahaverty I unfortunately don't have any ESP32 boards that I can test my code on at the moment, so I wouldn't be able to easily update the code to support it right now. What I do know is that there is a different library that has to be used for LittleFS with ESP32 boards. I could always try to update the code and see if it compiles with an ESP32 board selected, but I wouldn't be able to test it physically on a board.

@ahaverty
Copy link
Copy Markdown

ahaverty commented Mar 7, 2023

Cheers @belangp, I'm testing now with an esp8266.

Would you have details on the specific versions of each library you're using?

I hit compilation issues with the latest ArduinoJson (v6.20.1)
ArduinoJson v6.19.3 compiles and uploads,
but when I connect to the 192.168.4.1 I just get a blank page, with an almost empty html in inspect element.
I'm guessing there's another library that's fallen out of sync with this PR.

Here's what I see in serial monitor, it seems to print a "1" every time I refresh 192.168.4.1
image

Disregard my empty html page issue for the moment, I forgot to follow step 2 for LittleFS tool + upload (🤦).
Arduino IDE v2 doesn't support tools either 😮‍💨 earlephilhower/arduino-esp8266littlefs-plugin#21 (comment)

I'll see if I can downgrade.

@ahaverty
Copy link
Copy Markdown

ahaverty commented Mar 7, 2023

Yes, I can see the web page configurator now after running the upload tool.
@belangp Perhaps the readme should also include:

  1. ESP8266 support only
  2. ArduinoJson = v6.19.3 (v6.20.X will not compile)
  3. Arduino IDE v1 required for data upload step (v2 doesn't support tools/LittleFS tool) [Note: At least on Mac, both IDE's can be installed simultaneously without needing to uninstall v2, just download and drag 'Arduino' into your application folder]

@ahaverty
Copy link
Copy Markdown

I've got this running on an az delivery 8266 now. I had some issue with the data upload tool, I needed to downgrade esp8266 in board manager to below v2 (v1.9.3 if I remember right).

In other news (perhaps out of scope for this issue/PR) @robtillart has released a modified hx711 library that allows for mutlipoint calibrations.

For those of us using bed occupancy weights to distinguish between Person A or B or A+B, this could be a major improvement to accuracy: https://github.com/RobTillaart/HX711_MP
i.e a different calibration for each of the above scenarios

I'd give it a shot at implementing, but I'm very new to ESP unfortunately, might take a few months 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants