• Das Erstellen neuer Accounts wurde ausgesetzt. Bei berechtigtem Interesse bitte Kontaktaufnahme über die üblichen Wege. Beste Grüße der Admin

[GELÖST] Python to Javascript

nur noch ein Syntax Fehler:,
Code:
pi@carcam:~/ant-cycling-power $ node test.js
/home/pi/ant-cycling-power/test.js:13
message();
^
[/QUOTE]
message ist keine funktion, sondern ein parameter eines callbacks.
das callback wird automatisch aufgerufen, wenn das pythonscript etwas auf stdout schreibt
 
message ist keine funktion, sondern ein parameter eines callbacks.
das callback wird automatisch aufgerufen, wenn das pythonscript etwas auf stdout schreibt

Ich bekomme leider kein broadcast:
Code:
pi@carcam:~/ant-cycling-power $ node test.js
startup
Max channels: 8
cycling power meter initialized

*jetzt sollten eigentlich die Werte übertragen werden kommt aber nix
Oder muss ich hier noch was machen?:

Code:
var Ant = require('ant-plus');

var PowerMeter = function() {
  var stick = new Ant.GarminStick3;
  var channel = 1;
  if (!stick.is_present()) {
    stick = new Ant.GarminStick2;
  }

  stick.on('startup', function () {
    console.log('startup');
    console.log('Max channels:', stick.maxChannels);
    // 0xCAFFEDOOD
    var deviceId = 0xBEEF;
    stick.write(Ant.Messages.assignChannel(channel, 'transmit'));
    // The device type shall be set to 11 (0x0B) when searching to pair to an ANT+ bike power sensor
    // The transmitting sensor contains a 16-bit number that uniquely identifies its
    // transmissions. Set the Device Number parameter to zero to allow wildcard
    // matching. Once the device number is learned, the receiving device should
    // remember the number for future searches.
    // Device number set to 1 here
    stick.write(Ant.Messages.setDevice(channel, deviceId, 11, 1));
    // RF Channel 57 (2457 MHz) is used for the ANT+ bike power sensor.
    stick.write(Ant.Messages.setFrequency(channel, 57));
    // Channel period Data is transmitted from most bike power sensors every 8182/32768 seconds
    // (approximately 4.00 Hz). This channel period shall be used by default.
    stick.write(Ant.Messages.setPeriod(channel, 8182));
    stick.write(Ant.Messages.openChannel(channel));
    console.log('cycling power meter initialized');
  });

  stick.on('shutdown', function () { console.log('ANT+ shutdown'); });

  if (!stick.open()) {
  	console.log('ANT+ USB stick not found!');
  }

  this.stick = stick;
  this.channel = channel;
  this.power_event_count = 0;
  this.power_accumulated = 0;

};

PowerMeter.prototype.broadcast = function(power, cadence) {
  if (!this.stick.is_present()) {
    return;
  }

  var data = [];
  data.push(this.channel);
  data.push(0x10); // power only
  this.power_event_count++;
  this.power_event_count = this.power_event_count % 255; // rollover 255
  data.push(this.power_event_count);
  data.push(0xFF); // pedal power not-used
  data.push(cadence); // cadence
  this.power_accumulated += power;
  this.power_accumulated = this.power_accumulated % 65536;
  console.log("Event: %s \t Power: %sw \t Cadence: %srpm", this.power_event_count, power, cadence);

  data = data.concat(Ant.Messages.intToLEHexArray(this.power_accumulated, 2));
  data = data.concat(Ant.Messages.intToLEHexArray(power, 2));
  this.stick.write(Ant.Messages.buildMessage(data, 0x4E)); //ANT_BROADCAST_DATA
};

module.exports.PowerMeter = PowerMeter;

^^das ist das powermeter script

Mein PythonScript alleine macht diese Ausgabe:
Code:
pi@carcam:~/ant-cycling-power $ ./8powerx.py
0
0
0
0
0
0
0
117
145

Eigentlich sollte so eine Ausgabe kommen:

