diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 143f284..f431b07 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: arduino-cli update --additional-urls "$(<~/arduino-cores.txt)" echo d=$(sha256sum ~/.arduino15/package_*index.json | sha256sum | cut -d' ' -f1) >> $GITHUB_OUTPUT - name: Cache Arduino cores - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.arduino15/staging/packages key: cores-${{ steps.cores.outputs.d }} @@ -37,22 +37,18 @@ jobs: mkdir -p $HOME/Arduino/libraries cd $HOME/Arduino/libraries ln -s $GITHUB_WORKSPACE esp32cam - mkdir -p AsyncTCP ESPAsyncWebServer ODROID-GO + mkdir -p AsyncTCP ESPAsyncWebServer curl -fsLS https://github.com/me-no-dev/AsyncTCP/archive/${ASYNCTCP_VERSION}.tar.gz \ | tar -C AsyncTCP -xz --strip-components=1 curl -fsLS https://github.com/me-no-dev/ESPAsyncWebServer/archive/${ESPASYNCWEBSERVER_VERSION}.tar.gz \ | tar -C ESPAsyncWebServer -xz --strip-components=1 - curl -fsLS https://github.com/hardkernel/ODROID-GO/archive/${ODROIDGO_VERSION}.tar.gz \ - | tar -C ODROID-GO -xz --strip-components=1 --wildcards '*/library.properties' '*/src/odroid_go.*' '*/src/Fonts' '*/src/utility' env: ASYNCTCP_VERSION: ca8ac5f919d02bea07b474531981ddbfd64de97c ESPASYNCWEBSERVER_VERSION: 1d46269cedf477661ca8a29518414f4b74e957d4 - ODROIDGO_VERSION: 4a496e337d16bca4ddedbeca3486d7b60662d017 - name: Compile examples run: | arduino-cli compile -b esp32:esp32:esp32cam ./examples/WifiCam arduino-cli compile -b esp32:esp32:esp32cam ./examples/AsyncCam - arduino-cli compile -b esp32:esp32:odroid_esp32 ./examples/GoDisplay - name: Build docs run: docs/build.sh - name: Deploy docs diff --git a/examples/GoDisplay/GoDisplay.ino b/examples/GoDisplay/GoDisplay.ino deleted file mode 100644 index 63674bd..0000000 --- a/examples/GoDisplay/GoDisplay.ino +++ /dev/null @@ -1,49 +0,0 @@ -#include "SpiRamOStream.hpp" - -#include -#include -#include - -static const char* WIFI_SSID = "my-ssid"; -static const char* WIFI_PASS = "my-pass"; -static const char* CAM_SERVER = "192.0.2.1"; -static const uint16_t CAM_PORT = 80; -static const char* CAM_URI = "/320x240.jpg"; - -void -setup() { - GO.begin(115200); - - WiFi.persistent(false); - WiFi.mode(WIFI_STA); - WiFi.begin(WIFI_SSID, WIFI_PASS); - if (WiFi.waitForConnectResult() != WL_CONNECTED) { - Serial.println("WiFi failure"); - delay(5000); - ESP.restart(); - } -} - -void -loop() { - WiFiClient tcp; - HTTPClient http; - http.begin(tcp, CAM_SERVER, CAM_PORT, CAM_URI); - http.setFollowRedirects(HTTPC_STRICT_FOLLOW_REDIRECTS); - int httpCode = http.GET(); - if (httpCode != 200) { - Serial.printf("HTTP error %d\n", httpCode); - return; - } - - int length = http.getSize(); - if (length <= 0) { - Serial.printf("%lu JPEG length unknown\n", millis()); - return; - } - Serial.printf("%lu JPEG len=%d\n", millis(), length); - - SpiRamOStream os(length); - http.writeToStream(&os); - GO.lcd.drawJpg(os.data(), os.size(), 0, 0, 0, 0, 0, 0, JPEG_DIV_NONE); -} diff --git a/examples/GoDisplay/README.md b/examples/GoDisplay/README.md deleted file mode 100644 index 6bec9a3..0000000 --- a/examples/GoDisplay/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# GoDisplay: camera image display for ODROID-GO - -This example runs on [ODROID-GO](https://wiki.odroid.com/odroid_go/odroid_go) game console. -It displays images captured by ESP32-CAM (running WifiCam example) and retrieved over HTTP. -To use this example, modify WiFi SSID+password and ESP32-CAM IP address, then upload to ODROID-GO. - -As of 2022-02-06, [ODROID-GO package](https://github.com/hardkernel/ODROID-GO) is incompatible with ESP32 Arduino core v2.0.x. -Deleting `ODROID-GO/src/sensors` and `ODROID-GO/src/web` directories would resolve the compile errors. diff --git a/examples/GoDisplay/SpiRamOStream.hpp b/examples/GoDisplay/SpiRamOStream.hpp deleted file mode 100644 index ad3a8c3..0000000 --- a/examples/GoDisplay/SpiRamOStream.hpp +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef SPIRAM_OSTREAM_HPP -#define SPIRAM_OSTREAM_HPP - -#include - -/** @brief write-only Stream backed by fixed-size SPIRAM buffer. */ -class SpiRamOStream : public Stream { -public: - explicit SpiRamOStream(size_t cap) - : m_buf(reinterpret_cast(heap_caps_malloc(cap, MALLOC_CAP_SPIRAM))) - , m_len(0) - , m_cap(cap) {} - - ~SpiRamOStream() { - free(m_buf); - } - - const uint8_t* data() const { - return m_buf; - } - - const size_t size() const { - return m_len; - } - - size_t write(const uint8_t* buffer, size_t size) override { - size_t count = min(size, m_cap - m_len); - memcpy(m_buf + m_len, buffer, count); - m_len += count; - return count; - } - - size_t write(uint8_t data) override { - return write(&data, 1); - } - - int available() override { - return 0; - } - - int read() override { - return -1; - } - - int peek() override { - return -1; - } - - void flush() override {} - -private: - uint8_t* m_buf; - size_t m_len; - size_t m_cap; -}; - -#endif // SPIRAM_OSTREAM_HPP