frdteknikelektro / MMM-SimpleLogo

MagicMirror Modules Simple Logo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Seeking help with SIMPLE_LOGO_UPDATE

SdeGeata opened this issue · comments

Greetings;

I am attempting to use this module in conjunction with MMM-Remote-Control and CLI commands. I am able to use command line to show and hide the module, and the default graphic I have set up as follows:

`curl "http://192.168.1.200:8080/api/module/:MMM-SimpleLogo/show?apiKey=My_API_key"

curl "http://192.168.1.200:8080/api/module/:MMM-SimpleLogo/hide?apiKey=My_API_key"`

These work fine. I am having problems though sending commands to modify using SIMPLE_LOGO_UPDATE. I am not sure of the construction of the command. The MMM-Remote-Control API specifies the following:

http://localhost:8080/api/module/:moduleName/:action/:p?a=something&b=somethingelse

Sends a notification :action to the module :moduleName with a payload { param: p, a: b, c: d }

I have structured my command as: curl "http://192.168.1.200:8080/api/module/:MMM-SimpleLogo/:SIMPLE_LOGO_UPDATE/:p?fileUrl:'/modules/MMM-ImageSlideshow/on_tap/Pilsner.jpg'&apiKey=My_API_key"

but it throws the following errors:

TypeError: Cannot read properties of undefined (reading &#39;:SIMPLE_LOGO_UPDATE&#39;)<br> &nbsp; &nbsp;at Class.answerModuleApi (/home/pi/MagicMirror/modules/MMM-Remote-Control/API/api.js:406:36)<br> &nbsp; &nbsp;at /home/pi/MagicMirror/modules/MMM-Remote-Control/API/api.js:269:22<br> &nbsp; &nbsp;at Layer.handle [as handle_request] (/home/pi/MagicMirror/node_modules/express/lib/router/layer.js:95:5)<br> &nbsp; &nbsp;at next (/home/pi/MagicMirror/node_modules/express/lib/router/route.js:144:13)<br> &nbsp; &nbsp;at Route.dispatch (/home/pi/MagicMirror/node_modules/express/lib/router/route.js:114:3)<br> &nbsp; &nbsp;at Layer.handle [as handle_request] (/home/pi/MagicMirror/node_modules/express/lib/router/layer.js:95:5)<br> &nbsp; &nbsp;at /home/pi/MagicMirror/node_modules/express/lib/router/index.js:284:15<br> &nbsp; &nbsp;at param (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:365:14)<br> &nbsp; &nbsp;at param (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:376:14)<br> &nbsp; &nbsp;at param (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:376:14)

I am not sure what this means, is my command wrong or is there some other issue? Any hints on how I can get this to work properly?

I managed to figure it out. I will close the issue.

For reference for others who may be interested, the solution for the formatting of the CL request is as follows:

curl --location --request GET "magicMirror.local:8080/api/notification/SIMPLE_LOGO_UPDATE/p?fileUrl=/modules/MMM-SimpleLogo/on_tap/Pilsner.jpg&text=Pils&apiKey=YourAPIkey"