Skip to content

Commit

Permalink
First working version
Browse files Browse the repository at this point in the history
  • Loading branch information
shmuelzon committed Nov 25, 2023
1 parent 6e24d35 commit c53339c
Show file tree
Hide file tree
Showing 58 changed files with 6,104 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [ shmuelzon ]
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

*Please make sure you're using the ESP-IDF version specified in the [README](https://github.com/shmuelzon/esp32-ble2mqtt/blob/master/README.md) file, any other version is not supported.*

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Configuration and logs**
If applicable, add your configuration file (without passwords) and logs (preferably of DEBUG level) to help understand your problem.

**Additional context**
Add any other context about the problem here.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/general_question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: General question
about: Ask a question regarding this project
title: ''
labels: question
assignees: ''

---

**Question**
A clear and concise question. Ex. How do I [...]?

**Additional context**
Add any other context or screenshots about the question here.
43 changes: 43 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [ published ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: ESP-IDF Build
uses: espressif/[email protected]
with:
esp_idf_version: v5.1.1
command: idf.py image

- name: Upload Application Image
uses: actions/upload-artifact@v3
with:
name: Application
path: build/ipcam.bin

- name: Upload Filesystem Image
uses: actions/upload-artifact@v3
with:
name: File System
path: build/fs_0.bin

- name: Upload Full Flash Image
uses: actions/upload-artifact@v3
with:
name: Full Flash Image
path: build/ipcam-full.bin
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Outputs
build/

# Build depdendencies
dependencies.lock
managed_components

# Local files
sdkconfig
sdkconfig.old
log.txt

# General
*.swp
*.swo
tags
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "components/opus/opus"]
path = components/opus/opus
url = https://github.com/xiph/opus
66 changes: 66 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
cmake_minimum_required(VERSION 3.5)

execute_process(
COMMAND git describe --always --tags
OUTPUT_VARIABLE PROJECT_VER
OUTPUT_STRIP_TRAILING_WHITESPACE)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)

project(ipcam)

spiffs_create_partition_image(fs_0 data FLASH_IN_PROJECT)
spiffs_create_partition_image(fs_1 data FLASH_IN_PROJECT)
add_dependencies(spiffs_fs_0_bin validate-config)

add_custom_target(check-project-python-requirements
COMMAND ${python} $ENV{IDF_PATH}/tools/check_python_dependencies.py
-r ${PROJECT_DIR}/requirements.txt)

if(CMAKE_HOST_WIN32)
set(NULDEV NUL)
else()
set(NULDEV /dev/null)
endif()

add_custom_target(validate-config
COMMAND ${python} -m json.tool ${PROJECT_DIR}/data/config.json >${NULDEV}
|| (echo "Error: Invalid JSON in configuration file." && exit 1 ))

add_custom_target(upload
COMMAND ${python} ${PROJECT_DIR}/ota.py -f ${build_dir}/${PROJECT_BIN}
-v ${PROJECT_VER} -t $$\{OTA_TARGET:-IPCAM\} -n Firmware
DEPENDS check-project-python-requirements app validate-config
USES_TERMINAL
WORKING_DIRECTORY ${PROJECT_DIR})

add_custom_target(force-upload
COMMAND ${python} ${PROJECT_DIR}/ota.py -f ${build_dir}/${PROJECT_BIN}
-v \"\" -t $$\{OTA_TARGET:-IPCAM\} -n Firmware
DEPENDS check-project-python-requirements app validate-config
USES_TERMINAL
WORKING_DIRECTORY ${PROJECT_DIR})

add_custom_target(upload-config
COMMAND ${python} ${PROJECT_DIR}/ota.py -f ${build_dir}/fs_0.bin
-v $$\(shasum -a 256 ${build_dir}/fs_0.bin | awk '{ print $$1 }'\)
-t $$\{OTA_TARGET:-IPCAM\} -n Config
DEPENDS check-project-python-requirements spiffs_fs_0_bin validate-config
USES_TERMINAL
WORKING_DIRECTORY ${PROJECT_DIR})

add_custom_target(force-upload-config
COMMAND ${python} ${PROJECT_DIR}/ota.py -f ${build_dir}/fs_0.bin -v \"\"
-t $$\{OTA_TARGET:-IPCAM\} -n Config
DEPENDS check-project-python-requirements spiffs_fs_0_bin validate-config
USES_TERMINAL
WORKING_DIRECTORY ${PROJECT_DIR})

add_custom_target(remote-monitor
COMMAND ${python} -u ${PROJECT_DIR}/remote_log.py
DEPENDS validate-config
USES_TERMINAL
WORKING_DIRECTORY ${PROJECT_DIR})

add_custom_target(image
COMMAND esptool.py --chip esp32 merge_bin -o ipcam-full.bin @flash_project_args
DEPENDS bootloader blank_ota_data app spiffs_fs_0_bin spiffs_fs_1_bin)
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2023 Assaf Inbal

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit c53339c

Please sign in to comment.