Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .github/workflows/arduino.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- esp32:esp32:esp32

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: arduino/compile-sketches@v1
with:
enable-deltas-report: true
Expand All @@ -26,8 +26,8 @@ jobs:
- name: Base64
- name: Keypad
- name: uBitcoin
- source-path: ./libraries/TFT_eSPI
- source-path: ./libraries/QRCode
- name: TFT_eSPI
- name: QRCodeGenerator

cli-compile-flags: |
- --warnings="none"
Expand Down
27 changes: 16 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: main

Expand All @@ -26,6 +26,7 @@ jobs:
run: |
tmp=$(mktemp)
jq --arg version $tag '.versions |= [$version] + .' versions.json > "$tmp" && mv "$tmp" versions.json
sed -i "/define VERSION/c\#define VERSION \"$tag\"" lnpos/100_config.ino
git config --global user.name 'Alan Bits'
git config --global user.email 'alan@lnbits.com'
git commit -am "[CHORE] update version to $tag"
Expand All @@ -37,17 +38,21 @@ jobs:
- name: Install Arduino CLI
uses: arduino/setup-arduino-cli@v1

- name: build sketch with arduino cli
- name: build, release and upload on github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
sh build.sh

- name: Create github release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
gh release create "$tag" --generate-notes ./build/lnpos.ino.bootloader.bin \
./build/lnpos.ino.bin ./build/lnpos.ino.partitions.bin
sh install.sh
devices=$(jq '.devices[]' versions.json -r)
uploads=""
for device in $devices; do
sh build.sh $device
mv build/lnpos.ino.bin ./lnpos-$device.ino.bin
uploads="$uploads ./lnpos-$device.ino.bin"
mv build/lnpos.ino.partitions.bin ./lnpos-$device.ino.partitions.bin
uploads="$uploads ./lnpos-$device.ino.partitions.bin"
mv build/lnpos.ino.bootloader.bin ./lnpos-$device.ino.bootloader.bin
uploads="$uploads ./lnpos-$device.ino.bootloader.bin"
done
gh release create "$tag" --generate-notes $uploads
File renamed without changes.
15 changes: 9 additions & 6 deletions build-webinstaller.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/sh
PROJECT_NAME=lnpos
REPO=https://github.com/lnbits/lnpos/releases/download
RELEASE=https://github.com/lnbits/lnpos/releases/download
INSTALLER_REPO=https://github.com/lnbits/hardware-installer
INSTALLER_PATH=./hardware-installer/public/firmware

git clone https://github.com/lnbits/hardware-installer
git clone $INSTALLER_REPO

