| timer가 운도센서로 수정후 error발생 |
| Tianye Tan | 2017-08-16 17:22 | Views 2735 | New |
|
안녕하세요 제가 운도센서를 사용하기 위해 thyme폴더에 tas.js파일 timer부분을 수정했습니다. 수정 현황은 아래와 같습니다. function sensor() { if (sh_state == 'crtci') { for (var j = 0; j < conf.cnt.length; j++) { if (conf.cnt[j].name == 'cnt-tehu') { sensor.read(11, 4, function(err, temperature, humidity){ var content = JSON.stringify({value: 'temp:' + temperature.toFixed(1) + '°C' + ' ' + 'humi:' + humidity.toFixed(1) + '%'}); console.log('thyme cnt-tehu ' + content + ' ---->'); sh_adn.crtci(j, content, this, function (status, res_body, to, socket) { console.log('x-m2m-rsc : ' + status + ' <----'); }); }); } } } } 실행할때 error 발생했는대 TCP Server (192.168.31.121) for TAS is listening on port 3105 [mqtt_connect] noti_topic : /oneM2M/req/mobius-yt/ae-edu0/# thyme cnt-tehu {"value":"temp:27.0°C humi:36.0%"} ----> /home/pi/thyme-v1/http_adn.js:280 var parent_path = conf.cnt[count].parent + '/' + conf.cnt[count].name; ^ TypeError: Cannot read property 'parent' of undefined at Object.exports.crtci (/home/pi/thyme-v1/http_adn.js:280:38) at /home/pi/thyme-v1/tas.js:49:28 이상황은 어떻게 해야하는지를 물어보고 싶습니다. 감사합니다. |