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
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
[]
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
[]
[]
[]
[]