Decreased WiFi transmit level to 13. Level 15 is unstable, skip 14 just to be sure. It seems to be the bad designed antenna circuit on the ESP32-C3 Lolin v2.1.0 board. The board also benefits from a ground plane connected to the shield of the USB connector. The final implementation needs an external antenna anyway so the onboard antenna will go away. In the meanwhile, the wifi task is now more robust. Also, in testing mode there is no battery alarm, only when building for production.

The esp-idf-lib apds9930 component is now working. In nvsio stop logging not updated values. Store gain and aglbit values in nvs.

Some extra time for the mqtt messages.

Set the new measured deep sleep current consumption. This is half of the Wemos D1 system.

Added nvsio utilities to make read/write to nvs namespace easier. Added variables for deep sleep to nvs namespace. In task_wifi, removed some init parameters that might add to instable wifi connect problems.

Code changes to try to fix the not working ADPS9930 driver.

First pass of debugging APDS9930 with a real chip.

Splitted wifi and mqtt connect states to make the connections more robust. Protect the mqtt connection request against requests when a request is already done or in progress.

Fixed wrong voltage and current measurements due to differences between Arduino and ESP-IDF.

Changed voltage range to 32 volt. Tried INA219 powersave mode, doesn't work.

In the esp-idf-lib the adps9930 driver uses a device descriptor structure instead of just i2c_dev_t. Fixed a linking issue. Added APDS9930 task. Added getLightValues function. Added wifi quality value to the MQTT payload. The payload is complete and will be published.

Added untested port of the Arduino APDS9930 library as component into the esp-idf-lib.

Fixed start of json status message.

Added task_out to drive the relays and led lights. Added NVS namespace to store the state of the outputs. Respond to subscribed MQTT topics to set new output values.

Added namespace and output variables in NVS.

(0) -15 +15 tip

mercurial