Skip to content

Instantly share code, notes, and snippets.

View diegojfer's full-sized avatar

Diego José Fernández Hernández diegojfer

View GitHub Profile

Battery Percent on Argon ONE UP (Ubuntu)

I received the unit yesterday and started testing it. Argon provides a script to manage the battery, but it does not integrate natively with the operating system. The problem is that the script does not register any battery on the power_supply subsystem, so the system cannot recognize the battery as standard.

According to the block diagram, the Argon ONE UP uses a Cellwise CW2217 chip connected over I2C (on RPI1, bus i2c-1, address 0x64), so creating a driver for it is not very difficult.

I created the driver and uploaded it to GitHub kmod-cw2217b. After installing it, the system can display the battery percentage on Ubuntu or Debian.

🛠️ Build & Install the Module

@diegojfer
diegojfer / RedsysSignatureService.kt
Last active July 10, 2024 23:34
Redsys Signature Service for Kotlin - Generate Parameter Signature
package com.codanbaru.service
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonElement
import kotlinx.serialization.json.JsonObject
import kotlinx.serialization.json.JsonPrimitive
import org.bouncycastle.crypto.digests.SHA256Digest
import org.bouncycastle.crypto.macs.HMac
import org.bouncycastle.crypto.params.KeyParameter