Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

mcp3xxx node does not seem to recognise raspberry pi on a pi4 running bookworm

Ouverte
#1,067 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
35/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
javascript, linux, node.js, raspberry-pi
Domaine
embedded-iot

Piste de recherche

Commencez par le code du nœud mcp3xxx qui lit /proc/cpuinfo et recherche « : BCM », puis comparez cette détection avec la sortie de Raspberry Pi 4 Bookworm indiquée dans l’issue. Vérifiez le comportement au démarrage avec les versions signalées de Node-RED, Node.js, Linux et Raspberry Pi ; le travail est terminé lorsque le nœud A/D Converter n’est plus inactif et conserve le comportement fonctionnel de Bullseye.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Which node are you reporting an issue on?

A/D Converter (mcp3008)

What are the steps to reproduce?

I am running the bookworm pi build on a pi4

What happens?

A/D node has status text of "node inactive" in the design view, and functionality does not work as expected

What do you expect to happen?

Functionality to be the same as Bullsye (working)

Please tell us about your environment:
  • Node-RED version: 3.1.9
  • node.js version: 18.20.2
  • npm version: unknown
  • Platform/OS: raspberry pi 4/bookworm
  • Browser: Chrome on mac

The issue seems to be in the following code:

module.exports = function(RED) {
    "use strict";
    var fs = require('fs');
    var allOK = false;
    var mcpadc;
    // unlikely if not on a Pi
    try {
        var cpuinfo = fs.readFileSync("/proc/cpuinfo").toString();
        **if (cpuinfo.indexOf(": BCM") === -1) {**
            RED.log.warn("Info : mcp3xxx : Not running on a Pi - Ignoring node");
        }
        else {
            mcpadc = require('mcp-spi-adc');
            allOK = true;
        }
    }
    catch(err) {
        RED.log.warn("Info : mcp3xxx : Not running on a Pi - Ignoring node");
    }

If I understand this code correctly, I do not seem to get any mention of "BCM" in the CPU info under bookworm. I get the following output;

matt@EnergyWeek:~/.node-red $ /bin/cat /proc/cpuinfo
processor	: 0
BogoMIPS	: 108.00
Features	: fp asimd evtstrm crc32 cpuid
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x0
CPU part	: 0xd08
CPU revision	: 3

processor	: 1
BogoMIPS	: 108.00
Features	: fp asimd evtstrm crc32 cpuid
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x0
CPU part	: 0xd08
CPU revision	: 3

processor	: 2
BogoMIPS	: 108.00
Features	: fp asimd evtstrm crc32 cpuid
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x0
CPU part	: 0xd08
CPU revision	: 3

processor	: 3
BogoMIPS	: 108.00
Features	: fp asimd evtstrm crc32 cpuid
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x0
CPU part	: 0xd08
CPU revision	: 3

Revision	: a03115
Serial		: 100000005d04ed38
Model		: Raspberry Pi 4 Model B Rev 1.5

Here is the nodered startup logs:
Starting as a systemd service.

14 May 18:26:46 - [info]
Welcome to Node-RED
===================
14 May 18:26:46 - [info] Node-RED version: v3.1.9
14 May 18:26:46 - [info] Node.js  version: v18.20.2
14 May 18:26:46 - [info] Linux 6.6.28+rpt-rpi-v8 arm64 LE
14 May 18:26:47 - [info] Loading palette nodes
14 May 18:26:48 - [info] Dashboard version 3.6.5 started at /ui
**_14 May 18:26:49 - [warn] Info : mcp3xxx : Not running on a Pi - Ignoring node_**
14 May 18:26:49 - [info] Settings file  : /home/matt/.node-red/settings.js
14 May 18:26:49 - [info] Context store  : 'default' [module=memory]
14 May 18:26:49 - [info] User directory : /home/matt/.node-red
14 May 18:26:49 - [info] Projects directory: /home/matt/.node-red/projects
14 May 18:26:49 - [info] Server now running at http://127.0.0.1:1880/
Langage dominant
JavaScript
Étoiles
1.1k
Forks
610
Merge moyen
1 j 8 h
PR mergées (30 j)
1

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de node-red/node-red-nodes

Toutes les issues de node-red/node-red-nodes

Issues similaires

Plus d'issues JavaScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.