摘要: 新增粉尘仪检测设备调试中需要对 hex 32位浮点数 转10 进制小数(保留三位小数) def ieee_transfer(hex_str): """ :param hex_str: hex string like '4145851F' :return: float type """ ret = ' 阅读全文
posted @ 2021-11-24 19:05 Orientation 阅读(658) 评论(0) 推荐(0) 编辑
摘要: 服务器端口占用查看 命令 netstat -anp 可以对结果用grep 过滤想要查看的端口号 netstat - Print network connections, routing tables, interface statistics, masquerade connections, and 阅读全文
posted @ 2021-11-24 13:12 Orientation 阅读(63) 评论(0) 推荐(0) 编辑
摘要: 语法:sed [-hnV] [-e<script>] [-f<script文件>] [目标文本文件] sed -i -e '91c\ self.GPIO_DO3 = 16 # P10,风扇' -e '95c\ self.GPIO_DO6 = 29 # 声级计 ' work/IO/Cel712Cali 阅读全文
posted @ 2021-11-23 23:33 Orientation 阅读(53) 评论(0) 推荐(0) 编辑
摘要: CRC16 python实现 crc16_IBM def crc16_IBM(data): # parameter data :'01 00 00 80 00 00 00 ..... 00 ce c2 b6 c8 33 38 32 35 a1 e6' if isinstance(data, str) 阅读全文
posted @ 2021-11-22 16:08 Orientation 阅读(1072) 评论(0) 推荐(0) 编辑
摘要: 客户端 # -*- coding: UTF-8 -*- import socket import time socket.setdefaulttimeout(10) # 设置socket 接收超时 s = socket.socket() s.connect_ex(('101.37.*.*', 900 阅读全文
posted @ 2021-11-22 13:32 Orientation 阅读(32) 评论(0) 推荐(0) 编辑
摘要: _var :一个下划线开头,一般用来声明是内部变量,可以被继承,在模块或类外可以但不建议调用 __var: 前置双下划线,私有化属性或方法,不能被继承,只有内部可以访问,外部访问报错 __var__:以双下划线开头,并且以双下划线结尾的,是特殊变量(这就是在python中强大的魔法方法),特殊变量是 阅读全文
posted @ 2021-11-19 15:49 Orientation 阅读(64) 评论(0) 推荐(0) 编辑
摘要: 参考链接:https://blog.csdn.net/u013451404/article/details/80552765 1、使用df -h命令 查看需要制作镜像树莓派系统TF卡中实际有效数据占用:没啥用,参考下就好 2、将sd卡取出用读卡器插入另一台树莓派后使用 sudo fidsk -l / 阅读全文
posted @ 2021-10-30 17:55 Orientation 阅读(303) 评论(0) 推荐(0) 编辑
摘要: logging模块是Python内置的标准模块,主要用于输出运行日志,可以设置输出日志的等级、日志保存路径、日志文件回滚等; 1. 控制台基本使用: import logging logging.basicConfig(level = logging.INFO,format = '%(asctime 阅读全文
posted @ 2021-10-30 17:37 Orientation 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 树莓派Raspbian系统默认登录用户名为pi,该账户默认密码是raspberry(可在raspi-config中修改)。树莓派的Raspbian系统root用户默认是禁用状态,且没有密码,所以要先设置个密码,然后开启才能正常使用。使用pi账户进行登陆命令行,执行命令:【sudo passwd ro 阅读全文
posted @ 2021-10-25 13:47 Orientation 阅读(891) 评论(0) 推荐(0) 编辑
摘要: Linux 开机自启脚本 1、修改 /etc/rc.d/rc.local 文件方式 /etc/rc.d/rc.local 用于用户自定义开机启动程序,因此可以往里写开机要执行的命令或脚本。 1、设置 rc.local 的可执行权限 # chmod +x /etc/rc.d/rc.local 2、创建 阅读全文
posted @ 2021-10-25 13:19 Orientation 阅读(1025) 评论(0) 推荐(0) 编辑