Closed FallandeGubbe closed 1 month ago
@FallandeGubbe
When I try that exact config on my MM, it works as expected:
A couple things you can try:
Thanks for checking this and replying.
2, When accessing the url, you provided, from browser on R Pi running MM I get same result (success) , however when I click from my windows computer the file is not accessible. BUT in incognito mode it is !! But maybe that wont matter? As long as it is accessible from R Pi it should work?
@FallandeGubbe
Yes as long as it is available on the pi it should work. This is not a problem with the module but rather a problem with something in your setup.
If you're comfortable with code, you can try printing out the requestError
in the node_helper
file. You can add a new line 53 that reads:
console.log(requestError)
That might give us some more info on exactly why the request is failing on your pi.
ok, thanks. No I am far from a coder, but I added the code you suggested.
Same result - Would I be able so see a log file somewhere?
@FallandeGubbe
That code would print the error to the developer console in the browser. If you don't know how to access that you can change that line you added to:
Log.info(requestError)
And it will then print to the terminal (where you start MM from)
OK!
Does this help?
[20.10.2024 20:13.48.090] [LOG] [MMM-GoogleSheets] Sending request to https://script.google.com/macros/s/AKfycby6hghPqxI6DTgm3tNmsm2eaRWLVWTF5meCjmde4e3FbRxV79nxEGDebUqRBYrwNDPgUQ/exec?sheet=Blad1&range=D6:D10
[20.10.2024 20:13.48.109] [INFO] ReferenceError: fetch is not defined
at Class.socketNotificationReceived (/home/pi/MagicMirror/modules/MMM-GoogleSheets/node_helper.js:28:24)
at Socket.
@FallandeGubbe
The key here is "ReferenceError: fetch is not defined".
It looks like you are using an incorrect (old) version of nodejs. You can confirm this by tying this in your terminal:
node -v
My guess is it will show a version <18. The fetch
function was only introduced in nodejs 18+.
If you have an old node version, you need to upgrade.
If you have a current node version and it is still failing, you probably have an old version of MM (this thread talks about this exact problem).
I'm going to close this issue since this is not a module problem. If you still can't get it to work feel free to open it back up in the future.
Hi, I have followed the instructions, but get error when applying:
"There was an error in the request: Request failed. Check the URL and logs for more information."
config:
{ module: "MMM-GoogleSheets", header: "Google Sheets", position: "top_right", config: { url: "https://script.google.com/macros/s/AKfycby6hghPqxI6DTgm3tNmsm2eaRWLVWTF5meCjmde4e3FbRxV79nxEGDebUqRBYrwNDPgUQ/exec", sheet: "Blad1", range: "D6:D10" } },