- 8B PDO config: ULINT-sized payload, no 0x1A01 diag PDO on SM3 (device rejected SM3=8 with diag assigned: 'size not allowed, min/max 0xa') - twin_layout_blob_sized(): single 64-bit mapping entry for 8B payloads - Ticker: per-byte XOR 0x5A transform in 8B mode so TwinCAT can verify every byte individually (1KB path unchanged, const-guarded) - TwinCAT automation scripts: deploy with RPC retry, LinkVariables-based whole-array relink (element links only carry 1 byte), ADS watch, diag - Docs: 8B design, verification methodology, test report
47 lines
1.1 KiB
Python
47 lines
1.1 KiB
Python
#!/usr/bin/env python3
|
|
"""Find J1900 by MAC address on local subnet."""
|
|
import subprocess, sys
|
|
|
|
TARGET_MAC = "00:e2:69:34:71:2c"
|
|
SUBNET = "192.168.68"
|
|
|
|
def scan_arp_cache():
|
|
out = subprocess.check_output(["ip", "neigh", "show"], text=True)
|
|
for line in out.strip().split("\n"):
|
|
if TARGET_MAC.lower() in line.lower():
|
|
ip = line.split()[0]
|
|
return ip
|
|
return None
|
|
|
|
def ping_sweep():
|
|
procs = []
|
|
for i in range(1, 255):
|
|
ip = f"{SUBNET}.{i}"
|
|
p = subprocess.Popen(
|
|
["ping", "-c", "1", "-W", "0.2", ip],
|
|
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL
|
|
)
|
|
procs.append(p)
|
|
for p in procs:
|
|
p.wait()
|
|
|
|
def main():
|
|
ip = scan_arp_cache()
|
|
if ip:
|
|
print(f"{ip}")
|
|
return 0
|
|
|
|
print(f"MAC not in ARP cache, scanning {SUBNET}.0/24 ...", file=sys.stderr)
|
|
ping_sweep()
|
|
|
|
ip = scan_arp_cache()
|
|
if ip:
|
|
print(f"{ip}")
|
|
return 0
|
|
|
|
print(f"NOT FOUND: {TARGET_MAC}", file=sys.stderr)
|
|
return 1
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|