[SOLVED] API Error: 400 - Missing device_secret parameter

I already have the .bash_profile with

export MATRIX_DEVICE_ID=…
export MATRIX_DEVICE_SECRET=…

and use source .bash_profile. When I use echo $MATRIX_DEVICE_ID and echo $MATRIX_DEVICE_SECRET I get

MATRIX_DEVICE_ID=…
MATRIX_DEVICE_SECRET=…

but when I use NODE_ENV=rc node index.js in matrix os and I get this error.

API Error: 400 - Missing device_secret parameter.

I have the exact same issue. Any help would be appreciated. Thx.

1 Like

@spartacus_mcfly are you using sudo NODE_ENV=rc node index.js or without sudo?

With sudo it give me the same error as you. API Error: 400 - Missing device_secret parameter.
Without sudo it gives me a bunch of permission denied errors.
The id and secret environment variable are set

Same issue here, thanks in advance for any help.

Here is my console:

pi@raspberrypi:~/matrix-os$ echo $MATRIX_DEVICE_ID
dfb071xxxx

pi@raspberrypi:~/matrix-os$ echo $MATRIX_DEVICE_SECRET
fa6ffxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    

pi@raspberrypi:~/matrix-os$ sudo NODE_ENV=rc node index.js
Environment Selected: rc
Loading Core Matrix Files
Loading...  device
Loading...  event
Loading...  service
API Error:  400 - Missing device_secret parameter.
Incorrect or missing registration information. This device is not correctly configured. Please add MATRIX_DEVICE_ID and MATRIX_DEVICE_SECRET variables. If you do not have these available, you can get them by issuing `matrix register device` with matrix CLI or by registering your device using the mobile apps. 

If you continue to have problems, please reach out to our support forums at http://community.matrix.one
Waiting for BLE pairing
Starting BLE configuration: 
Device configuration via bluetooth enabled
[]

My exact error is:

pi@raspberrypi:~/matrix-os $ sudo NODE_ENV=rc node index.js
Environment Selected: rc
Loading Core Matrix Files
Loading… device
Loading… event
Loading… service
API Error: 400 - Missing device_secret parameter.
Incorrect or missing registration information. This device is not correctly configured. Please add MATRIX_DEVICE_ID and MATRIX_DEVICE_SECRET variables. If you do not have these available, you can get them by issuing matrix register device with matrix CLI or by registering your device using the mobile apps.

If you continue to have problems, please reach out to our support forums at http://community.matrix.one
Waiting for BLE pairing
Starting BLE configuration:
Device configuration via bluetooth enabled
[]
[]
[]
[]

@spartacus_mcfly @cwilsonhsv

I know what is the problem. First in the terminal in matrix os folder use

sudo chmod 777 db/*

then use NODE_ENV=rc node index.js without sudo.

Looks like that worked for me, thanks!

Worked for me as well. Many thanks!!!