rand256 / valetudo

Valetudo RE - experimental vacuum software, cloud free
Apache License 2.0
669 stars 74 forks source link

Cannot store map via MQTT #269

Closed juantxorena closed 4 years ago

juantxorena commented 4 years ago

Valetudo RE version 0.9 (also tested with 0.9.5.2)

I cannot store maps using MQTT. I'm using the topic "valetudo/rockrobo/custom_command" with the payload { "command": "store_map", "name": "mapa" }.

The log says:

/snapshot/valetudo/lib/MqttClient.js:577
                    this.MapManager.storeMap(msg.name, (err, data) => this.publishCommandStatus(msg.command,data,err));
                                    ^

TypeError: Cannot read property 'storeMap' of undefined
    at MqttClient.handleCustomCommand (/snapshot/valetudo/lib/MqttClient.js:577:22)
    at MqttClient.messageCallback (/snapshot/valetudo/lib/MqttClient.js:209:11)
    at MqttClient.emit (events.js:315:20)
    at MqttClient._handlePublish (/snapshot/valetudo/node_modules/mqtt/lib/client.js:1269:12)
    at MqttClient._handlePacket (/snapshot/valetudo/node_modules/mqtt/lib/client.js:409:12)
    at work (/snapshot/valetudo/node_modules/mqtt/lib/client.js:320:12)
    at Writable.writable._write (/snapshot/valetudo/node_modules/mqtt/lib/client.js:334:5)
    at doWrite (/snapshot/valetudo/node_modules/readable-stream/lib/_stream_writable.js:428:64)
    at writeOrBuffer (/snapshot/valetudo/node_modules/readable-stream/lib/_stream_writable.js:417:5)
    at Writable.write (/snapshot/valetudo/node_modules/readable-stream/lib/_stream_writable.js:334:11)
    at Socket.ondata (_stream_readable.js:717:22)
    at Socket.emit (events.js:315:20)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:271:9)
    at Socket.Readable.push (_stream_readable.js:212:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:186:23)
2020-07-19T18:09:02.050Z Loading configuration file: /mnt/data/valetudo/config.json
2020-07-19T18:09:02.727Z Dummycloud is spoofing 203.0.113.1:8053 on 127.0.0.1:8053
2020-07-19T18:09:02.738Z Webserver running on port 80
2020-07-19T18:09:02.790Z Connected successfully to mqtt server
2020-07-19T18:09:03.003Z Probed last id = 1001 using set_custom_mode (3 retries)

MQTT works correctly, i.e. any other command works. Storing the map via the web interface also works (the map is stored in /mnt/data/valetudo/maps/). I'm not sure if load_map works.

rand256 commented 4 years ago

There's a typo, will be fixed in the next release. Thanks for mentioning it.