Developer Portal Community

    Showing results for 
    Search instead for 
    Did you mean: 

    cobi.js 0.44.0 is buggy and I cant get it working


    cobi.js 0.44.0 is buggy and I cant get it working


    I  took the speedometer sample as a starting point and stripped it down to the very basics. I´ve tested both in DevKit simulator using Chrome under Windows 10 and in My Module on my Android 11 Smartphone.

    Problem: While the current speed is reported flawlessly, my own subscriptions to other channels like motor, battery and some others do not work, although I did everything like documented ( On the other hand, other channels do work fine.

    First, I´ve spent hours searching for my mistake - found none. Then I discovered a true bug, or at least a discrepancy between documentation and code:
    The static property "serialNumber" of channel motor does not exist at all. In the simulator, the console states "Uncaught TypeError: Cannot read property 'subscribe' of undefined" - and checking cobi.js file reveals that "serialNumber" truly does not exist.

    Now my question is: is this the only bug or is there something else wrong with version 0.44 that keeps my code from running? Or is it me being to stupid? Does is work for you guys? Is there a more recent version?

    Have a look at my stripped-down-to-the-bone code to demonstrate the issues:

    <!DOCTYPE html>
    		<meta charset="utf-8" />
    		<title>COBI.js 0.44.0 - showcase</title>
    		<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
    		<script src=""></script>
    		<script src=""></script>
    		<div id="speed">Go riding...</div>
    		<br />
    		<div id="dbg1">Debug1: waiting for data</div>
    		<br />
    		<div id="dbg2">Debug2: waiting for data</div>
    		<!-- COBI.JS -->
    			// Authenticate your module
    			// Subscribe to current speed - works!
    			COBI.rideService.speed.subscribe(function(speed) {
    				$('#speed').html(`Speed: ${speed.toFixed(2)} m/s`);
    			// Subscribe to total travelled distance - no data arrives
    			COBI.motor.distance.subscribe(function(value) {
    				$('#dbg1').html(`Value: ${value.toString()}`);
    			// Subscribe to serialNumber - object is undefined
    			COBI.motor.serialNumber.subscribe(function(value) {
    				$('#dbg2').html(`Value: ${value.toString()}`);


    1 REPLY 1

    Betreff: cobi.js 0.44.0 is buggy and I cant get it working

    Found it myself.

    There are multiple issues and reasons why it did not work. First, querying battery and motor is not supported by the simulator. Second, it does work in MyModule (in the app when truly connected with the bike) - but I overlooked that communication was blocked by my VPN-based AdBlocker (Blokada). Once I created an exception for the Cobi app, data was sent to my module.

    But the biggest fault was - and I stumbled over it just be accident - the documentation (, although stating it is for cobi-js 0.44.0, is for a more recent version! By trial and error, I have found version 0.59.0 but cannot be sure this really is the latest one. I have not found any hint anywhere on something newer than 0.44.0 but in fact...