Skip to content

Commit

Permalink
Update task.json, python script, manifest.json
Browse files Browse the repository at this point in the history
  • Loading branch information
xyzroe committed Apr 28, 2024
1 parent c234a6e commit e4e0bd7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 9 deletions.
19 changes: 19 additions & 0 deletions .github/scripts/process_and_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from zipfile import ZipFile

def download_and_extract(url, extract_to):
print(url)
try:
response = requests.get(url)
response.raise_for_status()
Expand Down Expand Up @@ -52,15 +53,32 @@ def update_manifest(root, file, chip, version):
json.dump({root: data}, f, indent=4)

with open('task.json', 'r') as f:
print('Read task.json')
tasks = json.load(f)
for task in tasks:
dir_path = os.path.join('ti', task['type'])
os.makedirs(dir_path, exist_ok=True)
download_and_extract(task['link'], dir_path)

print("hex2bin")
for root, dirs, files in os.walk('ti'):
for file in files:
if file.endswith(".hex"):
print(file)
hex_path = os.path.join(root, file)
bin_path = hex_path[:-4] + ".bin"
try:
command = f"srec_cat {hex_path} -intel -o {bin_path} -binary"
os.system(command)
os.remove(hex_path)
except Exception as e:
print(f"Error converting file {hex_path}: {e}")

print("update manifest")
for root, dirs, files in os.walk('ti'):
for file in files:
if file.endswith(".bin"):
print(file)
bin_path = os.path.join(root, file)
# Extract chip and version from the file name
parts = file.split('_')
Expand All @@ -69,6 +87,7 @@ def update_manifest(root, file, chip, version):
update_manifest(root, file, chip, version)

def clean_directory(directory):
print("clean directory")
for root, dirs, files in os.walk(directory):
for file in files:
if not (file.endswith(".bin") or file == "manifest.json"):
Expand Down
16 changes: 10 additions & 6 deletions task.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
[
{"type": "coordinator", "link": "https://github.com/Koenkk/Z-Stack-firmware/raw/master/coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_coordinator_20230507.zip"},
{"type": "coordinator", "link": "https://github.com/Koenkk/Z-Stack-firmware/raw/master/coordinator/Z-Stack_3.x.0/bin/CC1352P7_coordinator_20230507.zip"},
{"type": "coordinator", "link": "https://github.com/Koenkk/Z-Stack-firmware/raw/6e3b68404136c8cf87979212665e6505bd9a0e3b/coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_coordinator_20220219.zip"},
{"type": "router", "link": "https://github.com/Koenkk/Z-Stack-firmware/raw/master/router/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_router_20221102.zip"},
{"type": "coordinator", "link": "https://github.com/Koenkk/Z-Stack-firmware/files/15001944/20240315_20240316.zip"},
{"type": "coordinator", "link": "https://github.com/Koenkk/Z-Stack-firmware/raw/7398d834eb3a790876c280293c4181da96cc7114/coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_coordinator_20221226.zip"}
{"type": "coordinator", "link": "https://github.com/Koenkk/Z-Stack-firmware/raw/Z-Stack_3.x.0_coordinator_20230507/coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_coordinator_20230507.zip"},
{"type": "coordinator", "link": "https://github.com/Koenkk/Z-Stack-firmware/raw/Z-Stack_3.x.0_coordinator_20230507/coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_other_coordinator_20230507.zip"},
{"type": "coordinator", "link": "https://github.com/Koenkk/Z-Stack-firmware/raw/Z-Stack_3.x.0_coordinator_20230507/coordinator/Z-Stack_3.x.0/bin/CC1352P7_coordinator_20230507.zip"},
{"type": "coordinator", "link": "https://github.com/Koenkk/Z-Stack-firmware/raw/Z-Stack_3.x.0_coordinator_20221226/coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_coordinator_20221226.zip"},
{"type": "coordinator", "link": "https://github.com/Koenkk/Z-Stack-firmware/raw/Z-Stack_3.x.0_coordinator_20221226/coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_other_coordinator_20221226.zip"},
{"type": "coordinator", "link": "https://github.com/Koenkk/Z-Stack-firmware/raw/Z-Stack_Home_3.x.0_coordinator_20220219/coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_coordinator_20220219.zip"},
{"type": "coordinator", "link": "https://github.com/Koenkk/Z-Stack-firmware/raw/Z-Stack_Home_3.x.0_coordinator_20220219/coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_other_coordinator_20220219.zip"},
{"type": "router", "link": "https://github.com/Koenkk/Z-Stack-firmware/raw/Z-Stack_3.x.0_router_20221102/router/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_router_20221102.zip"},
{"type": "router", "link": "https://github.com/Koenkk/Z-Stack-firmware/raw/Z-Stack_3.x.0_router_20221102/router/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_other_router_20221102.zip"},
{"type": "coordinator", "link": "https://github.com/Koenkk/Z-Stack-firmware/files/15001944/20240315_20240316.zip"}
]
6 changes: 3 additions & 3 deletions ti/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"CC1352P2_CC2652P_launchpad_router_20221102.bin": {
"ver": "20221102",
"link": "https://raw.githubusercontent.com/xyzroe/XZG/zb_fws/ti/router/CC1352P2_CC2652P_launchpad_router_20221102.bin",
"notes": ""
"notes": "Allow to set transmit power\nFix directly connected Xiaomi devices disconnecting\nSimpleLink SDK 6.30.00.84 (changelog)"
}
}
},
Expand Down Expand Up @@ -39,7 +39,7 @@
"CC1352P7_coordinator_20230507.bin": {
"ver": "20230507",
"link": "https://raw.githubusercontent.com/xyzroe/XZG/zb_fws/ti/coordinator/CC1352P7_coordinator_20230507.bin",
"notes": ""
"notes": "Enable child aging to fix issues like #13478 (but not for older Xiaomi devices as they do not implement child aging correctly which gets them kicked out of the network)\nIncrease message timeout from 7 to 8 seconds to increase message delivery success rate for devices using a 7.5 seconds poll interval (#13478)\nImprove performance with larger network\nOptimize table sizes\nIncrease stack_size from 1024 to 8192\nAdd firmware for CC1352P7 and CC2652R7\nSimpleLink SDK 7.10.00.98"
}
},
"CC2652R7_coordinator": {
Expand All @@ -53,7 +53,7 @@
"CC1352P2_CC2652P_launchpad_coordinator_20230507.bin": {
"ver": "20230507",
"link": "https://raw.githubusercontent.com/xyzroe/XZG/zb_fws/ti/coordinator/CC1352P2_CC2652P_launchpad_coordinator_20230507.bin",
"notes": ""
"notes": "Enable child aging to fix issues like #13478 (but not for older Xiaomi devices as they do not implement child aging correctly which gets them kicked out of the network)\nIncrease message timeout from 7 to 8 seconds to increase message delivery success rate for devices using a 7.5 seconds poll interval (#13478)\nImprove performance with larger network\nOptimize table sizes\nIncrease stack_size from 1024 to 8192\nAdd firmware for CC1352P7 and CC2652R7\nSimpleLink SDK 7.10.00.98"
},
"CC1352P2_CC2652P_launchpad_coordinator_20240315.bin": {
"ver": "20240315",
Expand Down

0 comments on commit e4e0bd7

Please sign in to comment.