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

Module stopped working #158

Open
ihadx opened this issue May 23, 2023 · 65 comments · Fixed by #182
Open

Module stopped working #158

ihadx opened this issue May 23, 2023 · 65 comments · Fixed by #182
Assignees

Comments

@ihadx
Copy link

ihadx commented May 23, 2023

I'm pretty sure that Netatmo has finally depricated "Client credentials grant type" in favour of "Authorization code grant type".
Go to https://dev.netatmo.com/apidocumentation/oauth and look for 'Client credentials grant type'

Is someone in the community skilled enough to upgrade the existing code?

@Laz2516
Copy link

Laz2516 commented Jul 17, 2023

I join the request! (((
I also stopped working the module, after about June 29.... (((

@CFenner
Copy link
Owner

CFenner commented Jul 26, 2023

Will try to setup MM again to fix this. Any more hints for me? Are you willing to test the changes?

@skyhawk180
Copy link

skyhawk180 commented Jul 26, 2023

Will try to setup MM again to fix this. Any more hints for me? Are you willing to test the changes?

I'll be glad to test the changes as well. I believe the oauth2 auth code changes are described here: https://dev.netatmo.com/apidocumentation/oauth#authorization-code. I'd suspecting the changes will need to be in "node_helper.js". Standing by.

@Laz2516
Copy link

Laz2516 commented Jul 26, 2023

I am also ready to help if I understand how to get a new authorization (token probably).

@Laz2516
Copy link

Laz2516 commented Jul 29, 2023

Maybe this will help the developer fix the authorization?.....

https://forum.netatmo.com/viewtopic.php?t=21383

@Laz2516
Copy link

Laz2516 commented Aug 8, 2023

https://forum.magicmirror.builders/topic/12315/mmm-netatmo-updated/42?page=5

Could help the developer....
How you can get tokens.
The module from RaymondMolenaar works after retrieving the authorization data again on the Netatmo website.

@Laz2516
Copy link

Laz2516 commented Aug 9, 2023

Authorization also stopped working in the RainMachine application. This solution appeared on the user forum. Perhaps this will help a respected developer.
I cite links....

"Change: zagy/rainmachine-developer-resources@df1d75b

File: https://raw.githubusercontent.com/zagy/rainmachine-developer-resources/df1d75b84cf9fb12b3334029c48e5cbf6b8625d0/sdk-parsers/RMParserFramework/parsers/personalnetatmo-parser.py (can be uploaded via the rainmachine UI)

It's not very tested, but seems to work for now. "

@skyhawk180
Copy link

Many examples are available on how to implement OAuth2.0 auth code / access token flows. Hopefully someone can implement it here: https://developer.goto.com/guides/Authentication/04_HOW_accessTokenNodeJS/

@Laz2516
Copy link

Laz2516 commented Aug 11, 2023

The token can be obtained from the Netatmo app. Where are the keys.
image

@CFenner
Copy link
Owner

CFenner commented Aug 14, 2023

@Laz2516 @skyhawk180 @ihadx Can you check if this works for you?

#182

@Laz2516
Copy link

Laz2516 commented Aug 14, 2023

Of course. I will check now.))

@Laz2516
Copy link

Laz2516 commented Aug 14, 2023

Unfortunately, it doesn't work. Module icons do not appear on the screen. The inscription "Loading..." is shown.
I deleted only my login and password. He left the keys. And added a refresh token. Right?
Raspberry overloaded.
Perhaps in the Personal Account-Settings-Partner Applications you need to remove the permission for the old MagicMirror?

"
{
module: 'netatmo',
position: 'top_left', // the location where the module should be displayed
header: 'ДОМАШНЯЯ МЕТЕОСТАНЦИЯ', // a header if you like one
config: {
clientId: '63319aa6d7d9ebХХХХХХХХХ', // your app id
clientSecret: 'ХХХХХBeNDqyerfjkZaХХХХХХХХХХХ', // your app secret
refresh_token: 'ХХХХХХХХ75368c04c4188c8b52cf|0e864b8ХХХХХХХХХХХХХХ',
// username: 'ХХХХХХХХ', // your netatmo username
// password: 'ХХХХХХХХХ', // your netatmo password
// moduleOrder: ["NAMain", "NAModule4", "NAModule1", "NAModule3", "NAModule2" ],
}
},

image

@Laz2516
Copy link

Laz2516 commented Aug 14, 2023

Maybe the syntax of the name refresh token is not correct?
Could you add another access token?
Do you want to change only the lines in the configuration? Do you need any changes in the module itself?

https://forum.magicmirror.builders/topic/12315/mmm-netatmo-updated/42?page=5

@Laz2516
Copy link

Laz2516 commented Aug 14, 2023

refresh_token: 'ХХХХХХХХХХХХХХХХХХХХ88c8b52cf|0e864b8f9ХХХХХХХХХХХХХХ',
access_token: 'ХХХХХХХХХХХХХХХХХХХХХХcf|d8d36de50b9c7ХХХХХХХХХХХХХХ',

Alas, adding an access token to the configuration did not help. The weather station does not show the data....

@CFenner
Copy link
Owner

CFenner commented Aug 14, 2023

I deleted only my login and password. He left the keys. And added a refresh token. Right?

Did you update the module code from the auth branch?

@Laz2516
Copy link

Laz2516 commented Aug 14, 2023

No.... ((
Can I completely download the module again in the zip file and expand the archive on top of the old module?)

Or tell me how to update your module from SSH?

@Laz2516
Copy link

Laz2516 commented Aug 14, 2023

I downloaded the archive, uploaded it to raspberries. And replaced all the files that were fresh. But there are no files in the archive
helper.js
helper.test.js
module.js

@CFenner
Copy link
Owner

CFenner commented Aug 14, 2023

@Laz2516
Copy link

Laz2516 commented Aug 14, 2023

Downloaded your archive from the link. Replaced only new files. After rebooting the raspberry, the MM program itself does not start. I see only a raspberry desktop.
Then I wrote completely all the files from your archive on top of the installed module.
The same thing, I see only the desktop, MM does not start....

@Laz2516
Copy link

Laz2516 commented Aug 14, 2023

Returned the old module completely from the copy, MM starts.

@CFenner
Copy link
Owner

CFenner commented Aug 14, 2023

Ok, then I'm need to run the module myself. Sorry for the inconvenience.

@Laz2516
Copy link

Laz2516 commented Aug 14, 2023

Good. Then I am waiting for your decision.
A separate archive with only modified files would be good. To avoid spoiling module settings.

And I would very much like, since you have taken up the module, to be able to display the pressure value in mm Hg.

@CFenner
Copy link
Owner

CFenner commented Aug 14, 2023

I would very much like, since you have taken up the module, to be able to display the pressure value in mm Hg.

Let's fix this first and then I will have a look.

It actually works for me, I just missed to run npm clean-install --production --ignore-scripts as stated in the instructions.

@skyhawk180
Copy link

Good. Then I am waiting for your decision. A separate archive with only modified files would be good. To avoid spoiling module settings.

And I would very much like, since you have taken up the module, to be able to display the pressure value in mm Hg.

As a temporary fix for Pressure in 'in Hg', you can update netatmo.js follows. For mmHg, look for the formula and replace the numbers:

case this.measurement.PRESSURE:
return (value.toFixed(0)*0.02953).toFixed(2)// pressure conv to inHg.

@skyhawk180
Copy link

-I have tried to merge both my original code and 'auth' branch and while the error goes away, nothing gets loaded on the screen.
-I have tried to only copy node helper files to my original main code, and it fails with dependency errors.

  • I tried to overwrite auth.zip on top of my netatmo original code, same issue as above.
    -I did a clean install of MM and only installed netatmo from latest main branch and its same error as above.

Not sure the code is correctly loaded/committed into git. I see differences in netatmo files between branches and also helper files.
I am sure I'm missing something that you have a local copy of. Can you just zip your working copy of netatmo folder (under MM/modules) and provide me and I can see if that runs. If so, we can compare code base with git. I have the latest MM 2.4 and node/npm and all other modules are working if I remove this folder.

@CFenner
Copy link
Owner

CFenner commented Aug 14, 2023

So changes are merged to main branch. You need to

@CFenner CFenner reopened this Aug 21, 2023
@CFenner
Copy link
Owner

CFenner commented Aug 26, 2023

@skyhawk180 @Laz2516 what does the browser console show? There should be an error message.

@Laz2516
Copy link

Laz2516 commented Aug 26, 2023

@skyhawk180 @Laz2516что показывает консоль браузера ? Должно появиться сообщение об ошибке.

Unfortunately, I am not very well versed in programming. I can only repeat the tips. Tell me how to see the error?
At the moment, with the latest version of the module (I wrote about this above), MM does not start completely. Only two modules are launched, the rest in the "Download" status. If you change the name of the netatmo module to netatmo1, so that the module does not start from the config, then the MM starts normally, all the modules that I use.

@skyhawk180
Copy link

@skyhawk180 @Laz2516 what does the browser console show? There should be an error message.

  • In server mode (MM), the netatmo modules works without any errors. I see all modules getting loaded correctly on the browser (Firefox). Only when running locally, its not getting rendered on the screen, no errors in the pm2 logs. I tried dev tools for npm and no errors there either. I am running MM with a screen attached to my RPI/ODROID SBCs for many years and it works ok with latest updates, other than this silly issue with Netatmo AuthZ changes.

@CFenner
Copy link
Owner

CFenner commented Aug 26, 2023

Did you connect to your MM on the RPi with the Firefox or was MM running on your machine?
So is the error when displaying it with electron or on the RPi in general?

@skyhawk180
Copy link

Did you connect to your MM on the RPi with the Firefox or was MM running on your machine? So is the error when displaying it with electron or on the RPi in general?

Both are working in server mode. I tried remote and local via browser. As a workaround now, I am running firefox-esr in kiosk mode with the mm url and its working. I'd rather have a local option too so it can be managed via pm2.

@eierfeile
Copy link

I also have the same issue. But it sounds the latest version of netatmo module isnt the final solution. Is it mandatory to have latest version of magirmirrorOS installed to make the module run properly?

@Laz2516
Copy link

Laz2516 commented Aug 30, 2023

Unfortunately, for some reason we are not enough in this topic. Is Netatmo station in MM really so little used?
Maybe one of us should give access to the author of the module to his station so that the author can check the module improvements himself?

@Laz2516
Copy link

Laz2516 commented Sep 4, 2023

https://support.rainmachine.com/hc/en-us/articles/13251844688151-NetAtmo-Weather-Service-2023-Update-Fix-

Dear module developer, perhaps this can help you as a sample?
This developer of the auto-watering system has changed its module to access Netatmo.

@torth
Copy link

torth commented Sep 4, 2023

hi folks, I read your instructions and I can agree - problem is still existing.

I generated a new App in dev.netatmo.com
generated a "read_station" Token
mv netatmo -> netatmo_old
git clone https://github.com/CFenner/MMM-Netatmo.git netatmo
npm ci --production --ignore-scripts
reconfigured config.js with clientId: '', clientSecret: '', refresh_token: '',

but ... after pm2 restart are all modules in state "Downloading" and showing no data

once I deactivated 'netamo' in my config the MM runs as expected and correctly. When 'netatmo' config is enabled I'm also not able to access MM remote with browser <local_ip>:8080

don't know how to help / assist, but I'll you support as much as I can.

@torth
Copy link

torth commented Sep 4, 2023

i don't know if it's good news or bad news, but with the RaymondMolenaar Netatmo-Module and my new credentials works it
and MMM show me the data of my station. Tested 10 minutes ago ...

@Laz2516
Copy link

Laz2516 commented Sep 4, 2023

Привет, ребята, я прочитал ваши инструкции и могу согласиться - проблема все еще существует.

Я создал новое приложение на dev.netatmo.com, сгенерировал токен «read_station» mv netatmo -> netatmo_old git clone https://github.com/CFenner/MMM-Netatmo.git netatmo npm ci --production --ignore-scripts перенастроил config.js с clientId: '', clientSecret: '',refresh_token: '',

но... после перезапуска pm2 все модули находятся в состоянии «Загрузка» и не отображают никаких данных

как только я деактивировал «netamo» в своей конфигурации, ММ работает как положено и правильно. Когда включена конфигурация «netatmo», я также не могу получить удаленный доступ к MM с помощью браузера <local_ip>:8080.

не знаю чем помочь/содействовать, но поддержу, чем смогу.

I also have the same, one in one

@Laz2516
Copy link

Laz2516 commented Sep 4, 2023

но с модулем RaymondMolenaar Netatmo и моими новыми учетными данными все работает,

I would not like to change the module. I'm quite fine with this one. If I can then change the pressure display format. And perhaps now there are errors in the display of the wind, but I have a faulty wind sensor itself, I bought a new one. Then I will write comments.

@Laz2516
Copy link

Laz2516 commented Sep 7, 2023

Попробую снова настроить MM, чтобы это исправить. Есть еще подсказки для меня? Готовы ли вы протестировать изменения?

Did you manage to change something in the module for Netatmo authorization? I wrote you a sentence and links above.
I can give access to my station for your experiments. If it doesn't work out differently.....

@CFenner
Copy link
Owner

CFenner commented Sep 7, 2023

I can give access to my station for your experiments. If it doesn't work out differently.....

That's a great idea.

My mail would be ...

@fradrik
Copy link

fradrik commented Sep 7, 2023

please update this thread if you find a solution. I have been following here since june, because my netatmo-module in MM is not working either. Thanks. :)

@Laz2516
Copy link

Laz2516 commented Sep 7, 2023

Могу предоставить доступ к моей станции для ваших экспериментов. Если не получится по-другому.....

Это блестящая идея.

Моя почта будет ...

Sent you the data.

@Laz2516
Copy link

Laz2516 commented Sep 9, 2023

Могу предоставить доступ к моей станции для ваших экспериментов. Если не получится по-другому.....

Это блестящая идея.

Моя почта будет...

Do you have Telegrams? I can't insert the archive into my mail.

@Laz2516
Copy link

Laz2516 commented Sep 9, 2023

Thank you, sent the archive.

@Laz2516
Copy link

Laz2516 commented Sep 14, 2023

The developer of the module is still busy. With my data, he managed to authorize and display information from the Netatmo station in the MM.
We are waiting for the module correction....)

@CFenner
Copy link
Owner

CFenner commented Sep 14, 2023

@Laz2516 you credentials are no longer valid. Unfortunately the module does not yet bring this to the frontend.

mm  | [14.09.2023 14:55.17.314] [LOG]   error: Error: invalid_grant: undefined
mm  |     at Class.authenticate (/opt/magic_mirror/modules/netatmo/helper.js:41:15)
mm  |     at Class.socketNotificationReceived (/opt/magic_mirror/modules/netatmo/helper.js:125:14)
mm  |     at Socket.<anonymous> (/opt/magic_mirror/js/node_helper.js:107:11)
mm  |     at Socket.emit (node:events:513:28)
mm  |     at Socket.emitUntyped (/opt/magic_mirror/node_modules/socket.io/dist/typed-events.js:69:22)
mm  |     at /opt/magic_mirror/node_modules/socket.io/dist/socket.js:703:39
mm  |     at process.processTicksAndRejections (node:internal/process/task_queues:77:11)

@Laz2516
Copy link

Laz2516 commented Sep 17, 2023

@Laz2516 you credentials are no longer valid. Unfortunately the module does not yet bring this to the frontend.

mm  | [14.09.2023 14:55.17.314] [LOG]   error: Error: invalid_grant: undefined
mm  |     at Class.authenticate (/opt/magic_mirror/modules/netatmo/helper.js:41:15)
mm  |     at Class.socketNotificationReceived (/opt/magic_mirror/modules/netatmo/helper.js:125:14)
mm  |     at Socket.<anonymous> (/opt/magic_mirror/js/node_helper.js:107:11)
mm  |     at Socket.emit (node:events:513:28)
mm  |     at Socket.emitUntyped (/opt/magic_mirror/node_modules/socket.io/dist/typed-events.js:69:22)
mm  |     at /opt/magic_mirror/node_modules/socket.io/dist/socket.js:703:39
mm  |     at process.processTicksAndRejections (node:internal/process/task_queues:77:11)

Authorization data is not valid?
But they didn't change.

I have a RainMachine auto-watering controller. It also uses data from the weather station Netatmo. And since June, the controller could not connect to the cloud of the weather station using the old authorization method. A couple of weeks ago, technical support changed the software connection module. There I use exactly the same data and everything works.

If you are talking about my archive with your module, then check the authorization data in the config. Which I sent you in a letter. Perhaps in the config just actually old data. Fix them.

@Laz2516
Copy link

Laz2516 commented Sep 24, 2023

Good afternoon!
Can I help you with checking your module? I would like it to work faster..)))

