b) Doing this in C (if you are now running in nodeMcu) would be a good thing since I think this would be a
thing that a lot of people are going to use for a lot of things[/*]
Explore... Chat... Share...
function fromJson(MSG)
local hashMap = {}
local i = 1
local j = 1
for val in string.gmatch(MSG,'"%w+":"%w+",') do
hashMap[i] = {}
val = string.gsub(val, '":"', " ")
val = string.gsub(val, '"', "")
val = string.gsub(val, ',', "")
for sval in string.gmatch(val, "%S+") do
hashMap[i][j] = sval;
j = j + 1
end
j = 1
i = i+1
end
for val in string.gmatch(MSG,'"%w+":"%w+"}') do
hashMap[i] = {}
val = string.gsub(val, '":"', " ")
val = string.gsub(val, '"', "")
val = string.gsub(val, '}', "")
for sval in string.gmatch(val, "%S+") do
hashMap[i][j] = sval;
j = j + 1
end
j = 1
i = i+1
end
return hashMap
end
function toJson(MAP)
local outMsg = '{'
local i = 1
repeat
outMsg = outMsg..'"'..map[i][1]..'":"'..map[i][2]..'",'
i = i + 1
until map[i] == nil
return string.sub(outMsg,0,-2)..'}'
end
local json = require "cjson"
luaObject = json.decode("{\"json\": \"string\"}");
jsonString = json.encode(luaObject)
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]