@echo off
-call new_version.bat %1
+if "%~1"=="" goto usage
+set "PROJ_DIR=%~dp0project\%~1"
+if not exist "%PROJ_DIR%" goto proj_missing
+if not exist "%PROJ_DIR%\new_version.bat" goto ver_missing
+pushd "%PROJ_DIR%"
+call new_version.bat
+if errorlevel 1 goto popd_fail
+call new.bat
+if errorlevel 1 goto popd_fail
+popd
+call "%~dp0release_copy.bat" "%~1"
+if errorlevel 1 exit /b 1
+exit /b 0
-cd project\%1\
+:popd_fail
+popd
+exit /b 1
-call new.bat %1
+:proj_missing
+echo ERROR: Project directory does not exist: "%PROJ_DIR%"
+echo Expected folder: project\%~1 under the SDK root.
+exit /b 1
+
+:ver_missing
+echo ERROR: Cannot find new_version.bat in the project folder.
+echo Path: "%PROJ_DIR%\new_version.bat"
+echo Create project\%~1\new_version.bat to maintain firmware Version and Build_Time.
+exit /b 1
+
+:usage
+echo ERROR: Missing project name argument.
+echo Usage: new.bat ^<project_dir^>
+echo Example: new.bat K01
+exit /b 1
cd Helios_SDK
helios clean
cd ..
-new.bat %1
+call "%~dp0new.bat" "%~1"
:exit
\ No newline at end of file
+++ /dev/null
-echo Version="V1.0" > project\%1%\sdk\services\microPython\ports\quectel\core\versions.py
-echo Build_Time="%date:~0,4%-%date:~5,2%-%date:~8,2% %time:~0,8%" >> project\%1%\sdk\services\microPython\ports\quectel\core\versions.py
\ No newline at end of file
md images
del images /q
-@GOTO :STEP1
..\..\Helios_SDK\tools\ASR_1606\win32\mklfs.exe -c ext -b 4096 -r 4096 -p 4096 -s 1048576 -i .\images\ext_fs.bin
if errorlevel 1 (
- echo "ext_fs.bin生成失败 !!!!!!!!!!!!!!! "
+ echo ERROR: mklfs failed while building ext_fs.bin
goto exit
)
-if errorlevel 0 (
- echo "ext_fs.bin生成成功 !!!!!!!!!!!!!!! "
-)
-:STEP1
-
..\..\Helios_SDK\tools\ASR_1606\win32\mklfs.exe -c usr -b 4096 -r 4096 -p 4096 -s 696320 -i .\images\customer_fs.bin
if errorlevel 1 (
- echo "customer_fs.bin生成失败 请检查usr目录是否大于316K!!!!!!!!!!!!!!!"
+ echo ERROR: mklfs failed while building customer_fs.bin
+ echo usr may exceed LFS capacity - see mklfs -s on the line above
+ echo Legacy hint: old scripts mentioned ~316K - increase -s or shrink usr
goto exit
)
-if errorlevel 0 (
- echo "customer_fs.bin生成成功 !!!!!!!!!!!!!!! "
-)
-
-%copy font\ext_font.bin images\ext_font.bin%
-
+copy /Y font\ext_font.bin images\ext_font.bin
..\..\Helios_SDK\tools\common\win32\7z\7z a sdk\system\platform\ASR_1606\boards\EG810MCN_GA_VOLTE\images\firmware_base_release_pack.zip .\images\
-if errorlevel 0 (
- echo images压缩成功!!!!!!!!!!!!!!
-)
if errorlevel 1 (
- echo images压缩失败!!!!!!!!!!!!!!!!!!
+ echo ERROR: 7z failed to pack images into firmware_base_release_pack.zip
goto exit
)
xcopy sdk\ ..\..\Helios_SDK\ /e/h/y
cd ..\..\Helios_SDK
helios make services/microPython @EG810MCN_GA_VOLTE EG810MCN_GA_VOLTE
+if errorlevel 1 (
+ echo ERROR: helios build failed - see compiler output above
+ cd ..
+ exit /b 1
+)
cd ..
-:exit
\ No newline at end of file
+exit /b 0
+
+:exit
+exit /b 1
--- /dev/null
+@echo off
+REM FW version (edit FW_VERSION). Build_Time is generated each run.
+set "FW_VERSION=V1.0"
+
+echo Version="%FW_VERSION%" > sdk\services\microPython\ports\quectel\core\versions.py
+echo Build_Time="%date:~0,4%-%date:~5,2%-%date:~8,2% %time:~0,8%" >> sdk\services\microPython\ports\quectel\core\versions.py
md images
del images /q
-@GOTO :STEP1
..\..\Helios_SDK\tools\ASR_1606\win32\mklfs.exe -c ext -b 4096 -r 4096 -p 4096 -s 1048576 -i .\images\ext_fs.bin
if errorlevel 1 (
- echo "ext_fs.bin生成失败 !!!!!!!!!!!!!!! "
+ echo ERROR: mklfs failed while building ext_fs.bin
goto exit
)
-if errorlevel 0 (
- echo "ext_fs.bin生成成功 !!!!!!!!!!!!!!! "
-)
-:STEP1
-
..\..\Helios_SDK\tools\ASR_1606\win32\mklfs.exe -c usr -b 4096 -r 4096 -p 4096 -s 589824 -i .\images\customer_fs.bin
if errorlevel 1 (
- echo "customer_fs.bin生成失败 请检查usr目录是否大于316K!!!!!!!!!!!!!!!"
+ echo ERROR: mklfs failed while building customer_fs.bin
+ echo usr may exceed LFS capacity - see mklfs -s on the line above
+ echo Legacy hint: old scripts mentioned ~316K - increase -s or shrink usr
goto exit
)
-if errorlevel 0 (
- echo "customer_fs.bin生成成功 !!!!!!!!!!!!!!! "
-)
-
-%copy font\ext_font.bin images\ext_font.bin%
-
+copy /Y font\ext_font.bin images\ext_font.bin
..\..\Helios_SDK\tools\common\win32\7z\7z a sdk\system\platform\ASR_1606\boards\EG810MCN_GA_VOLTE\images\firmware_base_release_pack.zip .\images\
-if errorlevel 0 (
- echo images压缩成功!!!!!!!!!!!!!!
-)
if errorlevel 1 (
- echo images压缩失败!!!!!!!!!!!!!!!!!!
+ echo ERROR: 7z failed to pack images into firmware_base_release_pack.zip
goto exit
)
xcopy sdk\ ..\..\Helios_SDK\ /e/h/y
cd ..\..\Helios_SDK
helios make services/microPython @EG810MCN_GA_VOLTE EG810MCN_GA_VOLTE
+if errorlevel 1 (
+ echo ERROR: helios build failed - see compiler output above
+ cd ..
+ exit /b 1
+)
cd ..
-:exit
\ No newline at end of file
+exit /b 0
+
+:exit
+exit /b 1
--- /dev/null
+@echo off
+REM FW version (edit FW_VERSION). Build_Time is generated each run.
+set "FW_VERSION=V1.0"
+
+echo Version="%FW_VERSION%" > sdk\services\microPython\ports\quectel\core\versions.py
+echo Build_Time="%date:~0,4%-%date:~5,2%-%date:~8,2% %time:~0,8%" >> sdk\services\microPython\ports\quectel\core\versions.py
--- /dev/null
+@echo off
+setlocal EnableDelayedExpansion
+REM Copy Helios_SDK\opt\release\<board>\ to release\<proj>_<ver>_<time>\
+REM Usage: release_copy.bat <project_dir>
+
+set "SDKROOT=%~dp0"
+set "PROJ=%~1"
+if "%PROJ%"=="" goto rc_err_proj
+
+set "VFILE=%SDKROOT%project\%PROJ%\sdk\services\microPython\ports\quectel\core\versions.py"
+if not exist "%VFILE%" goto rc_err_ver
+
+if not exist "%SDKROOT%Helios_SDK\opt\tmp\build_sucess.tmp" goto rc_skip
+
+set "FW_VER=UNKNOWN"
+for /f "usebackq tokens=2 delims==" %%a in (`findstr /b /c:"Version=" "%VFILE%"`) do (
+ set "FW_VER=%%a"
+ goto v_done
+)
+:v_done
+set "FW_VER=!FW_VER:"=!"
+set "FW_VER=!FW_VER: =!"
+
+set "FW_BT=unknown"
+for /f "usebackq tokens=2 delims==" %%a in (`findstr /b /c:"Build_Time=" "%VFILE%"`) do (
+ set "FW_BT=%%a"
+ goto t_done
+)
+:t_done
+set "FW_BT=!FW_BT:"=!"
+REM Trim leading/trailing spaces so " =_!" does not turn a trailing space into "_"
+:trim_bt_lead
+if "!FW_BT:~0,1!"==" " set "FW_BT=!FW_BT:~1!" & goto trim_bt_lead
+:trim_bt_trail
+if "!FW_BT:~-1!"==" " set "FW_BT=!FW_BT:~0,-1!" & goto trim_bt_trail
+if "!FW_BT!"=="" set "FW_BT=unknown"
+set "FW_BT=!FW_BT: =_!"
+set "FW_BT=!FW_BT::=-!"
+:trim_bt_us
+if "!FW_BT:~-1!"=="_" set "FW_BT=!FW_BT:~0,-1!" & goto trim_bt_us
+
+set /p FW_NAME=<"%SDKROOT%Helios_SDK\opt\tmp\fw_name_record.tmp"
+set "FW_NAME=!FW_NAME: =!"
+if "!FW_NAME!"=="" set "FW_NAME=EG810MCN_GA_VOLTE"
+
+set "REL_SRC=!SDKROOT!Helios_SDK\opt\release\!FW_NAME!"
+if not exist "!REL_SRC!" goto rc_err_rel
+
+set "REL_DST=%SDKROOT%release\%PROJ%_!FW_VER!_!FW_BT!"
+:trim_dst_us
+if "!REL_DST:~-1!"=="_" set "REL_DST=!REL_DST:~0,-1!" & goto trim_dst_us
+mkdir "!REL_DST!" 2>nul
+echo [release] Copying build output to snapshot folder:
+echo !REL_DST!
+xcopy "!REL_SRC!" "!REL_DST!" /E /I /Y /Q
+if errorlevel 1 goto rc_err_copy
+echo [release] Done. All files from "!REL_SRC!" were copied.
+exit /b 0
+
+:rc_skip
+echo [release] Skipped: Helios_SDK\opt\tmp\build_sucess.tmp was not found.
+echo The build may have failed or did not finish; no files were copied to release\.
+exit /b 0
+
+:rc_err_proj
+echo [release] ERROR: No project directory name was passed.
+echo Usage: release_copy.bat ^<project_dir^> Example: release_copy.bat K01
+exit /b 1
+
+:rc_err_ver
+echo [release] ERROR: versions.py is missing. Run new_version.bat in the project first.
+echo Expected file: %VFILE%
+exit /b 1
+
+:rc_err_rel
+echo [release] ERROR: SDK release output folder does not exist:
+echo !REL_SRC!
+echo Check fw_name_record.tmp and that the Helios build produced opt\release\^<board^>.
+exit /b 1
+
+:rc_err_copy
+echo [release] ERROR: xcopy failed while copying to the release snapshot.
+echo Check free disk space, path length, and file locks.
+exit /b 1
--- /dev/null
+release/**
\ No newline at end of file
@echo off
-call new_version.bat %1
+if "%~1"=="" goto usage
+set "PROJ_DIR=%~dp0project\%~1"
+if not exist "%PROJ_DIR%" goto proj_missing
+if not exist "%PROJ_DIR%\new_version.bat" goto ver_missing
+pushd "%PROJ_DIR%"
+call new_version.bat
+if errorlevel 1 goto popd_fail
+call new.bat
+if errorlevel 1 goto popd_fail
+popd
+call "%~dp0release_copy.bat" "%~1"
+if errorlevel 1 exit /b 1
+exit /b 0
-cd project\%1\
+:popd_fail
+popd
+exit /b 1
-call new.bat %1
+:proj_missing
+echo ERROR: Project directory does not exist: "%PROJ_DIR%"
+echo Expected folder: project\%~1 under the SDK root.
+exit /b 1
+
+:ver_missing
+echo ERROR: Cannot find new_version.bat in the project folder.
+echo Path: "%PROJ_DIR%\new_version.bat"
+echo Create project\%~1\new_version.bat to maintain firmware Version and Build_Time.
+exit /b 1
+
+:usage
+echo ERROR: Missing project name argument.
+echo Usage: new.bat ^<project_dir^>
+echo Example: new.bat 7PIN_1_5
+exit /b 1
cd Helios_SDK
helios clean
cd ..
-new.bat %1
+call "%~dp0new.bat" "%~1"
:exit
\ No newline at end of file
+++ /dev/null
-echo Version="V1.0" > project\%1%\sdk\services\microPython\ports\quectel\core\versions.py
-echo Build_Time="%date:~0,4%-%date:~5,2%-%date:~8,2% %time:~0,8%" >> project\%1%\sdk\services\microPython\ports\quectel\core\versions.py
\ No newline at end of file
md images
del images /q
-@GOTO :STEP1
..\..\Helios_SDK\tools\ASR_1606\win32\mklfs.exe -c ext -b 4096 -r 4096 -p 4096 -s 1048576 -i .\images\ext_fs.bin
if errorlevel 1 (
- echo "ext_fs.bin����ʧ�� !!!!!!!!!!!!!!! "
+ echo ERROR: mklfs failed while building ext_fs.bin
goto exit
)
-if errorlevel 0 (
- echo "ext_fs.bin���ɳɹ� !!!!!!!!!!!!!!! "
-)
-:STEP1
-
..\..\Helios_SDK\tools\ASR_1606\win32\mklfs.exe -c usr -b 4096 -r 4096 -p 4096 -s 1376256 -i .\images\customer_fs.bin
if errorlevel 1 (
- echo "customer_fs.bin����ʧ�� ����usrĿ¼�Ƿ����316K!!!!!!!!!!!!!!!"
+ echo ERROR: mklfs failed while building customer_fs.bin
+ echo usr may exceed LFS capacity - see mklfs -s on the line above
+ echo Legacy hint: old scripts mentioned ~316K - increase -s or shrink usr
goto exit
)
-if errorlevel 0 (
- echo "customer_fs.bin���ɳɹ� !!!!!!!!!!!!!!! "
-)
-
-%copy font\ext_font.bin images\ext_font.bin%
-
+copy /Y font\ext_font.bin images\ext_font.bin
..\..\Helios_SDK\tools\common\win32\7z\7z a sdk\system\platform\ASR_1606\boards\EG810MCN_GA_VOLTE\images\firmware_base_release_pack.zip .\images\
-if errorlevel 0 (
- echo imagesѹ���ɹ�!!!!!!!!!!!!!!
-)
if errorlevel 1 (
- echo imagesѹ��ʧ��!!!!!!!!!!!!!!!!!!
+ echo ERROR: 7z failed to pack images into firmware_base_release_pack.zip
goto exit
)
xcopy sdk\ ..\..\Helios_SDK\ /e/h/y
cd ..\..\Helios_SDK
helios make services/microPython @EG810MCN_GA_VOLTE EG810MCN_GA_VOLTE
+if errorlevel 1 (
+ echo ERROR: helios build failed - see compiler output above
+ cd ..
+ exit /b 1
+)
cd ..
-:exit
\ No newline at end of file
+exit /b 0
+
+:exit
+exit /b 1
--- /dev/null
+@echo off
+REM FW version (edit FW_VERSION). Build_Time is generated each run.
+set "FW_VERSION=V1.0"
+
+echo Version="%FW_VERSION%" > sdk\services\microPython\ports\quectel\core\versions.py
+echo Build_Time="%date:~0,4%-%date:~5,2%-%date:~8,2% %time:~0,8%" >> sdk\services\microPython\ports\quectel\core\versions.py
@echo off\r
md images\r
del images /q\r
-@GOTO :STEP1\r
..\..\Helios_SDK\tools\ASR_1606\win32\mklfs.exe -c ext -b 4096 -r 4096 -p 4096 -s 1048576 -i .\images\ext_fs.bin\r
if errorlevel 1 (\r
- echo "ext_fs.bin生成失败 !!!!!!!!!!!!!!! "\r
+ echo ERROR: mklfs failed while building ext_fs.bin\r
goto exit\r
)\r
-if errorlevel 0 (\r
- echo "ext_fs.bin生成成功 !!!!!!!!!!!!!!! "\r
-)\r
-:STEP1\r
-\r
..\..\Helios_SDK\tools\ASR_1606\win32\mklfs.exe -c usr -b 4096 -r 4096 -p 4096 -s 1376256 -i .\images\customer_fs.bin\r
if errorlevel 1 (\r
- echo "customer_fs.bin生成失败 请检查usr目录是否大于316K!!!!!!!!!!!!!!!"\r
+ echo ERROR: mklfs failed while building customer_fs.bin\r
+ echo usr may exceed LFS capacity - see mklfs -s on the line above\r
+ echo Legacy hint: old scripts mentioned ~316K - increase -s or shrink usr\r
goto exit\r
)\r
-if errorlevel 0 (\r
- echo "customer_fs.bin生成成功 !!!!!!!!!!!!!!! "\r
-)\r
-\r
-%copy font\ext_font.bin images\ext_font.bin%\r
-\r
+copy /Y font\ext_font.bin images\ext_font.bin\r
..\..\Helios_SDK\tools\common\win32\7z\7z a sdk\system\platform\ASR_1606\boards\EG810MCN_GA_VOLTE\images\firmware_base_release_pack.zip .\images\\r
-if errorlevel 0 (\r
- echo images压缩成功!!!!!!!!!!!!!!\r
-)\r
if errorlevel 1 (\r
- echo images压缩失败!!!!!!!!!!!!!!!!!!\r
+ echo ERROR: 7z failed to pack images into firmware_base_release_pack.zip\r
goto exit\r
)\r
xcopy sdk\ ..\..\Helios_SDK\ /e/h/y\r
cd ..\..\Helios_SDK\r
helios.exe make services/microPython @EG810MCN_GA_VOLTE EG810MCN_GA_VOLTE\r
+if errorlevel 1 (\r
+ echo ERROR: helios build failed - see compiler output above\r
+ cd ..\r
+ exit /b 1\r
+)\r
cd ..\r
-:exit
\ No newline at end of file
+exit /b 0\r
+\r
+:exit\r
+exit /b 1\r
--- /dev/null
+@echo off
+REM FW version (edit FW_VERSION). Build_Time is generated each run.
+set "FW_VERSION=V1.1"
+
+echo Version="%FW_VERSION%" > sdk\services\microPython\ports\quectel\core\versions.py
+echo Build_Time="%date:~0,4%-%date:~5,2%-%date:~8,2% %time:~0,8%" >> sdk\services\microPython\ports\quectel\core\versions.py
print("dev_NTP1")
url =None
if dev_type == "7PIN_BK_EU":#英文小瑞
- url = "http://dmp-global.raisound.com/bz-api/dev/time"
+ url = constants.DMP_GLOBAL_BASE + "/dev/time"
else:
- url = "https://dmp-api.qipai.com/qp-dmp-api/dev/time"
- # url = "https://dmp-dev.raisound.com/dmp-api/dev/time"
+ url = constants.DMP_CN_BASE + "/dev/time"
response = request.get(url,timeout=5)
data = response.json()
print("dev_NTP:{}".format(data))
headers_T ={"Content-Type":"application/json"}
url =None
if dev_type == "7PIN_BK_EU":#英文小瑞
- url = "http://dmp-global.raisound.com/bz-api/dev/auth/active"
+ url = constants.DMP_GLOBAL_BASE + "/dev/auth/active"
else:
- url = "https://dmp-api.qipai.com/qp-dmp-api/dev/auth/active"
- # url = "https://dmp-dev.raisound.com/dmp-api/dev/auth/active"
+ url = constants.DMP_CN_BASE + "/dev/auth/active"
data =ujson.dumps(data)
response = None
response_result = 0
print(ujson.dumps(sign_in_data))
sign_url =None
if dev_type == "7PIN_BK_EU":#英文小瑞
- sign_url = "http://dmp-global.raisound.com/bz-api/dev/auth/sign_in" #登入地址
+ sign_url = constants.DMP_GLOBAL_BASE + "/dev/auth/sign_in"
else:
- sign_url = "https://dmp-api.qipai.com/qp-dmp-api/dev/auth/sign_in"
- # sign_url = "https://dmp-dev.raisound.com/dmp-api/dev/auth/sign_in" #登入地址
+ sign_url = constants.DMP_CN_BASE + "/dev/auth/sign_in"
#获取验证码
#url = "http://dmp.qipai.com.cn:30461/dev/device/bind-code/860132066060377"
# token = EventMesh.publish("get_dev_token")
token = EventMesh.publish("get_dev_token")
headers_T = None
if token:
- headers_T = {"qp-dt":"{}".format(token)}
- #http://dmp.raisound.com/bz-api/dev/iccid?deviceId=866610001099679&iccid=89860002192307889057
+ headers_T = {constants.ICCID_HEADER_POST_USER: "{}".format(token)}
url =None
if dev_type == "7PIN_BK_EU":#英文小瑞
- url = "http://dmp-global.raisound.com/bz-api/dev/iccid?deviceId={}&iccid={}".format(modem.getDevImei(),iccid)
+ url = (constants.DMP_GLOBAL_BASE + "/dev/iccid?deviceId={}&iccid={}").format(modem.getDevImei(),iccid)
else:
- url = "https://dmp-api.qipai.com/qp-dmp-api/dev/iccid?deviceId={}&iccid={}".format(modem.getDevImei(),iccid)
- # url = "https://dmp-dev.raisound.com/dmp-api/dev/iccid?deviceId={}&iccid={}".format(modem.getDevImei(),iccid) #北科地址
+ url = (constants.DMP_CN_BASE + "/dev/iccid?deviceId={}&iccid={}").format(modem.getDevImei(),iccid)
print("{} H:{}".format(url,headers_T))
response = request.post(url,headers = headers_T)
if response.status_code == 200:
EventMesh.publish("dev_sign_in")
dev_tokenip =None
if dev_type == "7PIN_BK_EU":#英文小瑞
- dev_tokenip = "http://dmp-global.raisound.com/bz-api/dev/auth/token" #设备新令牌更新地址
+ dev_tokenip = constants.DMP_GLOBAL_BASE + "/dev/auth/token"
else:
- dev_tokenip = "https://dmp-api.qipai.com/qp-dmp-api/dev/auth/token"
- # dev_tokenip = "https://dmp-dev.raisound.com/dmp-api/dev/auth/token" #设备新令牌更新地址
+ dev_tokenip = constants.DMP_CN_BASE + "/dev/auth/token"
token = self.dev_token
if token == None:
print("bt_versions:{}".format(bt_versions))
#url = "http://iot.api.thisiot.com/ota/task?deviceId=860132060348836&sourceVersion=2024-12-20-15:35-1"
url =None
- # if dev_type == "7PIN_BK_EU":#英文小瑞
- # url = "http://dmp-global.raisound.com/bz-api/ota/task?deviceId={}&sourceVersion={}".format(modem.getDevImei(),sourceVersion)
- # if dev_type == "7PIN" or dev_type == "7PIN_coze":#柒牌
- # url = "http://ota.qipai.com/bz-cmp-api/api/task?deviceId={}&sourceVersion={}".format(modem.getDevImei(),sourceVersion)
- # else:
- url = "https://dmp-api.qipai.com/qp-dmp-api/ota/task?deviceId={}&sourceVersion={}".format(modem.getDevImei(),sourceVersion)
+ url = (constants.DMP_CN_BASE + "/ota/task?deviceId={}&sourceVersion={}").format(modem.getDevImei(),sourceVersion)
print(url)
response = request.get(url,timeout=5)
if response.status_code == 200:
print("sourceVersion2:{}".format(sourceVersion))
#url = "http://iot.api.thisiot.com/ota/task?deviceId=860132060348836&sourceVersion=2024-12-20-15:35-1"
url =None
- # if dev_type == "7PIN_BK_EU":#英文小瑞
- # url = "http://dmp-global.raisound.com/bz-api/ota/task?deviceId={}&sourceVersion={}".format(modem.getDevImei(),sourceVersion)
- # if dev_type == "7PIN" or dev_type == "7PIN_coze":#柒牌
- # url = "http://ota.qipai.com/bz-cmp-api/api/task?deviceId={}&sourceVersion={}".format(modem.getDevImei(),sourceVersion)
- # else:
- url = "https://dmp-api.qipai.com/qp-dmp-api/ota/task?deviceId={}&sourceVersion={}".format(modem.getDevImei(),sourceVersion)
+ url = (constants.DMP_CN_BASE + "/ota/task?deviceId={}&sourceVersion={}").format(modem.getDevImei(),sourceVersion)
print(url)
response = request.get(url,timeout=5)
if response.status_code == 200:
print("currentVersion2:{}".format(currentVersion))
url =None
if dev_type == "7PIN_BK_EU":#英文小瑞
- url = "http://dmp-global.raisound.com/bz-api/ota/result?deviceId={}¤tVersion={}".format(modem.getDevImei(),currentVersion)
- # if dev_type == "7PIN" or dev_type == "7PIN_1_5" or dev_type == "7PIN_coze":#柒牌
- # url = "http://ota.qipai.com/bz-cmp-api/api/result?deviceId={}¤tVersion={}".format(modem.getDevImei(),currentVersion)
- # else:
- url = "https://dmp-api.qipai.com/qp-dmp-api/ota/result?deviceId={}¤tVersion={}".format(modem.getDevImei(),currentVersion)
+ url = (constants.DMP_GLOBAL_BASE + "/ota/result?deviceId={}¤tVersion={}").format(modem.getDevImei(),currentVersion)
+ else:
+ url = (constants.DMP_CN_BASE + "/ota/result?deviceId={}¤tVersion={}").format(modem.getDevImei(),currentVersion)
print(url)
response = request.post(url,timeout=5)
if response.status_code == 200:
token = EventMesh.publish("get_dev_token")
headers_T = None
if token:
- headers_T = {"bz-dt":"{}".format(token)}
- #http://dmp.raisound.com/bz-api/dev/iccid?deviceId=866610001099679&iccid=89860002192307889057
+ # 与 post_iccid_user 使用同一头域,避免 qp-dmp-api 误用 bz-dt 导致 50001
+ headers_T = {constants.ICCID_HEADER_POST_USER: "{}".format(token)}
url =None
if dev_type == "7PIN_BK_EU":#英文小瑞
- url = "http://dmp-global.raisound.com/bz-api/dev/iccid?deviceId={}&iccid={}".format(modem.getDevImei(),iccid)
+ url = (constants.DMP_GLOBAL_BASE + "/dev/iccid?deviceId={}&iccid={}").format(modem.getDevImei(),iccid)
else:
- url = "https://dmp-api.qipai.com/qp-dmp-api/dev/iccid?deviceId={}&iccid={}".format(modem.getDevImei(),iccid)
- # url = "http://dmp.raisound.com/bz-api/dev/iccid?deviceId={}&iccid={}".format(modem.getDevImei(),iccid) #北科地址
+ url = (constants.DMP_CN_BASE + "/dev/iccid?deviceId={}&iccid={}").format(modem.getDevImei(),iccid)
print("{} H:{}".format(url,headers_T))
response = request.post(url,headers = headers_T,timeout=5)
if response.status_code == 200:
elif self.VC_server == 7:#
self.server_ip="118.145.158.207:22080"
elif self.VC_server == 8:#
- self.server_ip="115.190.94.208:22080"
+ self.server_ip=constants.AMP_G10
elif self.VC_server == 86:#
self.server_ip="118.145.158.207:22086"
else:
#self.server_ip="115.190.94.208:22080"
self.server_ip="118.145.158.207:22086"
elif dev_type == "7PIN" or dev_type == "7PIN_1_5":
- #self.server_ip="sevenpin.qipai.com.cn"
- # self.server_ip="220.160.104.34"
- # self.server_ip="118.145.158.207:22080"
- # self.server_ip="amp-dev-global.raisound.com:22080"
- # self.server_ip="118.145.158.207:22080/22087"
- #self.server_ip="ai.qipai.com"
- self.server_ip="dmp-api.qipai.com/qp-amp-api"
- #self.server_ip="sevenpin1.qipai.com.cn:22082"
+ self.server_ip=constants.AMP_7PIN
elif dev_type == "G10":
- self.server_ip="115.190.94.208:22080"
+ self.server_ip=constants.AMP_G10
elif dev_type == "sjgq":
self.server_ip="118.145.158.207:22084"
elif dev_type == "7PIN_BK" or dev_type == 'csh'or dev_type == "7PIN_BK_coze"or dev_type == 'momo':
try:
url=None
if dev_type == "7PIN_BK_EU":#英文小瑞
- url = "http://dmp-global.raisound.com/bz-api/dev/config/{}".format(modem.getDevImei())
+ url = (constants.DMP_GLOBAL_BASE + "/dev/config/{}").format(modem.getDevImei())
elif dev_type == "7PIN" or dev_type == "7PIN_1_5" or dev_type == "7PIN_coze":#柒牌
- url = "http://ota.qipai.com/bz-cmp-api/api/config/{}".format(modem.getDevImei())
+ url = (constants.CONFIG_URL_7PIN + "/{}").format(modem.getDevImei())
else:
- url = "https://qipai-dev.dobell.top/qp-dmp-api/dev/config/{}".format(modem.getDevImei())
+ url = (constants.CONFIG_URL_OTHER + "/{}").format(modem.getDevImei())
print(url)
"bot_option": {
"use_workflow": True,
#"input_format": "text",
- "bot_id":"7462617881076351002",#语言助手
- "workflow_id":"7462621757327196187",
+ # "bot_id":"7462617881076351002",#语言助手
+ # "workflow_id":"7462621757327196187",
}
}
print("outbound_attributess_provider是VC_TTS_voice_type里的:{}".format(self.VC_TTS_voice_type[self.VC_TTS_voice_key]["outbound_attributess_provider"]))
if dev_type == "7PIN_BK"or dev_type == "7PIN_BK_coze"or dev_type == "G10":#小瑞
- json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["bot_id"]="7411071327182438412"#语言助手
- json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["workflow_id"]="7468577560454496295"
+ # json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["bot_id"]="7411071327182438412"#语言助手
+ # json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["workflow_id"]="7468577560454496295"
json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["use_workflow"]=True
# json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["bot_id"]="7486697248416989193"#极简
# json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["workflow_id"]="7486698347416649778"
keywords.append(key)
json_data["payload"]["inbound_attributes"]["cfg"]["keywords"] = keywords
elif dev_type == "7PIN_BK_EU":
- json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["bot_id"]="7493368740600446995"#英文
- json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["workflow_id"]="7493369551587213323"
+ # json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["bot_id"]="7493368740600446995"#英文
+ # json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["workflow_id"]="7493369551587213323"
+ json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["use_workflow"]=True
elif dev_type == "csh":
json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["bot_id"]="7490852493640384538"#慈善会
json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["use_workflow"]=False
elif dev_type == "7PIN" or dev_type == "7PIN_1_5" :#柒牌
# json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["bot_id"]="7550138354483298347"#
# json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["workflow_id"]="7549142130376671267"
- json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["bot_id"]="7411071327182438412"
- json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["workflow_id"]="7601036330500669467"
+ # json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["bot_id"]="7411071327182438412"
+ # json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["workflow_id"]="7601036330500669467"
+ json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["use_workflow"]=True
#json_data["payload"]["inbound_attributes"]["vad_silence"] = 1000
elif dev_type == "7PIN_coze":
- json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["bot_id"]="7550138354483298347"#
- json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["workflow_id"]="7549142130376671267"
+ # json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["bot_id"]="7550138354483298347"#
+ # json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["workflow_id"]="7549142130376671267"
+ json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["use_workflow"]=True
json_data["payload"]["dialog_attributes"]["provider"]="qipai"
#
elif dev_type == 'momo':#食梦貘
keywords.append(key)
json_data["payload"]["inbound_attributes"]["cfg"]["keywords"] = keywords
elif dev_type == 'sjgq':#四季甘泉
- json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["bot_id"]="7472201279826690111"
- json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["workflow_id"]="472203898494500914"
+ # json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["bot_id"]="7472201279826690111"
+ # json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["workflow_id"]="472203898494500914"
+ json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["use_workflow"]=True
pass
elif dev_type == 'szbst':#深圳百事通
- json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["bot_id"]="7469964258592931852"
- json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["workflow_id"]="7469968083063603241"
+ # json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["bot_id"]="7469964258592931852"
+ # json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["workflow_id"]="7469968083063603241"
+ json_data["payload"]["dialog_attributes"]["cfg"]["bot_option"]["use_workflow"]=True
elif dev_type == 'jswm' or dev_type == 'jswm_BOX':#金三完美
#json_data["payload"]["device_id"]= "WangQunTestID"
if self.VC_TTS_voice_type[self.VC_TTS_voice_key]["bot_id"] !="":
CALLCANCEL_RECV = "CALLCANCEL_RECV"
+# ---------------------------------------------------------------------------
+# 服务器地址集中配置:只改 SERVER_ENV 切换整组(与代码中生效地址、注释备选一致)
+#
+# qipai — 当前默认:dmp-api.qipai.com(REST)+ 柒牌 IoT WSS
+# raisound_dev— 注释「北科测试」:dmp-dev.raisound.com(HTTPS)+ 对应 IoT WSS
+# beike_bz — 注释「北科地址」:http://dmp.raisound.com/bz-api + wsiot-nocdn WS
+# kxc — 科学城 demo:kxc 域名(bz-api / amp / iot-api)
+# ---------------------------------------------------------------------------
+SERVER_ENV = "qipai"
+
+_SERVER_CFG = {
+ "qipai": {
+ "dmp_cn_base": "https://dmp-api.qipai.com/qp-dmp-api",
+ "iot_ws_url": "wss://dmp-api.qipai.com/qp-iot-api/ws-hub/dev/v1",
+ "iot_token_query": "qp-dt",
+ "iccid_header_post_user": "qp-dt",
+ "amp_7pin": "115.190.94.208:22080",
+ "amp_g10": "115.190.94.208:22080",
+ "config_7pin": "http://ota.qipai.com/bz-cmp-api/api/config",
+ "config_other": "https://qipai-dev.dobell.top/qp-dmp-api/dev/config",
+ },
+ "raisound_dev": {
+ "dmp_cn_base": "https://dmp-dev.raisound.com/dmp-api",
+ "iot_ws_url": "wss://dmp-dev.raisound.com/iot-api/ws-hub/dev/v1",
+ "iot_token_query": "bz-dt",
+ "iccid_header_post_user": "bz-dt",
+ "amp_7pin": "115.190.94.208:22080",
+ "amp_g10": "115.190.94.208:22080",
+ "config_7pin": "http://ota.qipai.com/bz-cmp-api/api/config",
+ "config_other": "http://dmp-dev.raisound.com/dmp-api/dev/config",
+ },
+ "beike_bz": {
+ "dmp_cn_base": "http://dmp.raisound.com/bz-api",
+ "iot_ws_url": "ws://wsiot-nocdn.raisound.com/ws-hub/dev/v1",
+ "iot_token_query": "bz-dt",
+ "iccid_header_post_user": "bz-dt",
+ "amp_7pin": "115.190.94.208:22080",
+ "amp_g10": "115.190.94.208:22080",
+ "config_7pin": "http://ota.qipai.com/bz-cmp-api/api/config",
+ "config_other": "https://qipai-dev.dobell.top/qp-dmp-api/dev/config",
+ },
+ "kxc": {
+ "dmp_cn_base": "http://kxc.raisound.com/bz-api",
+ "iot_ws_url": "ws://kxc.raisound.com/iot-api/ws-hub/dev/v1",
+ "iot_token_query": "bz-dt",
+ "iccid_header_post_user": "bz-dt",
+ "amp_7pin": "kxc.raisound.com/amp-api",
+ "amp_g10": "115.190.94.208:22080",
+ "config_7pin": "http://ota.qipai.com/bz-cmp-api/api/config",
+ "config_other": "https://qipai-dev.dobell.top/qp-dmp-api/dev/config",
+ },
+}
+
+_S = _SERVER_CFG[SERVER_ENV]
+DMP_CN_BASE = _S["dmp_cn_base"]
+DMP_GLOBAL_BASE = "http://dmp-global.raisound.com/bz-api"
+IOT_WS_URL = _S["iot_ws_url"]
+IOT_WS_TOKEN_QUERY = _S["iot_token_query"]
+ICCID_HEADER_POST_USER = _S["iccid_header_post_user"]
+AMP_7PIN = _S["amp_7pin"]
+AMP_G10 = _S["amp_g10"]
+CONFIG_URL_7PIN = _S["config_7pin"]
+CONFIG_URL_OTHER = _S["config_other"]
+
+
class EVENT:
CHANNEL_SOCKET_SEND = "CHANNEL_SOCKET_SEND"
START_LOCATION = "START_LOCATION"
try:
if token != None:
self.connect_web_timer_count = 0
- url_t = "wss://dmp-api.qipai.com/qp-iot-api/ws-hub/dev/v1?qp-dt={}".format(token)#柒牌测试
- # url_t = "wss://dmp-dev.raisound.com/iot-api/ws-hub/dev/v1?bz-dt={}".format(token)#北科测试
+ url_t = "{}?{}={}".format(constants.IOT_WS_URL, constants.IOT_WS_TOKEN_QUERY, token)
try:
self.iot_protocol_client=uwebsocket.Client.connect(url_t, debug=True)
self.reconnect_count=0
-Version="V1.0" \r
-Build_Time="2025-12-22 17:33:47" \r
+Version="V1.1" \r
+Build_Time="2026-04-20 18:27:50" \r
md images
del images /q
-@GOTO :STEP1
..\..\Helios_SDK\tools\ASR_1606\win32\mklfs.exe -c ext -b 4096 -r 4096 -p 4096 -s 1048576 -i .\images\ext_fs.bin
if errorlevel 1 (
- echo "ext_fs.bin生成失败 !!!!!!!!!!!!!!! "
+ echo ERROR: mklfs failed while building ext_fs.bin
goto exit
)
-if errorlevel 0 (
- echo "ext_fs.bin生成成功 !!!!!!!!!!!!!!! "
-)
-:STEP1
-
..\..\Helios_SDK\tools\ASR_1606\win32\mklfs.exe -c usr -b 4096 -r 4096 -p 4096 -s 696320 -i .\images\customer_fs.bin
if errorlevel 1 (
- echo "customer_fs.bin生成失败 请检查usr目录是否大于316K!!!!!!!!!!!!!!!"
+ echo ERROR: mklfs failed while building customer_fs.bin
+ echo usr may exceed LFS capacity - see mklfs -s on the line above
+ echo Legacy hint: old scripts mentioned ~316K - increase -s or shrink usr
goto exit
)
-if errorlevel 0 (
- echo "customer_fs.bin生成成功 !!!!!!!!!!!!!!! "
-)
-
-%copy font\ext_font.bin images\ext_font.bin%
-
+copy /Y font\ext_font.bin images\ext_font.bin
..\..\Helios_SDK\tools\common\win32\7z\7z a sdk\system\platform\ASR_1606\boards\EG810MCN_GA_VOLTE\images\firmware_base_release_pack.zip .\images\
-if errorlevel 0 (
- echo images压缩成功!!!!!!!!!!!!!!
-)
if errorlevel 1 (
- echo images压缩失败!!!!!!!!!!!!!!!!!!
+ echo ERROR: 7z failed to pack images into firmware_base_release_pack.zip
goto exit
)
xcopy sdk\ ..\..\Helios_SDK\ /e/h/y
cd ..\..\Helios_SDK
helios make services/microPython @EG810MCN_GA_VOLTE EG810MCN_GA_VOLTE
+if errorlevel 1 (
+ echo ERROR: helios build failed - see compiler output above
+ cd ..
+ exit /b 1
+)
cd ..
-:exit
\ No newline at end of file
+exit /b 0
+
+:exit
+exit /b 1
--- /dev/null
+@echo off
+REM FW version (edit FW_VERSION). Build_Time is generated each run.
+set "FW_VERSION=V1.0"
+
+echo Version="%FW_VERSION%" > sdk\services\microPython\ports\quectel\core\versions.py
+echo Build_Time="%date:~0,4%-%date:~5,2%-%date:~8,2% %time:~0,8%" >> sdk\services\microPython\ports\quectel\core\versions.py
del images /q
..\..\Helios_SDK\tools\ASR_1606\win32\mklfs.exe -c ext -b 4096 -r 4096 -p 4096 -s 1363148 -i .\images\ext_fs.bin
if errorlevel 1 (
- echo "ext_fs.bin??????? !!!!!!!!!!!!!!! "
+ echo ERROR: mklfs failed while building ext_fs.bin
goto exit
)
-if errorlevel 0 (
- echo "ext_fs.bin?????? !!!!!!!!!!!!!!! "
-)
-
..\..\Helios_SDK\tools\ASR_1606\win32\mklfs.exe -c usr -b 4096 -r 4096 -p 4096 -s 491520 -i .\images\customer_fs.bin
if errorlevel 1 (
- echo "customer_fs.bin??????? ????usr????????316K!!!!!!!!!!!!!!!"
+ echo ERROR: mklfs failed while building customer_fs.bin
+ echo usr may exceed LFS capacity - see mklfs -s on the line above
+ echo Legacy hint: old scripts mentioned ~316K - increase -s or shrink usr
goto exit
)
-if errorlevel 0 (
- echo "customer_fs.bin?????? !!!!!!!!!!!!!!! "
-)
-
copy font\ext_font.bin images\ext_font.bin
-
..\..\Helios_SDK\tools\common\win32\7z\7z a sdk\system\platform\ASR_1606\boards\EG810MCN_GA_VOLTE\images\firmware_base_release_pack.zip .\images\
-if errorlevel 0 (
- echo images??????!!!!!!!!!!!!!!
-)
if errorlevel 1 (
- echo images??????!!!!!!!!!!!!!!!!!!
+ echo ERROR: 7z failed to pack images into firmware_base_release_pack.zip
goto exit
)
xcopy sdk\ ..\..\Helios_SDK\ /e/h/y
cd ..\..\Helios_SDK
helios make services/microPython @EG810MCN_GA_VOLTE EG810MCN_GA_VOLTE
+if errorlevel 1 (
+ echo ERROR: helios build failed - see compiler output above
+ cd ..
+ exit /b 1
+)
cd ..
-:exit
\ No newline at end of file
+exit /b 0
+
+:exit
+exit /b 1
--- /dev/null
+@echo off
+REM FW version (edit FW_VERSION). Build_Time is generated each run.
+set "FW_VERSION=V1.0"
+
+echo Version="%FW_VERSION%" > sdk\services\microPython\ports\quectel\core\versions.py
+echo Build_Time="%date:~0,4%-%date:~5,2%-%date:~8,2% %time:~0,8%" >> sdk\services\microPython\ports\quectel\core\versions.py
--- /dev/null
+@echo off
+setlocal EnableDelayedExpansion
+REM Copy Helios_SDK\opt\release\<board>\ to release\<proj>_<ver>_<time>\
+REM Usage: release_copy.bat <project_dir>
+
+set "SDKROOT=%~dp0"
+set "PROJ=%~1"
+if "%PROJ%"=="" goto rc_err_proj
+
+set "VFILE=%SDKROOT%project\%PROJ%\sdk\services\microPython\ports\quectel\core\versions.py"
+if not exist "%VFILE%" goto rc_err_ver
+
+if not exist "%SDKROOT%Helios_SDK\opt\tmp\build_sucess.tmp" goto rc_skip
+
+set "FW_VER=UNKNOWN"
+for /f "usebackq tokens=2 delims==" %%a in (`findstr /b /c:"Version=" "%VFILE%"`) do (
+ set "FW_VER=%%a"
+ goto v_done
+)
+:v_done
+set "FW_VER=!FW_VER:"=!"
+set "FW_VER=!FW_VER: =!"
+
+set "FW_BT=unknown"
+for /f "usebackq tokens=2 delims==" %%a in (`findstr /b /c:"Build_Time=" "%VFILE%"`) do (
+ set "FW_BT=%%a"
+ goto t_done
+)
+:t_done
+set "FW_BT=!FW_BT:"=!"
+REM Trim leading/trailing spaces so " =_!" does not turn a trailing space into "_"
+:trim_bt_lead
+if "!FW_BT:~0,1!"==" " set "FW_BT=!FW_BT:~1!" & goto trim_bt_lead
+:trim_bt_trail
+if "!FW_BT:~-1!"==" " set "FW_BT=!FW_BT:~0,-1!" & goto trim_bt_trail
+if "!FW_BT!"=="" set "FW_BT=unknown"
+set "FW_BT=!FW_BT: =_!"
+set "FW_BT=!FW_BT::=-!"
+:trim_bt_us
+if "!FW_BT:~-1!"=="_" set "FW_BT=!FW_BT:~0,-1!" & goto trim_bt_us
+
+set /p FW_NAME=<"%SDKROOT%Helios_SDK\opt\tmp\fw_name_record.tmp"
+set "FW_NAME=!FW_NAME: =!"
+if "!FW_NAME!"=="" set "FW_NAME=EG810MCN_GA_VOLTE"
+
+set "REL_SRC=!SDKROOT!Helios_SDK\opt\release\!FW_NAME!"
+if not exist "!REL_SRC!" goto rc_err_rel
+
+set "REL_DST=%SDKROOT%release\%PROJ%_!FW_VER!_!FW_BT!"
+:trim_dst_us
+if "!REL_DST:~-1!"=="_" set "REL_DST=!REL_DST:~0,-1!" & goto trim_dst_us
+mkdir "!REL_DST!" 2>nul
+echo [release] Copying build output to snapshot folder:
+echo !REL_DST!
+xcopy "!REL_SRC!" "!REL_DST!" /E /I /Y /Q
+if errorlevel 1 goto rc_err_copy
+echo [release] Done. All files from "!REL_SRC!" were copied.
+exit /b 0
+
+:rc_skip
+echo [release] Skipped: Helios_SDK\opt\tmp\build_sucess.tmp was not found.
+echo The build may have failed or did not finish; no files were copied to release\.
+exit /b 0
+
+:rc_err_proj
+echo [release] ERROR: No project directory name was passed.
+echo Usage: release_copy.bat ^<project_dir^> Example: release_copy.bat 7PIN_1_5
+exit /b 1
+
+:rc_err_ver
+echo [release] ERROR: versions.py is missing. Run new_version.bat in the project first.
+echo Expected file: %VFILE%
+exit /b 1
+
+:rc_err_rel
+echo [release] ERROR: SDK release output folder does not exist:
+echo !REL_SRC!
+echo Check fw_name_record.tmp and that the Helios build produced opt\release\^<board^>.
+exit /b 1
+
+:rc_err_copy
+echo [release] ERROR: xcopy failed while copying to the release snapshot.
+echo Check free disk space, path length, and file locks.
+exit /b 1