API not reachable, error msg: Cannot GET /api/docs
Opened this issue · 13 comments
OS
Raspberry Pi OS (Linux magicmirror 6.6.31+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.31-1+rpt1 (2024-05-29) aarch64 GNU/Linux)
NodeJS Version
v22.9.0
MagicMirror² Version
2.29.0
Remote Control Version
2.3.8
Did you try using just Remote Control alone with MM?
- I have and the error still happening
Description
Brand new install of Magic Mirror using manual install on a Raspberry Pi 5.
MagicMirror and MMM-Remote-Control working flawlessly. Frontend of MagicMirror can be accessed from another machine (http://IP-of-MM:8080). Frontend of MMM-Remote-Control can be accessed from another machine (http://IP-of-MM:8080/remote.html).
However: I can not access the API endpoint. A normal GET request to http://IP-of-MM:8080/api/docs gets answered with Cannot GET /api/docs
Expected behavior
API request should be completed successfully.
Current behavior
Error message saying Cannot GET /api/docs
Possible solution
No response
Steps to reproduce
- Start MM
- Wait until everything starts
- Try to open "http://IP-of-MM:8080/api/docs"
Log
Nothing in log files regarding this issue. I started 'npm logs mm' and kept watching the logs as I send above request. No new entries.
config.js
let config = {
address: "0.0.0.0", // Address to listen on, can be:
// - "localhost", "127.0.0.1", "::1" to listen on loopback interface
// - another specific IPv4/6 to listen on a specific interface
// - "0.0.0.0", "::" to listen on any interface
// Default, when address config is left out or empty, is "localhost"
port: 8080,
basePath: "/", // The URL path where MagicMirror² is hosted. If you are using a Reverse proxy
// you must set the sub path here. basePath must end with a /
ipWhitelist: [], // Set [] to allow all IP addresses
// or add a specific IPv4 of 192.168.1.5 :
// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
// or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],
useHttps: false, // Support HTTPS or not, default "false" will use HTTP
httpsPrivateKey: "", // HTTPS private key path, only require when useHttps is true
httpsCertificate: "", // HTTPS Certificate path, only require when useHttps is true
language: "de",
locale: "de-CH",
// logLevel: ["INFO", "LOG", "WARN", "ERROR"], // Add "DEBUG" for even more logging
logLevel: ["WARN", "ERROR"], // Add "DEBUG" for even more logging
timeFormat: 24,
units: "metric",
// serverOnly: true/false/"local" ,
// local for armv6l processors, default
// starts serveronly and then starts chrome browser
// false, default for all NON-armv6l devices
// true, force serveronly mode, because you want to.. no UI on this device
modules: [
{
module: "alert",
},
{
module: "MMM-Remote-Control",
config: {
showModuleApiMenu: true,
secureEndpoints: false,
customCommand: {
monitorOnCommand: 'WAYLAND_DISPLAY=wayland-1 wlr-randr --output HDMI-A-1 --on --transform 270',
monitorOffCommand: 'WAYLAND_DISPLAY=wayland-1 wlr-randr --output HDMI-A-1 --off',
monitorStatusCommand: '/home/steve/MagicMirror/monitorstatus.sh'
}
}
},
Additional info
No response
This module needs changes to work with new MagicMirror² version v2.29.0
. A PR is on the way but I don't know who is maintaining this project at the moment ...
Interesting, thank you for reply.
Regarding the aforementioned PR: the module works perfectly fine on my setup - only the API does not work. Stock install of the module btw.
the api works with the PR, tested this ...
the module works perfectly fine on my setup
not on my side, e.g. http://localhost:8080/remote.html#update-menu is always empty and http://localhost:8080/remote.html#module-control-menu is missing ...
So #307 should fix the module and the API?
I did some cleanup/changes in the core mm for v2.29.0 which breaks this module at some points, #307 is the fix for this.
With this fix the /api/docs
shows the swagger site (whithout the fix you get the error described above), but I cannot say if the other PR is still needed.
I've just installed MM on PC running Linux Mint (Ubuntu version) and have the same problem. I've tried to update MMM_Remote-Control but it tells me I'm up to date. I can see the remote web page but API does not connect. Is there a way I can fix this?
Clone this repo and branch temporarily:
So it's safe to merge? I cannot test it anymore, as I don't own a MM instalation anymore.
Sorry for the absence, a lot happened on my side.
Please confirm that it's actually working, khassel PR merged
I can confirm, it works now.
Thank you.