Tip: You don't have to have an app installed on the phone to report the battery level if you use Bluetooth Classic.
You'll be able to query the battery level of the phone via the HFP profile V1.7 ( https://en.wikipedia.org/wiki/List_of_Bluetooth_profiles#Hands-Free_Profile_(HFP) ). The drawback is that you'll have to pair the phone to the charger via HFP and I don't know if you want to do that or not (side effect: you'll have to route the call to the dummy charger when you're reading the battery level). But as you only wake up occasionally, I think you can just wake up every 15 minutes, connect, check battery level and go back to sleep and disconnect bluetooth and pray that no call comes in during that time. Looks like the ESP32 has support for HFP profile that supports battery level querying: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/bluetooth/esp_hf_client.html#_CPPv4N24esp_hf_client_cb_param_t33hf_client_battery_level_ind_paramE If you are ok with requiring the user to install an app, then have a look at BLE https://docs.silabs.com/bluetooth/latest/code-examples/applications/reporting-battery-voltage-over-ble - then use ESP32 to read battery level over BLE and do the processing. If you are ok with paying lots of money + support Apple-only, you can probably look at the Apple MFi program to see if any third party provides any USB PMIC chip. That chip, with any luck, can read the phone's charge level, but I can't tell for sure: https://www.qorvo.com/products/p/ACT4530, https://www.maximintegrated.com/en/products/power/protection-control/protection-ics/MAX16970.html or something of that sort. Don't even think about reading battery level through Qi coil, you'll be disappointed. Cheers, - Huan. On Thu, Aug 6, 2020 at 11:55 AM Ron Craig via TriEmbed <[email protected]> wrote: > > > I want to build a simple iPhone charger using a SSR and NFC or Bluetooth to > communicate with an app on the phone. Battery below x%? Turn on. Battery y% > or higher? Turn off. Small base housing microcontroller and comms. App > sleeping most of the time, but periodically waking to check battery and issue > status to base. > > Suggestions for the MCU and Comms selection and pointers to info on app > creation are very appreciated. > > Best, > Ron > Sent from my iPhone. Please forgive my typos. > _______________________________________________ > Triangle, NC Embedded Computing mailing list > > To post message: [email protected] > List info: http://mail.triembed.org/mailman/listinfo/triembed_triembed.org > TriEmbed web site: http://TriEmbed.org > To unsubscribe, click link and send a blank message: > mailto:[email protected]?subject=unsubscribe > -- Huan Truong www tnhh.net _______________________________________________ Triangle, NC Embedded Computing mailing list To post message: [email protected] List info: http://mail.triembed.org/mailman/listinfo/triembed_triembed.org TriEmbed web site: http://TriEmbed.org To unsubscribe, click link and send a blank message: mailto:[email protected]?subject=unsubscribe
