-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
node-usb (via node-co2-monitor) crasht javascript adapter #710
Comments
Log vom javascript adapter install
` |
Hier so ein typischer crash loop (Die Ursache ist ein instabiler CO2 Dostmann sensor, der USB Husten hat. ;) ) Sollte aber auf Grund von Hotplug eben nichts machen und schon gar nicht den adapter umhauen. Ich habe zwei Sensoren - einer davon hat diesen Fehler, alle paar Stunden. Nichtsdestotrotz kannst den Fehler mit Abstecken und Anstecken reproduzieren. Kann man den Adaptercrash verhindern? Das script selbst ist simpel und angeblich ist im node-co2-monitor auch alles richtig. Auch ein detach drinnen - bringt aber nix. `'use strict'; const monitor = new CO2Monitor(); var logOn = false; // Ausgabe der Messwerte im Log var pfad = "co2sensor" + "."; // Pfad Systeminfos zur innovaphone var idCo2 = pfad + "co2"; // Datenpunkte anlegen createState(idTemp, { // Connect device.
}); // Get results. try{ // Error handler function stopCo2Monitor() { // Wird ausgeführt, wenn das Skript gestoppt wird: |
In fact your "disconnect" call in the on(error) is the reason for the exception and in fact it is the co2 lib which cases the error because there is no error handled registered for "this._interface" in https://github.com/huhamhire/node-co2-monitor/blob/master/co2_monitor.js#L55 ... but even if there would be one no error would be emitted there ... so I commented one of the node-usb issues ... I think your error is gone if you remove the disconnect in the error handler, but I have no idea what would be the side effects |
@Apollon77 Danke - das habe ich gleich getestet und den Sensor nach remove vom error handler abgezogen. Das Ergebnis: `
` |
Ich muss den error handler schon drinnen lassen, aber den disconnect raus. // Error handler // monitor.disconnect(() => { Dann erhalte ich nur ein:
Der Adapter fliegt nicht! Ich versuche dadurch, dass das Script mit einem transfer stall steht und ein disconnect ja alles zum crashen bringt jetzt einfach nach 10 Minuten keiner Wertänderung einen neustart aus dem script heraus. Wenn das klappt - hast du mein Problem gelöst bzw. mir dabei geholfen. Ich wusste nicht, dass der disconnect alles crasht. Mit dem part sollte es klappen:
|
Funktioniert - danke @Apollon77 :) |
Am raspberry gibt es einen hotplug issue anscheinend mit der node-usb.
Vorheriges detach funktioniert anscheinend nicht, so dass wenn man absteckt die node-usb letztendlich die node-co2-monitor crasht und die dann den javascript adapter mitreißen.
Ich habe dazu ein ticket bei node-usb aufgemacht, anfangs auch bei node-co2-monitor. Jay-cee hat auch versucht zu helfen.
Könnt ihr auf Eurer Seite etwas abfangen, damit es den nicht dauernd runterreißt bei einem disconnect, oder einem device, dass man von alleine disconnected?
Hier ist der issue und meine logs:
node-usb/node-usb#390
node-usb/node-usb#392
Danke & VG
The text was updated successfully, but these errors were encountered: