mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
10
.github/workflows/pre_release.yml
vendored
10
.github/workflows/pre_release.yml
vendored
@@ -38,15 +38,9 @@ jobs:
|
|||||||
sed -i "s/= 'pl'/= 'en'/" ./src/i18n/i18n-util.ts
|
sed -i "s/= 'pl'/= 'en'/" ./src/i18n/i18n-util.ts
|
||||||
yarn build
|
yarn build
|
||||||
yarn webUI
|
yarn webUI
|
||||||
- name: Build ESP32 4M firmware
|
- name: Build all target environments from default_envs
|
||||||
run: |
|
run: |
|
||||||
platformio run -e ci
|
platformio run
|
||||||
- name: Build ESP32-S3 16M firmware
|
|
||||||
run: |
|
|
||||||
platformio run -e ci_s3
|
|
||||||
- name: Build ESP32 16M firmware
|
|
||||||
run: |
|
|
||||||
platformio run -e ci_16M
|
|
||||||
- name: Create GitHub Release
|
- name: Create GitHub Release
|
||||||
id: 'automatic_releases'
|
id: 'automatic_releases'
|
||||||
uses: 'marvinpinto/action-automatic-releases@latest'
|
uses: 'marvinpinto/action-automatic-releases@latest'
|
||||||
|
|||||||
12
.github/workflows/tagged_release.yml
vendored
12
.github/workflows/tagged_release.yml
vendored
@@ -35,16 +35,10 @@ jobs:
|
|||||||
sed -i "s/= 'pl'/= 'en'/" ./src/i18n/i18n-util.ts
|
sed -i "s/= 'pl'/= 'en'/" ./src/i18n/i18n-util.ts
|
||||||
yarn build
|
yarn build
|
||||||
yarn webUI
|
yarn webUI
|
||||||
- name: Build ESP32 4M firmware
|
- name: Build all target environments from default_envs
|
||||||
run: |
|
run: |
|
||||||
platformio run -e ci
|
platformio run
|
||||||
- name: Build ESP32-S3 16M firmware
|
- name: Create GitHub Release
|
||||||
run: |
|
|
||||||
platformio run -e ci_s3
|
|
||||||
- name: Build ESP32 16M firmware
|
|
||||||
run: |
|
|
||||||
platformio run -e ci_16M
|
|
||||||
- name: Release
|
|
||||||
uses: 'marvinpinto/action-automatic-releases@latest'
|
uses: 'marvinpinto/action-automatic-releases@latest'
|
||||||
with:
|
with:
|
||||||
repo_token: '${{ secrets.GITHUB_TOKEN }}'
|
repo_token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
|
|||||||
12
.github/workflows/test_release.yml
vendored
12
.github/workflows/test_release.yml
vendored
@@ -38,16 +38,10 @@ jobs:
|
|||||||
sed -i "s/= 'pl'/= 'en'/" ./src/i18n/i18n-util.ts
|
sed -i "s/= 'pl'/= 'en'/" ./src/i18n/i18n-util.ts
|
||||||
yarn build
|
yarn build
|
||||||
yarn webUI
|
yarn webUI
|
||||||
- name: Build ESP32 4M firmware
|
- name: Build all target environments from default_envs
|
||||||
run: |
|
run: |
|
||||||
platformio run -e ci
|
platformio run
|
||||||
- name: Build ESP32-S3 16M firmware
|
- name: Create GitHub Release
|
||||||
run: |
|
|
||||||
platformio run -e ci_s3
|
|
||||||
- name: Build ESP32 16M firmware
|
|
||||||
run: |
|
|
||||||
platformio run -e ci_16M
|
|
||||||
- name: Create a GH Release
|
|
||||||
id: 'automatic_releases'
|
id: 'automatic_releases'
|
||||||
uses: 'marvinpinto/action-automatic-releases@latest'
|
uses: 'marvinpinto/action-automatic-releases@latest'
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -55,3 +55,6 @@
|
|||||||
- thermostat/remotetemp as command [#1835](https://github.com/emsesp/EMS-ESP32/discussions/1835)
|
- thermostat/remotetemp as command [#1835](https://github.com/emsesp/EMS-ESP32/discussions/1835)
|
||||||
- temperaturesensor id notation with underscore [#1794](https://github.com/emsesp/EMS-ESP32/discussions/1794)
|
- temperaturesensor id notation with underscore [#1794](https://github.com/emsesp/EMS-ESP32/discussions/1794)
|
||||||
- Change key-names in JSON to be compliant and consistent [#1860](https://github.com/emsesp/EMS-ESP32/issues/1860)
|
- Change key-names in JSON to be compliant and consistent [#1860](https://github.com/emsesp/EMS-ESP32/issues/1860)
|
||||||
|
- Updates to webUI [#1920](https://github.com/emsesp/EMS-ESP32/issues/1920)
|
||||||
|
- Correct firmware naming #1933 [#1933](https://github.com/emsesp/EMS-ESP32/issues/1933)
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.3.1",
|
"react-dom": "^18.3.1",
|
||||||
"react-icons": "^5.3.0",
|
"react-icons": "^5.3.0",
|
||||||
"react-router-dom": "^6.26.0",
|
"react-router-dom": "^6.26.1",
|
||||||
"react-toastify": "^10.0.5",
|
"react-toastify": "^10.0.5",
|
||||||
"typesafe-i18n": "^5.26.2",
|
"typesafe-i18n": "^5.26.2",
|
||||||
"typescript": "^5.5.4"
|
"typescript": "^5.5.4"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useCallback, useState } from 'react';
|
import { useCallback, useEffect, useState } from 'react';
|
||||||
import { useBlocker } from 'react-router-dom';
|
import { useBlocker } from 'react-router-dom';
|
||||||
import { toast } from 'react-toastify';
|
import { toast } from 'react-toastify';
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ import {
|
|||||||
Table
|
Table
|
||||||
} from '@table-library/react-table-library/table';
|
} from '@table-library/react-table-library/table';
|
||||||
import { useTheme } from '@table-library/react-table-library/theme';
|
import { useTheme } from '@table-library/react-table-library/theme';
|
||||||
import { updateState, useAutoRequest, useRequest } from 'alova/client';
|
import { updateState, useRequest } from 'alova/client';
|
||||||
import {
|
import {
|
||||||
BlockNavigation,
|
BlockNavigation,
|
||||||
ButtonRow,
|
ButtonRow,
|
||||||
@@ -48,9 +48,20 @@ const CustomEntities = () => {
|
|||||||
data: entities,
|
data: entities,
|
||||||
send: fetchEntities,
|
send: fetchEntities,
|
||||||
error
|
error
|
||||||
} = useAutoRequest(readCustomEntities, {
|
} = useRequest(readCustomEntities, {
|
||||||
initialData: [],
|
initialData: []
|
||||||
pollingTime: 2000
|
});
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const timer = setInterval(async () => {
|
||||||
|
if (dialogOpen) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await fetchEntities();
|
||||||
|
}, 2000);
|
||||||
|
return () => {
|
||||||
|
clearInterval(timer);
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
const { send: writeEntities } = useRequest(
|
const { send: writeEntities } = useRequest(
|
||||||
|
|||||||
@@ -672,7 +672,7 @@ const Customizations = () => {
|
|||||||
<>
|
<>
|
||||||
{devices && renderDeviceList()}
|
{devices && renderDeviceList()}
|
||||||
{selectedDevice !== -1 && !rename && renderDeviceData()}
|
{selectedDevice !== -1 && !rename && renderDeviceData()}
|
||||||
{restartNeeded && (
|
{restartNeeded ? (
|
||||||
<MessageBox my={2} level="warning" message={LL.RESTART_TEXT(0)}>
|
<MessageBox my={2} level="warning" message={LL.RESTART_TEXT(0)}>
|
||||||
<Button
|
<Button
|
||||||
startIcon={<PowerSettingsNewIcon />}
|
startIcon={<PowerSettingsNewIcon />}
|
||||||
@@ -683,8 +683,7 @@ const Customizations = () => {
|
|||||||
{LL.RESTART()}
|
{LL.RESTART()}
|
||||||
</Button>
|
</Button>
|
||||||
</MessageBox>
|
</MessageBox>
|
||||||
)}
|
) : (
|
||||||
{!restartNeeded && (
|
|
||||||
<Box display="flex" flexWrap="wrap">
|
<Box display="flex" flexWrap="wrap">
|
||||||
<Box flexGrow={1}>
|
<Box flexGrow={1}>
|
||||||
{numChanges !== 0 && (
|
{numChanges !== 0 && (
|
||||||
|
|||||||
@@ -136,30 +136,7 @@ export const createSettingsValidator = (settings: Settings) =>
|
|||||||
rx_gpio: [{ required: true, message: 'Rx GPIO is required' }, GPIO_VALIDATOR]
|
rx_gpio: [{ required: true, message: 'Rx GPIO is required' }, GPIO_VALIDATOR]
|
||||||
}),
|
}),
|
||||||
...(settings.board_profile === 'CUSTOM' &&
|
...(settings.board_profile === 'CUSTOM' &&
|
||||||
settings.platform === 'ESP32R' && {
|
settings.platform === 'ESP32C3' && {
|
||||||
led_gpio: [
|
|
||||||
{ required: true, message: 'LED GPIO is required' },
|
|
||||||
GPIO_VALIDATORR
|
|
||||||
],
|
|
||||||
dallas_gpio: [
|
|
||||||
{ required: true, message: 'GPIO is required' },
|
|
||||||
GPIO_VALIDATORR
|
|
||||||
],
|
|
||||||
pbutton_gpio: [
|
|
||||||
{ required: true, message: 'Button GPIO is required' },
|
|
||||||
GPIO_VALIDATORR
|
|
||||||
],
|
|
||||||
tx_gpio: [
|
|
||||||
{ required: true, message: 'Tx GPIO is required' },
|
|
||||||
GPIO_VALIDATORR
|
|
||||||
],
|
|
||||||
rx_gpio: [
|
|
||||||
{ required: true, message: 'Rx GPIO is required' },
|
|
||||||
GPIO_VALIDATORR
|
|
||||||
]
|
|
||||||
}),
|
|
||||||
...(settings.board_profile === 'CUSTOM' &&
|
|
||||||
settings.platform === 'ESP32-C3' && {
|
|
||||||
led_gpio: [
|
led_gpio: [
|
||||||
{ required: true, message: 'LED GPIO is required' },
|
{ required: true, message: 'LED GPIO is required' },
|
||||||
GPIO_VALIDATORC3
|
GPIO_VALIDATORC3
|
||||||
@@ -182,7 +159,7 @@ export const createSettingsValidator = (settings: Settings) =>
|
|||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
...(settings.board_profile === 'CUSTOM' &&
|
...(settings.board_profile === 'CUSTOM' &&
|
||||||
settings.platform === 'ESP32-S2' && {
|
settings.platform === 'ESP32S2' && {
|
||||||
led_gpio: [
|
led_gpio: [
|
||||||
{ required: true, message: 'LED GPIO is required' },
|
{ required: true, message: 'LED GPIO is required' },
|
||||||
GPIO_VALIDATORS2
|
GPIO_VALIDATORS2
|
||||||
@@ -205,7 +182,7 @@ export const createSettingsValidator = (settings: Settings) =>
|
|||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
...(settings.board_profile === 'CUSTOM' &&
|
...(settings.board_profile === 'CUSTOM' &&
|
||||||
settings.platform === 'ESP32-S3' && {
|
settings.platform === 'ESP32S3' && {
|
||||||
led_gpio: [
|
led_gpio: [
|
||||||
{ required: true, message: 'LED GPIO is required' },
|
{ required: true, message: 'LED GPIO is required' },
|
||||||
GPIO_VALIDATORS3
|
GPIO_VALIDATORS3
|
||||||
@@ -487,14 +464,12 @@ export const analogSensorItemValidation = (
|
|||||||
],
|
],
|
||||||
g: [
|
g: [
|
||||||
{ required: true, message: 'GPIO is required' },
|
{ required: true, message: 'GPIO is required' },
|
||||||
platform === 'ESP32-S3'
|
platform === 'ESP32S3'
|
||||||
? GPIO_VALIDATORS3
|
? GPIO_VALIDATORS3
|
||||||
: platform === 'ESP32-S2'
|
: platform === 'ESP32S2'
|
||||||
? GPIO_VALIDATORS2
|
? GPIO_VALIDATORS2
|
||||||
: platform === 'ESP32-C3'
|
: platform === 'ESP32C3'
|
||||||
? GPIO_VALIDATORC3
|
? GPIO_VALIDATORC3
|
||||||
: platform === 'ESP32R'
|
|
||||||
? GPIO_VALIDATORR
|
|
||||||
: GPIO_VALIDATOR,
|
: GPIO_VALIDATOR,
|
||||||
...(creating ? [isGPIOUniqueValidator(sensors)] : [])
|
...(creating ? [isGPIOUniqueValidator(sensors)] : [])
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -712,7 +712,7 @@ const ApplicationSettings = () => {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<Typography sx={{ pb: 1, pt: 2 }} variant="h6" color="primary">
|
<Typography sx={{ pb: 1, pt: 2 }} variant="h6" color="primary">
|
||||||
{LL.GENERAL_OPTIONS()}
|
{LL.SPECIAL_FUNCTIONS()}
|
||||||
</Typography>
|
</Typography>
|
||||||
<BlockFormControlLabel
|
<BlockFormControlLabel
|
||||||
control={
|
control={
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
import { useState } from 'react';
|
||||||
import { toast } from 'react-toastify';
|
import { toast } from 'react-toastify';
|
||||||
|
|
||||||
import DownloadIcon from '@mui/icons-material/GetApp';
|
import DownloadIcon from '@mui/icons-material/GetApp';
|
||||||
|
import PowerSettingsNewIcon from '@mui/icons-material/PowerSettingsNew';
|
||||||
import { Box, Button, Divider, Link, Typography } from '@mui/material';
|
import { Box, Button, Divider, Link, Typography } from '@mui/material';
|
||||||
|
|
||||||
import * as SystemApi from 'api/system';
|
import * as SystemApi from 'api/system';
|
||||||
@@ -15,8 +17,10 @@ import { getDevVersion, getStableVersion } from 'api/system';
|
|||||||
|
|
||||||
import { useRequest } from 'alova/client';
|
import { useRequest } from 'alova/client';
|
||||||
import type { APIcall } from 'app/main/types';
|
import type { APIcall } from 'app/main/types';
|
||||||
|
import RestartMonitor from 'app/status/RestartMonitor';
|
||||||
import {
|
import {
|
||||||
FormLoader,
|
FormLoader,
|
||||||
|
MessageBox,
|
||||||
SectionContent,
|
SectionContent,
|
||||||
SingleUpload,
|
SingleUpload,
|
||||||
useLayoutTitle
|
useLayoutTitle
|
||||||
@@ -26,6 +30,9 @@ import { useI18nContext } from 'i18n/i18n-react';
|
|||||||
const DownloadUpload = () => {
|
const DownloadUpload = () => {
|
||||||
const { LL } = useI18nContext();
|
const { LL } = useI18nContext();
|
||||||
|
|
||||||
|
const [restarting, setRestarting] = useState<boolean>(false);
|
||||||
|
const [restartNeeded, setRestartNeeded] = useState<boolean>(false);
|
||||||
|
|
||||||
const { send: sendSettings } = useRequest(getSettings(), {
|
const { send: sendSettings } = useRequest(getSettings(), {
|
||||||
immediate: false
|
immediate: false
|
||||||
}).onSuccess((event) => {
|
}).onSuccess((event) => {
|
||||||
@@ -41,7 +48,7 @@ const DownloadUpload = () => {
|
|||||||
const { send: sendEntities } = useRequest(getEntities(), {
|
const { send: sendEntities } = useRequest(getEntities(), {
|
||||||
immediate: false
|
immediate: false
|
||||||
}).onSuccess((event) => {
|
}).onSuccess((event) => {
|
||||||
saveFile(event.data, 'entities.json');
|
saveFile(event.data, 'custom_entities.json');
|
||||||
});
|
});
|
||||||
|
|
||||||
const { send: sendSchedule } = useRequest(getSchedule(), {
|
const { send: sendSchedule } = useRequest(getSchedule(), {
|
||||||
@@ -65,13 +72,29 @@ const DownloadUpload = () => {
|
|||||||
error
|
error
|
||||||
} = useRequest(SystemApi.readHardwareStatus);
|
} = useRequest(SystemApi.readHardwareStatus);
|
||||||
|
|
||||||
|
const { send: restartCommand } = useRequest(SystemApi.restart(), {
|
||||||
|
immediate: false
|
||||||
|
});
|
||||||
|
|
||||||
|
const restart = async () => {
|
||||||
|
await restartCommand()
|
||||||
|
.then(() => {
|
||||||
|
setRestarting(true);
|
||||||
|
})
|
||||||
|
.catch((error: Error) => {
|
||||||
|
toast.error(error.message);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// called immediately to get the latest version, on page load
|
// called immediately to get the latest version, on page load
|
||||||
// set immediate to false to avoid calling the API on page load and GH blocking while testing!
|
// set immediate to false to avoid calling the API on page load and GH blocking while testing!
|
||||||
const { data: latestVersion } = useRequest(getStableVersion, {
|
const { data: latestVersion } = useRequest(getStableVersion, {
|
||||||
immediate: true
|
immediate: true
|
||||||
|
// immediate: false
|
||||||
});
|
});
|
||||||
const { data: latestDevVersion } = useRequest(getDevVersion, {
|
const { data: latestDevVersion } = useRequest(getDevVersion, {
|
||||||
immediate: true
|
immediate: true
|
||||||
|
// immediate: false
|
||||||
});
|
});
|
||||||
|
|
||||||
const STABLE_URL = 'https://github.com/emsesp/EMS-ESP32/releases/download/';
|
const STABLE_URL = 'https://github.com/emsesp/EMS-ESP32/releases/download/';
|
||||||
@@ -83,31 +106,23 @@ const DownloadUpload = () => {
|
|||||||
'https://github.com/emsesp/EMS-ESP32/blob/dev/CHANGELOG_LATEST.md';
|
'https://github.com/emsesp/EMS-ESP32/blob/dev/CHANGELOG_LATEST.md';
|
||||||
|
|
||||||
const getBinURL = (v: string) =>
|
const getBinURL = (v: string) =>
|
||||||
'EMS-ESP-' +
|
'EMS-ESP-' + v.replaceAll('.', '_') + '-' + getPlatform() + '.bin';
|
||||||
v.replaceAll('.', '_') +
|
|
||||||
'-' +
|
|
||||||
getPlatform().replaceAll('-', '_') +
|
|
||||||
'.bin';
|
|
||||||
|
|
||||||
const getPlatform = () => {
|
const getPlatform = () => {
|
||||||
if (
|
return (
|
||||||
data.flash_chip_size >= 16384 &&
|
[data.esp_platform, data.flash_chip_size >= 16384 ? '16MB' : '4MB'].join('-') +
|
||||||
data.esp_platform === 'ESP32' &&
|
(data.psram ? '+' : '')
|
||||||
data.psram
|
);
|
||||||
) {
|
|
||||||
return data.esp_platform + '-16M';
|
|
||||||
}
|
|
||||||
return data.esp_platform;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const saveFile = (json: unknown, endpoint: string) => {
|
const saveFile = (json: unknown, filename: string) => {
|
||||||
const anchor = document.createElement('a');
|
const anchor = document.createElement('a');
|
||||||
anchor.href = URL.createObjectURL(
|
anchor.href = URL.createObjectURL(
|
||||||
new Blob([JSON.stringify(json, null, 2)], {
|
new Blob([JSON.stringify(json, null, 2)], {
|
||||||
type: 'text/plain'
|
type: 'text/plain'
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
anchor.download = 'emsesp_' + endpoint;
|
anchor.download = 'emsesp_' + filename;
|
||||||
anchor.click();
|
anchor.click();
|
||||||
URL.revokeObjectURL(anchor.href);
|
URL.revokeObjectURL(anchor.href);
|
||||||
toast.info(LL.DOWNLOAD_SUCCESSFUL());
|
toast.info(LL.DOWNLOAD_SUCCESSFUL());
|
||||||
@@ -284,12 +299,27 @@ const DownloadUpload = () => {
|
|||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<SingleUpload />
|
<SingleUpload setRestartNeeded={setRestartNeeded} />
|
||||||
|
|
||||||
|
{restartNeeded && (
|
||||||
|
<MessageBox mt={2} level="warning" message={LL.RESTART_TEXT(0)}>
|
||||||
|
<Button
|
||||||
|
startIcon={<PowerSettingsNewIcon />}
|
||||||
|
variant="contained"
|
||||||
|
color="error"
|
||||||
|
onClick={restart}
|
||||||
|
>
|
||||||
|
{LL.RESTART()}
|
||||||
|
</Button>
|
||||||
|
</MessageBox>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
return <SectionContent>{content()}</SectionContent>;
|
return (
|
||||||
|
<SectionContent>{restarting ? <RestartMonitor /> : content()}</SectionContent>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default DownloadUpload;
|
export default DownloadUpload;
|
||||||
|
|||||||
@@ -7,15 +7,16 @@ import { FormLoader } from 'components';
|
|||||||
import { useI18nContext } from 'i18n/i18n-react';
|
import { useI18nContext } from 'i18n/i18n-react';
|
||||||
|
|
||||||
const RESTART_TIMEOUT = 2 * 60 * 1000;
|
const RESTART_TIMEOUT = 2 * 60 * 1000;
|
||||||
const POLL_INTERVAL = 3000;
|
const POLL_INTERVAL = 1000;
|
||||||
|
|
||||||
const RestartMonitor = () => {
|
const RestartMonitor = () => {
|
||||||
const [failed, setFailed] = useState<boolean>(false);
|
const [failed, setFailed] = useState<boolean>(false);
|
||||||
const [timeoutId, setTimeoutId] = useState<NodeJS.Timeout>();
|
const [timeoutId, setTimeoutId] = useState<NodeJS.Timeout>();
|
||||||
const { LL } = useI18nContext();
|
const { LL } = useI18nContext();
|
||||||
const { send } = useRequest(SystemApi.readSystemStatus);
|
|
||||||
const timeoutAt = useRef(new Date().getTime() + RESTART_TIMEOUT);
|
const timeoutAt = useRef(new Date().getTime() + RESTART_TIMEOUT);
|
||||||
|
|
||||||
|
const { send } = useRequest(SystemApi.readSystemStatus);
|
||||||
|
|
||||||
const poll = useRef(async () => {
|
const poll = useRef(async () => {
|
||||||
try {
|
try {
|
||||||
await send();
|
await send();
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
// Code inspired by https://medium.com/@dprincecoder/creating-a-drag-and-drop-file-upload-component-in-react-a-step-by-step-guide-4d93b6cc21e0
|
// Code inspired by Prince Azubuike from https://medium.com/@dprincecoder/creating-a-drag-and-drop-file-upload-component-in-react-a-step-by-step-guide-4d93b6cc21e0
|
||||||
// (c) Prince Azubuike
|
|
||||||
import { type ChangeEvent, useRef, useState } from 'react';
|
import { type ChangeEvent, useRef, useState } from 'react';
|
||||||
|
|
||||||
import CancelIcon from '@mui/icons-material/Cancel';
|
import CancelIcon from '@mui/icons-material/Cancel';
|
||||||
|
|||||||
@@ -2,23 +2,17 @@ import { useEffect, useState } from 'react';
|
|||||||
import { toast } from 'react-toastify';
|
import { toast } from 'react-toastify';
|
||||||
|
|
||||||
import CancelIcon from '@mui/icons-material/Cancel';
|
import CancelIcon from '@mui/icons-material/Cancel';
|
||||||
import PowerSettingsNewIcon from '@mui/icons-material/PowerSettingsNew';
|
|
||||||
import { Box, Button, LinearProgress, Typography } from '@mui/material';
|
import { Box, Button, LinearProgress, Typography } from '@mui/material';
|
||||||
|
|
||||||
import * as SystemApi from 'api/system';
|
import * as SystemApi from 'api/system';
|
||||||
|
|
||||||
import { useRequest } from 'alova/client';
|
import { useRequest } from 'alova/client';
|
||||||
import RestartMonitor from 'app/status/RestartMonitor';
|
|
||||||
import MessageBox from 'components/MessageBox';
|
|
||||||
import { useI18nContext } from 'i18n/i18n-react';
|
import { useI18nContext } from 'i18n/i18n-react';
|
||||||
|
|
||||||
import DragNdrop from './DragNdrop';
|
import DragNdrop from './DragNdrop';
|
||||||
|
|
||||||
const SingleUpload = () => {
|
const SingleUpload = ({ setRestartNeeded }) => {
|
||||||
const [md5, setMd5] = useState<string>();
|
const [md5, setMd5] = useState<string>();
|
||||||
const [restarting, setRestarting] = useState<boolean>(false);
|
|
||||||
const [restartNeeded, setRestartNeeded] = useState<boolean>(false);
|
|
||||||
|
|
||||||
const [file, setFile] = useState<File>();
|
const [file, setFile] = useState<File>();
|
||||||
const { LL } = useI18nContext();
|
const { LL } = useI18nContext();
|
||||||
|
|
||||||
@@ -39,17 +33,6 @@ const SingleUpload = () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const { send: restartCommand } = useRequest(SystemApi.restart(), {
|
|
||||||
immediate: false
|
|
||||||
});
|
|
||||||
|
|
||||||
const restart = async () => {
|
|
||||||
await restartCommand().catch((error: Error) => {
|
|
||||||
toast.error(error.message);
|
|
||||||
});
|
|
||||||
setRestarting(true);
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(async () => {
|
useEffect(async () => {
|
||||||
if (file) {
|
if (file) {
|
||||||
console.log('going to upload file ', file.name);
|
console.log('going to upload file ', file.name);
|
||||||
@@ -75,7 +58,7 @@ const SingleUpload = () => {
|
|||||||
<Typography variant="body2">{LL.UPLOAD_TEXT()}</Typography>
|
<Typography variant="body2">{LL.UPLOAD_TEXT()}</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
{isUploading || restartNeeded ? (
|
{isUploading ? (
|
||||||
<>
|
<>
|
||||||
<Box width="100%" p={2}>
|
<Box width="100%" p={2}>
|
||||||
<LinearProgress
|
<LinearProgress
|
||||||
@@ -90,7 +73,6 @@ const SingleUpload = () => {
|
|||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
{!restartNeeded && (
|
|
||||||
<Button
|
<Button
|
||||||
sx={{ ml: 2 }}
|
sx={{ ml: 2 }}
|
||||||
startIcon={<CancelIcon />}
|
startIcon={<CancelIcon />}
|
||||||
@@ -100,7 +82,6 @@ const SingleUpload = () => {
|
|||||||
>
|
>
|
||||||
{LL.CANCEL()}
|
{LL.CANCEL()}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<DragNdrop onFileSelected={setFile} />
|
<DragNdrop onFileSelected={setFile} />
|
||||||
@@ -111,21 +92,6 @@ const SingleUpload = () => {
|
|||||||
<Typography variant="body2">{'MD5: ' + md5}</Typography>
|
<Typography variant="body2">{'MD5: ' + md5}</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{restartNeeded && (
|
|
||||||
<MessageBox mt={2} level="warning" message={LL.RESTART_TEXT(0)}>
|
|
||||||
<Button
|
|
||||||
startIcon={<PowerSettingsNewIcon />}
|
|
||||||
variant="contained"
|
|
||||||
color="error"
|
|
||||||
onClick={restart}
|
|
||||||
>
|
|
||||||
{LL.RESTART()}
|
|
||||||
</Button>
|
|
||||||
</MessageBox>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{restarting && <RestartMonitor />}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -331,9 +331,10 @@ const de: Translation = {
|
|||||||
RENAME: 'Umbenennen',
|
RENAME: 'Umbenennen',
|
||||||
ENABLE_MODBUS: 'Modbus aktivieren',
|
ENABLE_MODBUS: 'Modbus aktivieren',
|
||||||
VIEW_LOG: 'Sehen Sie sich das Protokoll an, um Probleme zu diagnostizieren',
|
VIEW_LOG: 'Sehen Sie sich das Protokoll an, um Probleme zu diagnostizieren',
|
||||||
UPLOAD_DRAG: 'Ziehen Sie eine Datei hierher oder klicken Sie, um eine auszuwählen', // TODO translate
|
UPLOAD_DRAG: 'Ziehen Sie eine Datei hierher oder klicken Sie, um eine auszuwählen',
|
||||||
SERVICES: 'Dienstleistungen', // TODO translate
|
SERVICES: 'Dienstleistungen',
|
||||||
ALLVALUES: 'Alle Werte' // TODO translate
|
ALLVALUES: 'Alle Werte',
|
||||||
|
SPECIAL_FUNCTIONS: 'Special Functions' // TODO translate
|
||||||
};
|
};
|
||||||
|
|
||||||
export default de;
|
export default de;
|
||||||
|
|||||||
@@ -333,7 +333,8 @@ const en: Translation = {
|
|||||||
VIEW_LOG: 'View log to diagnose issues',
|
VIEW_LOG: 'View log to diagnose issues',
|
||||||
UPLOAD_DRAG: 'drag and drop a file here or click to select one',
|
UPLOAD_DRAG: 'drag and drop a file here or click to select one',
|
||||||
SERVICES: 'Services',
|
SERVICES: 'Services',
|
||||||
ALLVALUES: 'All Values'
|
ALLVALUES: 'All Values',
|
||||||
|
SPECIAL_FUNCTIONS: 'Special Functions'
|
||||||
};
|
};
|
||||||
|
|
||||||
export default en;
|
export default en;
|
||||||
|
|||||||
@@ -333,7 +333,8 @@ const fr: Translation = {
|
|||||||
VIEW_LOG: 'View log to diagnose issues', // TODO translate
|
VIEW_LOG: 'View log to diagnose issues', // TODO translate
|
||||||
UPLOAD_DRAG: 'drag and drop a file here or click to select one', // TODO translate
|
UPLOAD_DRAG: 'drag and drop a file here or click to select one', // TODO translate
|
||||||
SERVICES: 'Services', // TODO translate
|
SERVICES: 'Services', // TODO translate
|
||||||
ALLVALUES: 'All Values' // TODO translate
|
ALLVALUES: 'All Values', // TODO translate
|
||||||
|
SPECIAL_FUNCTIONS: 'Special Functions' // TODO translate
|
||||||
};
|
};
|
||||||
|
|
||||||
export default fr;
|
export default fr;
|
||||||
|
|||||||
@@ -333,7 +333,8 @@ const it: Translation = {
|
|||||||
VIEW_LOG: 'View log to diagnose issues', // TODO translate
|
VIEW_LOG: 'View log to diagnose issues', // TODO translate
|
||||||
UPLOAD_DRAG: 'drag and drop a file here or click to select one', // TODO translate
|
UPLOAD_DRAG: 'drag and drop a file here or click to select one', // TODO translate
|
||||||
SERVICES: 'Services', // TODO translate
|
SERVICES: 'Services', // TODO translate
|
||||||
ALLVALUES: 'All Values' // TODO translate
|
ALLVALUES: 'All Values', // TODO translate
|
||||||
|
SPECIAL_FUNCTIONS: 'Special Functions' // TODO translate
|
||||||
};
|
};
|
||||||
|
|
||||||
export default it;
|
export default it;
|
||||||
|
|||||||
@@ -333,7 +333,8 @@ const nl: Translation = {
|
|||||||
VIEW_LOG: 'View log to diagnose issues', // TODO translate
|
VIEW_LOG: 'View log to diagnose issues', // TODO translate
|
||||||
UPLOAD_DRAG: 'drag and drop a file here or click to select one', // TODO translate
|
UPLOAD_DRAG: 'drag and drop a file here or click to select one', // TODO translate
|
||||||
SERVICES: 'Services', // TODO translate
|
SERVICES: 'Services', // TODO translate
|
||||||
ALLVALUES: 'All Values' // TODO translate
|
ALLVALUES: 'All Values', // TODO translate
|
||||||
|
SPECIAL_FUNCTIONS: 'Special Functions' // TODO translate
|
||||||
};
|
};
|
||||||
|
|
||||||
export default nl;
|
export default nl;
|
||||||
|
|||||||
@@ -333,7 +333,8 @@ const no: Translation = {
|
|||||||
VIEW_LOG: 'View log to diagnose issues', // TODO translate
|
VIEW_LOG: 'View log to diagnose issues', // TODO translate
|
||||||
UPLOAD_DRAG: 'drag and drop a file here or click to select one', // TODO translate
|
UPLOAD_DRAG: 'drag and drop a file here or click to select one', // TODO translate
|
||||||
SERVICES: 'Services', // TODO translate
|
SERVICES: 'Services', // TODO translate
|
||||||
ALLVALUES: 'All Values' // TODO translate
|
ALLVALUES: 'All Values', // TODO translate
|
||||||
|
SPECIAL_FUNCTIONS: 'Special Functions' // TODO translate
|
||||||
};
|
};
|
||||||
|
|
||||||
export default no;
|
export default no;
|
||||||
|
|||||||
@@ -333,7 +333,8 @@ const pl: BaseTranslation = {
|
|||||||
VIEW_LOG: 'View log to diagnose issues', // TODO translate
|
VIEW_LOG: 'View log to diagnose issues', // TODO translate
|
||||||
UPLOAD_DRAG: 'drag and drop a file here or click to select one', // TODO translate
|
UPLOAD_DRAG: 'drag and drop a file here or click to select one', // TODO translate
|
||||||
SERVICES: 'Services', // TODO translate
|
SERVICES: 'Services', // TODO translate
|
||||||
ALLVALUES: 'All Values' // TODO translate
|
ALLVALUES: 'All Values', // TODO translate
|
||||||
|
SPECIAL_FUNCTIONS: 'Special Functions' // TODO translate
|
||||||
};
|
};
|
||||||
|
|
||||||
export default pl;
|
export default pl;
|
||||||
|
|||||||
@@ -333,7 +333,8 @@ const sk: Translation = {
|
|||||||
VIEW_LOG: 'View log to diagnose issues', // TODO translate
|
VIEW_LOG: 'View log to diagnose issues', // TODO translate
|
||||||
UPLOAD_DRAG: 'drag and drop a file here or click to select one', // TODO translate
|
UPLOAD_DRAG: 'drag and drop a file here or click to select one', // TODO translate
|
||||||
SERVICES: 'Services', // TODO translate
|
SERVICES: 'Services', // TODO translate
|
||||||
ALLVALUES: 'All Values' // TODO translate
|
ALLVALUES: 'All Values', // TODO translate
|
||||||
|
SPECIAL_FUNCTIONS: 'Special Functions' // TODO translate
|
||||||
};
|
};
|
||||||
|
|
||||||
export default sk;
|
export default sk;
|
||||||
|
|||||||
@@ -333,7 +333,8 @@ const sv: Translation = {
|
|||||||
VIEW_LOG: 'View log to diagnose issues', // TODO translate
|
VIEW_LOG: 'View log to diagnose issues', // TODO translate
|
||||||
UPLOAD_DRAG: 'drag and drop a file here or click to select one', // TODO translate
|
UPLOAD_DRAG: 'drag and drop a file here or click to select one', // TODO translate
|
||||||
SERVICES: 'Services', // TODO translate
|
SERVICES: 'Services', // TODO translate
|
||||||
ALLVALUES: 'All Values' // TODO translate
|
ALLVALUES: 'All Values', // TODO translate
|
||||||
|
SPECIAL_FUNCTIONS: 'Special Functions' // TODO translate
|
||||||
};
|
};
|
||||||
|
|
||||||
export default sv;
|
export default sv;
|
||||||
|
|||||||
@@ -333,7 +333,8 @@ const tr: Translation = {
|
|||||||
VIEW_LOG: 'View log to diagnose issues', // TODO translate
|
VIEW_LOG: 'View log to diagnose issues', // TODO translate
|
||||||
UPLOAD_DRAG: 'drag and drop a file here or click to select one', // TODO translate
|
UPLOAD_DRAG: 'drag and drop a file here or click to select one', // TODO translate
|
||||||
SERVICES: 'Services', // TODO translate
|
SERVICES: 'Services', // TODO translate
|
||||||
ALLVALUES: 'All Values' // TODO translate
|
ALLVALUES: 'All Values', // TODO translate
|
||||||
|
SPECIAL_FUNCTIONS: 'Special Functions' // TODO translate
|
||||||
};
|
};
|
||||||
|
|
||||||
export default tr;
|
export default tr;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export interface Features {
|
export interface Features {
|
||||||
version: string;
|
version: string;
|
||||||
platform: string; // "ESP32-C3" "ESP32-S2" "ESP32-S3" "ESP32"
|
platform: string; // "ESP32C3" "ESP32S2" "ESP32S3" "ESP32"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1104,10 +1104,10 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@remix-run/router@npm:1.19.0":
|
"@remix-run/router@npm:1.19.1":
|
||||||
version: 1.19.0
|
version: 1.19.1
|
||||||
resolution: "@remix-run/router@npm:1.19.0"
|
resolution: "@remix-run/router@npm:1.19.1"
|
||||||
checksum: 10c0/8c1503a535035f43747fea063b027aa841690c19a6bd8b6251c53d3aab4d4cae89b0bd4809dc7ab69fdbe61897f43c2683b82fc4cdc5785f9166cf2ea60e5932
|
checksum: 10c0/9101fc96646e5107b6b0ef248d4c93bd965590c37ac02d35bcc57d1902467db7fc6eeec0a1fb97d0ce5bc96fae58e75239555e44a983239a61badba18e82d3b8
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -1694,7 +1694,7 @@ __metadata:
|
|||||||
react: "npm:^18.3.1"
|
react: "npm:^18.3.1"
|
||||||
react-dom: "npm:^18.3.1"
|
react-dom: "npm:^18.3.1"
|
||||||
react-icons: "npm:^5.3.0"
|
react-icons: "npm:^5.3.0"
|
||||||
react-router-dom: "npm:^6.26.0"
|
react-router-dom: "npm:^6.26.1"
|
||||||
react-toastify: "npm:^10.0.5"
|
react-toastify: "npm:^10.0.5"
|
||||||
rollup-plugin-visualizer: "npm:^5.12.0"
|
rollup-plugin-visualizer: "npm:^5.12.0"
|
||||||
terser: "npm:^5.31.6"
|
terser: "npm:^5.31.6"
|
||||||
@@ -5794,27 +5794,27 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"react-router-dom@npm:^6.26.0":
|
"react-router-dom@npm:^6.26.1":
|
||||||
version: 6.26.0
|
version: 6.26.1
|
||||||
resolution: "react-router-dom@npm:6.26.0"
|
resolution: "react-router-dom@npm:6.26.1"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@remix-run/router": "npm:1.19.0"
|
"@remix-run/router": "npm:1.19.1"
|
||||||
react-router: "npm:6.26.0"
|
react-router: "npm:6.26.1"
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
react: ">=16.8"
|
react: ">=16.8"
|
||||||
react-dom: ">=16.8"
|
react-dom: ">=16.8"
|
||||||
checksum: 10c0/f59a5b72b1dab6480f97f20fa49b601cb1366e6e1c8def7fd727ccbc4e8cf527f64f7aedd2889534de222dc86634a23e2ed108b99e5443e7b5401a4db104e611
|
checksum: 10c0/9d9d8ed54d1c95497c6fa35a6ab46992efeccf1cfc6f0f6089c6c9b040af3eae09568fbb80c690bae08051a955d92d7aa3a0e730f626eb69285114993d31d430
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"react-router@npm:6.26.0":
|
"react-router@npm:6.26.1":
|
||||||
version: 6.26.0
|
version: 6.26.1
|
||||||
resolution: "react-router@npm:6.26.0"
|
resolution: "react-router@npm:6.26.1"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@remix-run/router": "npm:1.19.0"
|
"@remix-run/router": "npm:1.19.1"
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
react: ">=16.8"
|
react: ">=16.8"
|
||||||
checksum: 10c0/498b97cac077170096715609e65e0039b64e497612ed585b8d3b88733310d23e7ca76ce189b09b6fbc65ca8df1595ca20ccac05a84006803843dfa05107d9540
|
checksum: 10c0/463078e740462b42bb5ba8004448f33fc9e63778f432a4ed55c57b93c5b519e25fb17913ee8435b0fda33c6b9f75df8ef6fcb2c3a4f8db84fb546d202e29aa51
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
|||||||
@@ -369,29 +369,27 @@ const GENERATE_TOKEN_ENDPOINT = REST_ENDPOINT_ROOT + 'generateToken';
|
|||||||
|
|
||||||
const hardware_status = {
|
const hardware_status = {
|
||||||
emsesp_version: '3.7-demo',
|
emsesp_version: '3.7-demo',
|
||||||
esp_platform: 'ESP32',
|
esp_platform: 'ESP32S3',
|
||||||
max_alloc_heap: 107,
|
|
||||||
cpu_type: 'ESP32-S3',
|
cpu_type: 'ESP32-S3',
|
||||||
cpu_rev: 3,
|
cpu_rev: 0,
|
||||||
cpu_cores: 2,
|
cpu_cores: 2,
|
||||||
cpu_freq_mhz: 240,
|
cpu_freq_mhz: 240,
|
||||||
free_heap: 166,
|
max_alloc_heap: 191,
|
||||||
arduino_version: 'ESP32 Arduino v2.0.16',
|
free_heap: 211,
|
||||||
sdk_version: 'v4.4.7',
|
arduino_version: 'ESP32 Arduino v2.0.17',
|
||||||
|
sdk_version: 'v4.4.7-dirty',
|
||||||
partition: 'app0',
|
partition: 'app0',
|
||||||
flash_chip_size: 4096,
|
flash_chip_size: 16384,
|
||||||
flash_chip_speed: 40000000,
|
flash_chip_speed: 80000000,
|
||||||
app_used: 1863,
|
app_used: 2258,
|
||||||
app_free: 121,
|
app_free: 3438,
|
||||||
fs_used: 24,
|
fs_used: 24,
|
||||||
fs_free: 2024,
|
fs_free: 2024,
|
||||||
free_mem: 100,
|
free_caps: 8376,
|
||||||
psram: true,
|
psram: 8189,
|
||||||
// psram: false,
|
psram_size: 8189,
|
||||||
psram_size: 4093,
|
free_psram: 8166,
|
||||||
free_psram: 4074,
|
|
||||||
has_loader: true,
|
has_loader: true,
|
||||||
free_caps: 4204,
|
|
||||||
// model: ''
|
// model: ''
|
||||||
model: 'BBQKees Electronics EMS Gateway E32 V2 (E32 V2.0 P3/2024011)'
|
model: 'BBQKees Electronics EMS Gateway E32 V2 (E32 V2.0 P3/2024011)'
|
||||||
};
|
};
|
||||||
@@ -671,7 +669,7 @@ let settings = {
|
|||||||
eth_power: 15,
|
eth_power: 15,
|
||||||
eth_phy_addr: 0,
|
eth_phy_addr: 0,
|
||||||
eth_clock_mode: 1,
|
eth_clock_mode: 1,
|
||||||
platform: 'ESP32R',
|
platform: 'ESP32',
|
||||||
modbus_enabled: false,
|
modbus_enabled: false,
|
||||||
modbus_port: 502,
|
modbus_port: 502,
|
||||||
modbus_max_clients: 10,
|
modbus_max_clients: 10,
|
||||||
|
|||||||
@@ -16,13 +16,12 @@
|
|||||||
; my_build_flags = -DEMSESP_DEBUG -DEMSESP_TEST -DEMSESP_PINGTEST
|
; my_build_flags = -DEMSESP_DEBUG -DEMSESP_TEST -DEMSESP_PINGTEST
|
||||||
|
|
||||||
[platformio]
|
[platformio]
|
||||||
; default_envs = esp32_4M
|
; default_envs = s_4M
|
||||||
; default_envs = esp32_16M
|
; default_envs = s_16M_P ; BBQKees E32V2
|
||||||
default_envs = lolin_s3
|
; default_envs = s3_16M ; BBQKees S3
|
||||||
; default_envs = lolin_c3_mini
|
; default_envs = c3_mini_4M
|
||||||
; default_envs = native
|
; default_envs = native
|
||||||
; default_envs = debug
|
; default_envs = debug
|
||||||
; default_envs = custom
|
|
||||||
|
|
||||||
[env]
|
[env]
|
||||||
; upload settings
|
; upload settings
|
||||||
@@ -31,7 +30,8 @@ default_envs = lolin_s3
|
|||||||
; upload_port = /dev/ttyUSB*
|
; upload_port = /dev/ttyUSB*
|
||||||
; for OTA add scripts/upload.py to extra_scripts
|
; for OTA add scripts/upload.py to extra_scripts
|
||||||
upload_protocol = custom
|
upload_protocol = custom
|
||||||
custom_emsesp_ip = 10.10.10.175
|
; custom_emsesp_ip = 10.10.10.175
|
||||||
|
custom_emsesp_ip = 192.168.1.23
|
||||||
; custom_emsesp_ip = ems-esp.local
|
; custom_emsesp_ip = ems-esp.local
|
||||||
custom_username = admin
|
custom_username = admin
|
||||||
custom_password = admin
|
custom_password = admin
|
||||||
@@ -45,21 +45,21 @@ extra_scripts =
|
|||||||
; pre:scripts/refresh_module_library_native.py
|
; pre:scripts/refresh_module_library_native.py
|
||||||
post:scripts/run_native.py
|
post:scripts/run_native.py
|
||||||
|
|
||||||
[env:lolin_s3]
|
[env:s3_16M]
|
||||||
extra_scripts =
|
extra_scripts =
|
||||||
pre:scripts/build_interface.py ; comment out if you don't want to re-build the WebUI each time
|
pre:scripts/build_interface.py ; comment out if you don't want to re-build the WebUI each time
|
||||||
scripts/rename_fw.py
|
scripts/rename_fw.py
|
||||||
scripts/upload.py
|
scripts/upload.py
|
||||||
|
|
||||||
[env:esp32_16M]
|
[env:s_16M_P]
|
||||||
extra_scripts =
|
extra_scripts =
|
||||||
pre:scripts/build_interface.py ; comment out if you don't want to re-build the WebUI each time
|
pre:scripts/build_interface.py ; comment out if you don't want to re-build the WebUI each time
|
||||||
scripts/rename_fw.py
|
scripts/rename_fw.py
|
||||||
; scripts/upload.py
|
scripts/upload.py
|
||||||
|
|
||||||
[env:lolin_c3_mini]
|
[env:c3_mini_4M]
|
||||||
extra_scripts =
|
extra_scripts =
|
||||||
; pre:scripts/build_interface.py ; comment out if you don't want to re-build the WebUI each time
|
pre:scripts/build_interface.py ; comment out if you don't want to re-build the WebUI each time
|
||||||
scripts/rename_fw.py
|
scripts/rename_fw.py
|
||||||
scripts/upload.py
|
scripts/upload.py
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
; PlatformIO Project Configuration File for EMS-ESP
|
; PlatformIO Project Configuration File for EMS-ESP
|
||||||
|
;
|
||||||
; override any settings with your own local ones in pio_local.ini (see example pio_local.ini_example)
|
; override any settings with your own local ones in pio_local.ini (see example pio_local.ini_example)
|
||||||
|
; The firmware is renamed following this convention, and placed in the build/firmware folder:
|
||||||
|
; EMS-ESP32-<version>-<chip_type>-<flash_mem>[+ if PSRAM onboard].bin
|
||||||
|
; For example: EMS-ESP-3_7_0-dev_31-esp32-16MB+.bin
|
||||||
|
|
||||||
[platformio]
|
[platformio]
|
||||||
; default_envs = esp32_4M
|
; build all the CI targets as default. Use pio_local.ini to override.
|
||||||
default_envs = lolin_s3
|
default_envs = ci_s_4M, ci_s_16M, ci_s_16M_P, ci_s3_16M_P
|
||||||
; default_envs = esp32_16M
|
|
||||||
; default_envs = native
|
|
||||||
; default_envs = espressi32_v3
|
|
||||||
|
|
||||||
extra_configs =
|
extra_configs =
|
||||||
factory_settings.ini
|
factory_settings.ini
|
||||||
@@ -16,10 +17,9 @@ extra_configs =
|
|||||||
core_build_flags = -std=gnu++2a -Isrc -Wno-type-limits -Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -Wno-format
|
core_build_flags = -std=gnu++2a -Isrc -Wno-type-limits -Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -Wno-format
|
||||||
core_unbuild_flags = -std=gnu++11
|
core_unbuild_flags = -std=gnu++11
|
||||||
|
|
||||||
; my_build_flags is set in pio_local.ini
|
|
||||||
my_build_flags =
|
my_build_flags =
|
||||||
|
|
||||||
; explanation on some custom settings:
|
; explanation on these custom settings:
|
||||||
; CONFIG_ASYNC_TCP_QUEUE - see https://github.com/emsesp/EMS-ESP32/issues/177
|
; CONFIG_ASYNC_TCP_QUEUE - see https://github.com/emsesp/EMS-ESP32/issues/177
|
||||||
; CONFIG_ASYNC_TCP_STACK_SIZE - stack usage measured: ESP32: ~2.3K, ESP32S3: ~3.5k
|
; CONFIG_ASYNC_TCP_STACK_SIZE - stack usage measured: ESP32: ~2.3K, ESP32S3: ~3.5k
|
||||||
; CONFIG_ASYNC_TCP_TASK_PRIORITY - default is 10, was 5 for EMS-ESP
|
; CONFIG_ASYNC_TCP_TASK_PRIORITY - default is 10, was 5 for EMS-ESP
|
||||||
@@ -81,18 +81,43 @@ lib_ldf_mode = chain+
|
|||||||
lib_deps =
|
lib_deps =
|
||||||
https://github.com/emsesp/EMS-ESP-Modules.git
|
https://github.com/emsesp/EMS-ESP-Modules.git
|
||||||
|
|
||||||
|
;
|
||||||
; build for GitHub Actions CI
|
; build for GitHub Actions CI
|
||||||
; the Web interface is built seperately, so is skipped in extra_scripts
|
;
|
||||||
[env:ci]
|
; the Web interface is built seperately during the GH Action so is skipped (not included in extra_scripts)
|
||||||
; 4MB using Tasmota (no SSL) - like BBQKees older S32
|
;
|
||||||
|
[env:ci_s_4M]
|
||||||
|
; 4MB ESP32 - using Tasmota - no SSL, no PSRAM - like the BBQKees older S32 models
|
||||||
extends = espressi32_base_tasmota
|
extends = espressi32_base_tasmota
|
||||||
extra_scripts = scripts/rename_fw.py
|
extra_scripts = scripts/rename_fw.py
|
||||||
board = esp32dev
|
board = esp32dev
|
||||||
board_build.partitions = esp32_partition_4M.csv
|
board_build.partitions = esp32_partition_4M.csv
|
||||||
board_build.extra_flags = -DBOARD_HAS_PSRAM
|
build_flags =
|
||||||
|
${espressi32_base_tasmota.build_flags}
|
||||||
|
|
||||||
[env:ci_s3]
|
[env:ci_s_16M]
|
||||||
; 16MB ESP32-S3 - like BBQKees S3
|
; 16MB ESP32 - using Tasmota - no SSL, no PSRAM - like the BBQKees older S32 models
|
||||||
|
extends = espressi32_base_tasmota
|
||||||
|
extra_scripts = scripts/rename_fw.py
|
||||||
|
board = esp32dev
|
||||||
|
board_build.partitions = esp32_partition_16M.csv
|
||||||
|
build_flags =
|
||||||
|
${espressi32_base_tasmota.build_flags}
|
||||||
|
'-DEMSESP_DEFAULT_BOARD_PROFILE="S32"'
|
||||||
|
|
||||||
|
[env:ci_s_16M_P]
|
||||||
|
; 16MB ESP32 - with PSRAM - like BBQKees E32V2
|
||||||
|
extends = espressi32_base
|
||||||
|
extra_scripts = scripts/rename_fw.py
|
||||||
|
board = esp32dev
|
||||||
|
board_build.partitions = esp32_partition_16M.csv
|
||||||
|
board_build.extra_flags = -DBOARD_HAS_PSRAM
|
||||||
|
build_flags =
|
||||||
|
${espressi32_base.build_flags}
|
||||||
|
'-DEMSESP_DEFAULT_BOARD_PROFILE="E32V2"'
|
||||||
|
|
||||||
|
[env:ci_s3_16M_P]
|
||||||
|
; 16MB ESP32-S3 - with PSRAM - like BBQKees S3
|
||||||
extends = espressi32_base
|
extends = espressi32_base
|
||||||
extra_scripts = scripts/rename_fw.py
|
extra_scripts = scripts/rename_fw.py
|
||||||
board = lolin_s3
|
board = lolin_s3
|
||||||
@@ -104,20 +129,11 @@ build_flags =
|
|||||||
${espressi32_base.build_flags}
|
${espressi32_base.build_flags}
|
||||||
'-DEMSESP_DEFAULT_BOARD_PROFILE="S32S3"'
|
'-DEMSESP_DEFAULT_BOARD_PROFILE="S32S3"'
|
||||||
|
|
||||||
[env:ci_16M]
|
;
|
||||||
; 16MB ESP32 with PSRAM - like BBQKees E32V2
|
|
||||||
extends = espressi32_base
|
|
||||||
extra_scripts = scripts/rename_fw.py
|
|
||||||
board = esp32dev
|
|
||||||
board_build.partitions = esp32_partition_16M.csv
|
|
||||||
board_build.extra_flags = -DBOARD_HAS_PSRAM
|
|
||||||
build_flags =
|
|
||||||
${espressi32_base.build_flags}
|
|
||||||
'-DEMSESP_DEFAULT_BOARD_PROFILE="E32V2"'
|
|
||||||
|
|
||||||
; Direct builds
|
; Direct builds
|
||||||
|
;
|
||||||
|
|
||||||
[env:esp32_4M]
|
[env:s_4M]
|
||||||
extends = espressi32_base_tasmota
|
extends = espressi32_base_tasmota
|
||||||
board = esp32dev
|
board = esp32dev
|
||||||
board_upload.flash_size = 4MB
|
board_upload.flash_size = 4MB
|
||||||
@@ -125,20 +141,20 @@ board_build.partitions = esp32_partition_4M.csv
|
|||||||
build_flags =
|
build_flags =
|
||||||
${espressi32_base_tasmota.build_flags}
|
${espressi32_base_tasmota.build_flags}
|
||||||
|
|
||||||
[env:esp32_4Mplus]
|
[env:s_asym_4M]
|
||||||
extends = espressi32_base_tasmota
|
extends = espressi32_base_tasmota
|
||||||
board = esp32dev
|
board = esp32dev
|
||||||
board_upload.flash_size = 4MB
|
board_upload.flash_size = 4MB
|
||||||
board_build.partitions = esp32_asym_partition_4M.csv
|
board_build.partitions = esp32_asym_partition_4M.csv
|
||||||
|
|
||||||
[env:esp32_16M]
|
[env:s_16M_P]
|
||||||
extends = espressi32_base
|
extends = espressi32_base
|
||||||
board = esp32dev
|
board = esp32dev
|
||||||
board_build.extra_flags = -DBOARD_HAS_PSRAM
|
board_build.extra_flags = -DBOARD_HAS_PSRAM
|
||||||
board_upload.flash_size = 16MB
|
board_upload.flash_size = 16MB
|
||||||
board_build.partitions = esp32_partition_16M.csv
|
board_build.partitions = esp32_partition_16M.csv
|
||||||
|
|
||||||
[env:lolin_c3_mini]
|
[env:c3_mini_4M]
|
||||||
extends = espressi32_base_tasmota
|
extends = espressi32_base_tasmota
|
||||||
board = lolin_c3_mini
|
board = lolin_c3_mini
|
||||||
board_upload.flash_size = 4MB
|
board_upload.flash_size = 4MB
|
||||||
@@ -149,7 +165,7 @@ build_flags =
|
|||||||
|
|
||||||
; lolin C3 mini v1 needs special wifi init.
|
; lolin C3 mini v1 needs special wifi init.
|
||||||
; https://www.wemos.cc/en/latest/c3/c3_mini_1_0_0.html#about-wifi
|
; https://www.wemos.cc/en/latest/c3/c3_mini_1_0_0.html#about-wifi
|
||||||
[env:lolin_c3_mini_v1]
|
[env:c3_miniv1_4M]
|
||||||
extends = espressi32_base_tasmota
|
extends = espressi32_base_tasmota
|
||||||
board = lolin_c3_mini
|
board = lolin_c3_mini
|
||||||
board_upload.flash_size = 4MB
|
board_upload.flash_size = 4MB
|
||||||
@@ -159,7 +175,7 @@ build_flags =
|
|||||||
-DBOARD_C3_MINI_V1
|
-DBOARD_C3_MINI_V1
|
||||||
'-DEMSESP_DEFAULT_BOARD_PROFILE="C3MINI"'
|
'-DEMSESP_DEFAULT_BOARD_PROFILE="C3MINI"'
|
||||||
|
|
||||||
[env:lolin_s2_mini]
|
[env:s2_4M]
|
||||||
extends = espressi32_base_tasmota
|
extends = espressi32_base_tasmota
|
||||||
board = lolin_s2_mini
|
board = lolin_s2_mini
|
||||||
board_upload.flash_size = 4MB
|
board_upload.flash_size = 4MB
|
||||||
@@ -168,7 +184,7 @@ build_flags =
|
|||||||
${espressi32_base_tasmota.build_flags}
|
${espressi32_base_tasmota.build_flags}
|
||||||
'-DEMSESP_DEFAULT_BOARD_PROFILE="S2MINI"'
|
'-DEMSESP_DEFAULT_BOARD_PROFILE="S2MINI"'
|
||||||
|
|
||||||
[env:lolin_s3]
|
[env:s3_16M]
|
||||||
extends = espressi32_base
|
extends = espressi32_base
|
||||||
board = lolin_s3
|
board = lolin_s3
|
||||||
board_build.f_cpu = 240000000L
|
board_build.f_cpu = 240000000L
|
||||||
@@ -180,7 +196,7 @@ build_flags =
|
|||||||
${espressi32_base.build_flags}
|
${espressi32_base.build_flags}
|
||||||
'-DEMSESP_DEFAULT_BOARD_PROFILE="S32S3"'
|
'-DEMSESP_DEFAULT_BOARD_PROFILE="S32S3"'
|
||||||
|
|
||||||
[env:esp32_s3_32M]
|
[env:s3_32M]
|
||||||
extends = espressi32_base
|
extends = espressi32_base
|
||||||
board = lolin_s3
|
board = lolin_s3
|
||||||
board_build.f_cpu = 240000000L
|
board_build.f_cpu = 240000000L
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ OUTPUT_DIR = "build{}".format(os.path.sep)
|
|||||||
|
|
||||||
def bin_copy(source, target, env):
|
def bin_copy(source, target, env):
|
||||||
|
|
||||||
# get the build info
|
# get the application version from version.h
|
||||||
bag = {}
|
bag = {}
|
||||||
exprs = [(re.compile(r'^#define EMSESP_APP_VERSION\s+"(\S+)"'), 'app_version')]
|
exprs = [(re.compile(r'^#define EMSESP_APP_VERSION\s+"(\S+)"'), 'app_version')]
|
||||||
with open('./src/version.h', 'r') as f:
|
with open('./src/version.h', 'r') as f:
|
||||||
@@ -19,27 +19,48 @@ def bin_copy(source, target, env):
|
|||||||
bag[var] = m.group(1)
|
bag[var] = m.group(1)
|
||||||
|
|
||||||
app_version = bag.get('app_version')
|
app_version = bag.get('app_version')
|
||||||
platform = "ESP32"
|
|
||||||
chip_target = env.get('PIOENV').upper()
|
|
||||||
|
|
||||||
# this breaks the CI so removed
|
|
||||||
# flash_size = env["PIOENV"].split('_')[1]
|
|
||||||
|
|
||||||
# print(env.Dump())
|
|
||||||
# my_flags = env.ParseFlags(env['BUILD_FLAGS'])
|
|
||||||
# defines = {k: v for (k, v) in my_flags.get("CPPDEFINES")}
|
|
||||||
# print(my_flags)
|
|
||||||
# print(my_flags.get("CPPDEFINES")
|
|
||||||
|
|
||||||
|
# get the chip type, in uppercase
|
||||||
|
mcu = env.get('BOARD_MCU').upper()
|
||||||
# alternatively take platform from the pio target
|
# alternatively take platform from the pio target
|
||||||
# platform = str(target[0]).split(os.path.sep)[2]
|
# platform = str(target[0]).split(os.path.sep)[2]
|
||||||
|
|
||||||
print("app version: " + app_version)
|
# work out the flash memory from the PIO env name (sloppy but works)
|
||||||
print("platform: " + platform)
|
# unfortunately the board_upload.flash_size is not passed down
|
||||||
print("chip_target: " + chip_target)
|
flash_mem = "4MB"
|
||||||
|
pio_env = env.get('PIOENV').upper()
|
||||||
|
parts = pio_env.split('_')
|
||||||
|
# if it ends with a _P skip (we use this to denote PSRAM)
|
||||||
|
if parts[-1].endswith("P"):
|
||||||
|
index = -2
|
||||||
|
else:
|
||||||
|
index = -1
|
||||||
|
|
||||||
|
# if doesn't have an M at the end
|
||||||
|
if parts[index].endswith("M"):
|
||||||
|
flash_mem = parts[index] + "B"
|
||||||
|
|
||||||
|
# print(env.Dump())
|
||||||
|
|
||||||
|
# my_flags = env.ParseFlags(env['BUILD_FLAGS'])
|
||||||
|
# defines = {k: v for (k, v) in my_flags.get("CPPDEFINES")}
|
||||||
|
|
||||||
|
# find if BOARD_HAS_PSRAM is in the cppdefines
|
||||||
|
cppdefines = env.get("CPPDEFINES")
|
||||||
|
if 'BOARD_HAS_PSRAM' in cppdefines:
|
||||||
|
psram = True
|
||||||
|
else:
|
||||||
|
psram = False
|
||||||
|
|
||||||
|
print("*********************************************")
|
||||||
|
print("EMS-ESP version: " + app_version)
|
||||||
|
print("Has PSRAM: "+str(psram))
|
||||||
|
print("mcu: "+str(mcu))
|
||||||
|
print("Flash Mem: " + flash_mem)
|
||||||
|
|
||||||
# convert . to _ so Windows doesn't complain
|
# convert . to _ so Windows doesn't complain
|
||||||
variant = "EMS-ESP-" + app_version.replace(".", "_") + "-" + chip_target.replace("CI","ESP32")
|
# Format is EMS-ESP-<version>-<mcu>-<flash> with + at the end if it has PSRAM
|
||||||
|
variant = "EMS-ESP-" + app_version.replace(".", "_") + "-" + mcu + "-" + flash_mem + ("+" if psram else "")
|
||||||
|
|
||||||
# check if output directories exist and create if necessary
|
# check if output directories exist and create if necessary
|
||||||
if not os.path.isdir(OUTPUT_DIR):
|
if not os.path.isdir(OUTPUT_DIR):
|
||||||
|
|||||||
@@ -274,11 +274,11 @@ enum {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#if CONFIG_IDF_TARGET_ESP32C3
|
#if CONFIG_IDF_TARGET_ESP32C3
|
||||||
#define EMSESP_PLATFORM "ESP32-C3"
|
#define EMSESP_PLATFORM "ESP32C3"
|
||||||
#elif CONFIG_IDF_TARGET_ESP32S2
|
#elif CONFIG_IDF_TARGET_ESP32S2
|
||||||
#define EMSESP_PLATFORM "ESP32-S2"
|
#define EMSESP_PLATFORM "ESP32S2"
|
||||||
#elif CONFIG_IDF_TARGET_ESP32S3
|
#elif CONFIG_IDF_TARGET_ESP32S3
|
||||||
#define EMSESP_PLATFORM "ESP32-S3"
|
#define EMSESP_PLATFORM "ESP32S3"
|
||||||
#elif CONFIG_IDF_TARGET_ESP32 || EMSESP_STANDALONE
|
#elif CONFIG_IDF_TARGET_ESP32 || EMSESP_STANDALONE
|
||||||
#define EMSESP_PLATFORM "ESP32"
|
#define EMSESP_PLATFORM "ESP32"
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -4525,8 +4525,13 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
|
|||||||
register_device_value(tag, &hc->coolstart, DeviceValueType::UINT8, FL_(coolstart), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_coolstart), 20, 35);
|
register_device_value(tag, &hc->coolstart, DeviceValueType::UINT8, FL_(coolstart), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_coolstart), 20, 35);
|
||||||
register_device_value(tag, &hc->coolondelay, DeviceValueType::UINT8, FL_(coolondelay), DeviceValueUOM::HOURS, MAKE_CF_CB(set_coolondelay), 1, 48);
|
register_device_value(tag, &hc->coolondelay, DeviceValueType::UINT8, FL_(coolondelay), DeviceValueUOM::HOURS, MAKE_CF_CB(set_coolondelay), 1, 48);
|
||||||
register_device_value(tag, &hc->cooloffdelay, DeviceValueType::UINT8, FL_(cooloffdelay), DeviceValueUOM::HOURS, MAKE_CF_CB(set_cooloffdelay), 1, 48);
|
register_device_value(tag, &hc->cooloffdelay, DeviceValueType::UINT8, FL_(cooloffdelay), DeviceValueUOM::HOURS, MAKE_CF_CB(set_cooloffdelay), 1, 48);
|
||||||
register_device_value(
|
register_device_value(tag,
|
||||||
tag, &hc->switchProgMode, DeviceValueType::ENUM, FL_(enum_switchProgMode), FL_(switchProgMode), DeviceValueUOM::NONE, MAKE_CF_CB(set_switchProgMode));
|
&hc->switchProgMode,
|
||||||
|
DeviceValueType::ENUM,
|
||||||
|
FL_(enum_switchProgMode),
|
||||||
|
FL_(switchProgMode),
|
||||||
|
DeviceValueUOM::NONE,
|
||||||
|
MAKE_CF_CB(set_switchProgMode));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case EMSdevice::EMS_DEVICE_FLAG_CRF:
|
case EMSdevice::EMS_DEVICE_FLAG_CRF:
|
||||||
|
|||||||
@@ -1834,7 +1834,7 @@ void EMSdevice::mqtt_ha_entity_config_create() {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef EMSESP_DEBUG
|
#if defined(EMSESP_DEBUG) || defined(EMSESP_STANDALONE)
|
||||||
if (count) {
|
if (count) {
|
||||||
EMSESP::logger().debug("Created %d HA-%s-configs", count, device_type_name());
|
EMSESP::logger().debug("Created %d HA-%s-configs", count, device_type_name());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1538,7 +1538,9 @@ EMSESP::EMSESP()
|
|||||||
// start all the core services
|
// start all the core services
|
||||||
// the services must be loaded in the correct order
|
// the services must be loaded in the correct order
|
||||||
void EMSESP::start() {
|
void EMSESP::start() {
|
||||||
|
#ifndef EMSESP_STANDALONE
|
||||||
system_.PSram(ESP.getPsramSize());
|
system_.PSram(ESP.getPsramSize());
|
||||||
|
#endif
|
||||||
// don't need shell if running unit tests
|
// don't need shell if running unit tests
|
||||||
#ifndef EMSESP_UNITY
|
#ifndef EMSESP_UNITY
|
||||||
// Serial console's shell
|
// Serial console's shell
|
||||||
|
|||||||
@@ -379,7 +379,9 @@ std::string Helpers::data_to_hex(const uint8_t * data, const uint8_t length) {
|
|||||||
return "<empty>";
|
return "<empty>";
|
||||||
}
|
}
|
||||||
|
|
||||||
char str[length * 3] = {0};
|
char str[length * 3];
|
||||||
|
memset(str, 0, length * sizeof(char));
|
||||||
|
|
||||||
char buffer[4];
|
char buffer[4];
|
||||||
char * p = &str[0];
|
char * p = &str[0];
|
||||||
for (uint8_t i = 0; i < length; i++) {
|
for (uint8_t i = 0; i < length; i++) {
|
||||||
|
|||||||
@@ -142,8 +142,7 @@ void WebDataService::sensor_data(AsyncWebServerRequest * request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
root["analog_enabled"] = EMSESP::analog_enabled();
|
root["analog_enabled"] = EMSESP::analog_enabled();
|
||||||
String platform = EMSESP_PLATFORM;
|
root["platform"] = EMSESP_PLATFORM;
|
||||||
root["platform"] = (platform == "ESP32" && EMSESP::system_.PSram()) ? "ESP32R" : platform;
|
|
||||||
|
|
||||||
response->setLength();
|
response->setLength();
|
||||||
request->send(response);
|
request->send(response);
|
||||||
|
|||||||
@@ -75,8 +75,7 @@ void WebSettings::read(WebSettings & settings, JsonObject root) {
|
|||||||
root["eth_power"] = settings.eth_power;
|
root["eth_power"] = settings.eth_power;
|
||||||
root["eth_phy_addr"] = settings.eth_phy_addr;
|
root["eth_phy_addr"] = settings.eth_phy_addr;
|
||||||
root["eth_clock_mode"] = settings.eth_clock_mode;
|
root["eth_clock_mode"] = settings.eth_clock_mode;
|
||||||
String platform = EMSESP_PLATFORM;
|
root["platform"] = EMSESP_PLATFORM;
|
||||||
root["platform"] = (platform == "ESP32" && EMSESP::system_.PSram()) ? "ESP32R" : platform;
|
|
||||||
root["modbus_enabled"] = settings.modbus_enabled;
|
root["modbus_enabled"] = settings.modbus_enabled;
|
||||||
root["modbus_port"] = settings.modbus_port;
|
root["modbus_port"] = settings.modbus_port;
|
||||||
root["modbus_max_clients"] = settings.modbus_max_clients;
|
root["modbus_max_clients"] = settings.modbus_max_clients;
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ void WebStatusService::systemStatus(AsyncWebServerRequest * request) {
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
root["esp_platform"] = EMSESP_PLATFORM; // from default_settings.h: ESP32, ESP32-C3, ESP32-S2, ESP32-S3
|
root["esp_platform"] = EMSESP_PLATFORM; // from default_settings.h: ESP32, ESP32C3, ESP32S2, ESP32S3
|
||||||
root["status"] = EMSESP::bus_status(); // 0, 1 or 2
|
root["status"] = EMSESP::bus_status(); // 0, 1 or 2
|
||||||
root["bus_uptime"] = EMSbus::bus_uptime();
|
root["bus_uptime"] = EMSbus::bus_uptime();
|
||||||
root["num_devices"] = EMSESP::count_devices();
|
root["num_devices"] = EMSESP::count_devices();
|
||||||
@@ -81,6 +81,7 @@ void WebStatusService::systemStatus(AsyncWebServerRequest * request) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef EMSESP_STANDALONE
|
||||||
const esp_partition_t * partition = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_APP_FACTORY, nullptr);
|
const esp_partition_t * partition = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_APP_FACTORY, nullptr);
|
||||||
root["has_loader"] = partition != NULL && partition != esp_ota_get_running_partition();
|
root["has_loader"] = partition != NULL && partition != esp_ota_get_running_partition();
|
||||||
partition = esp_ota_get_next_update_partition(nullptr);
|
partition = esp_ota_get_next_update_partition(nullptr);
|
||||||
@@ -91,6 +92,7 @@ void WebStatusService::systemStatus(AsyncWebServerRequest * request) {
|
|||||||
} else {
|
} else {
|
||||||
root["has_partition"] = false;
|
root["has_partition"] = false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
response->setLength();
|
response->setLength();
|
||||||
request->send(response);
|
request->send(response);
|
||||||
|
|||||||
Reference in New Issue
Block a user