Sensor test app, no leds


#1

I’m trying to run the sensor test app, but something seems amiss.
I don’t get any leds lighting up, and instead I get the following:

==== Application mySensorTest started! ====
(mySensorTest) Matrix OS Application Library Loading…
(mySensorTest) Initialize Sensor: temperature
Duplicate Sensor Initialization undefined
(mySensorTest) Initialize Sensor: pressure
Duplicate Sensor Initialization undefined
(mySensorTest) Initialize Sensor: humidity
Duplicate Sensor Initialization undefined
Duplicate Sensor Initialization undefined
(mySensorTest) Initialize Sensor: uv
Initialize Sensor: altitude
Duplicate Sensor Initialization undefined
Duplicate Sensor Initialization undefined
Duplicate Sensor Initialization undefined
Duplicate Sensor Initialization undefined
(mySensorTest) Initialize Sensor: gyroscope
Initialize Sensor: magnetometer
Initialize Sensor: accelerometer
(mySensorTest) Matrix App Host Ready!
hb: sen> [ ‘temperature’,
‘pressure’,
‘humidity’,
‘uv’,
‘altitude’,
‘gyroscope’,
‘magnetometer’,
‘accelerometer’ ] svc> []

No leds ever light up (apart from the normal blue status leds of course)
Here’s my config.yaml for the app:

# do not touch this line configVersion: 2 description: Sensor testing with LEDs keywords: Sensor Test Led name: mySensorTest shortName: mySensorTest displayName: My Sensor Test

sensors:
  - temperature
  - pressure
  - humidity
  - uv
  - altitude
  - gyroscope
  - magnetometer
  - accelerometer

And here’s my app.js:

// app code goes here
// matrix.init()…
//
// have fun
matrix.sensor(‘temperature’, function(data){
matrix.led({
angle: 0,
color: ‘blue’
}).render();
});
… repeated for all the other sensors, with angle changed …

Any clues on how to proceed?


#2

Well, I got it solved, by changing to code to look more like the test projects on github.

My temperature sensor values seem WAY off though (unless it is actually 3 degrees celcius in my room ;).
Other values seem to be within expected ranges. Broken sensor?


#3

What kind of changes did you make it?


#4

Simply by using the test code from the Github tests, rather can copying the code from the docs. The docs often seem to be outdated and incorrect. The testcode on Github works more often.

Also, the temp sensor values are OK when I use them directly from HAL or MALOS (Matrix Core), rather than from Matrix OS.


#5

How big is the difference from the sensor values from MOS and HAL (or MALOS) ?


#6

In my case, huge. Because in MOS I was getting useless values. It gave temps of -2 degrees to +3 degrees, while the room temp was more like 22 degrees :wink: