I have failed getting DS18B20 example to work.
t = require("ds18b20")
-- ESP-01 GPIO Mapping
gpio0 = 3
gpio2 = 4
t.setup(gpio2)
addrs = t.addrs()
if (addrs ~= nil) then
print("Total DS18B20 sensors: "..table.getn(addrs))
end
-- Just read temperature
print("Temperature: "..t.read().."'C")
-- Don't forget to release it after use
t = nil
ds18b20 = nil
package.loaded["ds18b20"]=nilThe answer I get is
ds18b20.lua:80: attempt to index local 'addr' (a number value)I wonder if this is because it does not detect my sensors (three with pull-up resistor) or if the library needs to be modified.
Also, what command is used to read fw version from the ESP?
Thanks,
Dick