Vai al contenuto
New

DeepSeek V4.1 Flash free for 7 days: 10M tokens a day after a top-up of $10 or more. Until Nov 30.

How it works
aeondave/can-bus-modulesMobile, firmware e hardware

can-bus-modules

⁨CAN Bus interfacing for automotive/industrial networks using MCP2515 over SPI, baud rates, reading OBD-II frames.⁩

v2026.11.13-21cd5683 installazioni+3 in 7 giorni39 Stellesincronizzato 10 ore fa

Installa

Non hai ancora la CLI di NotHoly? Installala prima.

$ curl -fsSL https://notholy.com/install.sh | sh
$ notholy skills install aeondave/can-bus-modules

Scrive in ⁦~/.notholy/skills⁩ dopo aver controllato la firma e lo SHA-256.

FirmaFirmato, ed25519
b6Rbre1WT/…0QI1N6CQ==La CLI controlla lo SHA-256 e la firma prima di scrivere qualsiasi file.
Pacchetto3cd32375…c5ad6f2f
3cd32375f1af…7647c5ad6f2f1 file · ⁦1.3 KB⁩
ScansioneMedio1 segnalazione
  • Nessuna licenza trovata
Vedi la scansione completa
Sorgentegithub.com/AeonDave/malskill/tree/main/hardware/can-bus-modules@21cd568

Questa voce non è ancora scritta in italiano, quindi è mostrata in un'altra lingua: English.

Goal: Interface microcontrollers with automotive and industrial Controller Area Networks (CAN) using transceivers to read and spoof packets.

1. Hardware Stack

  • MCU: e.g., Arduino or ESP32.
  • Controller: MCP2515 (Translates SPI from MCU into CAN format). Maintains transmit buffers and acceptance filters.
  • Transceiver: TJA1050 or MCP2551 (Translates logic-level CAN from the MCP2515 into the differential CAN_H and CAN_L analog voltages required by the physical bus).
  • Physical Bus: CAN_H and CAN_L twisted pair. Requires 120-ohm termination resistors at both ends of the bus.

2. Setting Baud Rates & Oscillators

The CAN bus relies entirely on timing. Connecting with the wrong speed brings down the bus (Error Passive).

  • Standard OBD-II in vehicles uses 500 kbps.
  • Slower comfort buses (doors, windows) might use 125 kbps or 250 kbps.
  • Make sure you initialize the library with the exact crystal oscillator speed attached to your MCP2515 board (commonly 8 MHz or 16 MHz).

3. Standard vs Extended Frames

  • Standard Frame: 11-bit ID. (e.g., 0x7DF). Used heavily in standard automotive.
  • Extended Frame: 29-bit ID. (e.g., 0x18DAF100). Often seen in heavy duty (J1939) or specialized sensors.
  • Payload is always 0 to 8 bytes.

4. Code Snapshot (mcp_can library)

cpp
#include <SPI.h>
#include <mcp_can.h>

const int spiCSPin = 10;
MCP_CAN CAN(spiCSPin);

void setup() {
    Serial.begin(115200);
    // Initialize exactly for 500k baud and 8MHz crystal
    while (CAN_OK != CAN.begin(CAN_500KBPS, MCP_8MHz)) {
        Serial.println("CAN init fail, retry...");
        delay(100);
    }
    Serial.println("CAN init ok!");
}

void loop() {
    long unsigned int rxId;
    unsigned char len = 0;
    unsigned char rxBuf[8];

    if (CAN_MSGAVAIL == CAN.checkReceive()) {
        CAN.readMsgBuf(&rxId, &len, rxBuf);
        Serial.print("ID: "); Serial.print(rxId, HEX);
        Serial.print(" Data: ");
        for(int i = 0; i<len; i++) {
            Serial.print(rxBuf[i], HEX); Serial.print(" ");
        }
        Serial.println();
    }
}

File di questa versione

Permessi

PermessoDichiaratoTrovato dalla scansione
Legge fileNoNo
Scrive fileNoNo
Esegue comandi shellNoNo
Usa la reteNoNo
Usa i connettoriNoNo
Controlla un browserNoNo

Segnalazioni della scansione

Rivisto il 13 nov 2026

  1. MediaLicenza · Nessuna licenza trovata

Una scansione pulita abbassa il rischio, ma non prova che il pacchetto sia sicuro. Leggi quello che installi.

VersionePubblicataCommitSHA-256FirmaCambio di permessi
v2026.11.13-21cd56813 nov 202621cd5683cd32375Firmata–

Chiedi tutto quello che il tuo perimetro consente.

Crea un account, aggiungi crediti e fai la prima domanda in chat o nel terminale.

  1. 1/3

    Crea l'account

    Privato o azienda. Puoi passare ad azienda in seguito senza perdere saldo o chiavi.

    PrivatoAzienda
  2. 2/3

    Aggiungi crediti

    Con carta. Paghi a token, senza abbonamento.

    $5.00ricarica minima
  3. 3/3

    Chiedi

    In chat, oppure installa la CLI ed esegui notholy login nel terminale.

    $ notholy login