@Laz2516
Copy link

Laz2516 commented Oct 12, 2023

Good afternoon!
Have you completely forgotten about us?))))

@Laz2516
Copy link

Laz2516 commented Oct 14, 2023

Good afternoon!
I've formed all the new data again.
But the module does not load... (((

Try at home...... I sent you my config in telegrams

@Laz2516
Copy link

Laz2516 commented Oct 28, 2023

I have updated to 2.25, but the module does not start and does not allow the rest of the modules to start...
If you rename the module folder or return the module archive before you change (in August), then the mirror with all modules starts, except for the Netatmo module.
Unfortunately, I can't see the bugs in the browser console.
Anyone tell me how to do this?

@fradrik
Copy link

fradrik commented Nov 6, 2023

@Laz2516 I found this. Tommys's solution worked for me as well.
I had to rename the "ModuleOrder" in config.js so it matches the productes names in the Netatmo App.

@Laz2516
Copy link

Laz2516 commented Nov 10, 2023

@Laz2516Я нашел это . Решение Томмиса сработало и для меня. Мне пришлось переименовать «ModuleOrder» в config.js, чтобы он соответствовал именам продуктов в приложении Netatmo.

I tried it, but it doesn't work. It is possible that I have module names in Russian in the Netatmo application...
And you have this module of the old version or already changed by the author (I think it may be for me to reinstall the module).

@cgillinger
Copy link
Contributor

There is a guy in this thread who appears to have solved it. Unfortunately Im not code-savvy enough to implement it:

https://forum.magicmirror.builders/topic/18112/mmm-netatmo-does-not-load/5

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

Successfully merging a pull request may close this issue.

8 participants