VOICE, Unable to reach device, client registration fail troubles


#1

I am little angry (and it is a big little) after waiting almost a year for a device, I discovered - I have to use some #&$^&# cloud circus. And then when I wanted to play with it a little, I am receiving:

client registration fail
Unable to reach device, the application will be installed as soon as your device is available

My device is registered, my ~/.envrc exports MATRIX_DEVICE_ID and MATRIX_DEVICE_SECRET correctly, malos is working. I read a lot of posts and I don’t see solution anywhere.

So the question: how to fix it and how to run app without using any (any!) cloud software?

pi@raspberrypi:~ $ matrix log
=========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

Error: client registration fail
    at Socket.<anonymous> (/home/pi/.npm-global/lib/node_modules/matrix-cli/node_modules/matrix-node-sdk/utils/Socket.js:45:16)
    at Socket.Emitter.emit (/home/pi/.npm-global/lib/node_modules/matrix-cli/node_modules/component-emitter/index.js:133:20)
    at Socket.onPacket (/home/pi/.npm-global/lib/node_modules/matrix-cli/node_modules/engine.io-client/lib/socket.js:452:14)
    at WS.<anonymous> (/home/pi/.npm-global/lib/node_modules/matrix-cli/node_modules/engine.io-client/lib/socket.js:268:10)
    at WS.Emitter.emit (/home/pi/.npm-global/lib/node_modules/matrix-cli/node_modules/component-emitter/index.js:133:20)
    at WS.Transport.onPacket (/home/pi/.npm-global/lib/node_modules/matrix-cli/node_modules/engine.io-client/lib/transport.js:145:8)
    at WS.Transport.onData (/home/pi/.npm-global/lib/node_modules/matrix-cli/node_modules/engine.io-client/lib/transport.js:137:8)
    at WebSocket.ws.onmessage (/home/pi/.npm-global/lib/node_modules/matrix-cli/node_modules/engine.io-client/lib/transports/websocket.js:146:10)
    at WebSocket.onMessage (/home/pi/.npm-global/lib/node_modules/matrix-cli/node_modules/ws/lib/WebSocket.js:442:14)
    at emitTwo (events.js:126:13)

#2

You can use the other layers called Core and HAL. No internet connection is required.

Check out how to install and run example apps for :


#3

Thank you.
I already played with Core and zeromq, based on this https://github.com/matrix-io/matrix-creator-malos/tree/master/src/js_test
But there is no information about microphones for Voice in documentation, is it exactly the same like in Creator? Same with Vision?
And I need nodejs for rapid work, so HAL for me seems like not an option.

Ok, I reinstalled everything and I think I’ve found one issue, there is a few “No such file or directory” errors while installing because “No space left on device”, it is hard to notice, because install is fast rebooting, and after reboot I have again enough space.


#4

the mic, vision, wakeword and everloop should also work on the voice device.


#5

To access the microphones you just need malos services running. I am sure you already have it running but if you need to install it use the script install_core.sh. So it the same installation steps for both MATRIX Creator and Voice. Same for the Vision part because it just uses the Pi camera.

If you need to get audio from the mics there are different options:

  • To just record audio you can use arecord as follows:
    arecord --device=mic_channel0 -r 16000 -c 1 -f S16_LE test.wav
    you can use channels from 0 to 8 in the --device parameter
  • From nodejs, you can use something link this to basically use arecord from nodejs.
  • Finally, you can also access the mics from the HAL layer (C++) using this demo as a reference.

Let me know if this helps.


#6

Thanks.

I have already huge system in js, I managed to connect it with HAL. Working on vision.

But, reinstalled everything on 32GB card twice, everything should be working, but still cannot deploy :frowning:

pi@raspberrypi:~ $ matrix use d4xxxxx65
Now using device: voice5 ID: d4xxxxx65
pi@raspberrypi:~ $ matrix ping
client registration fail
pi@raspberrypi:~ $ matrix deploy testApp
⣷ Reading /home/pi/testApp/
Writing /home/pi/.matrix/testApp.zip
Validating configuration file…
Successfully validated configuration file
Requesting deploy…
Processing deployment parameters…
Deploying to device…
⣷ Unable to reach device, the application will be installed as soon as your device is available
pi@raspberrypi:~ $ matrix list devices
devices list
┌──

│ Device ID │ Name │ Description │ ok │ Last Online │

│ d4xxxxx65 │ voice5 │ voice5 │ no │ 48 years ago │
└────────────────────┴────────────────────┴─────────────────────────
pi@raspberrypi:~ $ date
Wed 14 Feb 18:47:31 UTC 2018


#7

Hey @wojak, have you started MOS? You need to start MOS application in order to matrix-cli reach your device.


#8

yes, MOS is working, leds are blinking. Without MOS I was unable to use device:

pi@raspberrypi:~ $ matrix use d48xxxxb65
undefined

with MOS

pi@raspberrypi:~ $ matrix use d48xxxxb65
Now using device: voice5 ID: d48xxxxb65
pi@raspberrypi:~ $ matrix ping
client registration fail

I am registered, logged in, etc. I also DMZ’d rpi to be sure no ports are blocked.


#9

When you say that the LEDs are blinking do you mean the initial blink when MOS starts? It’s blinking forever or just blink a while and stops?


#10

maybe the issue is this: MOS Currently Under Maintenance Update


#11

@dilan.nery forever, like an orb of death :slight_smile:

@loom ahhhhh it explains a lot, and I am spreading panic, so lets wait :slight_smile:


#12

@wojak that means that something goes wrong during MOS initialization, maybe he couldn’t connect on a service, probably you can see what goes wrong on the terminal output.

The correct thing to happen is, the LEDs blinks for a while and when MOS finish its set up stops blink.


#13

No errors or warning anywhere, even with DEBUG=*

I think it may be related to maintenance, when trying to run MOS with different env than production, I am receiving:

Starting as device: d4XXX65
matrix Offline setup successful +5ms
matrix Checking API server… +11ms
sdk secret-> f04e9XXXX14150f28 +473ms
sdk [post] params: { url: ‘https://dev-api.admobilize.com/v2/device/token’,
form:
{ device_id: ‘d4XXX65’,
device_secret: ‘f04e9XXXX14150f28’,
jwt_token: true },
json: true } +6ms
sdk [post] body: { status: ‘error’, status_code: 400, error: ‘Device not found.’ } +296ms
sdk Device Error { status: ‘error’, status_code: 400, error: ‘Device not found.’ } +8ms
API Error: 400 - Device not found.
Unable to setup online MOS, something went wrong (400) (Device Token Retrieval Error)
Bad Matrix Initialization Device Token Retrieval Error
matrix DESTROYING +2s

or I have no auth to access this endpoints :slight_smile:


#14

reason is somewhere else, only to clarify:


MALOS starting


You can query specific driver info using port 20012.
Registered driver IMU with port 20013.
Registered driver Humidity with port 20017.
Registered driver Everloop with port 20021.
Registered driver Pressure with port 20025.
Registered driver UV with port 20029.
Registered driver MicArray_Alsa with port 20037.
Registered driver Servo with port 20045.
Registered driver Gpio with port 20049.
Floating point exception


#15

Hello @wojak,

We will discuss about this issue in this thread: Help me please! floating point exception

Regards,

Kevin Patino


#16

Really annoying.

However, OS wasn’t starting. I was digging a little (I should sleep :confused: )

        try {
          Matrix.service.stream.initSocket(cb);
        } catch( e ) {
           console.log(e)
       }

I got:

          { Error: Cannot find module 'xmlhttprequest-ssl'
              at Function.Module._resolveFilename (module.js:547:15)
              at Function.Module._load (module.js:474:25)
              at Module.require (module.js:596:17)
              at require (internal/module.js:11:18)
              at Object.<anonymous> (/home/pi/matrix-os/node_modules/engine.io-client/lib/transports/index.js:5:22)
              at Module._compile (module.js:652:30)
              at Object.Module._extensions..js (module.js:663:10)
              at Module.load (module.js:565:32)
              at tryModuleLoad (module.js:505:12)
              at Function.Module._load (module.js:497:3) code: 'MODULE_NOT_FOUND' }

after installing it, voice started to work a little…

Installed Apps: testApp
  matrix Invariance. Clean System. Matching Records +33ms
  app Stop all apps... +1ms
  matrix Setting up Firebase Listeners... +142ms
  matrix Checking Firebase Info... +13ms
  firebase:user Type: object +146ms
  firebase:user Now watching for app install changes (1520820456981)... +1ms
  matrix [fb]devices/> { acl: { ownerId: 'XXXX' },
  meta:
   { createdAt: 1520820245307,
     description: 'dev2',
     name: 'dev2',
     osVersion: '0',
     type: 'matrix',
     version: '1.7.0' } } +7ms
  matrix [fb]user/devices/deviceId> +195ms
  matrix a46790da1a90 - testApp +2ms
MXSS Unavailable
CORE COMPONENTS  ⚙ IMU:20013 | Provides yaw/pitch/roll. Check Imu message (protocol buffer)
 ⚙ Humidity:20017 | Provides humidity and temperature. Check Humidity message (protocol buffer)
 ⚙ Everloop:20021 | Write-only. There are 35 leds. Values range from 0 to 255. Check message EverloopImage (protocol buffer)
 ⚙ Pressure:20025 | Provides barometer/altimeter and temperature. Check Pressure message (protocol buffer)
 ⚙ UV:20029 | Provides UV index. Check UV index message (protocol buffer). Also provides a string with the UV risk according to the OMS. See: https://www.epa.gov/sunsafety/uv-index-scale-0
 ⚙ MicArray_Alsa:20037 | Simple ALSA Driver for MATRIX Creator's Microphone Array
 ⚙ Servo:20045 | Write-read. Servo handler. In development
 ⚙ Gpio:20049 | Write-read. Gpio handler. In development

=<[^\/^]>= [xxxx] ready
[xxxxxx]
 _  _ ____ ___ ____ _ _  _
 |\/| |__|  |  |__/ |  \/   [o__o]
 |  | |  |  |  |  \ | _/\_  v0.17.0-e705130
  matrix Online setup successful! +10ms
  matrix The main flow worked on the first attempt! +2ms

but!

stream Init Streaming Server: wss://dev-mxss.admobilize.com/engine.io?deviceToken=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGFpbXxxxxxxxx86 +287ms
socket error: websocket error
  stream socket close:  null +63ms
  stream Start Socket Watch +0ms
  stream Socket Watch 4000 +1ms
  stream Stop Socket Watch +0ms
hb: sen> [] svc> []

Same for every env, local, rc, dev… How I can run matrix-os API localy?


#17

@wojak did you try to manually npm install xmlhttprequest-ssl?


#18

Yes, it allowed me to initialize matrix-os at all, and pass spinning orb of dead :wink:
However, then I started receiving transport error on websockets. So had to do some hacks to disable connecting to admobilize at all, and work localy only.