Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attempt to index global 'storage' (a nil value) #1

Open
Vitus-TL opened this issue Dec 18, 2024 · 2 comments
Open

attempt to index global 'storage' (a nil value) #1

Vitus-TL opened this issue Dec 18, 2024 · 2 comments

Comments

@Vitus-TL
Copy link

Vitus-TL commented Dec 18, 2024

Besides a stray character at line 290 and problems with the payload and socket code, I get this:
/usr/bin/lua: /opt/GIT/LUA-hue2mqtt/hue2mqtt.lua:112: attempt to index global 'storage' (a nil value)
stack traceback:
/opt/GIT/LUA-hue2mqtt/hue2mqtt.lua:112: in main chunk
[C]: ?

I've added to the top :
package.path = "/usr/local/share/lua/5.1/?.lua;" .. package.path
package.cpath = "/usr/local/lib/lua/5.1/?.so;" .. package.cpath
local socket = require('socket')

But no success.. (everything is installed right. This code works on my install (Ubuntu 22.04.5):

local socket = require("socket")
print("Socket module loaded: ", socket)

-- Example of using socket to create a TCP connection
local tcp = socket.tcp()
tcp:settimeout(5)
local success, err = tcp:connect("example.com", 80)
if success then
print("Connected successfully")
else
print("Connection failed: ", err)
end

@autoSteve
Copy link
Owner

This code is designed to run on a Schneider/Clipsal automation controller (OEM LogicMachine). Where might you be running it?

@autoSteve
Copy link
Owner

And 290 looks fine to me...

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants