@@ -428,6 +437,9 @@
加载固件
+
+
+
diff --git a/platform/web/public-browser-runtime.js b/platform/web/public-browser-runtime.js
index 3cadab5e8..a407e8224 100644
--- a/platform/web/public-browser-runtime.js
+++ b/platform/web/public-browser-runtime.js
@@ -20,6 +20,7 @@ import { THERMAL_ID, thermalExample } from './public-thermal-example.js';
import { cores3SensorExample } from './public-cores3-sensor-examples.js';
import { displayUnitExample, hasDisplayUnitFrame } from './public-display-unit-examples.js';
import { ASR_UNIT_ID, ECG_MODULE_ID, uartUnitExample } from './public-uart-unit-examples.js';
+import { isWeightSample, serialSensorExample } from './public-serial-sensor-examples.js';
import { dofBoard } from './public-dof-examples.js';
import { moduleRadioAttachment } from './public-module-radio-examples.js';
import { instrumentExample,instrumentSamplesAvailable } from './public-instrument-examples.js';
@@ -209,7 +210,7 @@ export class PublicBrowserRuntime {
try { data = JSON.parse(message.text); } catch { this.onSerial(String(message.text)); }
if (data?.t === 'serial') this.receiveSerial(data);
else if (data?.t === 'emu') this.onSerial(`[emulator] ${data.msg}\n`);
- else if (['mic-input','module-llm','ir-envelope','dual-kmeter-temperature','ultrasonic-distance','cap-radio-state','cap-radio-frame','cap-gps','qrcode-module-result','faces-input','env-sample','mini-scales-adc','finger-input','fingerprint2-input','hall-magnet','rui3-payload','drive-module-sample','nbiot-mqtt-message','mqtt-unit-message','instrument-sample','rs232-line','dof-sample','cores3-sensor-sample','usb-module-input','port-b-key','port-b-adc','thermal-scene','uart-example-sample','unit-example-value','rtu-peer','cardkb-key','usb-hid-host','review-server-send'].includes(data?.t)) {
+ else if (['mic-input','module-llm','ir-envelope','dual-kmeter-temperature','ultrasonic-distance','cap-radio-state','cap-radio-frame','cap-gps','qrcode-module-result','faces-input','env-sample','mini-scales-adc','finger-input','fingerprint2-input','hall-magnet','rui3-payload','drive-module-sample','nbiot-mqtt-message','mqtt-unit-message','instrument-sample','rs232-line','dof-sample','cores3-sensor-sample','usb-module-input','port-b-key','port-b-adc','weight-unit-sample','thermal-scene','uart-example-sample','unit-example-value','rtu-peer','cardkb-key','usb-hid-host','review-server-send'].includes(data?.t)) {
const pending = this.pending.get(data.t);
if (pending) {
this.pending.delete(data.t);
@@ -242,6 +243,17 @@ export class PublicBrowserRuntime {
else if (data?.t === 'unit-example-state' && data.unit === this.profile.unitExample) {
const value = data.value;
const count = n => Number.isSafeInteger(n) && n >= 0;
+ const sensor = serialSensorExample(data.unit);
+ if (data.unit === 'weight-unit' && isWeightSample(value?.['raw-setpoint'])
+ && (value['last-transferred'] === null || isWeightSample(value['last-transferred'])) && count(value.conversions)) {
+ this.lastUnitExampleState = {kind:data.unit,...value};
+ }
+ if (sensor?.uart && value?.uart === sensor.uart && typeof value.configured === 'boolean'
+ && [value.directed,value.broadcasts].every(count)
+ && [value['last-directed'],value['last-broadcast']].every(bytes=>Array.isArray(bytes)
+ && bytes.length<=92 && bytes.every(byte=>count(byte)&&byte<=255))) {
+ this.lastUnitExampleState = {kind:data.unit,...value};
+ }
if (data.unit === 'relay' && typeof value?.['output-level'] === 'boolean' && count(value['output-transitions'])) {
this.lastUnitExampleState = {kind:data.unit,level:value['output-level'],transitions:value['output-transitions']};
} else if (data.unit === 'ultrasonic-i2c' && Number.isInteger(value?.['distance-mm'])
@@ -324,7 +336,8 @@ export class PublicBrowserRuntime {
|| usbModuleExample(this.profile.unitExample) || displayUnitExample(this.profile.unitExample)
|| uartUnitExample(this.profile.unitExample) || driveModuleExample(this.profile.unitExample)
|| serialMqttAttachment(this.profile.unitExample)
- || pwmUnitExample(this.profile.unitExample) || portBUnitExample(this.profile.unitExample))) {
+ || pwmUnitExample(this.profile.unitExample) || portBUnitExample(this.profile.unitExample)
+ || serialSensorExample(this.profile.unitExample))) {
const now = performance.now();
if (now >= this.nextUnitObservationAt) {
this.nextUnitObservationAt = now + 250;
@@ -486,6 +499,7 @@ export class PublicBrowserRuntime {
const thermal = thermalExample(unitExample);
const usbModule = usbModuleExample(unitExample);
const pwmUnit = pwmUnitExample(unitExample);
+ const serialSensor = serialSensorExample(unitExample);
const portBUnit = portBUnitExample(unitExample);
const displayUnit = displayUnitExample(unitExample);
const uartUnit = uartUnitExample(unitExample);
@@ -521,6 +535,11 @@ export class PublicBrowserRuntime {
&& firmwareInputSha256 === QRCODE_MODULE_FIRMWARE,
'browser_attachment_mismatch', '此 M-Bus 模块需要匹配的 CoreS3 编程固件和浏览器内核。');
Object.assign(profile,{board:driveModule.board,unitExample});
+ } else if (serialSensor) {
+ requireValue(profile.deviceId === 'cores3' && this.availableProfiles?.includes(serialSensor.board)
+ && firmwareInputSha256 === QRCODE_MODULE_FIRMWARE,
+ 'browser_attachment_mismatch', '此附件需要匹配的 CoreS3 编程固件和浏览器内核。');
+ Object.assign(profile,{board:serialSensor.board,unitExample});
} else if (usbModule) {
requireValue(profile.deviceId === 'cores3' && this.availableProfiles?.includes(usbModule.board)
&& firmwareInputSha256 === QRCODE_MODULE_FIRMWARE,
@@ -946,6 +965,12 @@ export class PublicBrowserRuntime {
isEcg ? '请选择 ECG Module 的采样。' : '请选择已连接的 ASR Unit 的命令样本。');
const reply = await this.ask(t,{op:'text',data:JSON.stringify({t,sample})});
return {accepted:reply.ok === true};
+ } else if (event?.type === 'weight-unit-sample') {
+ const {type:t,raw} = event;
+ requireValue(this.status === 'running' && this.profile.unitExample === 'weight-unit' && isWeightSample(raw),
+ 'invalid_weight_sample', '请在 Weight Unit 例程中输入有符号 24 位 ADC 整数。');
+ const reply = await this.ask(t,{op:'text',data:JSON.stringify({t,raw})});
+ return {accepted:reply.ok === true};
} else if (event?.type === 'dof-sample') {
const {sample} = event;
requireValue(this.status === 'running' && dofBoard(this.profile.unitExample) && ['a','b'].includes(sample),
diff --git a/platform/web/public-serial-sensor-examples.js b/platform/web/public-serial-sensor-examples.js
new file mode 100644
index 000000000..42f959320
--- /dev/null
+++ b/platform/web/public-serial-sensor-examples.js
@@ -0,0 +1,24 @@
+const root = 'https://raw.githubusercontent.com/m5stack/uiflow-micropython/a61a29409f09f1f4bebae05e15c4bd6dcc4956b6/examples/';
+const sources = {
+ 'weight-unit': {
+ name:'Weight Unit', path:'unit/weight/weight_cores3_example.py', bytes:1107,
+ sha256:'250424223330169696c47a3a11063d9b0aab8cf31794e7880c071b70a30f9cf4',
+ },
+ 'zigbee-unit': {
+ name:'Zigbee Unit', path:'unit/zigbee/cores3_zigbee_tx_example.py', bytes:1150, uart:1,
+ sha256:'338745add8d306ea0b1d3a0222b59bc9df40c8ef51627d52c4073fa794905cef',
+ },
+ 'zigbee-module': {
+ name:'Zigbee Module', path:'module/zigbee/cores3_zigbee_tx_example.py', bytes:1257, uart:2,
+ sha256:'2760cb81e375bb6bd4064b624568833d6fc291af861413c70b1f9fd1c0af7b1b',
+ },
+};
+
+export function serialSensorExample(id) {
+ const row = Object.hasOwn(sources,id) ? sources[id] : null;
+ return row && {...row,attachment:id,board:`m5stack-cores3+${id}`,url:root+row.path};
+}
+
+export function isWeightSample(raw) {
+ return Number.isInteger(raw) && raw >= -8388608 && raw <= 8388607;
+}
diff --git a/platform/web/public.js b/platform/web/public.js
index 2db0b6c00..df1a38023 100644
--- a/platform/web/public.js
+++ b/platform/web/public.js
@@ -18,6 +18,7 @@ import {THERMAL_ID, thermalExample} from './public-thermal-example.js';
import {ASR_UNIT_ID, ECG_MODULE_ID, uartUnitExample} from './public-uart-unit-examples.js';
import {cores3SensorExample} from './public-cores3-sensor-examples.js';
import {drawDisplayUnitFrame, displayUnitExample} from './public-display-unit-examples.js';
+import {serialSensorExample} from './public-serial-sensor-examples.js';
import {dofBoard,dofExample} from './public-dof-examples.js';
import {moduleRadioExample,moduleRadioAttachment} from './public-module-radio-examples.js';
import {instrumentExample,instrumentSamplesAvailable} from './public-instrument-examples.js';
@@ -165,7 +166,7 @@ function availableDualKmeterSource(profile, workbench) {
return dualKmeterExampleSource(getQemuBrowserProfile('cores3',state.qemuProfiles),workbench,state.config.browser_dual_kmeter_example);
}
function documentedAttachmentExample(id) {
- return mqttUnitExample(id) || nbiotExample(id) || instrumentExample(id) || uartUnitExample(id) || portAUnitExample(id) || moduleRadioExample(id) || driveModuleExample(id) || usbModuleExample(id) || displayUnitExample(id) || pwmUnitExample(id) || portBUnitExample(id) || dofExample(id) || thermalExample(id) || cores3SensorExample(id) || audioModuleExample(id) || gpioUnitExample(id) || rui3ModuleExample(id) || capGpsExample(id) || moduleLlmExample(id) || fingerprint2Example(id) || miniScalesExample(id) || servos8Example(id) || envExample(id) || facesModuleExample(id) || qrcodeModuleExample(id);
+ return mqttUnitExample(id) || nbiotExample(id) || instrumentExample(id) || uartUnitExample(id) || portAUnitExample(id) || moduleRadioExample(id) || driveModuleExample(id) || usbModuleExample(id) || displayUnitExample(id) || pwmUnitExample(id) || portBUnitExample(id) || serialSensorExample(id) || dofExample(id) || thermalExample(id) || cores3SensorExample(id) || audioModuleExample(id) || gpioUnitExample(id) || rui3ModuleExample(id) || capGpsExample(id) || moduleLlmExample(id) || fingerprint2Example(id) || miniScalesExample(id) || servos8Example(id) || envExample(id) || facesModuleExample(id) || qrcodeModuleExample(id);
}
function availableAttachmentSource(profile, workbench, id) {
const example=documentedAttachmentExample(id);
@@ -474,6 +475,21 @@ function updateBrowserUnitExample(run) {
? `GPIO 输入 ${moduleState['gpio-in']} · 输出 ${moduleState['gpio-out']}`
: moduleState.configured?'USB 设备已就绪':moduleState.connected?'等待来宾配置 USB 设备':'USB 设备未连接';
$('browserUsbModuleStatus').textContent=usbModule?run.usbModuleStatus||'':'';
+ const serialSensor=live&&serialSensorExample(kind);
+ const weight=serialSensor&&kind==='weight-unit';
+ $('browserSerialSensorPanel').hidden=!serialSensor;
+ $('browserWeightInput').hidden=!weight;
+ $('browserWeightApply').disabled=!weight||controller.status!=='running'||!!run.weightPending;
+ $('browserWeightStatus').textContent=weight?run.weightStatus||'':'';
+ if(serialSensor){
+ const sensorState=reading?.kind===kind?reading:null;
+ const payload=bytes=>String.fromCharCode(...bytes);
+ $('browserSerialSensorState').textContent=weight
+ ? (sensorState?.['last-transferred']!=null?`来宾已读取 ADC ${sensorState['last-transferred']}`:'等待 ADC 读数')
+ : sensorState?.configured
+ ? `UART${sensorState.uart} · 单播 ${sensorState.directed} ${payload(sensorState['last-directed'])} · 广播 ${sensorState.broadcasts} ${payload(sensorState['last-broadcast'])}`
+ : '等待来宾配置 Zigbee';
+ }
const portB=live&&portBUnitExample(kind);
const portBState=portB&&reading?.kind===kind?reading:null;
const key=portB&&kind==='key-unit';
@@ -626,7 +642,7 @@ function updateBrowserUnitExample(run) {
$('browserEnvHumidity').value=$('browserEnvHumidity').defaultValue;
}
$('browserEnvStatus').textContent=env?run.envStatus||'':'';
- panel.hidden=!live||qrcode||!!faces||!!env||!!modbusRtuExample(kind)||usb||scale||fingerprint||moduleLlm||usbModule||driveModule||displayUnit||pwm||portB||thermal||uartUnit||sampling||portAUnit||[AUDIO_MODULE_ID,PDM_UNIT_ID].includes(kind)||!!moduleRadioAttachment(kind);
+ panel.hidden=!live||qrcode||!!faces||!!env||!!modbusRtuExample(kind)||usb||scale||fingerprint||moduleLlm||usbModule||driveModule||displayUnit||pwm||portB||serialSensor||thermal||uartUnit||sampling||portAUnit||[AUDIO_MODULE_ID,PDM_UNIT_ID].includes(kind)||!!moduleRadioAttachment(kind);
panel.dataset.kind=live?kind:'';
$('browserExampleDistanceControl').hidden=!live||kind!=='ultrasonic-i2c';
input.disabled=!reading||controller.status!=='running'||!!run?.unitDistancePending;
@@ -1173,6 +1189,7 @@ function renderDetails() {
:ref.moduleSource.attachment===ECG_MODULE_ID?'运行官方例程后发送采样 A 或 B,查看波形和数值。'
:uartUnitExample(ref.moduleSource.attachment)?'运行官方例程,在工作台查看来宾 UART 数据。'
:cores3SensorExample(ref.moduleSource.attachment)?'运行官方例程并切换板载传感器采样。'
+ :serialSensorExample(ref.moduleSource.attachment)?'运行官方例程并查看已连接附件的读写结果。'
:dofBoard(ref.moduleSource.attachment)?'运行官方例程后选择采样 A 或 B,查看来宾的传感器读数。'
:moduleRadioAttachment(ref.moduleSource.attachment)?'在两个标签页运行同一模块的发送端与接收端,使用相同配对码连接。'
:portAUnitExample(ref.moduleSource.attachment)?.inputLabel?'运行官方例程后调整附件输入,查看来宾画面。'
@@ -2606,6 +2623,20 @@ for (const [id, sample] of [
}
});
}
+$('browserWeightApply').addEventListener('click',async()=>{
+ const run=state.run;
+ if(!active(run)||$('browserWeightApply').disabled)return;
+ run.weightPending=true;
+ updateBrowserUnitExample(run);
+ try {
+ const {accepted}=await run.controller.input({type:'weight-unit-sample',raw:$('browserWeightRaw').valueAsNumber});
+ run.weightStatus=accepted?'已设置 ADC 输入':'无法设置 ADC 输入';
+ } catch(cause) { run.weightStatus=cause.message; }
+ finally {
+ run.weightPending=false;
+ if(active(run))updateBrowserUnitExample(run);
+ }
+});
for(const [id,sample] of [['browserDofA','a'],['browserDofB','b']]){
$(id).addEventListener('click',async()=>{
const run=state.run;
From 19d76f29aa3f1216ae73908a09a2c931f17e21e0 Mon Sep 17 00:00:00 2001
From: m5agent <329351612+m5agent@users.noreply.github.com>
Date: Tue, 1 Dec 2026 19:00:31 +0800
Subject: [PATCH 15/20] Expose the isolated UHF-RFID documentation fixture
---
platform/tools/bootstrap_browser_runtime.py | 1 +
platform/web/index.html | 1 +
platform/web/public-browser-runtime.js | 8 ++++++++
platform/web/public-serial-sensor-examples.js | 4 ++++
platform/web/public.js | 6 +++++-
5 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/platform/tools/bootstrap_browser_runtime.py b/platform/tools/bootstrap_browser_runtime.py
index a7cb399f7..0d881e151 100644
--- a/platform/tools/bootstrap_browser_runtime.py
+++ b/platform/tools/bootstrap_browser_runtime.py
@@ -39,6 +39,7 @@
"m5stack-cores3+ecg-module",
"m5stack-cores3+module-16340", "m5stack-cores3+pps-module", "m5stack-cores3+rs232-module",
"m5stack-cores3+weight-unit", "m5stack-cores3+zigbee-unit", "m5stack-cores3+zigbee-module",
+ "m5stack-cores3+uhf-rfid-unit",
"m5stack-cores3+env-iii", "m5stack-cores3+env-pro",
"m5stack-cores3+audio-module", "m5stack-cores3+pdm-unit", "m5stack-cores3+byteswitch", "m5stack-cores3+step16", "m5stack-cores3+ncir2",
"m5stack-cores3+key-unit", "m5stack-cores3+fader-unit", "m5stack-cores3+flashlight-unit",
diff --git a/platform/web/index.html b/platform/web/index.html
index 714fa5906..1abf08743 100644
--- a/platform/web/index.html
+++ b/platform/web/index.html
@@ -437,6 +437,7 @@ 加载固件
+
diff --git a/platform/web/public-browser-runtime.js b/platform/web/public-browser-runtime.js
index a407e8224..91299d992 100644
--- a/platform/web/public-browser-runtime.js
+++ b/platform/web/public-browser-runtime.js
@@ -248,6 +248,14 @@ export class PublicBrowserRuntime {
&& (value['last-transferred'] === null || isWeightSample(value['last-transferred'])) && count(value.conversions)) {
this.lastUnitExampleState = {kind:data.unit,...value};
}
+ if (data.unit === 'uhf-rfid-unit' && value && typeof value.selected === 'boolean'
+ && [value.inventories,value.reads,value.writes].every(count)
+ && [null,0,1].includes(value['select-bank'])
+ && (value['last-error'] === null || count(value['last-error']) && value['last-error'] <= 255)
+ && Array.isArray(value.reserved) && value.reserved.length === 8
+ && value.reserved.every(byte=>count(byte)&&byte<=255)) {
+ this.lastUnitExampleState = {kind:data.unit,...value};
+ }
if (sensor?.uart && value?.uart === sensor.uart && typeof value.configured === 'boolean'
&& [value.directed,value.broadcasts].every(count)
&& [value['last-directed'],value['last-broadcast']].every(bytes=>Array.isArray(bytes)
diff --git a/platform/web/public-serial-sensor-examples.js b/platform/web/public-serial-sensor-examples.js
index 42f959320..105fd5309 100644
--- a/platform/web/public-serial-sensor-examples.js
+++ b/platform/web/public-serial-sensor-examples.js
@@ -1,5 +1,9 @@
const root = 'https://raw.githubusercontent.com/m5stack/uiflow-micropython/a61a29409f09f1f4bebae05e15c4bd6dcc4956b6/examples/';
const sources = {
+ 'uhf-rfid-unit': {
+ name:'UHF-RFID Unit', path:'unit/uhf_rfid/cores3_uhf_rfid_example.py', bytes:1018,
+ sha256:'f775b33324253d7c2fca66be4ee9a35858f048836553b9395d98185b2acea879',
+ },
'weight-unit': {
name:'Weight Unit', path:'unit/weight/weight_cores3_example.py', bytes:1107,
sha256:'250424223330169696c47a3a11063d9b0aab8cf31794e7880c071b70a30f9cf4',
diff --git a/platform/web/public.js b/platform/web/public.js
index df1a38023..390d308f7 100644
--- a/platform/web/public.js
+++ b/platform/web/public.js
@@ -484,7 +484,11 @@ function updateBrowserUnitExample(run) {
if(serialSensor){
const sensorState=reading?.kind===kind?reading:null;
const payload=bytes=>String.fromCharCode(...bytes);
- $('browserSerialSensorState').textContent=weight
+ if(kind==='uhf-rfid-unit') {
+ $('browserSerialSensorState').textContent=sensorState?.inventories
+ ? `标签扫描 ${sensorState.inventories} · 读 ${sensorState.reads} · 写 ${sensorState.writes}`
+ : '等待标签扫描';
+ } else $('browserSerialSensorState').textContent=weight
? (sensorState?.['last-transferred']!=null?`来宾已读取 ADC ${sensorState['last-transferred']}`:'等待 ADC 读数')
: sensorState?.configured
? `UART${sensorState.uart} · 单播 ${sensorState.directed} ${payload(sensorState['last-directed'])} · 广播 ${sensorState.broadcasts} ${payload(sensorState['last-broadcast'])}`
From e45a2badf736754fc6d3e1889dfac7d04c969a37 Mon Sep 17 00:00:00 2001
From: m5agent
Date: Tue, 1 Dec 2026 14:32:42 +0800
Subject: [PATCH 16/20] Add a restricted HTTP fixture for the LabelPlus example
---
platform/tools/bootstrap_browser_runtime.py | 2 +-
platform/web/index.html | 1 +
platform/web/public-browser-runtime.js | 24 ++++++--
platform/web/public-network-fixtures.js | 14 ++++-
platform/web/public.js | 16 ++++--
platform/web/vendor/esp32sim/UPSTREAM.md | 2 +-
platform/web/vendor/esp32sim/source.json | 6 +-
platform/web/vendor/esp32sim/worker.js | 62 ++++++++++++++++++++-
8 files changed, 110 insertions(+), 17 deletions(-)
diff --git a/platform/tools/bootstrap_browser_runtime.py b/platform/tools/bootstrap_browser_runtime.py
index 0d881e151..f6912ce8a 100644
--- a/platform/tools/bootstrap_browser_runtime.py
+++ b/platform/tools/bootstrap_browser_runtime.py
@@ -21,7 +21,7 @@
ROOT = Path(__file__).resolve().parents[2]
SOURCE_URL = "https://github.com/m5agent/esp32sim.git"
-SOURCE_COMMIT = "877484e80f83371118305c457f0da70616ea75e9"
+SOURCE_COMMIT = "779f93a6adb652d6714fa68e50ae4fca36063f53"
BOARD_PROFILES = json.loads((ROOT / "platform/web/esp32sim-browser-boards.json").read_text())
SOURCE_PROFILES = [
"m5stack-cores3", "m5stack-cores3+dual-kmeter",
diff --git a/platform/web/index.html b/platform/web/index.html
index 1abf08743..36fc722ad 100644
--- a/platform/web/index.html
+++ b/platform/web/index.html
@@ -486,6 +486,7 @@ 加载固件
+
diff --git a/platform/web/public-browser-runtime.js b/platform/web/public-browser-runtime.js
index 91299d992..35ac68253 100644
--- a/platform/web/public-browser-runtime.js
+++ b/platform/web/public-browser-runtime.js
@@ -34,13 +34,13 @@ import { AUDIO_MODULE_BOARD, AUDIO_MODULE_ID, PDM_UNIT_BOARD, PDM_UNIT_ID } from
import { envBoard } from './public-env-examples.js';
import { facesModuleExample } from './public-faces-module.js';
import { WLAN_AP_EXAMPLE_ID, TCP_SERVER_EXAMPLE_ID, MODBUS_TCP_SERVER_EXAMPLE_ID, EASY_TCP_SERVER_EXAMPLE_ID, ARDUINO_RTC_EXAMPLE_ID, ARDUINO_RTC_FIRMWARE,
- ARDUINO_RTC_WIFI, networkFixtureSource, usesExampleStation, usesTextTcpPeer } from './public-network-fixtures.js';
+ ARDUINO_RTC_WIFI, LABEL_PLUS_EXAMPLE_ID, labelPlusEndpoint, networkFixtureSource, usesExampleStation, usesTextTcpPeer } from './public-network-fixtures.js';
import { QRCODE_MODULE_ID, QRCODE_MODULE_BOARD, QRCODE_MODULE_FIRMWARE } from './public-qrcode-module.js';
import { USB_HID_FIRMWARE, usbHidExample } from './public-usb-hid-examples.js';
import { MODBUS_RTU_FIRMWARE, modbusRtuExample } from './public-modbus-rtu.js';
import admittedBoards from './esp32sim-browser-boards.json' with {type:'json'};
-export const ESP32SIM_SOURCE_COMMIT = '877484e80f83371118305c457f0da70616ea75e9';
+export const ESP32SIM_SOURCE_COMMIT = '779f93a6adb652d6714fa68e50ae4fca36063f53';
export const ESP32SIM_LEGACY_COMMIT = '3cd3db3b7202e9fc559328c7247c11134c0437f9';
export const ESP32SIM_DUAL_KMETER_BOARD = 'm5stack-cores3+dual-kmeter';
const CAP_RADIO_KIND = Object.freeze({cc1101:'02',lora1262:'01',lora868:'01',sx1276:'03'});
@@ -210,7 +210,7 @@ export class PublicBrowserRuntime {
try { data = JSON.parse(message.text); } catch { this.onSerial(String(message.text)); }
if (data?.t === 'serial') this.receiveSerial(data);
else if (data?.t === 'emu') this.onSerial(`[emulator] ${data.msg}\n`);
- else if (['mic-input','module-llm','ir-envelope','dual-kmeter-temperature','ultrasonic-distance','cap-radio-state','cap-radio-frame','cap-gps','qrcode-module-result','faces-input','env-sample','mini-scales-adc','finger-input','fingerprint2-input','hall-magnet','rui3-payload','drive-module-sample','nbiot-mqtt-message','mqtt-unit-message','instrument-sample','rs232-line','dof-sample','cores3-sensor-sample','usb-module-input','port-b-key','port-b-adc','weight-unit-sample','thermal-scene','uart-example-sample','unit-example-value','rtu-peer','cardkb-key','usb-hid-host','review-server-send'].includes(data?.t)) {
+ else if (['mic-input','module-llm','ir-envelope','dual-kmeter-temperature','ultrasonic-distance','cap-radio-state','cap-radio-frame','cap-gps','qrcode-module-result','faces-input','env-sample','mini-scales-adc','finger-input','fingerprint2-input','hall-magnet','rui3-payload','drive-module-sample','nbiot-mqtt-message','mqtt-unit-message','instrument-sample','rs232-line','dof-sample','cores3-sensor-sample','usb-module-input','port-b-key','port-b-adc','weight-unit-sample','thermal-scene','uart-example-sample','unit-example-value','rtu-peer','cardkb-key','usb-hid-host','review-server-send','review-http-data'].includes(data?.t)) {
const pending = this.pending.get(data.t);
if (pending) {
this.pending.delete(data.t);
@@ -761,7 +761,17 @@ export class PublicBrowserRuntime {
if (networkFixture===TCP_SERVER_EXAMPLE_ID) worker.postMessage({op:'review-server'});
else if (networkFixture===EASY_TCP_SERVER_EXAMPLE_ID) worker.postMessage({op:'review-server',mode:'easy-tcp'});
else if (networkFixture===MODBUS_TCP_SERVER_EXAMPLE_ID) worker.postMessage({op:'review-server',mode:'modbus'});
- else if (usesExampleStation(networkFixture)) worker.postMessage({op:'review-tcp',mode:networkFixture});
+ else if (networkFixture===LABEL_PLUS_EXAMPLE_ID) {
+ const source=networkFixtureSource(networkFixture);
+ const asset=await loadVerifiedRuntimeAsset(source.url,{
+ signal:this.controller.signal,fetchImpl:this.fetchImpl,
+ expectedSha256:source.sha256,expectedBytes:source.bytes,maxBytes:source.bytes,
+ });
+ active();
+ const address=labelPlusEndpoint(new TextDecoder('utf-8',{fatal:true}).decode(asset.bytes));
+ requireValue(address, 'browser_attachment_mismatch', '官方 LabelPlus 例程缺少可用的虚拟对端。');
+ worker.postMessage({op:'review-tcp',mode:networkFixture,address});
+ } else if (usesExampleStation(networkFixture)) worker.postMessage({op:'review-tcp',mode:networkFixture});
if (arduinoRtc) worker.postMessage({op:'wifi',spec:ARDUINO_RTC_WIFI});
if (profile.camera) await this.queueInput({t:'camera-pattern',enabled:1});
requireValue((await this.ask('started', {op:'start',appDirect:false})).started, 'browser_boot_failed', '客体启动失败,请查看串口。'); active();
@@ -1082,6 +1092,12 @@ export class PublicBrowserRuntime {
const t = 'cardkb-key';
const reply = await this.ask(t,{op:'text',data:JSON.stringify({t,key})});
return {accepted:reply.ok === true};
+ } else if (event?.type === 'review-http-data') {
+ const {type,payload} = event;
+ requireValue(this.receipt.networkFixture === LABEL_PLUS_EXAMPLE_ID && typeof payload === 'string'
+ && /^[A-Za-z0-9 -]{1,32}$/.test(payload), 'invalid_http_fixture_data', '请输入 1 到 32 个字母、数字、空格或连字符。');
+ const reply = await this.ask(type,{op:type,data:payload});
+ return {accepted:reply.ok === true};
} else if (event?.type === 'review-server-send') {
const {payload} = event;
const fixture=this.receipt.networkFixture;
diff --git a/platform/web/public-network-fixtures.js b/platform/web/public-network-fixtures.js
index c02867946..43050ff0e 100644
--- a/platform/web/public-network-fixtures.js
+++ b/platform/web/public-network-fixtures.js
@@ -5,6 +5,7 @@ export const MODBUS_TCP_SERVER_EXAMPLE_ID = 'modbus-tcp-server';
export const TCP_SERVER_EXAMPLE_ID = 'tcp-server';
export const EASY_TCP_SERVER_EXAMPLE_ID = 'easy-tcp-server';
const EASY_TCP_CLIENT_EXAMPLE_ID = 'easy-tcp-client';
+export const LABEL_PLUS_EXAMPLE_ID = 'label-plus';
export const MQTT_BASIC_EXAMPLE_ID = 'mqtt-basic';
export const ARDUINO_RTC_EXAMPLE_ID = 'arduino-rtc';
export const ARDUINO_RTC_FIRMWARE = 'cf450835c9b8d88f815272158040afee79f0d88cf32b1f46add9bd783b8ab00d';
@@ -25,15 +26,26 @@ const examples = new Map([
bytes:2936,sha256:'76b52aec85fd69291178449a1a1b069b877acbfbd3915c772fdba5fa4c2ea379'}],
[TCP_SERVER_EXAMPLE_ID,{name:'TCP Server',url:officialSource+'software/tcp/cores3_tcp_server_example.py',
bytes:3141,sha256:'66852604195ea59f24ccc9c5dc33df549a444d9e52dc47e29ad2ba7c98636992'}],
+ [LABEL_PLUS_EXAMPLE_ID,{name:'LabelPlus HTTP',url:officialSource+'widgets/labelplus/cores3_labelplus_example.py',
+ bytes:1283,sha256:'013a27a4c1ac9a693049c42856c650ee49a6bdabd7e668efef524e6197577fb4'}],
[MQTT_BASIC_EXAMPLE_ID,{name:'MQTT Client',url:officialSource+'software/mqtt/cores3_mqtt_basic_example.py',
bytes:4600,sha256:'0242384b10d48a2aa5fcc8a863945f4a4b71c3f90a7be482e12b91bcba91afc2'}],
]);
export function networkFixtureSource(id) { return examples.get(id) || null; }
+export function labelPlusEndpoint(source) {
+ const addresses = [...source.matchAll(/["']http:\/\/([0-9]+(?:\.[0-9]+){3}):8000\/data["']/g)];
+ if (addresses.length !== 1) return null;
+ const address = addresses[0][1].split('.').map(Number);
+ const [first,second] = address;
+ if (address.some(part=>!Number.isInteger(part) || part < 0 || part > 255)
+ || !(first===10 || first===172 && second>=16 && second<=31 || first===192 && second===168)) return null;
+ return address;
+}
export function usesTextTcpPeer(id) {
return id===TCP_SERVER_EXAMPLE_ID || id===EASY_TCP_SERVER_EXAMPLE_ID;
}
export function usesExampleStation(id) {
- return [TCP_CLIENT_EXAMPLE_ID, TCP_SERVER_EXAMPLE_ID, MQTT_BASIC_EXAMPLE_ID,
+ return [TCP_CLIENT_EXAMPLE_ID, TCP_SERVER_EXAMPLE_ID, MQTT_BASIC_EXAMPLE_ID, LABEL_PLUS_EXAMPLE_ID,
MODBUS_TCP_CLIENT_EXAMPLE_ID, MODBUS_TCP_SERVER_EXAMPLE_ID, EASY_TCP_CLIENT_EXAMPLE_ID, EASY_TCP_SERVER_EXAMPLE_ID].includes(id);
}
diff --git a/platform/web/public.js b/platform/web/public.js
index 390d308f7..45423c232 100644
--- a/platform/web/public.js
+++ b/platform/web/public.js
@@ -4,7 +4,7 @@ import {composeUIFlowWorkbenchFirmware,loadUIFlowWorkbenchProfiles,getUIFlowWork
import {openQemuPeerPair,newQemuPeerCode} from './public-qemu-peer-pair.js';
import {capGpsExample} from './public-cap-gps-examples.js';
import {GNSS_EXAMPLE_ID,supportsQemuGnssWorkbench} from './public-qemu-gnss-example.js';
-import {MODBUS_TCP_SERVER_EXAMPLE_ID,NETWORK_STATION_PREP,networkFixtureSource,usesExampleStation,usesTextTcpPeer} from './public-network-fixtures.js';
+import {MODBUS_TCP_SERVER_EXAMPLE_ID,LABEL_PLUS_EXAMPLE_ID,NETWORK_STATION_PREP,networkFixtureSource,usesExampleStation,usesTextTcpPeer} from './public-network-fixtures.js';
import {QRCODE_MODULE_ID,QRCODE_MODULE_BOARD,QRCODE_MODULE_FIRMWARE,qrcodeModuleExample} from './public-qrcode-module.js';
import {FINGER_ID,FINGERPRINT2_ID,fingerprint2Example} from './public-fingerprint2-examples.js';
import {SERVOS8_ID,servos8Example} from './public-8servos-examples.js';
@@ -836,11 +836,15 @@ function updatePythonControls(currentStatus=state.run?.controller?.status || sta
const replace=pythonBusy&&run.python.canReplace===true&&run.pythonPhase==='running';
const fixtureId=receipt?.networkFixture;
const modbusTcp=fixtureId===MODBUS_TCP_SERVER_EXAMPLE_ID;
- const tcpPeer=active(run)&&run.kind==='browser'&&(usesTextTcpPeer(fixtureId)||modbusTcp);
+ const httpData=fixtureId===LABEL_PLUS_EXAMPLE_ID;
+ const tcpPeer=active(run)&&run.kind==='browser'&&(usesTextTcpPeer(fixtureId)||modbusTcp||httpData);
const tcpInput=$('browserTcpPeerText');
const peerReady=tcpPeer&&pythonBusy&&run.pythonPhase==='running'&&!run.tcpPeerPending;
$('browserTcpPeerPanel').hidden=!tcpPeer;
$('browserTcpPeerTextLabel').hidden=tcpInput.hidden=$('browserTcpPeerSend').hidden=modbusTcp;
+ $('browserTcpPeerTextLabel').textContent=httpData?'虚拟 HTTP 响应数据':'虚拟 TCP 客户端';
+ tcpInput.maxLength=httpData?32:64;
+ $('browserTcpPeerSend').textContent=httpData?'设置数据':'发送';
$('browserTcpPeerSend').disabled=!peerReady||modbusTcp;
$('browserModbusTcpRead').hidden=$('browserModbusTcpWrite').hidden=!modbusTcp;
$('browserModbusTcpRead').disabled=$('browserModbusTcpWrite').disabled=!peerReady||!modbusTcp;
@@ -2875,8 +2879,12 @@ for (const [id,payload] of [
run.tcpPeerPending=true;
updatePythonControls();
try{
- const {accepted}=await run.controller.input({type:'review-server-send',payload:payload??$('browserTcpPeerText').value});
- run.tcpPeerStatus=accepted?'数据已进入虚拟客户端的发送队列。':'上一条消息尚未完成。';
+ const http=run.controller.receipt.networkFixture===LABEL_PLUS_EXAMPLE_ID;
+ const type=http?'review-http-data':'review-server-send';
+ const {accepted}=await run.controller.input({type,payload:payload??$('browserTcpPeerText').value});
+ run.tcpPeerStatus=http
+ ? (accepted?'下次请求将返回已设置的数据。':'无法设置响应数据。')
+ : (accepted?'数据已进入虚拟客户端的发送队列。':'上一条消息尚未完成。');
}catch(cause){
run.tcpPeerStatus=cause.message;
}finally{
diff --git a/platform/web/vendor/esp32sim/UPSTREAM.md b/platform/web/vendor/esp32sim/UPSTREAM.md
index 163e63b28..55f869d13 100644
--- a/platform/web/vendor/esp32sim/UPSTREAM.md
+++ b/platform/web/vendor/esp32sim/UPSTREAM.md
@@ -1,7 +1,7 @@
# esp32sim browser execution glue
The ES modules and MIT license in this directory come from the
-[M5Stack esp32sim fork](https://github.com/m5agent/esp32sim/tree/877484e80f83371118305c457f0da70616ea75e9).
+[M5Stack esp32sim fork](https://github.com/m5agent/esp32sim/tree/779f93a6adb652d6714fa68e50ae4fca36063f53).
The browser runtime extends the
[backend completion milestone](https://github.com/m5agent/esp32sim/tree/m5-milestone-backend-complete-20261201).
It includes PaperMono and PaperColor timed PM1 input and PaperColor SPI SD.
diff --git a/platform/web/vendor/esp32sim/source.json b/platform/web/vendor/esp32sim/source.json
index 75f0a3d15..8a977a592 100644
--- a/platform/web/vendor/esp32sim/source.json
+++ b/platform/web/vendor/esp32sim/source.json
@@ -2,14 +2,14 @@
"schema_version": 1,
"repository": "https://github.com/m5agent/esp32sim",
"upstream": "https://github.com/mikroverk/esp32sim",
- "commit": "877484e80f83371118305c457f0da70616ea75e9",
+ "commit": "779f93a6adb652d6714fa68e50ae4fca36063f53",
"license": "MIT",
"scope": "WASM worker, pacing and block JIT glue only; no firmware or ROM",
"files": {
"worker.js": {
"source_path": "web/wasm/worker.js",
- "sha256": "b626f3c51b156b2a0f3f4ccc80ffa736e9f7dc313f4b5b65885db5a06ec9d656",
- "bytes": 23697
+ "sha256": "715d1dd55eddd89b3f5de36cc8b1b42689fab42f12db958437bdf250c8686925",
+ "bytes": 26015
},
"jit.mjs": {
"source_path": "web/wasm/jit.mjs",
diff --git a/platform/web/vendor/esp32sim/worker.js b/platform/web/vendor/esp32sim/worker.js
index 478cfde15..d7a302979 100644
--- a/platform/web/vendor/esp32sim/worker.js
+++ b/platform/web/vendor/esp32sim/worker.js
@@ -30,6 +30,17 @@ const reviewEndpoints = {
'easy-tcp-client': {address:[192,168,8,196],port:8000},
'mqtt-basic': {address:[192,0,2,20],port:1883,name:'broker.emqx.io'},
};
+function reviewEndpoint(mode, address) {
+ if (mode !== 'label-plus') {
+ return Object.hasOwn(reviewEndpoints, mode) ? reviewEndpoints[mode] : null;
+ }
+ if (!Array.isArray(address) || address.length !== 4
+ || !address.every(part => Number.isInteger(part) && part >= 0 && part <= 255)) return null;
+ const [first, second] = address;
+ if (!(first === 10 || first === 172 && second >= 16 && second <= 31
+ || first === 192 && second === 168)) return null;
+ return {address,port:8000};
+}
const emptyBytes = new Uint8Array();
let reviewTcp = null;
function reviewEvent(kind,id,arg=0,bytes=emptyBytes) {
@@ -49,10 +60,29 @@ function* reviewRecords() {
}
}
+function respondReviewHttp(flow, bytes, data) {
+ if (flow.replied || flow.pending.length + bytes.length > 4096) throw new Error('invalid request length');
+ const pending = new Uint8Array(flow.pending.length + bytes.length);
+ pending.set(flow.pending);
+ pending.set(bytes, flow.pending.length);
+ flow.pending = pending;
+ const raw = dec.decode(pending);
+ const end = raw.indexOf('\r\n\r\n');
+ if (end === -1) return null;
+ const requestLine = raw.slice(0, raw.indexOf('\r\n'));
+ if (!/^GET \/data HTTP\/1\.[01]$/.test(requestLine) || end + 4 !== raw.length) {
+ throw new Error('unexpected HTTP request');
+ }
+ flow.replied = true;
+ const body = JSON.stringify({ data });
+ return enc.encode('HTTP/1.0 200 OK\r\nContent-Type: application/json\r\n'
+ + 'Connection: close\r\nContent-Length: ' + body.length + '\r\n\r\n' + body);
+}
+
function drainReviewTcp() {
if (!reviewTcp) return;
const flows = reviewTcp.flows;
- const endpoint = reviewEndpoints[reviewTcp.mode];
+ const {endpoint}=reviewTcp;
for(const {op,port,id,bytes,size} of reviewRecords()){
if(op===1){
if(port!==endpoint.port||size!==4||flows.size>=8||!endpoint.address.every((part,i)=>part===bytes[i])){
@@ -64,6 +94,25 @@ function drainReviewTcp() {
reviewEvent(1,id,4096);
}
}else if(op===2&&flows.has(id)){
+ if (reviewTcp.mode === 'label-plus') {
+ try {
+ const response = respondReviewHttp(flows.get(id), bytes, reviewTcp.httpData);
+ if (response && reviewEvent(3,id,0,response) !== response.length) {
+ throw new Error('restricted HTTP response is full');
+ }
+ reviewEvent(6,id,size);
+ if (response) {
+ reviewTcp.exchanges++;
+ reviewTcp.last = reviewTcp.httpData;
+ reviewEvent(4,id);
+ }
+ } catch {
+ reviewTcp.denied++;
+ flows.delete(id);
+ reviewEvent(5,id);
+ }
+ continue;
+ }
if(reviewTcp.mode==='mqtt-basic'){
try{
const {responses,close}=serveReviewMqtt(flows.get(id),bytes,reviewTcp);
@@ -374,15 +423,22 @@ onmessage = async (ev) => {
}
else if (m.op === 'review-tcp') {
const mode=m.mode||'tcp-client';
- if (!Object.hasOwn(reviewEndpoints,mode)||!wasm.esp32sim_nat_relay || withBytes(enc.encode('ssid=M5ExampleNet'),(p,n)=>wasm.esp32sim_wifi(emu,p,n)) !== 0
+ const endpoint=reviewEndpoint(mode,m.address);
+ if (!endpoint||!wasm.esp32sim_nat_relay || withBytes(enc.encode('ssid=M5ExampleNet'),(p,n)=>wasm.esp32sim_wifi(emu,p,n)) !== 0
|| wasm.esp32sim_nat_relay(emu,3) !== 0) {
setupError ||= 'restricted TCP fixture is unavailable';
} else {
reviewServer=null;
- reviewTcp={mode,flows:new Map(),connects:0,exchanges:0,handshakes:0,subscriptions:0,denied:0,last:null,
+ reviewTcp={mode,endpoint,flows:new Map(),connects:0,exchanges:0,handshakes:0,subscriptions:0,denied:0,last:null,httpData:'M5-A',
modbus:mode==='modbus-tcp-client'?newModbusRegisters():null};
}
}
+ else if (m.op === 'review-http-data') {
+ const accepted = reviewTcp?.mode === 'label-plus'
+ && typeof m.data === 'string' && /^[A-Za-z0-9 -]{1,32}$/.test(m.data);
+ if (accepted) reviewTcp.httpData = m.data;
+ postMessage({text:JSON.stringify({t:'review-http-data',ok:accepted})});
+ }
else if (m.op === 'review-tcp-state') {
const value=reviewTcp&&{connects:reviewTcp.connects,exchanges:reviewTcp.exchanges,
handshakes:reviewTcp.handshakes,subscriptions:reviewTcp.subscriptions,denied:reviewTcp.denied,last:reviewTcp.last};
From 75004c4b0858f3c7a892ad5a478f3ece962d56ac Mon Sep 17 00:00:00 2001
From: m5agent <329351612+m5agent@users.noreply.github.com>
Date: Tue, 1 Dec 2026 20:21:44 +0800
Subject: [PATCH 17/20] Pin the UART and radio workbench batch after the P4
fixes
---
platform/tools/bootstrap_browser_runtime.py | 2 +-
platform/web/public-browser-runtime.js | 2 +-
platform/web/vendor/esp32sim/UPSTREAM.md | 2 +-
platform/web/vendor/esp32sim/source.json | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/platform/tools/bootstrap_browser_runtime.py b/platform/tools/bootstrap_browser_runtime.py
index f6912ce8a..e820de468 100644
--- a/platform/tools/bootstrap_browser_runtime.py
+++ b/platform/tools/bootstrap_browser_runtime.py
@@ -21,7 +21,7 @@
ROOT = Path(__file__).resolve().parents[2]
SOURCE_URL = "https://github.com/m5agent/esp32sim.git"
-SOURCE_COMMIT = "779f93a6adb652d6714fa68e50ae4fca36063f53"
+SOURCE_COMMIT = "d1c930adffaa8d94d03856eb0276df17da668002"
BOARD_PROFILES = json.loads((ROOT / "platform/web/esp32sim-browser-boards.json").read_text())
SOURCE_PROFILES = [
"m5stack-cores3", "m5stack-cores3+dual-kmeter",
diff --git a/platform/web/public-browser-runtime.js b/platform/web/public-browser-runtime.js
index 35ac68253..788763dc5 100644
--- a/platform/web/public-browser-runtime.js
+++ b/platform/web/public-browser-runtime.js
@@ -40,7 +40,7 @@ import { USB_HID_FIRMWARE, usbHidExample } from './public-usb-hid-examples.js';
import { MODBUS_RTU_FIRMWARE, modbusRtuExample } from './public-modbus-rtu.js';
import admittedBoards from './esp32sim-browser-boards.json' with {type:'json'};
-export const ESP32SIM_SOURCE_COMMIT = '779f93a6adb652d6714fa68e50ae4fca36063f53';
+export const ESP32SIM_SOURCE_COMMIT = 'd1c930adffaa8d94d03856eb0276df17da668002';
export const ESP32SIM_LEGACY_COMMIT = '3cd3db3b7202e9fc559328c7247c11134c0437f9';
export const ESP32SIM_DUAL_KMETER_BOARD = 'm5stack-cores3+dual-kmeter';
const CAP_RADIO_KIND = Object.freeze({cc1101:'02',lora1262:'01',lora868:'01',sx1276:'03'});
diff --git a/platform/web/vendor/esp32sim/UPSTREAM.md b/platform/web/vendor/esp32sim/UPSTREAM.md
index 55f869d13..a8958f65e 100644
--- a/platform/web/vendor/esp32sim/UPSTREAM.md
+++ b/platform/web/vendor/esp32sim/UPSTREAM.md
@@ -1,7 +1,7 @@
# esp32sim browser execution glue
The ES modules and MIT license in this directory come from the
-[M5Stack esp32sim fork](https://github.com/m5agent/esp32sim/tree/779f93a6adb652d6714fa68e50ae4fca36063f53).
+[M5Stack esp32sim fork](https://github.com/m5agent/esp32sim/tree/d1c930adffaa8d94d03856eb0276df17da668002).
The browser runtime extends the
[backend completion milestone](https://github.com/m5agent/esp32sim/tree/m5-milestone-backend-complete-20261201).
It includes PaperMono and PaperColor timed PM1 input and PaperColor SPI SD.
diff --git a/platform/web/vendor/esp32sim/source.json b/platform/web/vendor/esp32sim/source.json
index 8a977a592..2b9596d40 100644
--- a/platform/web/vendor/esp32sim/source.json
+++ b/platform/web/vendor/esp32sim/source.json
@@ -2,7 +2,7 @@
"schema_version": 1,
"repository": "https://github.com/m5agent/esp32sim",
"upstream": "https://github.com/mikroverk/esp32sim",
- "commit": "779f93a6adb652d6714fa68e50ae4fca36063f53",
+ "commit": "d1c930adffaa8d94d03856eb0276df17da668002",
"license": "MIT",
"scope": "WASM worker, pacing and block JIT glue only; no firmware or ROM",
"files": {
From 0a67e7d7857de82c5867b05af8f0f131a7546b52 Mon Sep 17 00:00:00 2001
From: m5agent <329351612+m5agent@users.noreply.github.com>
Date: Tue, 1 Dec 2026 21:25:49 +0800
Subject: [PATCH 18/20] Include serial sensor fixtures in the workbench entry
contract
---
platform/tests/test_public_qemu_entry.mjs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/platform/tests/test_public_qemu_entry.mjs b/platform/tests/test_public_qemu_entry.mjs
index 8152ebe31..079a59622 100644
--- a/platform/tests/test_public_qemu_entry.mjs
+++ b/platform/tests/test_public_qemu_entry.mjs
@@ -117,7 +117,7 @@ async function entry({search='',pageUrl=pageRoot,siteServiceUrl='',isolationErro
throw new Error('Unexpected fetch '+url);
};
const dependencies=Object.fromEntries(required.map(name=>[name,()=>{throw new Error(`Unexpected execution boundary ${name}`);} ]));
- Object.assign(dependencies,config,firmware,demoFirmware,uiflowFirmware,cloudStatus,qemuProfiles,qemuFrame,qemuServo,qemuPeerPair,qemuUnitExamples,qrcodeModule,facesModule,envExamples,moduleLlm,miniScales,servos8,capGps,rui3Module,nbiotExamples,mqttUnitExamples,instruments,uartUnits,dofExamples,moduleRadios,gpioExamples,portAUnitExamples,usbModuleExamples,displayUnitExamples,driveModuleExamples,portBUnitExamples,pwmUnitExamples,thermalExamples,cores3SensorExamples,fingerprint2,modbusRtu,networkFixtures,usbHidExamples,audioModule,{
+ Object.assign(dependencies,config,firmware,demoFirmware,uiflowFirmware,cloudStatus,qemuProfiles,qemuFrame,qemuServo,qemuPeerPair,qemuUnitExamples,qrcodeModule,facesModule,envExamples,moduleLlm,miniScales,servos8,capGps,rui3Module,nbiotExamples,mqttUnitExamples,instruments,uartUnits,dofExamples,moduleRadios,gpioExamples,portAUnitExamples,usbModuleExamples,displayUnitExamples,driveModuleExamples,portBUnitExamples,serialSensorExamples,pwmUnitExamples,thermalExamples,cores3SensorExamples,fingerprint2,modbusRtu,networkFixtures,usbHidExamples,audioModule,{
siteRoot:()=>new URL(pageUrl),
ensurePublicIsolation:async()=>{events.push('isolation');if(isolationError)throw isolationError;return isolation;},
PublicMicroPythonRunner,deviceIdentityCapability,GNSS_EXAMPLE_ID,supportsQemuGnssWorkbench,
From 481e587f8c9b458cdf97b2b7c81f6b275dfaeff4 Mon Sep 17 00:00:00 2001
From: m5agent <329351612+m5agent@users.noreply.github.com>
Date: Tue, 1 Dec 2026 21:40:51 +0800
Subject: [PATCH 19/20] Bind the LabelPlus fixture in the editor UI contract
---
platform/tests/test_public_micropython_ui.mjs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/platform/tests/test_public_micropython_ui.mjs b/platform/tests/test_public_micropython_ui.mjs
index f5677523c..e5f4352a8 100644
--- a/platform/tests/test_public_micropython_ui.mjs
+++ b/platform/tests/test_public_micropython_ui.mjs
@@ -5,7 +5,7 @@ import fs from 'node:fs/promises';
import vm from 'node:vm';
import {PublicQemuRuntime} from '../web/public-qemu-runtime.js';
import {PublicMicroPythonRunner} from '../web/public-micropython.js';
-import {MODBUS_TCP_SERVER_EXAMPLE_ID, usesExampleStation, usesTextTcpPeer} from '../web/public-network-fixtures.js';
+import {LABEL_PLUS_EXAMPLE_ID, MODBUS_TCP_SERVER_EXAMPLE_ID, usesExampleStation, usesTextTcpPeer} from '../web/public-network-fixtures.js';
import {DUAL_KMETER_EXAMPLE_ID} from '../web/public-qemu-unit-examples.js';
const source=await fs.readFile(new URL('../web/public.js',import.meta.url),'utf8');
@@ -32,7 +32,7 @@ function fixture(){
const run={kind:'browser',generation:1,controller:runtime};
const state={run,runGeneration:1};
const context={state,$:id=>nodes[id],active:value=>value===state.run&&value.generation===state.runGeneration&&!value.stopping,
- PublicQemuRuntime,PublicMicroPythonRunner,DUAL_KMETER_EXAMPLE_ID,MODBUS_TCP_SERVER_EXAMPLE_ID,usesExampleStation,usesTextTcpPeer,
+ PublicQemuRuntime,PublicMicroPythonRunner,DUAL_KMETER_EXAMPLE_ID,LABEL_PLUS_EXAMPLE_ID,MODBUS_TCP_SERVER_EXAMPLE_ID,usesExampleStation,usesTextTcpPeer,
TextEncoder,Uint8Array,DOMException,
error:error=>{if(error.name!=='AbortError')errors.push(error);}};
vm.createContext(context);vm.runInContext(radio+'\n'+functions+'\n'+serial+'\n'+keyboard,context);
From f8c0a0999649c1d777981dc1b92aace61dc1af3d Mon Sep 17 00:00:00 2001
From: m5agent <329351612+m5agent@users.noreply.github.com>
Date: Tue, 1 Dec 2026 22:53:08 +0800
Subject: [PATCH 20/20] Regenerate the project snapshot for the browser fixture
batch
---
docs/project-snapshot.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/project-snapshot.md b/docs/project-snapshot.md
index a061b1bcd..507688ce3 100644
--- a/docs/project-snapshot.md
+++ b/docs/project-snapshot.md
@@ -155,7 +155,7 @@
## 代码与文档规模
-- `platform/tools`:`105` 个 Python 模块,`63228` 行;规模最大的模块如下。
+- `platform/tools`:`105` 个 Python 模块,`63237` 行;规模最大的模块如下。
| 模块 | 行数 |
| --- | ---: |