Linco work#51
Open
chris1howell wants to merge 59 commits into
Open
Conversation
…nd RTC year range to 2036 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- build.yml: trigger on linco-work branch, reference @linco-work workflows - build_platformio.yml: replace old environments with m328p_v5, m328p_v6, m328p_v5_RTC_BTN_LCD, m328p_v6_RTC_BTN_LCD, samd; add SAMD .bin handling - release.yml: include *.bin artifacts alongside *.hex for SAMD releases Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
actions/cache v2 -> v4, actions/checkout v2 -> v4, actions/setup-python v2 -> v5 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…o-work Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
checkout v4->v5, cache v4->v5, setup-python v5->v6, upload-artifact v4->v6, download-artifact v4->v7. Remove FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 workaround. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Raise ADC6 CGMI detection threshold from 512 to 1000; CGMI boards pull A6 to VCC via 330 ohm (~1023), floating pin on non-CGMI boards was falsely triggering above 512 - Move pinChargingAC.write(1) outside OEV6 if/else in chargingOn() so PB1 (AC relay) is driven HIGH for V6 boards, matching master behavior - Update platformio.ini and prepare-release.sh for unified autodetect envs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace separate m328p_v5/v6 matrix entries with m328p_autodetect and m328p_RTC_BTN_LCD to match consolidated platformio.ini envs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…loader upload - Copy uf2-samdx1 bootloader source into repo (SAMD21/OpenEVSE_NXT board) - Add PlatformIO pre-build extra_script (build_bootloader.py) that compiles the bootloader using PlatformIO's own arm-none-eabi toolchain (no make required), copies the .bin to the PlatformIO build dir, and converts firmware.bin to .uf2 - Add post-upload extra_script (upload_bootloader.py) for env:samd_ice that flashes the bootloader to 0x0 via Atmel-ICE after the firmware upload - Update GitHub Actions: fix renamed m328p env names, upload firmware.uf2 and bootloader-*.bin as artifacts, add *.uf2 to release assets - Fix env names throughout: m328p_autodetect -> m328p_TFT_WIFI, m328p_RTC_BTN_LCD -> m328p_noWiFi_RTC_BTN_LCD Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Switch convert_firmware_to_uf2 post-action from .bin to .elf target: SCons does not track .bin as a build node so AddPostAction on it never fired - Generate .bin via objcopy in the callback if the platform hasn't created it yet - Add if-no-files-found: warn to SAMD artifact upload so missing files are reported rather than silently dropped Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Change VID from 0x1B4F (SparkFun) to 0x04D8 (Microchip) Change PID from 0x0D22 to 0xE437 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…y measurement
- Add RELAY_ZC_SWITCH feature: close relay at voltage ZC (CGMI hardware),
open relay at voltage ZC (all hardware with valid AC signal)
- Add waitCurrentZero(): block until ammeter drops below 100 mA before
opening relay; called from chargingOff() non-emergency path (#ifdef AMMETER)
- Add measureAcFreq(): three-path implementation —
SAMD: ADC sign-change on GMI_LINE (PA09)
m328p CGMI: midpoint of pinAC2 HIGH off-period pulses
m328p non-CGMI: alternating rising edges on pinAC1/pinAC2 half-wave
channels; diode threshold offset cancels in the interval measurement
- GFI trip calls chargingOff(1) — emergency flag bypasses ZC wait and
waitCurrentZero() for minimum-latency fault response
- Add $FF Z RAPI command to enable/disable ZC relay switching (persisted)
- Add $GZ RAPI command to read measured AC frequency × 100
- Non-CGMI boards: frequency updated on relay open only (AC pins are
load-side on older non-V6 boards; no valid signal at relay close)
- Enable RELAY_ZC_SWITCH in common platformio.ini build flags
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removes RELAY_ZC_SWITCH from the shared EU common flags in the root platformio.ini and adds it explicitly to the m328p and samd target configs, keeping target-specific features out of the common section. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Allows individual DC1, DC2, and AC relay outputs to be enabled or disabled at runtime via new $SR and $GR RAPI commands. Settings are persisted to EEPROM (offset 39) and applied on boot. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When PP_AUTO_AMPACITY is compiled in but the ECF_PP_AUTO_AMPACITY EEPROM flag is not set (default), the ACCController is disabled and ppMaxAmps is never initialized — it stays 0 from global zero-init. GetMaxCurrentCapacity() was reading this stale zero via GetPPMaxAmps() without checking IsEnabled(), causing ampacity to clamp to MIN_CURRENT_CAPACITY_J1772 (6A) during STATE_B/C. Any nosave=1 SetCurrentCapacity call (e.g. heartbeat supervision fallback) would then cap the pilot to 6A instead of the intended value. Fix: guard the PP cache read with g_ACCController.IsEnabled(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- platformio.ini: m328p_noWiFi extends env:m328p_TFT_WIFI (stale after rename); update to extends env:m328p_core - prepare-release.sh: SAMD copy path was .pio/build/samd_us/ (old name); correct to .pio/build/samd/ - build_platformio.yml: m328p_noWiFi matrix entry missing python: 3.x; add to match other AVR entries and avoid empty version in setup-python Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OpenEVSE
linco-workBranch — Change SummaryBranch:
linco-workvsorigin/masterRAPI version bumped: 5.2.1 → 6.0.0
Major Feature Changes
1. Relay Wear Protection (
RELAY_ZC_SWITCH)Relays are now switched at AC voltage zero-crossings to minimize contact arcing and wear.
measureAcFreq()detects AC frequency via:pinAC2(HIGH = near ZC)pinAC1/pinAC2zcWaitRelayClose()/zcWaitRelayOpen()time coil energize/de-energize relative to detected ZCRELAY_CLOSE_ADVANCE_MS = 20,RELAY_OPEN_ADVANCE_MS = 2,ZC_DETECT_TIMEOUT_MS = 35CURRENT_ZERO_THRESHOLD_MA)$FF Z 0|1and is saved to EEPROM2. Per-Relay Enable/Disable Control
Individual relays (DC1, DC2, AC) can be independently enabled or disabled.
EOFS_RELAY_FLAGSstores bitmask:ERELAYF_DC1_DISABLED (0x01)— DC relay 1ERELAYF_DC2_DISABLED (0x02)— DC relay 2ERELAYF_AC_DISABLED (0x04)— AC relayERELAYF_DEFAULT = 0x00)$SR/$GR(see table below)3. Multi-Target Build System (PlatformIO)
The project now supports multiple MCU targets built via PlatformIO.
firmware/targets/m328p/for AVR-specific files (GFI, LCD, pilot, I2C, etc.)arduino/directory and all Arduino IDE board/programmer definition filesopen_evse.sln,.vcxproj)#define RTCrenamed to#define HAVE_RTCthroughoutRAPI_SERIAL_PORTis now configurable (was hardcoded toSerial)begin()moved intoEvseSerialRapiProcessor::init()(initialization order fix)4. Temperature Monitoring Simplification
$GO/$FOnow use a single panic temperature (m_panicTemperature) instead of separate ambient/IR thresholdsEVSE_STATE_OVER_TEMPERATURETEMPERATURE_THROTTLING: if not set, only the panic threshold is enforced (no current throttling)5. PP (Proximity Pilot) Auto-Ampacity Improvements
EVSE_STATE_PP_MISSING— cable missing PP resistorEVSE_STATE_PP_SHORTED— PP resistor shorted$FF P 0|16. Boot Lock Feature (
BOOTLOCK)$SBcommand$FF L 0|1ECF_BOOT_LOCK_DISABLED7. Overcurrent Check Control
ECF_OVERCURRENT_DISABLED$FF O 0|18. Fault Counter Reset (
$FC)$FCresets all fault counters and total energy meter in one call9. Signed Integer Parsing Fix
dtou32()replaced bydtoi32()— now correctly handles negative decimal inputs across all RAPI numeric arguments10. V6 / CGMI Detection Refactor
INVERT_V6_DETECTIONmechanismg_isV6andg_hasCGMIset byinitTarget()at bootCGMIisEnabled()renamed tohasCGMI()11. No-Ground Record Delay (CGMI boards)
NO_GND_RECORD_DELAY(default 2 s) suppresses recording of this false fault12. MCU ID (
$GI) — SAMD Support13. OpenEVSE NXT USB VID/PID Update
New & Changed RAPI Commands
$FC$FC$FF L$FF L 0|10) / enable (1) boot lock featureBOOTLOCK$FF O$FF O 0|10) / enable (1) overcurrent checkOVERCURRENT_THRESHOLD$FF P$FF P 0|10) / enable (1) PP auto-ampacity detectionPP_AUTO_AMPACITY$FF Z$FF Z 0|10) / enable (1) zero-crossing relay switchingRELAY_ZC_SWITCH$FO$FO panicthresh$FO 705= 70.5 °C. If exceeded, EVSE enters OVER_TEMPERATURE fault.TEMPERATURE_MONITORING$SR$SR n 0|11) or disable (0) relayn(1=DC relay 1, 2=DC relay 2, 3=AC relay). Saved to EEPROM, applied at boot.RELAY_ZC_SWITCH$GR$GR$OK dc1 dc2 ac(1=enabled, 0=disabled)$GO$GOpanicthreshinstead ofambientthresh irthreshTEMPERATURE_MONITORING$GI$GIMCU_ID_LEN$GZ$GZ6012= 60.12 Hz.0= not yet measured.RELAY_ZC_SWITCHExisting Commands — Behavioral Notes
$FF RL/O/P/Zsub-commands$FF T$FF V$FF D$FF F$FF G$SY$S1RTCtoHAVE_RTC$G1/$GTRTCtoHAVE_RTCFiles Changed
firmware/open_evse/rapi_proc.cppdtou32→dtoi32; serial port abstractionfirmware/open_evse/rapi_proc.hfirmware/open_evse/J1772EvseController.hGetAcFreqX100();ResetFaultCounters()firmware/open_evse/J1772EvseController.cpphasCGMI()rename; SAMD ADC initfirmware/open_evse/open_evse.hRTC→HAVE_RTC; ZC timing constants; PP/overcurrent/bootlock flagsfirmware/open_evse/main.cppfirmware/open_evse/AutoCurrentCapacityController.cpp/.hfirmware/open_evse/EnergyMeter.cpp/.hResetTotkWh()added for$FCfirmware/open_evse/Language_default.hfirmware/targets/m328p/firmware/CHANGELOGfirmware/open_evse/CHANGELOG.github/workflows/platformio.iniRELAY_ZC_SWITCHmoved to per-target configarduino/