octoblu / meshblu

Meshblu is a cross-protocol IoT machine-to-machine messaging system.
https://meshblu.readme.io/
MIT License
815 stars 182 forks source link

TypeError: Cannot call method 'toString' of undefined when POSTing to /data/ #31

Closed bassdread closed 10 years ago

bassdread commented 10 years ago
Skynet development environment loaded...
Skynet listening at http://0.0.0.0:3000
Sensor data logged: {"timestamp":"2014-03-25T08:52:14.549Z","uuid":"f65ea8e0-ab7c-11e3-b66c-575bfd455815","temperature":"22.16","pressure":"1005.65","light":"2283","humidity":"99.9","backdoor":"1","online":"true","ipAddress":"192.168.0.201","_id":"533143be5e1b0b3d63000001"}
[TypeError: Cannot call method 'toString' of undefined]
{ timestamp: '2014-03-25T08:52:14.549Z',
  uuid: 'f65ea8e0-ab7c-11e3-b66c-575bfd455815',
  temperature: '22.16',
  pressure: '1005.65',
  light: '2283',
  humidity: '99.9',
  backdoor: '1',
  online: 'true',
  ipAddress: '192.168.0.201',
  eventCode: 700,
  _id: 533143be5e1b0b3d63000002 }
Event Loggged: {"timestamp":"2014-03-25T08:52:14.549Z","uuid":"f65ea8e0-ab7c-11e3-b66c-575bfd455815","temperature":"22.16","pressure":"1005.65","light":"2283","humidity":"99.9","backdoor":"1","online":"true","ipAddress":"192.168.0.201","eventCode":700,"_id":"533143be5e1b0b3d63000002"}
Log file updated
{ _index: 'log',
  _type: '700',
  _id: 'NLct1AZpSgS8h6mbhfQ_Bw',
  _version: 1,
  created: true }
logged to elastic search

Think it's https://github.com/skynetim/skynet/blob/master/lib/logData.js#L17 not sure what in my payload would break it.

octoblu commented 10 years ago

Just pushed an update to fix this issue. Please reopen if my fix doesn't work. Thanks.