I've had a bit of a crisis in the past few months. Both of our (very) old cats decided it was their time to pass - which they did with only a couple of weeks between them. It was heart breaking, both for me and for my wife. But mostly, it made me stop working on anything that mattered to me. That included the scale, but also caused me to abandon my sourdough altogether. Sort of a "leaving the past behind" thing, I suppose.
Anyway, since I did not make any progress and had no progress in the past few months, I decided to publish the source code in its present state, with all its flaws. I'll list here some of the things I think should be addressed, in no particular order:
- Documentation is really horrible. That's got to be fixed.
- Also, Arduino sketch can be separated to several files to help readability and modularity.
- Since all testing was done with the esp32 connected to USB, I did not include any provision for battery powered operation in software - i.e. I need to add some code to power down the screens, then after some more time go to the esp32's ultra-low-power core for prolonging battery life. I should probably add some transistor to power down the load cell as well.
- The ULP core can be now programmed in C, and from most environments! That's great news, and I'll test it out shortly.
- On that note, I'll probably have to add some way to measure voltage level, then a battery level GATT service, and a battery level indicator on one of the screens.
- Most of the effort was given to the esp32 code, but there are (at least) two other components to the system: a pseudo-database (Google Sheets), and a configuration app to handle the connection and WiFi credentials.
- The Google app script should probably be configured as a plug in, for people to easily use it. That requires diving into Google's Oauth2 documentation, and I haven't done any of that yet.
- At the moment I'm using Bernd Giesecke's ESP32 WiFi setup over BLE (ESP32 code) as the basis for configuring WiFi credentials, and used his Android configuration app, or, alternatively, Nordic's nRF connect app. Since I no close to nothing about Java and Android app development, I decided to create a basic web-ble web app to replace the native Android app. The advantage for me is that I'm more comfortable with JS than Java, and this app will be able to run on many more platforms - such as from a desktop PC or any smartphone that supports web-ble, including iOS devices.
- Even more than that, I will also be able to configure server side access using Google's 'server-side flow' to define Oauth2 credentials on the esp32, and will probably try and venture into creating a progressive web app from that, which will allow me to use this app as a remote display for the scale as well, even without a working network connection.
Anyway, I really hope to dive into this project soon. You can check out the Github repo for the esp32 code, and have a go with my version of Akshaya Niraula's (further development by Allan schwartz here) Google app script.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.