Lichang Zhang
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    ## OCPP 1.6 授權與交易流程詳解 ### 一、核心概念定義 **引用章節**: Section 2.2 Definitions (Page 5-6), Section 3.6 (Page 15-16) | 術語 | 定義 | |------|------| | **Charging Session** | 用戶或 EV 首次互動開始(刷卡、遠端啟動、插線、佔位偵測等) | | **Transaction** | 所有充電前提條件滿足時開始(EV 連接且用戶已授權),直到條件不可逆地變為 false | | **Energy Offer Period** | EVSE 準備好並願意供電的時段 | | **Energy Transfer Period** | 實際能量傳輸的時段(一個 Transaction 可有多個) | --- ### 二、授權機制 (Authorization) **引用章節**: Section 3.5 Local Authorization & Offline Behavior (Page 12-15), Section 4.1 Authorize (Page 32) #### 2.1 授權方式優先順序 ``` 1. Local Authorization List (本地授權清單) - 最高優先 2. Authorization Cache (授權快取) 3. Central System Authorization (遠端授權) ``` #### 2.2 Authorize.req/conf 訊息 **Authorize.req** (`Section 6.1, Page 60`) ```json { "idTag": "string[20]" // 必要,用戶識別碼 } ``` **Authorize.conf** (`Section 6.2, Page 60`) ```json { "idTagInfo": { "status": "Accepted|Blocked|Expired|Invalid|ConcurrentTx", // 必要 "expiryDate": "datetime", // 選填 "parentIdTag": "string[20]" // 選填 } } ``` #### 2.3 AuthorizationStatus 狀態說明 | Status | 說明 | |--------|------| | `Accepted` | 識別碼已接受,允許充電 | | `Blocked` | 識別碼被封鎖 | | `Expired` | 識別碼已過期 | | `Invalid` | 識別碼無效/不明 | | `ConcurrentTx` | 識別碼已有進行中的交易 | #### 2.4 本地授權清單 (Local Authorization List) **引用章節**: Section 3.5.2 (Page 13) - 由 Central System 同步管理 - 使用 `SendLocalList.req` 進行完整或差異更新 - 支援 `Full` 或 `Differential` 更新模式 - 相關組態鍵: `LocalAuthListEnabled`, `LocalAuthListMaxLength` #### 2.5 授權快取 (Authorization Cache) **引用章節**: Section 3.5.1 (Page 13) - 自動維護先前成功授權的識別碼記錄 - 從 `Authorize.conf`, `StartTransaction.conf`, `StopTransaction.conf` 更新 - 相關組態鍵: `AuthorizationCacheEnabled` --- ### 三、交易流程 (Transaction Flow) #### 3.1 標準交易流程 **引用章節**: Section 3.4 (Page 10-11), Figure 1 ``` ┌─────────────┐ ┌─────────────────┐ │ Charge Point│ │ Central System │ └──────┬──────┘ └────────┬────────┘ │ │ │ [1] Authorize.req(idTag) │ │────────────────────────────────────>│ │ │ │ [2] Authorize.conf(idTagInfo) │ │<────────────────────────────────────│ │ │ │ *** 開始充電 *** │ │ │ │ [3] StartTransaction.req │ │ (connectorId, idTag, │ │ meterStart, timestamp, │ │ [reservationId]) │ │────────────────────────────────────>│ │ │ │ [4] StartTransaction.conf │ │ (idTagInfo, transactionId) │ │<────────────────────────────────────│ │ │ │ *** 充電中 (MeterValues) *** │ │ │ │ [5] StopTransaction.req │ │ (meterStop, timestamp, │ │ transactionId, [reason], │ │ [idTag], [transactionData]) │ │────────────────────────────────────>│ │ │ │ [6] StopTransaction.conf │ │ ([idTagInfo]) │ │<────────────────────────────────────│ ``` #### 3.2 StartTransaction.req 詳細 **引用章節**: Section 4.8 (Page 37), Section 6.45 (Page 79) ```json { "connectorId": integer, // 必要,連接器 ID (>0) "idTag": "string[20]", // 必要,用戶識別碼 "meterStart": integer, // 必要,起始電錶讀數 (Wh) "timestamp": "datetime", // 必要,交易開始時間 "reservationId": integer // 選填,預約 ID } ``` #### 3.3 StartTransaction.conf 詳細 ```json { "idTagInfo": { "status": "Accepted|Blocked|Expired|Invalid|ConcurrentTx", "expiryDate": "datetime", "parentIdTag": "string[20]" }, "transactionId": integer // 必要,交易 ID (由 CS 分配) } ``` #### 3.4 StopTransaction.req 詳細 **引用章節**: Section 4.10 (Page 43-44), Section 6.49 (Page 82) ```json { "transactionId": integer, // 必要 "timestamp": "datetime", // 必要 "meterStop": integer, // 必要,結束電錶讀數 (Wh) "idTag": "string[20]", // 選填,停止交易的識別碼 "reason": "enum", // 選填,停止原因 "transactionData": [...] // 選填,交易期間的電錶數據 } ``` **StopTransaction Reason 列舉值**: | Reason | 說明 | |--------|------| | `EmergencyStop` | 緊急停止 | | `EVDisconnected` | EV 斷開連接 | | `HardReset` | 硬重置 | | `Local` | 本地操作(預設) | | `Other` | 其他原因 | | `PowerLoss` | 斷電 | | `Reboot` | 重啟 | | `Remote` | 遠端停止 | | `SoftReset` | 軟重置 | | `UnlockCommand` | 解鎖命令 | | `DeAuthorized` | 取消授權 | --- ### 四、遠端啟動/停止交易 **引用章節**: Section 5.11 (Page 49-50), Section 5.12 (Page 50) #### 4.1 RemoteStartTransaction.req ```json { "idTag": "string[20]", // 必要 "connectorId": integer, // 選填 "chargingProfile": {...} // 選填,TxProfile } ``` **行為受 `AuthorizeRemoteTxRequests` 組態鍵控制**: - `true`: 先執行授權流程再啟動交易 - `false`: 直接嘗試啟動交易(StartTransaction 時再驗證) #### 4.2 RemoteStopTransaction.req ```json { "transactionId": integer // 必要 } ``` --- ### 五、離線行為與未知識別碼授權 **引用章節**: Section 3.5.4 Unknown Offline Authorization (Page 14-15) #### 5.1 相關組態鍵 | 組態鍵 | 說明 | |--------|------| | `LocalAuthorizeOffline` | 離線時是否使用本地授權 | | `LocalPreAuthorize` | 是否在等待 CS 回應前預先授權 | | `AllowOfflineTxForUnknownId` | 離線時是否允許未知識別碼 | | `StopTransactionOnInvalidId` | 無效識別碼時是否停止交易 | | `MaxEnergyOnInvalidId` | 無效識別碼時的最大充電量 | #### 5.2 離線交易恢復流程 ``` 連線恢復後: 1. 發送 StartTransaction.req(離線期間授權的交易) 2. 如果 StartTransaction.conf 的 status ≠ Accepted: - StopTransactionOnInvalidId = true → 停止交易,Reason = DeAuthorized - StopTransactionOnInvalidId = false → 僅停止能量傳輸 ``` --- ### 六、Connector 狀態轉換 **引用章節**: Section 4.9 Status Notification (Page 38-43) ``` Available ─┬─> Preparing ─┬─> Charging ──┬─> Finishing ─> Available │ │ │ │ ├─> SuspendedEV │ │ │ │ │ └─> SuspendedEVSE │ └─> Reserved ──────────────────┘ ``` **關鍵狀態說明**: | 狀態 | 說明 | |------|------| | `Available` | 可用,等待使用者 | | `Preparing` | 準備中(插線或刷卡後) | | `Charging` | 充電中 | | `SuspendedEV` | EV 暫停(電池滿/溫度) | | `SuspendedEVSE` | EVSE 暫停(智慧充電限制) | | `Finishing` | 結束中(等待拔線) | | `Reserved` | 已預約 | | `Unavailable` | 不可用 | | `Faulted` | 故障 | --- ### 七、Transaction-related Messages 處理 **引用章節**: Section 3.7 (Page 17-18) #### 7.1 訊息重試機制 相關組態鍵: - `TransactionMessageAttempts`: 最大重試次數 - `TransactionMessageRetryInterval`: 重試間隔(秒) 重試間隔採用指數退避: ``` 第 1 次重試: RetryInterval 秒後 第 2 次重試: RetryInterval × 2 秒後 第 3 次重試: RetryInterval × 3 秒後 ... ``` #### 7.2 無 transactionId 時的處理 **引用章節**: Errata Sheet Section 3.18 (Page 10) 如果 StartTransaction.req 無法成功傳送或未收到 StartTransaction.conf: - Charge Point 應使用 `transactionId = -1` 發送後續交易相關訊息 - Central System 應正常處理這些訊息 --- ### 八、相關組態鍵總覽 **引用章節**: Chapter 9 Standard Configuration Key Names & Values | 組態鍵 | 類型 | 說明 | |--------|------|------| | `AuthorizeRemoteTxRequests` | boolean | 遠端啟動是否需要授權 | | `LocalAuthorizeOffline` | boolean | 離線時是否本地授權 | | `LocalPreAuthorize` | boolean | 是否預先本地授權 | | `AuthorizationCacheEnabled` | boolean | 是否啟用授權快取 | | `LocalAuthListEnabled` | boolean | 是否啟用本地授權清單 | | `LocalAuthListMaxLength` | integer | 本地授權清單最大長度 | | `StopTransactionOnInvalidId` | boolean | 無效 ID 是否停止交易 | | `StopTransactionOnEVSideDisconnect` | boolean | EV 側斷開是否停止交易 | | `UnlockConnectorOnEVSideDisconnect` | boolean | EV 側斷開是否解鎖 | | `ConnectionTimeOut` | integer | 連接超時(秒) | | `MaxEnergyOnInvalidId` | integer | 無效 ID 最大充電量 (Wh) | --- 讓我搜尋更詳細的規範內容來回答這兩個問題。現在我有完整資訊來回答您的兩個問題。 --- ## 問題一:idTag 識別碼的形式與內容 **引用章節**: Section 3.9 ID Tokens (Page 18), Section 7.28 IdToken (Page 98) ### 1.1 資料類型規格 | 屬性 | 說明 | |------|------| | **類型** | `CiString20Type` (Case Insensitive String) | | **最大長度** | 20 字元 | | **大小寫** | **不區分大小寫** | | **字元集** | 可列印 ASCII 字元 | ### 1.2 常見的 idTag 形式 #### (A) 實體 RFID 卡 UID(最常見) ``` 來源:ISO 14443 相容的 RFID 卡 格式:4 bytes 或 7 bytes 的 UID 表示:8 或 14 個十六進位字元 範例: - 4 bytes UID: "A1B2C3D4" (8 字元) - 7 bytes UID: "04A1B2C3D4E5F6" (14 字元) ``` **規範建議**:依據 ISO14443-3,byte 0 應放在 hex 字串的最前面。 #### (B) 虛擬授權碼 (Virtual Transaction Authorization Code) ``` 用途:遠端啟動交易時由 Central System 發送 特性:可能是一次性使用的授權碼 格式:刻意使用非標準 UID 格式,避免與實體卡 UID 衝突 範例: - "REMOTE_TX_20241210_001" - "APP_AUTH_5A7B9C" - "SMS_CODE_123456" ``` #### (C) 帳號識別碼 (Account Identifier) ``` 用途:作為 ParentIdTag 群組識別 特性:不一定是有效的 idTag,可能是共用帳號編號 範例: - "ACCT_FAMILY_001" - "CORP_FLEET_ABC" - "CONTRACT_12345" ``` ### 1.3 實際範例對照 | 場景 | idTag 範例 | 說明 | |------|-----------|------| | 刷 RFID 卡啟動 | `"04E5C1D2A3B4F5"` | 7-byte UID 十六進位 | | 手機 App 啟動 | `"APP_USER_8821"` | 虛擬授權碼 | | 會員卡 | `"M1234567890"` | 會員編號 | | 車隊管理 | `"FLEET_TRUCK_05"` | 車輛識別 | | 一次性密碼 | `"OTP_983621"` | SMS/App 動態碼 | ### 1.4 重要規範提醒 ``` ⚠️ Charge Point 不得對 idTag 格式做任何假設: - 不能假設必須是十六進位字元 - 不能假設必須是偶數位數 - 必須接受任何符合 CiString20Type 的資料 ⚠️ 比對時不區分大小寫: "A1B2C3D4" 等同於 "a1b2c3d4" ``` --- ## 問題二:Core Profile 組態鍵 (Section 9.1) **引用章節**: Section 9.1 Core Profile (Page 97-105) ### 2.1 Core Profile 組態鍵完整列表 | # | 組態鍵 | 必要性 | R/RW | 類型 | 說明 | |---|--------|--------|------|------|------| | 9.1.1 | `AllowOfflineTxForUnknownId` | 選填 | RW | boolean | 離線時是否允許未知識別碼交易 | | 9.1.2 | `AuthorizationCacheEnabled` | 選填 | RW | boolean | 是否啟用授權快取 | | 9.1.3 | `AuthorizeRemoteTxRequests` | **必填** | R/RW | boolean | 遠端啟動是否需要先授權 | | 9.1.4 | `BlinkRepeat` | 選填 | RW | integer | 燈號閃爍次數 | | 9.1.5 | `ClockAlignedDataInterval` | **必填** | RW | integer (秒) | 時鐘對齊資料間隔 (0=停用) | | 9.1.6 | `ConnectionTimeOut` | **必填** | RW | integer (秒) | Preparing 狀態超時時間 | | 9.1.7 | `ConnectorPhaseRotation` | **必填** | RW | CSL | 各連接器相位旋轉設定 | | 9.1.8 | `ConnectorPhaseRotationMaxLength` | 選填 | R | integer | 上項最大項目數 | | 9.1.9 | `GetConfigurationMaxKeys` | **必填** | R | integer | GetConfiguration 最大鍵數 | | 9.1.10 | `HeartbeatInterval` | **必填** | RW | integer (秒) | 心跳間隔 | | 9.1.11 | `LightIntensity` | 選填 | RW | integer (%) | 燈光亮度百分比 | | 9.1.12 | `LocalAuthorizeOffline` | **必填** | RW | boolean | 離線時是否使用本地授權 | | 9.1.13 | `LocalPreAuthorize` | **必填** | RW | boolean | 是否預先本地授權(不等 CS 回應) | | 9.1.14 | `MaxEnergyOnInvalidId` | 選填 | RW | integer (Wh) | 無效 ID 時最大充電量 | | 9.1.15 | `MeterValuesAlignedData` | **必填** | RW | CSL | 時鐘對齊電錶量測項目 | | 9.1.16 | `MeterValuesAlignedDataMaxLength` | 選填 | R | integer | 上項最大項目數 | | 9.1.17 | `MeterValuesSampledData` | **必填** | RW | CSL | 取樣電錶量測項目 | | 9.1.18 | `MeterValuesSampledDataMaxLength` | 選填 | R | integer | 上項最大項目數 | | 9.1.19 | `MeterValueSampleInterval` | **必填** | RW | integer (秒) | 電錶取樣間隔 (0=停用) | | 9.1.20 | `MinimumStatusDuration` | 選填 | RW | integer (秒) | 狀態通知最小持續時間 | | 9.1.21 | `NumberOfConnectors` | **必填** | R | integer | 實體連接器數量 | | 9.1.22 | `ResetRetries` | **必填** | RW | integer | 重置重試次數 | | 9.1.23 | `StopTransactionOnEVSideDisconnect` | **必填** | RW | boolean | EV 側拔線是否停止交易 | | 9.1.24 | `StopTransactionOnInvalidId` | **必填** | RW | boolean | 無效 ID 是否停止交易 | | 9.1.25 | `StopTxnAlignedData` | **必填** | RW | CSL | StopTx 時鐘對齊資料項目 | | 9.1.26 | `StopTxnAlignedDataMaxLength` | 選填 | R | integer | 上項最大項目數 | | 9.1.27 | `StopTxnSampledData` | **必填** | RW | CSL | StopTx 取樣資料項目 | | 9.1.28 | `StopTxnSampledDataMaxLength` | 選填 | R | integer | 上項最大項目數 | | 9.1.29 | `SupportedFeatureProfiles` | **必填** | R | CSL | 支援的功能 Profile 清單 | | 9.1.30 | `SupportedFeatureProfilesMaxLength` | 選填 | R | integer | 上項最大項目數 | | 9.1.31 | `TransactionMessageAttempts` | **必填** | RW | integer | 交易訊息重試次數 | | 9.1.32 | `TransactionMessageRetryInterval` | **必填** | RW | integer (秒) | 交易訊息重試間隔 | | 9.1.33 | `UnlockConnectorOnEVSideDisconnect` | **必填** | RW | boolean | EV 側拔線是否解鎖連接器 | | 9.1.34 | `WebSocketPingInterval` | 選填 | RW | integer (秒) | WebSocket Ping 間隔 (0=停用) | > **CSL** = Comma Separated List(逗號分隔清單) --- ## 問題二補充:SendLocalList 的 Full 與 Differential 更新模式 **引用章節**: Section 5.15 Send Local List (Page 52-53), Section 7.48 UpdateType (Page 95) ### 完整更新 (Full Update) vs 差異更新 (Differential Update) ``` ┌─────────────────────────────────────────────────────────────────────┐ │ Full Update (完整更新) │ ├─────────────────────────────────────────────────────────────────────┤ │ 行為:完全取代 Charge Point 現有的 Local Authorization List │ │ 適用:首次同步、清單嚴重不一致、定期完整同步 │ │ │ │ Central System 現有清單: Charge Point 更新後: │ │ ┌──────────────────────┐ ┌──────────────────────┐ │ │ │ idTag: A → Accepted │ │ idTag: A → Accepted │ │ │ │ idTag: B → Blocked │ ─► │ idTag: B → Blocked │ │ │ │ idTag: C → Accepted │ │ idTag: C → Accepted │ │ │ └──────────────────────┘ └──────────────────────┘ │ │ (舊清單完全被新清單取代) │ └─────────────────────────────────────────────────────────────────────┘ ┌─────────────────────────────────────────────────────────────────────┐ │ Differential Update (差異更新) │ ├─────────────────────────────────────────────────────────────────────┤ │ 行為:只更新有變動的項目(新增、修改、刪除) │ │ 適用:日常維護、小量變更、節省傳輸資料量 │ │ │ │ Charge Point 原有清單: 差異更新內容: 更新後結果: │ │ ┌──────────────────────┐ ┌────────────────┐ ┌──────────────────┐│ │ │ idTag: A → Accepted │ │ B → Expired │ │ A → Accepted ││ │ │ idTag: B → Accepted │ + │ D → Accepted │ = │ B → Expired (改) ││ │ │ idTag: C → Accepted │ │ C → (刪除) │ │ D → Accepted(新) ││ │ └──────────────────────┘ └────────────────┘ └──────────────────┘│ │ │ │ ⚠️ 刪除操作:發送 idTag 但不包含 idTagInfo │ └─────────────────────────────────────────────────────────────────────┘ ``` ### SendLocalList.req 訊息結構 ```json { "listVersion": 239, // 必填:更新後的版本號 "updateType": "Differential", // 必填:"Full" 或 "Differential" "localAuthorizationList": [ // 選填:授權清單項目 { "idTag": "A1B2C3D4", // 必填:識別碼 "idTagInfo": { // 選填:授權資訊 (差異更新時省略=刪除) "status": "Accepted", "expiryDate": "2025-12-31T23:59:59Z", "parentIdTag": "PARENT_001" } }, { "idTag": "E5F6G7H8" // 只有 idTag,沒有 idTagInfo = 刪除此項 } ] } ``` ### 差異更新的三種操作 | 操作 | 條件 | 說明 | |------|------|------| | **新增** | idTag 不存在於 CP | 將項目加入清單 | | **修改** | idTag 已存在於 CP,有 idTagInfo | 更新該項目的授權狀態 | | **刪除** | idTag 已存在於 CP,**無** idTagInfo | 從清單移除該項目 | ### SendLocalList.conf 回應狀態 | Status | 說明 | |--------|------| | `Accepted` | 成功更新本地授權清單 | | `Failed` | 更新失敗 | | `NotSupported` | Charge Point 不支援本地授權清單 | | `VersionMismatch` | 差異更新時版本號錯誤(≤ 現有版本) | ### 版本號管理規則 ``` 版本號機制: - listVersion = 0 → 清單為空 - listVersion = -1 → 不支援本地授權清單 - 差異更新時,新版本號必須 > 現有版本號 - 版本號由 Central System 管理,Charge Point 只負責儲存 流程範例: 1. CS 發送 GetLocalListVersion.req 2. CP 回應 listVersion: 234 3. CS 計算差異,發送 SendLocalList.req (listVersion: 235, updateType: Differential) 4. 如果 CP 回應 VersionMismatch → CS 應改用 Full 更新 ``` ### 最佳實務建議 ``` ✅ 建議做法: 1. 定期(如每天)執行 Full 更新確保一致性 2. 日常變更使用 Differential 更新減少傳輸量 3. Differential 失敗時自動 fallback 到 Full 更新 4. 監控 LocalListConflict 錯誤(StatusNotification, errorCode) ⚠️ 注意事項: - LocalAuthListMaxLength 限制清單最大項目數 - SendLocalListMaxLength 限制單次傳送最大項目數 - 清單應儲存在非揮發性記憶體,重啟後保留 ``` --- 這兩個欄位的意義如下: --- ## R/RW(Accessibility 存取權限) **引用章節**: Section 9 Standard Configuration Key Names & Values (Page 96) | 值 | 全稱 | 意義 | Central System 可執行的操作 | |----|------|------|---------------------------| | **R** | Read-only | 唯讀 | 只能用 `GetConfiguration.req` 讀取,**不能**用 `ChangeConfiguration.req` 修改 | | **RW** | Read-Write | 可讀寫 | 可用 `GetConfiguration.req` 讀取,也可用 `ChangeConfiguration.req` 修改 | ### 實際範例 ``` 唯讀 (R) 的組態鍵: ┌─────────────────────────┬────────────────────────────────────┐ │ NumberOfConnectors │ 實體連接器數量 - 硬體決定,不可改 │ │ SupportedFeatureProfiles│ 支援的功能 - 韌體決定,不可改 │ │ LocalAuthListMaxLength │ 清單最大長度 - 記憶體限制,不可改 │ └─────────────────────────┴────────────────────────────────────┘ 可讀寫 (RW) 的組態鍵: ┌─────────────────────────┬────────────────────────────────────┐ │ HeartbeatInterval │ 心跳間隔 - 營運需求可調整 │ │ MeterValueSampleInterval│ 電錶取樣間隔 - 依需求可調整 │ │ LocalAuthorizeOffline │ 離線授權開關 - 政策可調整 │ └─────────────────────────┴────────────────────────────────────┘ ``` ### 特殊情況:R or RW 有些組態鍵標示為 `R or RW`,表示由 Charge Point 製造商決定: ``` AuthorizeRemoteTxRequests: R or RW - 有些 CP 實作為唯讀(出廠固定) - 有些 CP 實作為可讀寫(允許營運商調整) ``` --- ## 類型(Type 資料型態) | 類型 | 說明 | 範例值 | |------|------|--------| | **boolean** | 布林值,只有 true 或 false | `true`, `false` | | **integer** | 整數 | `60`, `300`, `0`, `-1` | | **CSL** | Comma Separated List,逗號分隔清單 | `"Core,SmartCharging,LocalAuthListManagement"` | | **String** | 字串 | `"0.RST,1.RST,2.RTS"` | ### 各類型詳細說明 #### boolean(布林值) ```json // GetConfiguration.conf 回傳範例 { "key": "LocalAuthorizeOffline", "readonly": false, "value": "true" // 注意:在 OCPP 中以字串形式傳輸 } // ChangeConfiguration.req 設定範例 { "key": "LocalAuthorizeOffline", "value": "false" } ``` #### integer(整數) ```json // 範例:設定心跳間隔為 60 秒 { "key": "HeartbeatInterval", "value": "60" // 以字串形式傳輸 } // 範例:設定電錶取樣間隔為 0(停用) { "key": "MeterValueSampleInterval", "value": "0" } ``` #### CSL(逗號分隔清單) ```json // 範例:支援的功能 Profile { "key": "SupportedFeatureProfiles", "readonly": true, "value": "Core,FirmwareManagement,LocalAuthListManagement,SmartCharging" } // 範例:電錶取樣資料項目 { "key": "MeterValuesSampledData", "readonly": false, "value": "Energy.Active.Import.Register,Power.Active.Import,Current.Import,Voltage" } // 範例:連接器相位旋轉 { "key": "ConnectorPhaseRotation", "readonly": false, "value": "0.RST,1.RST,2.RST" // 格式: connectorId.PhaseRotation } ``` ### CSL 相關的 MaxLength 組態鍵 對於 CSL 類型的組態鍵,通常會有對應的 `MaxLength` 鍵來告知最大項目數: ``` MeterValuesSampledData (CSL) └── MeterValuesSampledDataMaxLength (integer) = 最多幾個項目 若 MaxLength 鍵不存在,應假設安全值為 1 ``` --- ## 組態鍵操作流程圖 ``` ┌─────────────────────────────────────────────────────────────────┐ │ GetConfiguration.req │ │ (讀取組態鍵) │ ├─────────────────────────────────────────────────────────────────┤ │ │ │ Central System Charge Point │ │ │ │ │ │ │ GetConfiguration.req([key]) │ │ │ │──────────────────────────────────────>│ │ │ │ │ │ │ │ GetConfiguration.conf │ │ │ │ (configurationKey, [unknownKey]) │ │ │ │<──────────────────────────────────────│ │ │ │ │ 回應內容: │ │ { │ │ "configurationKey": [ │ │ { │ │ "key": "HeartbeatInterval", │ │ "readonly": false, ← 表示這是 RW │ │ "value": "60" │ │ }, │ │ { │ │ "key": "NumberOfConnectors", │ │ "readonly": true, ← 表示這是 R │ │ "value": "2" │ │ } │ │ ] │ │ } │ └─────────────────────────────────────────────────────────────────┘ ┌─────────────────────────────────────────────────────────────────┐ │ ChangeConfiguration.req │ │ (修改組態鍵 - 僅限 RW) │ ├─────────────────────────────────────────────────────────────────┤ │ │ │ Central System Charge Point │ │ │ │ │ │ │ ChangeConfiguration.req │ │ │ │ (key, value) │ │ │ │──────────────────────────────────────>│ │ │ │ │ │ │ │ ChangeConfiguration.conf(status) │ │ │ │<──────────────────────────────────────│ │ │ │ │ 可能的回應狀態: │ │ ┌────────────────┬─────────────────────────────────────────┐ │ │ │ Accepted │ 成功套用,立即生效 │ │ │ │ Rejected │ 拒絕(值超出範圍、格式錯誤等) │ │ │ │ RebootRequired │ 成功套用,但需重啟才生效 │ │ │ │ NotSupported │ 不認識這個 key │ │ │ └────────────────┴─────────────────────────────────────────┘ │ │ │ │ ⚠️ 如果對 readonly=true 的鍵發送 ChangeConfiguration: │ │ → 回應 Rejected 或 NotSupported │ └─────────────────────────────────────────────────────────────────┘ ``` --- ## 快速參照表 | 縮寫 | 意義 | 可讀取 | 可修改 | |------|------|:------:|:------:| | R | Read-only | ✅ | ❌ | | RW | Read-Write | ✅ | ✅ | | 類型 | 傳輸格式 | 值域範例 | |------|----------|----------| | boolean | 字串 `"true"` / `"false"` | `true`, `false` | | integer | 字串形式的數字 | `"0"`, `"60"`, `"-1"` | | CSL | 逗號分隔的字串 | `"A,B,C"` |

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully