郑州巩义网站建设,个人免费网站怎么建设,建设银行大连招聘网站,cms可以做多少个网站0. 环境
- win10 虚拟机ubuntu18 - i5 ubuntu22笔记本 - USB-GPS模块一台#xff0c;比如华大北斗TAU1312-232板 - 双笔记本组网设备#xff1a;路由器#xff0c;使得win10笔记本ip#xff1a;192.168.123.x#xff0c;而i5笔记本IP是192.168.123.215。 - 安卓 手机
1.…0. 环境
- win10 虚拟机ubuntu18 - i5 ubuntu22笔记本 - USB-GPS模块一台比如华大北斗TAU1312-232板 - 双笔记本组网设备路由器使得win10笔记本ip192.168.123.x而i5笔记本IP是192.168.123.215。 - 安卓 手机
1. 搭建traccar服务
1.0 环境 ubuntu22 i5笔记本
1.1 安装docker
$ sudo apt remove docker docker-engine docker \
sudo apt update \
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common \
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add - \
sudo add-apt-repository deb [archamd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable \
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7EA0A9C3F273FCD8
$ sudo apt update
$ sudo apt install docker-ce docker-ce-cli containerd.io
$ sudo systemctl status docker
$ sudo systemctl restart docker
$ sudo docker run hello-world
1.2 跟着教程安装docker traccar 1.2.1 Create work directories:
mkdir -p /opt/traccar/logs
1.2.2 Get default traccar.xml:
docker run \
--rm \
--entrypoint cat \
traccar/traccar:latest \
/opt/traccar/conf/traccar.xml /opt/traccar/traccar.xml
1.2.3 Create container:
docker run \
--name traccar \
--hostname traccar \
--detach --restart unless-stopped \
--publish 80:8082 \
--publish 5000-5150:5000-5150 \
--publish 5000-5150:5000-5150/udp \
--volume /opt/traccar/logs:/opt/traccar/logs:rw \
--volume /opt/traccar/traccar.xml:/opt/traccar/conf/traccar.xml:ro \
traccar/traccar:latest 2. 手机测试效果 安卓手机安装traccar client 。 手机浏览器打开https://www.traccar.org/client/下载apk后安装。服务器地址改为搭建了traccar服务的i5笔记本ip默认端口是5055。 电脑登录traccar服务器的web添加手机设备编码到账户下。 设置完毕后可以看到手机在线。注意手机和服务器在同一个路由器下。 3. win10笔记本作为客户端 3.0 环境 ubuntu18虚拟机 gps机
3.1 验证gps minicom -s 配置ttyUSB0波特率115200 有数据再进行下一步。
注意如果没有收到 GPS 数据可能是权限问题导致的。执行下面命令将当前用户非 root 用户添加到 dialout 用户组然后重启系统后再次尝试。
sudo usermod -a -G dialout $USER
reboot 3.2 apt直接安装gpsd sudo apt install gpsd gpsd-clients 以 systemd 方式启动 gpsd 服务
sudo systemctl start gpsd
以 systemd 方式停止 gpsd 服务原因是gpsd默认的配置不正常不是ttyUSB0
sudo systemctl stop gpsd.socket
查看 gpsd 服务状态
sudo systemctl status gpsd
启动一个新的gpsd实例该实例将正确的串行端口的数据重定向到套接字
sudo gpsd /dev/ttyUSB0 -F /var/run/gpsd.sock
启动 cgps 客户端观测数据
cgps
启动 gpsmon 客户端观测数据
gpsmon
3.3 获取gpsd-traccar脚本
https://gist.github.com/linuxsocist/55e10998e88f61af9e6ec12c12bbb04e
3.4 运行测试 把IP修改为192.168.123.215为部署了traccar的电脑ip.
运行测试
sudo apt install jd
chmod x gpsd-traccar.sh
./gpsd-traccar.sh
登录web看到位置。 traccar带有报表功能可以查看客户到过的轨迹、地区。 不过docker里面的数据库如果未经过额外的设置退出docker后数据库数据会被清空。 4. 感想
这个服务是占用的端口比较多昨晚1C2G的服务器也不够我部署用实际部署占用了i5笔记本2.5G内存。这个应用比较惊艳用了几个短视频APP都会获取用户的位置数据信息。真的后背有点凉。 参考
如何在Raspberry Pi 4中使用GPS接收器模块https://www.yiboard.com/thread-1381-1-1.html
Install Traccar on DigitalOcean VPShttps://www.traccar.org/install-digitalocean/
Traccar 记录你的足迹https://zhuanlan.zhihu.com/p/98380567
[进阶教程] traccar从零开始到完美使用完全教程https://bbs.hassbian.com/thread-7568-1-1.html
traccar从零开始到完美使用完全教程https://bbs.iobroker.cn/t/topic/772