错误: 加载模块'periphery'失败:未定义的符号:lua_gettop (RaspberryPi-ThingWorx)

我在使用ThingWorx与我的Raspberry Pi通信并尝试从连接到Raspberry Pi的PIR传感器中检索运动数据。它通过Lua脚本进行通信。为了测试它,我创建了一个与ThingWorx服务器分离的Lua脚本,并使用"periphery"模块访问GPIO引脚的输入。它正常工作。但是当通过ThingWorx的EMS运行脚本时,我会得到错误信息'Error: error loading module 'periphery' from file 'usr/local/lib/lua/5.1/periphery.so: undefined symbol: lua_gettop'

以下是在独立运行时工作但在EMS中使用时无法工作的代码片段:

local GPIO = require('periphery').GPIO
local GPIO_in = GPIO(4,"in")
local value = GPIO_in:read()

编辑:我没有解决这个特定的错误,但是我通过仅运行Lua脚本来解决我的问题,将该数据发送到txt文件中,然后在EMS的Lua脚本中,我只需从txt文件中读取数据即可将其发送到ThingWorx。

原文链接 https://stackoverflow.com/questions/69226533

点赞