Conversation
|
Thanks! I like this PR and only have a few minor comments. |
|
Should be all done now, thanks so much again for this awesome project and still maintaining it !!!!!!!! |
Both dpsboot and opendps now always start at 9600. Main firmware reads past_uart_baud on boot and switches to the saved operational baud. - protocol: add cmd_set_baud (22) for runtime baud negotiation - pastunits: add past_uart_baud for persisting operational baud - opendps: add hw_set_baudrate(), opendps_set_uart_baud(), opendps_is_valid_baud() - protocol_handler: add handle_set_baud() - ACKs at old baud, then switches - dpsboot: add hw_set_baudrate_boot(), handle cmd_set_baud session-only - Rename cmd_success_with_response (was cmd_success_but_i_actually_sent_my_own_status_thank_you_very_much) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hey - would you mind having a look at this again? Bootloader & Firmware always start off at 9600 This way no baud config during compile is required, all bauds can be changed, it remains "simple" and is very safe as well, no bricking possible - not even "hard" to reach bl should be possible this way |
- protocol.py: add CMD_SET_BAUD (23), VALID_BAUD_RATES, create_set_baud() - dpsctl.py: add --set-baud to set/save device UART baud at runtime - dpsctl.py: add --upgrade-baud to switch bootloader to faster rate after upgrade_start ACK for faster data transfer - tty_interface: add set_baudrate() to switch serial port without reconnecting - handle_response: handle CMD_SET_BAUD response Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Eliminates per-sample ADC noise from display and query values. OCP/OVP still operate on raw per-sample values for fast response. i_out averaging uses offset-corrected value matching OCP logic. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…display - hw.c: i_corrected was applying adc_i_offset twice when pwrctl_i_limit_raw was set (i already had offset added for OCP check). Fix: only apply offset in averaging path when the OCP block was skipped (limit not yet loaded). - opendps.c: increase Vin display from 1 to 2 decimal places. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ADC offset calibration leaves a ~8mA residual baseline on this unit due to ADC_CHA_IOUT_GOLDEN_VALUE being tuned for the developer's unit. Clamp averaged i_out to 0 when <= 10 counts; 11mA+ is unaffected. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…urrent Derived from calibration data: A_ADC_K=1.64672816, A_ADC_C=-106.07878113 Zero count = 106.08/1.647 = 64.41 → 64 (was 69/0x45, causing +8mA baseline offset) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Set correct value (64) directly in dps-model.h for DPS5005 instead of overriding via Makefile -D flag, which caused redefinition warnings (dps-model.h defines unconditionally, hw.c has #ifndef guard, Makefile -D was a third conflicting definition). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| } | ||
| uint8_t valid = 0; | ||
| switch (baud) { | ||
| case 9600: case 19200: case 38400: case 57600: case 115200: |
There was a problem hiding this comment.
Or use opendps_is_valid_baud(...) ;)
| void hw_set_baudrate(uint32_t baud) | ||
| { | ||
| switch (baud) { | ||
| case 9600: case 19200: case 38400: case 57600: case 115200: |
There was a problem hiding this comment.
Or use opendps_is_valid_baud(...) ;)
| * UART meaning this message got lost. The ESP will however send the | ||
| * wifi_connected status when it connects but if that does not happen, the | ||
| * ui module will turn off the wifi icon after 10s to save the user's | ||
| * twork_connected status when it connects but if that does not happen, the |
|
Just a few minor wrinkles and then we should be able to merge this before the weekend is over. Thanks for your contribution! |
|
<3 thanks so much fort reviewing so quickly - a little ashamed of these "stupid" mistakes I left in there rn - gonna fix them quickly now Edit says - should hopefully be fine now. Also added the function to dpsboot bootloader, just to make it all more consistent across project - and doesnt require "more" space for bootloader .. so I hope that`s fine |
|
退订
At 2026-04-19 15:45:39, "Johan Kanflo" ***@***.***> wrote:
@kanflo commented on this pull request.
In dpsboot/dpsboot.c:
@@ -261,6 +261,33 @@ static void handle_frame(uint8_t *payload, uint32_t length)
}
}
break;
+ case cmd_set_baud:
+ {
+ uint32_t baud = 0;
+ if (payload_len >= 5) {
+ baud = (uint32_t)payload[1] << 24 | (uint32_t)payload[2] << 16 |
+ (uint32_t)payload[3] << 8 | (uint32_t)payload[4];
+ }
+ uint8_t valid = 0;
+ switch (baud) {
+ case 9600: case 19200: case 38400: case 57600: case 115200:
Or use opendps_is_valid_baud(...) ;)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
…_baud to dpsboot, use it in both firmwares, fix spelling Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…or ui_parameter_t Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@kanflo I think u will also be proud as soon as u see what is possible with your opendps and my esphome component.
|
As the title says - my esphome component allows for ethernet connectivity as well, therefore I propose the following rework.
Mostly just renaming from wifi to network and add ethernet logic & symbol.
Also, display backlight value was added to response-content and I changed default baud to 19200 after intensive changes (please just deny that change of course if you dont agree)
Removed the status code change and rather changed my esphome component to be fully backwards compatible, no need to reflash if someone doesnt need display backlight in query response etc.
Esphome component finished now as well, last remaining point is to create a nice HA custom card
ESPHome component features:
to read fw bin file from
As esphome can deal with ethernet/wifi + mqtt + api connections (ha & custom) -> these features are automatically available as well when replacing the esp8266 wifi-serial- proxy with an esphome based device using my opendps component
Hope this helps =)