找回密码
 立即注册
查看: 349|回复: 8

[技术讨论] 适配苹果新机制,自制AirTag定位器Docker/HA脚本更新

[复制链接]

6

主题

190

回帖

1029

积分

金牌会员

积分
1029
金钱
823
HASS币
40
发表于 前天 09:04 | 显示全部楼层 |阅读模式
本帖最后由 lovelyelfpop 于 2025-5-27 13:18 编辑

如果不知道是什么的,请移步 以前的帖子 https://bbs.hassbian.com/thread-27928-1-1.html


苹果上周改变了获取位置报告的机制,现在一次请求最多只能取到20~40条位置报告。
若一次性使用太多公钥去请求,可能会出现取不到最新位置的情况。
项目(https://gitee.com/lovelyelfpop/macless-haystack)已经适配,改为分批次获取(所以速度比以前略慢)。

1、macless-haystack-gitee 镜像已更新,需重新下载docker镜像
详细步骤:
```
docker rm -f macless-haystack-gitee
docker rmi lovelyelfpop/macless-haystack-gitee
docker run -d --restart unless-stopped --name macless-haystack-gitee -p 6176:6176 --volume mh_data:/app/endpoint/data --network mh-network lovelyelfpop/macless-haystack-gitee

#立即开启另一个终端,执行下面命令重新启动服务器
docker restart macless-haystack-gitee
```

2、HA用的脚本 request_reports.py 也已更新
替换一下脚本文件即可

由于保留了上次的登录状态,所以一般不需要重新登录AppleID。






123123.jpg



回复

使用道具 举报

2

主题

34

回帖

234

积分

中级会员

积分
234
金钱
198
HASS币
0
发表于 前天 18:34 | 显示全部楼层
大佬,原来我一直用的镜像是christld/macless-haystack,这次换成你的镜像,启动报错了。。。。。

2025-05-27 18:25:34,761 - DEBUG - Using selector: EpollSelector
Traceback (most recent call last):
  File "/app/endpoint/mh_endpoint.py", line 215, in <module>
    web.run_app(app, host=mh_config.getBindingAddress(), port=mh_config.getPort(), ssl_context=ssl_context if hasCert else None)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/web.py", line 530, in run_app
    loop.run_until_complete(main_task)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/usr/local/lib/python3.13/asyncio/base_events.py", line 719, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
RuntimeError: can't start new thread
回复

使用道具 举报

2

主题

34

回帖

234

积分

中级会员

积分
234
金钱
198
HASS币
0
发表于 前天 18:59 | 显示全部楼层
GavinChan 发表于 2025-5-27 18:34
大佬,原来我一直用的镜像是christld/macless-haystack,这次换成你的镜像,启动报错了。。。。。

2025-05 ...

配置文件里binding_address以前是留空的,改成容器IP后可以启动,但是发送请求会报错




2025-05-27 18:56:52,449 - INFO - Searching for token at /app/endpoint/data/auth.json
2025-05-27 18:56:52,450 - INFO - Certificate file /app/endpoint/data/certificate.pem not found, so not using SSL
2025-05-27 18:56:52,450 - INFO - serving at 172.17.0.3:6176 over HTTP
2025-05-27 18:56:52,450 - WARNING - Endpoint is not protected by authentication
2025-05-27 18:56:52,450 - DEBUG - Using selector: EpollSelector
======== Running on http://172.17.0.3:6176 ========
(Press CTRL+C to quit)
2025-05-27 18:56:58,574 - DEBUG - Querying for 1 days
Request failed: can't start new thread
Request failed: can't start new thread
Request failed: can't start new thread
Request failed: can't start new thread
Request failed: can't start new thread
Request failed: can't start new thread
Request failed: can't start new thread
Request failed: can't start new thread
Request failed: can't start new thread
Request failed: can't start new thread
Request failed: can't start new thread
Request failed: can't start new thread
Request failed: can't start new thread
Request failed: can't start new thread
Request failed: can't start new thread
Request failed: can't start new thread
Request failed: can't start new thread
2025-05-27 18:56:58,587 - INFO - 172.17.0.1 [27/May/2025:18:56:58 +0800] "POST / HTTP/1.1" 200 206 "-" "Dart/3.7 (dart:io)"
2025-05-27 18:57:02,612 - DEBUG - Querying for 1 days
Request failed: can't start new thread
Request failed: can't start new thread
回复

使用道具 举报

Ari 手机认证

0

主题

663

回帖

2817

积分

金牌会员

积分
2817
金钱
2154
HASS币
0
发表于 昨天 09:56 | 显示全部楼层
这个标签刷机必须要ST-LINK吗?昨天用J-link刷了半天搞不上,又去淘宝下单了6元的ST-LINK等到货了
回复

使用道具 举报

6

主题

190

回帖

1029

积分

金牌会员

积分
1029
金钱
823
HASS币
40
 楼主| 发表于 昨天 10:17 | 显示全部楼层
Ari 发表于 2025-5-28 09:56
这个标签刷机必须要ST-LINK吗?昨天用J-link刷了半天搞不上,又去淘宝下单了6元的ST-LINK等到货了 ...

是的。不过有人用J-link能刷,不知道用啥命令
回复

使用道具 举报

6

主题

190

回帖

1029

积分

金牌会员

积分
1029
金钱
823
HASS币
40
 楼主| 发表于 昨天 10:18 | 显示全部楼层
GavinChan 发表于 2025-5-27 18:59
配置文件里binding_address以前是留空的,改成容器IP后可以启动,但是发送请求会报错

你全部重新来一遍试试。
看这个FAQ
https://gitee.com/lovelyelfpop/macless-haystack/blob/master/read/FAQ.md#%E6%88%91%E5%A6%82%E4%BD%95%E9%87%8D%E7%BD%AE%E6%89%80%E6%9C%89%E5%86%85%E5%AE%B9%E5%B9%B6%E9%87%8D%E6%96%B0%E5%BC%80%E5%A7%8B%E6%88%91%E5%A6%82%E4%BD%95%E5%BD%BB%E5%BA%95%E5%8D%B8%E8%BD%BD-macless-haystack
回复

使用道具 举报

6

主题

190

回帖

1029

积分

金牌会员

积分
1029
金钱
823
HASS币
40
 楼主| 发表于 昨天 11:11 | 显示全部楼层
GavinChan 发表于 2025-5-27 18:59
配置文件里binding_address以前是留空的,改成容器IP后可以启动,但是发送请求会报错

奇怪,我这1个WSL,1个ubuntu云服务器,一个阿里云OpenAnolis服务器,都没遇到这个错误
回复

使用道具 举报

6

主题

190

回帖

1029

积分

金牌会员

积分
1029
金钱
823
HASS币
40
 楼主| 发表于 昨天 11:34 | 显示全部楼层
GavinChan 发表于 2025-5-27 18:59
配置文件里binding_address以前是留空的,改成容器IP后可以启动,但是发送请求会报错

docker start -ai macless-haystack-gitee 再试试,代码已经提交上去,restart会自动拉取最新代码
回复

使用道具 举报

2

主题

34

回帖

234

积分

中级会员

积分
234
金钱
198
HASS币
0
发表于 昨天 12:43 | 显示全部楼层
lovelyelfpop 发表于 2025-5-28 11:34
docker start -ai macless-haystack-gitee 再试试,代码已经提交上去,restart会自动拉取最新代码 ...

可能是docker环境不行。。。用的UNRAID自带的(版本19.03.5),换到群晖的docker(版本20.10.3)就可以了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian ( 晋ICP备17001384号-1 )

GMT+8, 2025-5-29 12:50 , Processed in 0.092808 second(s), 25 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表