Code:
Event: 1         Power: 0w       Cadence: undefinedrpm
Event: 2         Power: 0w       Cadence: undefinedrpm
startup
Max channels: 8
cycling power meter initialized
Event: 3         Power: 0w       Cadence: undefinedrpm
Event: 4         Power: 0w       Cadence: undefinedrpm
Event: 5         Power: 145w       Cadence: undefinedrpm
Event: 6         Power: 117w       Cadence: undefinedrpm

Da muss ja irgendwie eine Schleife rein, damit der Wert immer aktualisiert wird?
 
Zuletzt bearbeitet:
lass das console.log(message) mal drinn
und füge den end-eventhandler hinzu, der wird bei fehler oder wenn das pythonscript endet aufgerufen
Code:
// end the input stream and allow the process to exit
shell.end(function (err) {
  if (err) throw err;
  console.log('finished');
});
 
Leider keine Veränderung:

Code:
^Cpi@carcam:~/ant-cycling-power $ sudo node test.js
startup
Max channels: 8
cycling power meter initialized

mein code:

Code:
var PythonShell = require('python-shell');
var pyshell = new PythonShell('8powerx.py');
var power_meter = require('./power-meter');
var pm = new power_meter.PowerMeter();

pyshell.on('message', function (message) {
  // received a message sent from the Python script (a simple "print" statement)
  console.log(message);
  var power_instant = message;
  pm.broadcast(power_instant);
  // end the input stream and allow the process to exit
});

// end the input stream and allow the process to exit
  pyshell.end(function (err) {
  if (err) throw err;
  console.log('finished');
});
 
Code:
^Cpi@carcam:~/ant-cycling-power $ sudo node test.js
startup
Max channels: 8
cycling power meter initialized
und wo kommt das "startup", "Max channels: 8" und "cycling power meter initialized" her?
die stehen ja nicht als ausgabe in deinem script.
sicher das du das richtige script startest?
 
ja das kommt vom

Code:
var power_meter = require('./power-meter');

das Script hab ich oben weiter gepostet.

Code:
var Ant = require('ant-plus');

var PowerMeter = function() {
  var stick = new Ant.GarminStick3;
  var channel = 1;
  if (!stick.is_present()) {
    stick = new Ant.GarminStick2;
  }

  stick.on('startup', function () {
    console.log('startup');
    console.log('Max channels:', stick.maxChannels);
    // 0xCAFFEDOOD
    var deviceId = 0xBEEF;
    stick.write(Ant.Messages.assignChannel(channel, 'transmit'));
    // The device type shall be set to 11 (0x0B) when searching to pair to an ANT+ bike power sensor
    // The transmitting sensor contains a 16-bit number that uniquely identifies its
    // transmissions. Set the Device Number parameter to zero to allow wildcard
    // matching. Once the device number is learned, the receiving device should
    // remember the number for future searches.
    // Device number set to 1 here
    stick.write(Ant.Messages.setDevice(channel, deviceId, 11, 1));
    // RF Channel 57 (2457 MHz) is used for the ANT+ bike power sensor.
    stick.write(Ant.Messages.setFrequency(channel, 57));
    // Channel period Data is transmitted from most bike power sensors every 8182/32768 seconds
    // (approximately 4.00 Hz). This channel period shall be used by default.
    stick.write(Ant.Messages.setPeriod(channel, 8182));
    stick.write(Ant.Messages.openChannel(channel));
    console.log('cycling power meter initialized');
  });

  stick.on('shutdown', function () { console.log('ANT+ shutdown'); });

  if (!stick.open()) {
  	console.log('ANT+ USB stick not found!');
  }

  this.stick = stick;
  this.channel = channel;
  this.power_event_count = 0;
  this.power_accumulated = 0;

};

PowerMeter.prototype.broadcast = function(power, cadence) {
  if (!this.stick.is_present()) {
    return;
  }

  var data = [];
  data.push(this.channel);
  data.push(0x10); // power only
  this.power_event_count++;
  this.power_event_count = this.power_event_count % 255; // rollover 255
  data.push(this.power_event_count);
  data.push(0xFF); // pedal power not-used
  data.push(cadence); // cadence
  this.power_accumulated += power;
  this.power_accumulated = this.power_accumulated % 65536;
  console.log("Event: %s \t Power: %sw \t Cadence: %srpm", this.power_event_count, power, cadence);

  data = data.concat(Ant.Messages.intToLEHexArray(this.power_accumulated, 2));
  data = data.concat(Ant.Messages.intToLEHexArray(power, 2));
  this.stick.write(Ant.Messages.buildMessage(data, 0x4E)); //ANT_BROADCAST_DATA
};

module.exports.PowerMeter = PowerMeter;
 
ok, mach mal folgendes. leg
test.py
Code:
print "test"
und test.js
Code:
var PythonShell = require('python-shell');
var pyshell = new PythonShell('test.py');

pyshell.on('message', function (message) {
  console.log(message);
});

pyshell.end(function (err) {
  if (err) throw err;
  console.log('finished');
});
in ein verzeichnis
ruf dort npm install python-shell auf
und dann node test.js
die ausgabe sollte so aussehen
Code:
test
finished
 
Kann ich leider erst zu Hause machen, bin nun auf der Arbeit.

Code:
"npm install python-shell" habe ich aber schon.

Das muss man doch nicht für jedes Verzeichnis extra machen, oder?

ich mach das auch immer mit "sudo" da mein Raspberry eh hinter ner NAT liegt. Also:

Code:
sudo npm install python-shell
 
Kann ich leider erst zu Hause machen, bin nun auf der Arbeit.
ok

Code:
"npm install python-shell" habe ich aber schon.

Das muss man doch nicht für jedes Verzeichnis extra machen, oder?
doch, sonst müsste man npm install mit -g option aufrufen.
das macht man in der regel nur für tools

ich mach das auch immer mit "sudo" da mein Raspberry eh hinter ner NAT liegt.
sudo hat nichts mit NAT zu tun, sondern weil man root rechte benötigst
 
Code:
pi@carcam:~/ant-cycling-power $ sudo npm install python-shell
ant-cycling-power@0.1.0 /home/pi/ant-cycling-power
└── python-shell@0.4.0

pi@carcam:~/ant-cycling-power $

Sieht ja schon mal gut aus.

klappt aber leider nicht :(

Code:
Cpi@carcam:~/ant-cycling-power $ sudo node test.js
startup
Max channels: 8
cycling power meter initialized


Bei dem test klappt es wie beschrieben:

Code:
pi@carcam:~/testx $ node test.js
test
finished
pi@carcam:~/testx $

Hat das was mit dem power-meter.js zu tun?

denn das Orginal macht ja an Ausgabe:

Code:
Max channels: 8
cycling power meter initialized
Event: 3         Power: 0w       Cadence: undefinedrpm
Event: 4         Power: 0w       Cadence: undefinedrpm
Event: 5         Power: 145w       Cadence: undefinedrpm
Event: 6         Power: 117w       Cadence: undefinedrpm

Ich müsste doch kurz davor sein?
 
glaube ich nicht, aber schließen wir das mal als erstes aus.
ersetze dein python script mal durch
Code:
for x in range(1, 11):
  print x*100
kommt dann was?

wie rufst du das python script (ohne js) denn auf(mit sudo?)? brauchst du root-rechte für die gpios?

Für die GPIOS brauche ich keine root Rechte, das funktioniert so.
Code:
./7powerTX.py

Ausgabe kommt ja auch, was sehr beruhigend ist :)

Ergebnis kann ich erst wieder nach der Arbeit liefern, aber dann ist ja WE! :)

- - - Aktualisiert - - -

Hier mein Output:

Code:
pi@carcam:~/ant-cycling-power $ node test.js
100
100 undefined
200
200 undefined
300
300 undefined
400
400 undefined
500
500 undefined
600
600 undefined
700
700 undefined
800
800 undefined
900
900 undefined
1000
1000 undefined
finished
cycling power meter initialized

