Mosca Error Expected "schema" to be an object or boolean

Hi everybody.
I'm teaching IoT to a class of students, which are experiencing a problem in the MQTT connection.
MQTT (mosca) node is not successfully connecting and is giving this error:

schemaerror: Expected "schema" to be an object or boolean

Apparently is related to jsonschema? We found this.

The interesting thing is that just 6 out of 20 are experiencing the issue, possibly unrelated to the version of npm or node js (nothing changed when updated)

Thanks in advance for your help!

Edit1: a quick fix found by a student is shifting to Aedes[1]


mosca is a dead project & superseded by aedes.

How are you running a broker in your class lessons? - a shared broker (amongst students) I assume (for interaction)

Are you running aedes (formerlly mosca) under nodejs from command line?

If so, why not use just use the node-red broker node node-red-contrib-aedes - or for that matter install mosquito in a central location?

Hi Steve.
Thanks for the answer.
We did use aedes, yet everybody on his own node-red instance.
What we are trying to achieve are several interaction between a selfhosted Node-RED cloud and and Arduino MKR1010.

While Aedes is properly working within Node-RED, Arduino is having an hard time to connect to the broker.
I guess this problem is not related or addressed to this forum though.

Thanks for the quick answer!

so is that aedes or node-red-contrib-aedes?

This should work (aedes is a very reasonable broker) - assuming devices can contact the aedes IP:PORT (same network / no firewalls etc)

but again why not have a mosquito install?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.