||
openadms-node出现如下错误:
Loading module "com1" failed: No module named 'serial'
用VS code调试Python代码以后发现manager.py的268行代码中:
worker_class = getattr(import_module(module_path), class_name)
import_module(module_path)出现如下错误:
ModuleNotFoundError("No module named 'serial'")
在configuration 中添加了如下模块,
{ "core": { "modules": { "schedulerCom1": "module.schedule.Scheduler", "com1": "module.port.SerialPort", "preProcessor": "module.processing.PreProcessor", "fileExporter": "module.export.FileExporter" } } }
module.port.SerialPort需要提前安装serial
pipenv install serial -i https://pypi.tuna.tsinghua.edu.cn/simple/
另外,openadms-node的configuration文件编写Json格式运行出现如下错误:
Loading module "schedulerUsb" failed: Configuration of "modules.schedule.Scheduler" is invalid
原因:
core->modules加载了某一个模块,后面再modules中没有完全对照 schemas/modules目录下面的"required"
比如:如果使用
"com1": "module.port.SerialPort",
则,必须包含如下"required",缺一不可!
"required": [
"port",
"baudRate",
"byteSize",
"stopBits",
"parity",
"timeout",
"softwareFlowControl",
"hardwareFlowControl",
"maxAttempts"
],
类似的,上面错误schedulerUsb就是没有严格对照schemas\modules\schedule目录下面的scheduler.json中的"required"
"required": [
"enabled",
"endDate",
"observations",
"startDate",
"weekdays"
],
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-12-8 23:44
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社