undefined is cadence das ist egal :)
Aber Zahlen sind ja da!? Was nun?
 
dann nimm wieder dein richtiges python script und streue dort solang prints rein, bis du die stelle gefunden hast, bei der es hängt.
so in etwa wird es ja noch das aus post 1 sein. dort würde ich
bei
Code:
GPIO.setmode(GPIO.BCM)
   GPIO.setup(20, GPIO.IN, pull_up_down=GPIO.PUD_UP)
   GPIO.setup(21, GPIO.IN, pull_up_down=GPIO.PUD_UP)
anfangen in etwa so
Code:
   print 1
   GPIO.setmode(GPIO.BCM)
   print 2
   GPIO.setup(20, GPIO.IN, pull_up_down=GPIO.PUD_UP)
   print 3
   GPIO.setup(21, GPIO.IN, pull_up_down=GPIO.PUD_UP)
   print 4
dann vor und nach dem aufruf von main() 5 und 6 ausgeben
dann erst mal sehen wie weit es geht.
 
das script alleine macht
1
2
3
4
Code:
if __name__ == "__main__":

   import time
   import pigpio
   import readRPM
   import RPi.GPIO as GPIO
   GPIO.setmode(GPIO.BCM)
   GPIO.setup(20, GPIO.IN, pull_up_down=GPIO.PUD_UP)
   GPIO.setup(21, GPIO.IN, pull_up_down=GPIO.PUD_UP)

   print 1
   GPIO.setmode(GPIO.BCM)
   print 2
   GPIO.setup(20, GPIO.IN, pull_up_down=GPIO.PUD_UP)
   print 3
   GPIO.setup(21, GPIO.IN, pull_up_down=GPIO.PUD_UP)
   print 4


   count = 5
   RPM_GPIO = 4
   RUN_TIME = 9600.0
   SAMPLE_TIME = 1.0
   RPM_LOWER_LIMIT = 20
   RPM_HIGHER_LIMIT = 120
   LEVEL_TO_POWER = {
    1: [6,12,20,29,40,53,69,79,92,106,121],

bei Aufruf mit node test.js

Code:
Max channels: 8
cycling power meter initialized

Ich glaub gerade ging was.... vielleicht nen timing problem.
 
Zuletzt bearbeitet:
Code:
   GPIO.setmode(GPIO.BCM)
   GPIO.setup(20, GPIO.IN, pull_up_down=GPIO.PUD_UP)
   GPIO.setup(21, GPIO.IN, pull_up_down=GPIO.PUD_UP)

   print 1
   GPIO.setmode(GPIO.BCM)
   print 2
   GPIO.setup(20, GPIO.IN, pull_up_down=GPIO.PUD_UP)
   print 3
   GPIO.setup(21, GPIO.IN, pull_up_down=GPIO.PUD_UP)
   print 4
di e 1. 3 müssen dann aber raus
 
hab ich, mein output beim script alleine:
1
2
3
4
0
0
0
0
175
117

^^ power Werte

mit node test.js

wieder nix :(

- - - Aktualisiert - - -

Warte! Nach einer gewissen Zeit!!

Code:
Max channels: 8
cycling power meter initialized
1
Event: 1         Power: 1w       Cadence: undefinedrpm
2
Event: 2         Power: 2w       Cadence: undefinedrpm
3
Event: 3         Power: 3w       Cadence: undefinedrpm
4
Event: 4         Power: 4w       Cadence: undefinedrpm
0
Event: 5         Power: 0w       Cadence: undefinedrpm
0
Event: 6         Power: 0w       Cadence: undefinedrpm


dann :
Code:
/home/pi/ant-cycling-power/test.js:16
  if (err) throw err;
           ^

Error: IndexError: list index out of range
    at PythonShell.parseError (/home/pi/ant-cycling-power/node_modules/python-shell/index.js:183:17)
    at terminateIfNeeded (/home/pi/ant-cycling-power/node_modules/python-shell/index.js:98:28)
    at ChildProcess.<anonymous> (/home/pi/ant-cycling-power/node_modules/python-shell/index.js:88:9)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
    ----- Python Traceback -----
    File "7powerx.py", line 194, in <module>
      print(calculate_power(LEVEL, RPM))
    File "7powerx.py", line 154, in calculate_power
      return LEVEL_TO_POWER[LEVEL][(RPM)  //10]  # //10
pi@carcam:~/ant-cycling-power $

- - - Aktualisiert - - -

Wenn ich dann wieder neu starte mit sudo node test.js, wieder nix, ist auch bei ps aux keine Leiche noch offen. *kopfkratz
 
Mein Python script:

Code:
#!/usr/bin/env python
import time
import pigpio
import json
import require

class reader:
   """
A class to read speedometer pulses and calculate the RPM.
"""
   def __init__(self, pi, gpio, pulses_per_rev=1.0, weighting=0, min_RPM=5):
      """
   Instantiate with the Pi and gpio of the RPM signal
   to monitor.
 
   Optionally the number of pulses for a complete revolution
   may be specified.  It defaults to 1.
 
   Optionally a weighting may be specified.  This is a number
   between 0 and 1 and indicates how much the old reading
   affects the new reading.  It defaults to 0 which means
   the old reading has no effect.  This may be used to
   smooth the data.
 
   Optionally the minimum RPM may be specified.  This is a
   number between 1 and 1000.  It defaults to 5.  An RPM
   less than the minimum RPM returns 0.0.
   """
      self.pi = pi
      self.gpio = gpio
      self.pulses_per_rev = pulses_per_rev
 
      if min_RPM > 1000:
         min_RPM = 1000
      elif min_RPM < 1:
         min_RPM = 1
 
      self.min_RPM = min_RPM
 
      self._watchdog = 200 # Milliseconds.
 
      if weighting < 0:
         weighting = 0
      elif weighting > 0:
         weighting = 0
 
      self._new = 1 - weighting # Weighting for new reading.
      self._old = weighting       # Weighting for old reading.
 
      self._high_tick = None
      self._period = None
 
      pi.set_mode(gpio, pigpio.INPUT)
 
      self._cb = pi.callback(gpio, pigpio.RISING_EDGE, self._cbf)
      pi.set_watchdog(gpio, self._watchdog)
 
   def _cbf(self, gpio, level, tick):
 
      if level == 1: # Rising edge.
 
         if self._high_tick is not None:
            t = pigpio.tickDiff(self._high_tick, tick)
 
            if self._period is not None:
               self._period = (self._old * self._period) + (self._new * t)
            else:
               self._period = t
 
         self._high_tick = tick
 
      elif level == 2: # Watchdog timeout.
 
         if self._period is not None:
            if self._period < 2000000000:
               self._period += (self._watchdog * 1000)
 
   def RPM(self):
      """
   Returns the RPM.
   """
      RPM = 0
      if self._period is not None:
         RPM = 60000000 / (self._period * self.pulses_per_rev)
         if RPM < self.min_RPM:
            RPM = 0
 
      return RPM
 
   def cancel(self):
      """
   Cancels the reader and releases resources.
   """
      self.pi.set_watchdog(self.gpio, 0) # cancel watchdog
      self._cb.cancel()
 
if __name__ == "__main__":
 
   import time
   import pigpio
   import readRPM
   import RPi.GPIO as GPIO
   #GPIO.setmode(GPIO.BCM)
   #GPIO.setup(20, GPIO.IN, pull_up_down=GPIO.PUD_UP)
   #GPIO.setup(21, GPIO.IN, pull_up_down=GPIO.PUD_UP)

   print 1
   GPIO.setmode(GPIO.BCM)
   print 2
   GPIO.setup(20, GPIO.IN, pull_up_down=GPIO.PUD_UP)
   print 3
   GPIO.setup(21, GPIO.IN, pull_up_down=GPIO.PUD_UP)
   print 4
   
   count = 5
   RPM_GPIO = 4
   RUN_TIME = 9600.0
   SAMPLE_TIME = 0.15
   RPM_LOWER_LIMIT = 20
   RPM_HIGHER_LIMIT = 120
   LEVEL_TO_POWER = {
    1: [6,12,20,29,40,53,69,79,92,106,121],
    2: [8,16,26,38,53,68,88,103,120,138,152],
    3: [9,20,32,47,66,84,107,125,148,172,186],
    4: [11,23,39,56,79,101,126,150,173,206,219],
    5: [13,27,45,65,92,117,145,175,202,238,254],
    6: [15,31,52,75,105,135,166,202,231,275,289],
    7: [16,35,58,85,118,152,185,226,260,305,332],
    8: [18,39,65,96,131,169,208,249,289,333,375],
    9: [19,42,71,104,144,184,227,272,318,361,408],
    10:[21,46,77,113,157,199,245,295,345,386,442],
    11:[23,50,84,123,170,216,262,318,372,413,480],
    12:[24,53,89,131,183,230,279,342,398,441,512],
    13:[26,56,94,139,196,245,296,365,424,468,548],
    14:[28,60,101,148,209,261,318,389,449,494,585],
    15:[30,64,108,158,222,277,337,415,476,518,620],
    16:[32,68,115,168,235,296,355,439,503,548,658],
    17:[33,72,122,177,248,312,373,463,530,576,694],
    18:[35,76,129,187,261,328,390,484,556,606,727],
    19:[37,79,134,195,274,342,407,507,572,632,763],
    20:[39,83,140,204,287,354,424,528,598,659,790],
    21:[40,87,146,213,300,368,442,551,616,689,812],
    22:[42,91,153,223,313,385,461,574,645,720,840],
    23:[44,95,160,234,326,401,479,598,673,752,872],
    24:[47,101,171,246,340,418,501,625,706,788,908],
    }
 
   def calculate_power(LEVEL, RPM):
       
    if RPM <= RPM_LOWER_LIMIT:
     return 0
    if RPM >= RPM_HIGHER_LIMIT:
     return 0
    return LEVEL_TO_POWER[LEVEL][(RPM)  //10]  # //10
    
 
 
   def main():
    for LEVEL, RPM in [(1, 6), (2, 8), (3, 9)]:
     print(calculate_power(LEVEL, RPM))
   
   pi = pigpio.pi()
 
   p = readRPM.reader(pi, RPM_GPIO)
 
   start = time.time()
 
   while (time.time() - start) < RUN_TIME:
   
    input_state = GPIO.input(20)
    if input_state == False:
        if count < 24:
         count = count + 1
         RPM = (int(RPM+1))
     	 LEVEL = count
      #  print('Power',calculate_power(LEVEL, RPM),'Level', count, 'RPM={}'.format(int(RPM+1)))
         print(calculate_power(LEVEL, RPM))
     	 time.sleep(SAMPLE_TIME)
   
    input_state = GPIO.input(21)
    if input_state == False:
        if count > 1:
         count = count - 1
         RPM = (int(RPM+1))
    	 LEVEL = count
         print(calculate_power(LEVEL, RPM))
	 time.sleep(SAMPLE_TIME)
 
   
    LEVEL = count
    RPM = p.RPM()
    RPM = (int(RPM+1))
    time.sleep(SAMPLE_TIME)
    print(calculate_power(LEVEL, RPM)) 
   # print('Power',calculate_power(LEVEL, RPM),'Level', count, "RPM={}".format(int(RPM+1)))    

   
   GPIO.setup(20, GPIO.IN, pull_up_down=GPIO.PUD_UP)
   print 7
   GPIO.setup(21, GPIO.IN, pull_up_down=GPIO.PUD_UP)
   print 8 
   p.cancel()
   pi.stop()


 
 
 
if __name__ == '__main__':
    main()

Jetzt ist es so(Ich war einfach mal ne halbe Stunde weg :)

Code:
Event: 247       Power: 0w       Cadence: undefinedrpm
0
Event: 248       Power: 0w       Cadence: undefinedrpm
0
Event: 249       Power: 0w       Cadence: undefinedrpm
0
Event: 250       Power: 0w       Cadence: undefinedrpm
0
Event: 251       Power: 0w       Cadence: undefinedrpm
0
Event: 252       Power: 0w       Cadence: undefinedrpm
0
Event: 253       Power: 0w       Cadence: undefinedrpm
0
Event: 254       Power: 0w       Cadence: undefinedrpm
0
Event: 0         Power: 0w       Cadence: undefinedrpm
0
Event: 1         Power: 0w       Cadence: undefinedrpm
0
Event: 2         Power: 0w       Cadence: undefinedrpm
0
Event: 3         Power: 0w       Cadence: undefinedrpm
0
Event: 4         Power: 0w       Cadence: undefinedrpm
0
Event: 5         Power: 0w       Cadence: undefinedrpm
0
Event: 6         Power: 0w       Cadence: undefinedrpm
0
Event: 7         Power: 0w       Cadence: undefinedrpm
0
Event: 8         Power: 0w       Cadence: undefinedrpm
0
Event: 9         Power: 0w       Cadence: undefinedrpm
0
Event: 10        Power: 0w       Cadence: undefinedrpm
0
Event: 11        Power: 0w       Cadence: undefinedrpm
0
Event: 12        Power: 0w       Cadence: undefinedrpm
0
Event: 13        Power: 0w       Cadence: undefinedrpm
0
Event: 14        Power: 0w       Cadence: undefinedrpm
0
Event: 15        Power: 0w       Cadence: undefinedrpm
0
Event: 16        Power: 0w       Cadence: undefinedrpm
0
Event: 17        Power: 0w       Cadence: undefinedrpm
0
Event: 18        Power: 0w       Cadence: undefinedrpm
0
Event: 19        Power: 0w       Cadence: undefinedrpm
0
Event: 20        Power: 0w       Cadence: undefinedrpm
0
Event: 21        Power: 0w       Cadence: undefinedrpm
0
Event: 22        Power: 0w       Cadence: undefinedrpm
0
Event: 23        Power: 0w       Cadence: undefinedrpm
0
Event: 24        Power: 0w       Cadence: undefinedrpm
0
Event: 25        Power: 0w       Cadence: undefinedrpm
0
Event: 26        Power: 0w       Cadence: undefinedrpm
0
Event: 27        Power: 0w       Cadence: undefinedrpm
0
Event: 28        Power: 0w       Cadence: undefinedrpm
0
Event: 29        Power: 0w       Cadence: undefinedrpm
0
Event: 30        Power: 0w       Cadence: undefinedrpm

Also er läuft hält aber zwischendurch immer wieder einfach an, hier bei 30 vorher irgendwo bei 20.

- - - Aktualisiert - - -

Jetzt lief er gerade wieder los(von 31 bis 9)

Neu gestartet....
nach ca. 5-8 Minuten
Event 1 bis 231
dann steht es wieder

cpu und memory Auslastung ist nicht erwähnenswert, also resource Problem kanns nicht sein :)

- - - Aktualisiert - - -

Also wenn ich aus dem Orginal test.js das setTimeout(a, 249); entferne bleibt das script auch bei
startup
Max channels: 8
cycling power meter initialized

stehen.
muss da was mit zu tun haben?
 
Zuletzt bearbeitet:
Also er läuft hält aber zwischendurch immer wieder einfach an, hier bei 30 vorher irgendwo bei 20.
mhh, mehr fällt mir jetzt auch nicht ein

Also wenn ich aus dem Orginal test.js das setTimeout(a, 249); entferne bleibt das script auch bei
startup
Max channels: 8
cycling power meter initialized

stehen.
das ist klar, da fehlt dann der zyklische aufruf deiner funktion a, das erledigt ja hier das callback.

teste doch nochmal folgendes, nehme das test.js von mir und rufe dort dein python script auf
 
Zurück
Oben