Can i suggest using Domoticz internal Weatherunderground and patch your script to use that.. and remove all other weatherunderground from the script...
(I can not see why it is in the script anyway, since the hardware was already available, it kinda double if you have both this script & weatherunderground as hardware... but anyway..)...
Check out:
http://domoticz.com/forum/viewtopic.php ... 100#p94028
http://domoticz.com/forum/viewtopic.php ... 100#p94042 and the surrounding posts...
Trying to run LUA Script got error 'popen' not supported-osx
Moderator: leecollings
-
- Posts: 74
- Joined: Monday 26 December 2016 16:30
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.11590
- Location: France
- Contact:
Re: Trying to run LUA Script got error 'popen' not supported-osx
You read my mind 

-
- Posts: 74
- Joined: Monday 26 December 2016 16:30
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.11590
- Location: France
- Contact:
Re: Trying to run LUA Script got error 'popen' not supported-osx
Hello,
What is the "r" for in your exemple ?
local config = io.open(tmpfile, "r")
What is the "r" for in your exemple ?
local config = io.open(tmpfile, "r")
-
- Posts: 74
- Joined: Monday 26 December 2016 16:30
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.11590
- Location: France
- Contact:
Re: Trying to run LUA Script got error 'popen' not supported-osx
Thank you. I start to feel im even understanding what i'm reading 
still getting a nil value with this.
trying my best to understand each line with the correct syntax but still...

still getting a nil value with this.
Code: Select all
tmpfile = os.tmpname()
cmd = 'curl "http://www.ogimet.com/cgi-bin/getsynop?block='..WMOID..'&begin='..UTC..'"' .. ' > ' .. tmpfile
if( DEBUG == 1) then print(cmd) end
os.execute(cmd)
local ogimet = io.open(tmpfile, "r")
local synop = ogimet:read('*all')
ogimet:close()
if( DEBUG == 1) then print('ogimet:'..synop) end
Re: Trying to run LUA Script got error 'popen' not supported-osx
Well the idea is to execute curl, save its output in a temporary file, and read it back.
You can try to executing the command you printed with debug in the terminal to see if its correct...
I do not know where os.tmpname stores its file, and if you have rights there (it should be, but who knows) so you can also hardcode the tempfile
instead of using os.tmpname().
as example for my pi to my home folder:
if you are done with it, or else it will fill up your storage. and you should check your the temp folder printed with the debug, for the already existing temp files you created and delete those...
https://www.lua.org/manual/5.1/manual.h ... -os.remove
You can try to executing the command you printed with debug in the terminal to see if its correct...
I do not know where os.tmpname stores its file, and if you have rights there (it should be, but who knows) so you can also hardcode the tempfile
instead of using os.tmpname().
as example for my pi to my home folder:
You should remove the temp files withtmpfile = /home/pi/sun.tmp
Code: Select all
os.remove(tmpfile)
https://www.lua.org/manual/5.1/manual.h ... -os.remove
-
- Posts: 74
- Joined: Monday 26 December 2016 16:30
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.11590
- Location: France
- Contact:
Re: Trying to run LUA Script got error 'popen' not supported-osx


Dank u wel, i was so lost. It works fine with a hardcoded temp file. Dunno why not with a generated one.
Re: Trying to run LUA Script got error 'popen' not supported-osx
it probably wanted to write were it has no rights. Who knows... i should have opted for the hardcoded to begin with... anyway.
About the whole lux sensor. the thing is inaccurate as f anyway... especially if you ogmet station is not really close and you have clear skies and the station has not..,... better point a lux sensor to the sky yourself
About the whole lux sensor. the thing is inaccurate as f anyway... especially if you ogmet station is not really close and you have clear skies and the station has not..,... better point a lux sensor to the sky yourself

-
- Posts: 74
- Joined: Monday 26 December 2016 16:30
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.11590
- Location: France
- Contact:
Re: Trying to run LUA Script got error 'popen' not supported-osx
Still better than nothing, the station is a few KM away. I will see how it works for a few days. Thanks again.
Who is online
Users browsing this forum: No registered users and 1 guest