Skip to content

Instantly share code, notes, and snippets.

@PL125
PL125 / readGidPin.sh
Last active May 1, 2024 14:42
Decode Astra H Gid 93c66 eeprom
#!/usr/bin/env bash
function printUsage() {
echo "Usage: $0 <OPTIONS>"
echo " OPTIONS:"
echo " -f <= EEprom file location"
echo " -? -h --? --help <= Help info"
echo ""
}
constexpr uint32_t SERIAL_SPEED = 115200;
enum class TextAlign : uint8_t;
enum class FontWeight : uint8_t;
enum class FontWeight : uint8_t {
Bold = 0,
Normal,
ToTest,
static constexpr const uint32_t SERIAL_SPEED = 115200;
/** WARNING --> If you are using an external power supply do not connect VM pin to the mcu <-- WARNING **/
// Motor connections (Must use PWM pins)
#if defined(ESP8266)
constexpr uint8_t IN1 = 4;
constexpr uint8_t IN2 = 5;
#else // Arduino
constexpr uint8_t IN1 = 5;
constexpr uint8_t IN2 = 6;
#include <SPI.h>
#include <mcp2515.h> // https://github.com/autowp/arduino-mcp2515
// SPI Chip Select
#if defined(ESP8266)
constexpr uint8_t SPI_CS_PIN = 15; // ESP8266 - Make sure to use a 3.3V CAN transceiver(LTC2875, MAX3051, TCAN33x, SN65HVD23x, TPT133x)
#else
constexpr uint8_t SPI_CS_PIN = 10; // Arduino
#endif
#include <SPI.h>
#include <mcp2515.h> // https://github.com/autowp/arduino-mcp2515
#define SPI_CS_PIN 10 // SPI Chip Select
#define SERIAL_SPEED 115200
MCP2515 mcp2515(SPI_CS_PIN);
struct can_frame canMsg;
class AstraH_ZafiraB_IPC_Utils {
private:
static constexpr inline bool isDigit(char c) {
return ('0' <= c && '9' >= c);
}
public:
static constexpr uint8_t SECURITY_CODE_LENGTH = 4;
static constexpr uint8_t VIN_NUMBER_LENGTH = 17;
static constexpr uint8_t CODE_IDENT_LENGTH = 2;
@PL125
PL125 / Lora.ino
Created July 9, 2022 16:04
Sending and receiving messages between two SX1278 Lora modules at 433 MHz
#include <SPI.h>
#include <LoRa.h> // https://github.com/sandeepmistry/arduino-LoRa/
#define LORA_NSS 15 // D8(GPIO15)
#define LORA_MOSI 13 // D7(GPIO13)
#define LORA_MISO 12 // D6(GPIO12)
#define LORA_SCK 14 // D5(GPIO14)
#define LORA_RST 16 // D0(GPIO16)
#define LORA_DIO0 05 // D1(GPIO05) /* This pin is only needed for receive callback mode, and it MUST be a hardware interrupt pin */
#include <SPI.h>
#include <mcp2515_can.h> // https://github.com/Seeed-Studio/Seeed_Arduino_CAN
#define GID_SHOW_TEXT
/*///////////////////////////////////////////////////////
Opel/Vauxhall configs
HSCAN - Dual-wire, High Speed CAN-BUS, 500 kbps
MSCAN - Dual-wire, Medium Speed CAN-BUS, 95 kbps
SWCAN - Single-wire, Low Speed CAN-BUS, 33.3 kbps
@PL125
PL125 / 00README.md
Created March 15, 2020 10:23 — forked from smarek/00README.md
E3372s-153 from Stick mode to HiLink mode automatic installer

E3372s from STICK to HiLink mode installer

You need

  • curl, usb-modeswitch, grep, awk, sudo (not necessary, last step can fail safely)
  • balong_flash in $PATH ( https://github.com/forth32/balongflash.git )
  • atinout in $PATH ( https://github.com/beralt/atinout.git will work fine )
  • 2 files we flash (core sw update version 22.x, WebUI installer), we use these (you can probably use different balong-compatible):
    • core sw: "E3372sUpdate_22.298.03.02.965.BIN" / "E3372sUpdate_22.298.03.02.965.exe"
    • webui: "Update_WEBUI_17.100.06.00.03_Hilink_V7R2_9x25_CPIO.exe"