Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote Control REST API not working #291

Closed
1 task done
Anonym-tsk opened this issue Aug 7, 2023 · 5 comments · May be fixed by #292
Closed
1 task done

Remote Control REST API not working #291

Anonym-tsk opened this issue Aug 7, 2023 · 5 comments · May be fixed by #292

Comments

@Anonym-tsk
Copy link

OS

Raspbian

NodeJS Version

10.24.1

MagicMirror Version

2.23.0

Remote Control Version

2.3.7

Did you try using just Remote Control alone with MM?

  • I have and the error still happening

Description

I tried to use remote control integration with my module https://github.com/Anonym-tsk/MMM-go2rtc
I added REGISTER_API notification and it works from /remote.html interface.
But it doesn't work as REST API (when i open api/module/:moduleName/:action url).

Expected behavior

URL should work as documented: /api/module/go2rtc/play

Current behavior

Look ad my code: https://github.com/Anonym-tsk/MMM-go2rtc/blob/e15362c60fad4d15cce06427a2d04ddb025244b1/MMM-go2rtc.js#L70

  1. path option doesn't work. I wanted to have url /api/module/go2rtc, but working url is /api/module/module_3_MMM-go2rtc
  2. /api/module/module_3_MMM-go2rtc response missed actions.
  3. Actions not working. /api/module/module_3_MMM-go2rtc/play returns error
TypeError: Cannot read properties of undefined (reading 'play')
    at Class.answerModuleApi (/home/pi/MagicMirror/modules/MMM-Remote-Control/API/api.js:415:36)
    at /home/pi/MagicMirror/modules/MMM-Remote-Control/API/api.js:273:22
    at Layer.handle [as handle_request] (/home/pi/MagicMirror/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/pi/MagicMirror/node_modules/express/lib/router/route.js:144:13)
    at Route.dispatch (/home/pi/MagicMirror/node_modules/express/lib/router/route.js:114:3)
    at Layer.handle [as handle_request] (/home/pi/MagicMirror/node_modules/express/lib/router/layer.js:95:5)
    at /home/pi/MagicMirror/node_modules/express/lib/router/index.js:284:15
    at param (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:365:14)
    at param (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:376:14)
    at param (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:376:14)
    at param (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:376:14)
    at Function.process_params (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:421:3)
    at next (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:280:10)
    at /home/pi/MagicMirror/modules/MMM-Remote-Control/API/api.js:153:13
    at Layer.handle [as handle_request] (/home/pi/MagicMirror/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:328:13)

Possible solution

No response

Steps to reproduce

Install MMM-go2rtc and try to use

Log

---------

config.js

{
                        module: 'MMM-Remote-Control',
                        config: {
                                customCommand: {},
                                showModuleApiMenu: true,
                                secureEndpoints: false,
                        }
                },
                {
                        module: "MMM-go2rtc",
                        position: "top_left",
                        config: {
                                host: "192.168.10.10",
                                port: "1984",
                                entity: "camera",
                        },
                },

Additional info

No response

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.

@github-actions github-actions bot added the stale label Aug 28, 2023
@earlywaff
Copy link

up!

@github-actions github-actions bot removed the stale label Sep 4, 2023
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.

@kris4ever
Copy link

Hi, any update on this ? Facing the same issue.
Thanks for your help.

@ezeholz
Copy link
Collaborator

ezeholz commented Oct 5, 2023

There was an update in the latest release affecting this area. It's possible that this issue has been resolved.

Let me know if you're still facing this issue in the latest update. I'll try to make some time to check it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants