Cannot load matrix device into matrix app

Chated with Diego to troubleshoot getting matrix linked with app.

Hi , how can we help you today?

Hello

How can I help you?

I’m having trouble connecting my matrix to the matrix app

What problem is happening?

Can you share with me more information

I can connect the only device, name it, but then it shows it’s offline. I click on the red box, it then says No device found.
on the pi, it shows my phone connecting, then disconnectin.
Device registration failed: Environment mismatch dev

the green box shows after that?

no

Did you follow the installation steps on our documentation page?

https://matrix-io.github.io/matrix-documentation/matrix-os/getting-started/installation/

Yes, several times

wow!

The ENV variables went successful configured?
How are you running the matrix-os?

I can load the device on PC, I can run node index.js on the pi. The clock app works, the ifttt-weather works. The app on my phone does not connect.

Understood

what is your NODE_ENV on the matrix os?
rc or dev?

rc

What is the mobile phone? Android or iOs?

phone is android, tablet is ios

Are you trying in which device?

both

Ok. Let’s do it with iOS

We need to check the Environment for the Mobile App

ok

Firstly let me ask you something:

Did you login with your account on the iOS app?

yes

Do you can see your MATRIX Device there?

in the iOS App after the login?

I see one, but it may be an old one, I have registered several (on one matrix card)

wow

Please click in the three dots button on the top right of the iOS App

ok

At the bottom You’ll see the version of this app

can you share with me?

2.0.2 build 74 prod

You are using a different environment for the app

We need to change it to rc, to be the same as you matrix device

ok

can you go to the iOS settings?

ok

Go down this page until you see the MATRIX App

ok

Please click there and click again in Environment

and please set: Release Candidate

Go back and close your MATRIX Mobile App

only thing it says is Cellular Data

Let me see it

Please wait a moment

ok

Please wait a bit more

NP

Hey! I have a solution but I’ll have to configure your MATRIX OS and MATRIX CLI again

ok

to match the same environment as the MATRIX App

Okay?

sure

okay. The first this is create a new env for you

so. In your matrix please run: matrix set env prod

sorry

This is for you local machine

please run there: matrix set env prod

prod didn’t work, needed production, done

nice!

now you need to create a new account for prod env

create new or loging with old?

please create an account, register a new device, copy the env variables and put in your matrix device.

ok

the env is different. So that account only exists for RC

now you have to create a new one for PROD

almost done

nice!!

Create an envprod file and put your new settings there

we’ll load those new variables with:

source envprod

done

Nice!!

Now, we’ll run the MATRIX OS with the new env

Please do:

NODE_ENV=prod node index.js

sudo?

no

sudo is not necessary

After that close you MATRIX iOS App and open again. When you open please logout and login with your prod account

getting an error…

what error? Because of the sudo?

enviroment selected: prod
module.js:457
throw err;

wow

please replace prod by production

so, run:

cannot find module’home/pi/matrix-os/config/env/prod.js

NODE_ENV=production node index.js

is working for me.

Looks good for you?

didn’t work that way, does work with sudo, now asking for BLE pairing

is working with sudo because You certainly tried with sudo before. So some files permissions went changed

ok. Is asking BLE pairing because the env variables aren’t working

Let’s do something to check if everything is ok:

run:

echo $MATRIX_DEVICE_ID

It shows same as PC matrix device

and let me know if match with the new env

yes it does

same with secret

Hey!

yes

Is the same secret as the rc?

prod and rc are the same?

no, id and secret are the new prod ones

nice!

Can you share with me how are you running the matrix os?

How so?

are you doing: NODE_ENV=production node index.js ?

sudo first, then what u have above

ok

so the MATRIX is blinking blue?

yes

ok

please go to your MATRIX iOS App

Login in

and click to add a new device. Let’s do it this time because I don’t know why the prod env is ignoring your new env variables

Tried with new account, does not let me login.

please try the old account

one sec

im in on the android

Tried to add matrix to phone app, still get Environment missmatch dev

wow

Please logout from the Android app

ok

at the bottom of the login page can you see the environment?

no

Hey! Can you be using your MATRIX Device from CLI (with RC env) for while?

I’ll need to report this issue to the Engineering Team.

yes

I’m sorry about that. But I’ll report it to the guys

And a soon as possible this will be fixed

Okay?

Sounds good, is there a case number ?

I’ll report internally but you can do it the community or in some github repo

I think the Community is better

How will I know when it’s fixed?

Do you want do that? I think is better because maybe another user could be getting the same issue


Anyone else have this issue?

Thanks,
Craig

I have the same issue
2 month later, I want to restart everything on a new pi
Got my iOS app in prod env as well and the Matrix starts using rc env