cp INSTALLER.md ./hardware-installer/public/INSTALLER.md
cp versions.json ./hardware-installer/src/versions.json
Expand All @@ -15,9 +16,11 @@ mkdir -p $INSTALLER_PATH
for device in $(jq -r '.devices[]' ./hardware-installer/src/versions.json); do
for version in $(jq -r '.versions[]' ./hardware-installer/src/versions.json); do
mkdir -p $INSTALLER_PATH/$device/$version
wget $REPO/$version/$PROJECT_NAME.ino.bin
wget $REPO/$version/$PROJECT_NAME.ino.partitions.bin
wget $REPO/$version/$PROJECT_NAME.ino.bootloader.bin
mv $PROJECT_NAME* $INSTALLER_PATH/$device/$version
wget $RELEASE/$version/$PROJECT_NAME-$device.ino.bin
wget $RELEASE/$version/$PROJECT_NAME-$device.ino.partitions.bin
wget $RELEASE/$version/$PROJECT_NAME-$device.ino.bootloader.bin
mv $PROJECT_NAME-$device.ino.bin $INSTALLER_PATH/$device/$version/main.bin
mv $PROJECT_NAME-$device.ino.partitions.bin $INSTALLER_PATH/$device/$version/partitions.bin
mv $PROJECT_NAME-$device.ino.bootloader.bin $INSTALLER_PATH/$device/$version/bootloader.bin
done
done
26 changes: 16 additions & 10 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
#!/bin/sh
command -v arduino-cli >/dev/null 2>&1 || { echo >&2 "arduino-cli not found. Aborting."; exit 1; }
arduino-cli config --additional-urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json init --overwrite
arduino-cli core update-index
arduino-cli upgrade
# uBitcoin is broken on esp32 3.x.x
arduino-cli core install esp32:esp32@2.0.17
arduino-cli lib install ArduinoJson Base64 Keypad uBitcoin
if [ -z "$1" ]; then
echo "Usage: sh build.sh <device>"
echo "tdisplay is the default device"
exit 1
fi
device_name=$(echo $1 | tr '[:lower:]' '[:upper:]')
tft_config_file="tft_config_$1.txt"
if [ -f "$tft_config_file" ]; then
echo "Using TFT configuration file $tft_config_file."
user_tft_config=$(cat $tft_config_file | tr '\n' ' ' | sed -e "s/\ /\ -D/g" -e "s/-D$//")
tft_font="-DLOAD_GLCD=1 -DLOAD_FONT2=1 -DLOAD_FONT4=1 -DLOAD_FONT6=1 -DLOAD_FONT7=1 -DLOAD_FONT8=1 -DLOAD_GFXFF=1 -DSMOOTH_FONT=1"
tft_config=" -DTFT=1 -DUSER_SETUP_LOADED=1 -D${user_tft_config} ${tft_font} -DSPI_FREQUENCY=27000000 -DSPI_READ_FREQUENCY=20000000"
fi
arduino-cli compile \
--build-property "build.partitions=min_spiffs" \
--build-property "upload.maximum_size=1966080" \
--library ./libraries/TFT_eSPI \
--library ./libraries/QRCode \
--build-path build --fqbn esp32:esp32:ttgo-lora32 lnpos
--build-property "build.extra_flags.esp32=-D${device_name}${tft_config}" \
--build-path build \
--fqbn esp32:esp32:ttgo-lora32 lnpos
16 changes: 13 additions & 3 deletions config.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
export const addressesAndFiles = [
{
address: "0x1000",
fileName: "lnpos.ino.bootloader.bin",
fileName: "bootloader.bin",
},
{
address: "0x8000",
fileName: "lnpos.ino.partitions.bin",
fileName: "partitions.bin",
},
{
address: "0xE000",
fileName: "boot_app0.bin",
},
{
address: "0x10000",
fileName: "lnpos.ino.bin",
fileName: "main.ino.bin",
},
];

Expand Down Expand Up @@ -105,4 +105,14 @@ export const elements = [
label: "FIAT Decimal Places ie 2 for USD, 0 for YEN",
type: "text",
},
{
type: "heading",
label: "Device settings",
},
{
name: "config_qr_screen_brightness",
value: 121,
label: "QR Screen Brightness (0-255)",
type: "text",
},
];
9 changes: 2 additions & 7 deletions debug.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
if [ -z "$1" ]; then
echo "Usage: ./debug.sh /dev/ttyACM0"
echo "Usage: ./debug.sh /dev/ttyACM0 tdisplay"
exit 1
fi
arduino-cli compile \
--build-property "build.partitions=min_spiffs" \
--build-property "upload.maximum_size=1966080" \
--library ./libraries/TFT_eSPI \
--library ./libraries/QRCode \
--build-path build --fqbn esp32:esp32:ttgo-lora32 lnpos && \
sh build.sh $2 && \
arduino-cli upload --input-dir build --fqbn esp32:esp32:ttgo-lora32 -p $1 && \
arduino-cli monitor -p $1 -c baudrate=115200
8 changes: 8 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
command -v arduino-cli >/dev/null 2>&1 || { echo >&2 "arduino-cli not found. Aborting."; exit 1; }
arduino-cli config --additional-urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json init
arduino-cli core update-index
# uBitcoin is broken on esp32 3.x.x
arduino-cli core install esp32:esp32@2.0.17
arduino-cli upgrade
arduino-cli lib install ArduinoJson TFT_eSPI uBitcoin QrCodeGenerator
1 change: 0 additions & 1 deletion libraries/QRCode/.gitignore

This file was deleted.

26 changes: 0 additions & 26 deletions libraries/QRCode/LICENSE.txt

This file was deleted.

Loading
Loading