
        location /check_i2c_tools {
             add_header 'Access-Control-Allow-Origin' '*';
             add_header 'Access-Control-Allow-Credentials' 'true';
             add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
             add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
             add_header 'Content-type' 'text/plain; charset=utf-8';

             content_by_lua '
                os.execute("i2cdetect -l > /tmp/check_i2c_tools")
                local handle = io.open("/tmp/check_i2c_tools", "r");
                local res = handle:read("*all");
                io.close(handle);
                ngx.say(res);
             ';
        }

        location /install_i2c_tools {
             add_header 'Access-Control-Allow-Origin' '*';
             add_header 'Access-Control-Allow-Credentials' 'true';
             add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
             add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
             add_header 'Content-type' 'text/plain; charset=utf-8';

             content_by_lua '
                os.execute("apt-get install -y i2c-tools");
             ';
        }

        location /check_0x20 {
             add_header 'Access-Control-Allow-Origin' '*';
             add_header 'Access-Control-Allow-Credentials' 'true';
             add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
             add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
             add_header 'Content-type' 'text/plain; charset=utf-8';

             content_by_lua '
                local handle = io.popen("i2cdetect -r -y 0 0x20 0x20")
                local res = handle:read("*all");
                io.close(handle);
                ngx.say(res);
             ';
        }
