Hypfer / ICantBelieveItsNotValetudo

A Valetudo companion service which renders maps to pngs
Apache License 2.0
129 stars 80 forks source link

Cannot find a docker with rotate option? #36

Closed markrennie71 closed 3 years ago

markrennie71 commented 3 years ago

Hello

I cannot find a dockerfile that uses the newer option of rotate. Can you point me in the right direction please? As you don't have a docker for it?

Cheers Mark

markrennie71 commented 3 years ago

I have tried this one from @alceasan but I get this error in the docker.. I think it is the 0.3.0

i-cant-believe-its-not-valetudo@0.3.0 start /app

node app.js

Loading configuration file: /app/config.json

Connecting to MQTT Broker

Webserver running on port 3000

Connected to MQTT Broker

SyntaxError: Unexpected token  in JSON at position 0

at JSON.parse (<anonymous>)

at MqttClient.<anonymous> (/app/lib/MqttClient.js:85:42)

at MqttClient.emit (events.js:314:20)

at MqttClient._handlePublish (/app/node_modules/mqtt/lib/client.js:987:12)

at MqttClient._handlePacket (/app/node_modules/mqtt/lib/client.js:336:12)

at work (/app/node_modules/mqtt/lib/client.js:292:12)

at Writable.writable._write (/app/node_modules/mqtt/lib/client.js:302:5)

at doWrite (/app/node_modules/readable-stream/lib/_stream_writable.js:428:64)

at writeOrBuffer (/app/node_modules/readable-stream/lib/_stream_writable.js:417:5)

at Writable.write (/app/node_modules/readable-stream/lib/_stream_writable.js:334:11)
alceasan commented 3 years ago

Hi @markrennie71 , I have tried the rotate option with my docker build and it works without problem. The parameter goes into the mapSettings block of config.json, I paste here my config with a 90 degrees rotation:

"mapSettings": {
    "drawPath": true,
    "drawCharger": true,
    "drawRobot": true,
    "scale": 2,
    "rotate": 90,
    "colors": {
      "floor": "#0076ff",
      "obstacle_weak": "#6699ff",
      "obstacle_strong": "#52aeff",
      "path": "#ffffff"
    }
  }

This is the function used for rotation, from Jimp package. If your config isn't working, try to delete config.json and it will create a default new one on start.

markrennie71 commented 3 years ago

thanks, I have tried everything and I get the same error each time using your docker image, looks like when it connects to mqtt it bombs out

Connected to MQTT Broker

SyntaxError: Unexpected token  in JSON at position 0

at JSON.parse (<anonymous>)

at MqttClient.<anonymous> (/app/lib/MqttClient.js:85:42)

at MqttClient.emit (events.js:314:20)

at MqttClient._handlePublish (/app/node_modules/mqtt/lib/client.js:987:12)

at MqttClient._handlePacket (/app/node_modules/mqtt/lib/client.js:336:12)

at work (/app/node_modules/mqtt/lib/client.js:292:12)

at Writable.writable._write (/app/node_modules/mqtt/lib/client.js:302:5)

at doWrite (/app/node_modules/readable-stream/lib/_stream_writable.js:428:64)

at writeOrBuffer (/app/node_modules/readable-stream/lib/_stream_writable.js:417:5)

at Writable.write (/app/node_modules/readable-stream/lib/_stream_writable.js:334:11)
markrennie71 commented 3 years ago

going to close this as I realised I flashed with a different version of valetudo!! sorry