Skip to content

Commit

Permalink
Academy: build of WebUI for 'Uno R4 WiFi' target
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Feb 23, 2024
1 parent de7052f commit 7cf5401
Show file tree
Hide file tree
Showing 77 changed files with 14,273 additions and 23 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ jobs:
arduino --pref "custom_xtal=nodemcuv2_80" --save-prefs ;
cd $HOME/.arduino15/packages/esp8266/hardware/esp8266/2.7.0 ;
sed -i '52 a #define isFlashInterfacePin(p) ((p) == 6 || (p) == 7 || (p) == 8 || (p) == 9 || (p) == 11)' variants/nodemcu/pins_arduino.h ;
sed -i '57 a \ unsigned long getTimeout () const { return _timeout; }' cores/esp8266/Stream.h ;
cd $GITHUB_WORKSPACE ;
fi
if [[ "$BOARD" =~ "esp32:esp32:esp32:" ]]; then
Expand Down
2 changes: 0 additions & 2 deletions software/firmware/source/SoftRF/src/driver/WiFi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ void Raw_Transmit_UDP()
}

#if defined(USE_ARDUINO_WIFI)
#include <WiFi.h>

void WiFi_setup()
{
// Set Hostname.
Expand Down
2 changes: 0 additions & 2 deletions software/firmware/source/SoftRF/src/platform/ESP32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ lmic_pinmap lmic_pins = {
.tcxo = LMIC_UNUSED_PIN,
};

WebServer server ( 80 );

#if !defined(EXCLUDE_LED_RING)
#if defined(USE_NEOPIXELBUS_LIBRARY)
NeoPixelBus<NeoGrbFeature, Neo800KbpsMethod> strip(PIX_NUM, SOC_GPIO_PIN_LED);
Expand Down
6 changes: 3 additions & 3 deletions software/firmware/source/SoftRF/src/platform/ESP32.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@

#include "sdkconfig.h"

#define USE_WIFI_NINA false
#define USE_WIFI_CUSTOM true
#include <WiFi.h>
#include <WebServer.h>

#include <ESPmDNS.h>
#include <Update.h>
#include <WiFiClient.h>
Expand Down Expand Up @@ -238,8 +240,6 @@ extern Adafruit_NeoPixel strip;
#include "iomap/WT0132C6.h"
#include "iomap/LilyGO_T3C6.h"

extern WebServer server;

enum rst_reason {
REASON_DEFAULT_RST = 0, /* normal startup by power on */
REASON_WDT_RST = 1, /* hardware watch dog reset */
Expand Down
2 changes: 0 additions & 2 deletions software/firmware/source/SoftRF/src/platform/ESP8266.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ Exp_SoftwareSerial swSer(SOC_GPIO_PIN_GNSS_RX, SOC_GPIO_PIN_GNSS_TX, false, 256)
SoftwareSerial swSer;
#endif

ESP8266WebServer server ( 80 );

// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
Expand Down
5 changes: 3 additions & 2 deletions software/firmware/source/SoftRF/src/platform/ESP8266.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
#ifndef PLATFORM_ESP8266_H
#define PLATFORM_ESP8266_H

#define USE_WIFI_NINA false
#define USE_WIFI_CUSTOM true
#include <ESP8266WiFi.h>

#include <ESP8266mDNS.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>

#define USE_EXP_SW_SERIAL

Expand Down Expand Up @@ -92,7 +94,6 @@ extern "C" {
#include <user_interface.h>
}

extern ESP8266WebServer server;
#if defined(USE_EXP_SW_SERIAL)
extern Exp_SoftwareSerial swSer;
#else
Expand Down
6 changes: 4 additions & 2 deletions software/firmware/source/SoftRF/src/platform/RA4M1.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ struct rst_info {
#elif defined(ARDUINO_UNOR4_WIFI)
#define USE_ARDUINO_WIFI
#define EXCLUDE_OTA
#define EXCLUDE_WEBUI /* TODO */
#define USE_WIFI_NINA false
#define USE_WIFI_CUSTOM true
#include <WiFiS3.h>
#define Serial_setDebugOutput(x) ({})
#endif

Expand All @@ -160,7 +162,7 @@ struct rst_info {
#define EXCLUDE_NRF905 // - kb
#define EXCLUDE_UATM // - kb
#define EXCLUDE_MAVLINK // - kb
//#define EXCLUDE_EGM96 // - kb
#define EXCLUDE_EGM96 // - kb
#define EXCLUDE_LED_RING // - kb
#define EXCLUDE_SOUND

Expand Down
1 change: 0 additions & 1 deletion software/firmware/source/SoftRF/src/platform/RP2040.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIX_NUM, SOC_GPIO_PIN_LED,
char UDPpacketBuffer[4]; // Dummy definition to satisfy build sequence
#else
#include "../driver/WiFi.h"
WebServer server ( 80 );

#define isTimeToAP() (millis() - AP_clients_TimeMarker > 1000)
static unsigned long AP_clients_TimeMarker = 0;
Expand Down
7 changes: 4 additions & 3 deletions software/firmware/source/SoftRF/src/platform/RP2040.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,12 @@ struct rst_info {
#endif

#if defined(ARDUINO_RASPBERRY_PI_PICO_W)
#include <WiFi.h>
#include <WebServer.h>
#define USE_WIFI_NINA false
#define USE_WIFI_CUSTOM true
#include <ESP8266WiFi.h>
#define Serial_setDebugOutput(x) ({})
#define WIFI_STA_TIMEOUT 20000
extern WebServer server;

/* Experimental */
#define ENABLE_PROL
//#define ENABLE_BT_VOICE
Expand Down
22 changes: 16 additions & 6 deletions software/firmware/source/SoftRF/src/ui/Web.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ static const char Logo[] PROGMEM = {

#include "jquery_min_js.h"

#include <WiFiWebServer.h>
WiFiWebServer server ( 80 );

byte getVal(char c)
{
if(c >= '0' && c <= '9')
Expand Down Expand Up @@ -800,7 +803,7 @@ void handleRoot() {
#endif /* ENABLE_RECORDER */

/* SoC specific part 1 */
if (SoC->id != SOC_RP2040) {
if (SoC->id != SOC_RP2040 && SoC->id != SOC_RA4M1) {
snprintf_P ( offset, size, PSTR("\
<td align=right><input type=button onClick=\"location.href='/firmware'\" value='Firmware update'></td>"));
len = strlen(offset);
Expand Down Expand Up @@ -1164,6 +1167,10 @@ void Web_setup()
server.on ( "/inline", []() {
server.send ( 200, "text/plain", "this works as well" );
} );

server.onNotFound ( handleNotFound );

#if !defined(EXCLUDE_OTA)
server.on("/firmware", HTTP_GET, [](){
SoC->swSer_enableRx(false);
server.sendHeader(String(F("Connection")), String(F("close")));
Expand Down Expand Up @@ -1226,7 +1233,6 @@ void Web_setup()
);
SoC->swSer_enableRx(true);
});
server.onNotFound ( handleNotFound );

server.on("/update", HTTP_POST, [](){
SoC->swSer_enableRx(false);
Expand Down Expand Up @@ -1263,15 +1269,19 @@ void Web_setup()
}
yield();
});
#endif /* EXCLUDE_OTA */

/* FLASH memory usage optimization */
#if !defined(ARDUINO_ARCH_RP2040) && !defined(CONFIG_IDF_TARGET_ESP32C6)
#if !defined(ARDUINO_ARCH_RP2040) && \
!defined(CONFIG_IDF_TARGET_ESP32C6) && \
!defined(ARDUINO_ARCH_RENESAS)

server.on ( "/logo.png", []() {
server.send_P ( 200, "image/png", Logo, sizeof(Logo) );
} );
#endif /* ARDUINO_ARCH_RP2040 CONFIG_IDF_TARGET_ESP32C6 */
#endif /* ARDUINO_ARCH_RP2040 CONFIG_IDF_TARGET_ESP32C6 ARDUINO_ARCH_RENESAS */

#if !defined(ARDUINO_ARCH_RP2040)
#if !defined(ARDUINO_ARCH_RP2040) && !defined(ARDUINO_ARCH_RENESAS)
server.on ( "/jquery.min.js", []() {

PGM_P content = jquery_min_js_gz;
Expand All @@ -1290,7 +1300,7 @@ void Web_setup()
} while (bytes_left > 0) ;

} );
#endif /* ARDUINO_ARCH_RP2040 */
#endif /* ARDUINO_ARCH_RP2040 ARDUINO_ARCH_RENESAS */

#if defined(ENABLE_RECORDER)
server.on("/flights", HTTP_GET, Handle_Flight_Download);
Expand Down
7 changes: 7 additions & 0 deletions software/firmware/source/libraries/WiFiWebServer/.codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See: https://github.com/codespell-project/codespell#using-a-config-file
[codespell]
# In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here:
ignore-words-list = ,
check-filenames =
check-hidden =
skip = ./.git,./src,./examples,./Packages_Patches,./LibraryPatches
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

### Describe the bug

A clear and concise description of what the bug is.

### Steps to Reproduce

Steps to reproduce the behavior. Including the [MRE](https://stackoverflow.com/help/minimal-reproducible-example) sketches

### Expected behavior

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

### Actual behavior

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

### Debug and AT-command log (if applicable)

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

### Screenshots

If applicable, add screenshots to help explain your problem.

### Information

Please ensure to specify the following:

* Arduino IDE version (e.g. 1.8.19) or Platform.io version
* Board Core Version (e.g. Arduino SAMDUE core v1.6.12, ESP8266 core v3.0.2, ArduinoCore-mbed v3.4.1, etc.)
* Contextual information (e.g. what you were trying to achieve)
* Simplest possible steps to reproduce
* Anything that might be relevant in your opinion, such as:
* Operating system (Windows, Ubuntu, etc.) and the output of `uname -a`
* Network configuration


### Example

```
Arduino IDE version: 1.8.19
RASPBERRY_PI_PICO board
ArduinoCore-mbed v3.4.1
OS: Ubuntu 20.04 LTS
Linux xy-Inspiron-3593 5.15.0-53-generic #59~20.04.1-Ubuntu SMP Thu Oct 20 15:10:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Context:
I encountered a crash while using this library
Steps to reproduce:
1. ...
2. ...
3. ...
4. ...
```

### Additional context

Add any other context about the problem here.

---

### Sending Feature Requests

Feel free to post feature requests. It's helpful if you can explain exactly why the feature would be useful.

There are usually some outstanding feature requests in the [existing issues list](https://github.com/khoih-prog/WiFiWebServer/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement), feel free to add comments to them.

---

### Sending Pull Requests

Pull Requests with changes and fixes are also welcome!

Please use the `astyle` to reformat the updated library code as follows (demo for Ubuntu Linux)

1. Change directory to the library GitHub

```
xy@xy-Inspiron-3593:~$ cd Arduino/xy/WiFiWebServer_GitHub/
xy@xy-Inspiron-3593:~/Arduino/xy/WiFiWebServer_GitHub$
```

2. Issue astyle command

```
xy@xy-Inspiron-3593:~/Arduino/xy/WiFiWebServer_GitHub$ bash utils/restyle.sh
```

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: ''
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# See: https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#about-the-dependabotyml-file
version: 2

updates:
# Configure check for outdated GitHub Actions actions in workflows.
# See: https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot
- package-ecosystem: github-actions
directory: / # Check the repository's workflows under /.github/workflows/
schedule:
interval: daily
31 changes: 31 additions & 0 deletions software/firmware/source/libraries/WiFiWebServer/.github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Configuration for probot-stale - https://github.com/probot/stale

daysUntilStale: 60
daysUntilClose: 14
limitPerRun: 30
staleLabel: stale
exemptLabels:
- pinned
- security
- "to be implemented"
- "for reference"
- "move to PR"
- "enhancement"

only: issues
onlyLabels: []
exemptProjects: false
exemptMilestones: false
exemptAssignees: false

markComment: >
[STALE_SET] This issue has been automatically marked as stale because it has not had
recent activity. It will be closed in 14 days if no further activity occurs. Thank you
for your contributions.
unmarkComment: >
[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it opening the future.
closeComment: >
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: auto-github-actions
on: [push]
jobs:
check-bats-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '14'
- run: npm install -g bats
- run: bats -v
Loading

0 comments on commit 7cf5401

Please sign in to comment.