tooyipjee / Spark-Analyzer

USB-PD ESP32 Power Analyzer
MIT License
118 stars 22 forks source link

How to configure 3.3V #2

Closed doniks closed 3 months ago

doniks commented 3 months ago

Just received my spark analyzer and plugged it in for the first time :heart:

I could

so far so good, however,

Is it somehow in ... I don't know "PD mode" and I have to switch it somehow to PPS?

tooyipjee commented 3 months ago

The out of the box demo is a PD example. PD doesn't support precise voltage control, you need to use PPS. You can load this version instead; Spark-Analyzer/PlatformIO/WebApp_PPS at master · tooyipjee/Spark-Analyzer (github.com) https://github.com/tooyipjee/Spark-Analyzer/tree/master/PlatformIO/WebApp_PPS

PPS supports 20mV and 50mA resolution, where it will trip the plug when you draw too much.

Jason.

On Thu, 1 Aug 2024 at 14:21, doniks @.***> wrote:

Just received my spark analyzer and plugged it in for the first time ❤️

I could

  • connect to the spark analyzer access point
  • configure my local wifi
  • scan the ble advertisement to get the local IP
  • open that IP in my browser
  • turn it on
  • measured it to be 5V
  • also 9v works ok

so far so good, however,

  • I don't see any way to configure voltages other than 5, 9, 12, 15, 20, like "Precisely control voltage from 3.3V to 21V at 20 mV resolution"
  • I also don't see how to "set current limits up to 3A with 50mA resolution"

Is it somehow in ... I don't know "PD mode" and I have to switch it somehow to PPS?

— Reply to this email directly, view it on GitHub https://github.com/tooyipjee/Spark-Analyzer/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADKZGTARFNTEI4Z7LQ3N7T3ZPIY55AVCNFSM6AAAAABL2R7YWGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ2DENBUG4ZDIOI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Sincerely,

Jason Too

doniks commented 3 months ago

Thanks. Let me try that

doniks commented 3 months ago

Mhm, so this was the first time using PlatformIO for me .. took me a while to figure out how to flash, but I can do it now, first with a blink example for debug_led and now I'm trying to flash back WebApp. It flashes and runs (according to some extra Serial.println() in updateStatus(), but I get

E (1442) SPIFFS: mount failed, -10025
[  1436][E][SPIFFS.cpp:89] begin(): Mounting SPIFFS failed! Error: -1
An Error has occurred while mounting SPIFFS

at boot, and no web interface.

could it be that maybe I wiped the SPIFFS with my blink example?! How could I make a kind of full flash, clean wipe ..

doniks commented 3 months ago

ah, I had to Use PlatformIO's "Upload Filesystem Image" command to upload the contents of the 'data' directory

doniks commented 3 months ago

ok, so now I could reflash the WebApp version (including its filesystem) and that works again as expected.

I could also flash the WepApp_PPS version, including that corresponding FS. Now the website suggests that I can configure a granular voltage, and the serial terminal reflects that voltage, but if I measure the terminals with my voltmeter, I always see 5V

tooyipjee commented 3 months ago

Please check that your USB-C plug supports PPS

On Thu, 1 Aug 2024, 19:31 doniks, @.***> wrote:

ok, so now I could reflash the WebApp version (including its filesystem) and that works again as expected.

I could also flash the WepApp_PPS version, including that corresponding FS. Now the website suggests that I can configure a granular voltage, and the serial terminal reflects that voltage, but if I measure the terminals with my voltmeter, I always see 5V

— Reply to this email directly, view it on GitHub https://github.com/tooyipjee/Spark-Analyzer/issues/2#issuecomment-2263708266, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADKZGTACZCM7RYEOMVOIQRTZPJ5GVAVCNFSM6AAAAABL2R7YWGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRTG4YDQMRWGY . You are receiving this because you commented.Message ID: @.***>

doniks commented 3 months ago

ahhhh :facepalm: I hadn't really grasped that before. So PPS is another feature/protocol that usb chargers might or might not support - got it.

Ok. seems my laptops usb-c ports do not support pps.

I have another charger which claims to support pps and lo and behold, I can configure it to 3.3 with that. Thanks! That clarifies my initial question. I could try and summarize it and make a PR to add it to the README!? Or other place if you prefer?

Having gotten that far now, I'd have a couple further feedback/remark

(maybe I should create separate tickets for these ... )

tooyipjee commented 3 months ago

Appreciate and feel free to make a PR yes! Haha thanks.

I need help from ppl like you!

On Thu, 1 Aug 2024, 22:19 doniks, @.***> wrote:

ahhhh 🤦 I hadn't really grasped that before. So PPS is another feature/protocol that usb chargers might or might not support - got it.

Ok. seems my laptops usb-c ports do not support pps.

I have another charger which claims to support pps and lo and behold, I can configure it to 3.3 with that. Thanks! That clarifies my initial question. I could try and summarize it and make a PR to add it to the README!? Or other place if you prefer?

Having gotten that far now, I'd have a couple further feedback/remark

  • It would be better if it would not fallback to 5v output if PPS is not supported. Rather keep the output off
  • Maybe also show an error message in the web interface and maybe indicate via the led
  • it seems that the web interface always comes up showing the output as on, even though it is (as expected) initially off
  • even when I was unable to actually configure 3.3, because my charger was not PPS compatible the web app showed 3.3 . would it be possible to show 5 instead, or whatever would actually be put out
  • it seems the PPS app does not remember the configured values. would it be sufficient to use the Preferences similar as in the WebApp? If so, I think I could make a PR for this
  • oh, and just to not forget to state the obvious ... if at all possible, it would of course be much nicer if both PD and PPS could be supported in one firmware

— Reply to this email directly, view it on GitHub https://github.com/tooyipjee/Spark-Analyzer/issues/2#issuecomment-2264021721, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADKZGTFWZBEGGZ4TQCVVVCTZPKQ7HAVCNFSM6AAAAABL2R7YWGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRUGAZDCNZSGE . You are receiving this because you commented.Message ID: @.***>

doniks commented 3 months ago

https://github.com/tooyipjee/Spark-Analyzer/pull/3