Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serial feature #309

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4b372f3
Add Streamserver
mjkl-gh Jan 2, 2021
21e092c
add Streamserver to main
mjkl-gh Jan 2, 2021
f6fd0bd
Add EventConsole
mjkl-gh Dec 25, 2021
b8145c6
Merge branch 'master' of https://github.com/rjwats/esp8266-react into…
mjkl-gh Dec 25, 2021
5e3b6e2
Merge branch 'serial' of https://github.com/mjkl-gh/esp-dsmr into ser…
mjkl-gh Dec 25, 2021
d99de58
Add SerialService
mjkl-gh Feb 7, 2021
ebbf9f4
Comment out LogEventController
mjkl-gh Dec 25, 2021
5a69d33
Merge ser2net
mjkl-gh Dec 25, 2021
39a8d2d
Rename ser2net to serial
mjkl-gh Dec 25, 2021
c72cbc0
add baud to SerialStatus
mjkl-gh Feb 7, 2021
dc7b28c
WIP Serial page
mjkl-gh Feb 7, 2021
2b3996a
Merge fixes from main branch
mjkl-gh Dec 25, 2021
0c9d454
Merge remote-tracking branch 'refs/remotes/Upstream/master'
mjkl-gh Dec 25, 2021
9249d1e
WIP update serial feature to new format
mjkl-gh Jun 6, 2022
5888bdc
Merge remote-tracking branch 'Upstream/master' into SerialFeature-Fix
mjkl-gh Jun 6, 2022
cddf41e
fix Tab moved to @mui/material from @material-ui/core
mjkl-gh Jun 6, 2022
11fb837
styleguide fixes
mjkl-gh Jun 8, 2022
6725888
Fix typo in Serial status title
mjkl-gh Jun 16, 2022
70ec5fc
Set sensible defaults for serial pins for both platforms
mjkl-gh Jun 16, 2022
8710636
WIP logevent console
mjkl-gh Jun 16, 2022
a7148b4
Fix endpoint.ts and env.ts names
mjkl-gh Jun 16, 2022
0760a5e
Fix double dependency
mjkl-gh Jun 16, 2022
956aacc
Simplify serial feature
mjkl-gh Jun 19, 2022
436a00e
add numbervalue to serialsettingsform
mjkl-gh Jun 19, 2022
44b5c7e
Fix settings forms
mjkl-gh Jun 20, 2022
35f37f3
Remove unnecessary this
mjkl-gh Jun 20, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,13 @@ Many of the framework's built in features may be enabled or disabled as required
Customize the settings as you see fit. A value of 0 will disable the specified feature:

```ini
-D FT_PROJECT=1
-D FT_SECURITY=1
-D FT_MQTT=1
-D FT_NTP=1
-D FT_OTA=1
-D FT_UPLOAD_FIRMWARE=1
-D FT_PROJECT=1
-D FT_SECURITY=1
-D FT_MQTT=1
-D FT_NTP=1
-D FT_SERIAL=1
-D FT_OTA=1
-D FT_UPLOAD_FIRMWARE=1
```

Flag | Description
Expand Down
9 changes: 9 additions & 0 deletions factory_settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,14 @@ build_flags =
-D FACTORY_MQTT_CLEAN_SESSION=true
-D FACTORY_MQTT_MAX_TOPIC_LENGTH=128

; Serial settings
-D FACTORY_SERIAL_ENABLED=true
-D FACTORY_SERIAL_RXPIN=14
-D FACTORY_SERIAL_TXPIN=15
-D FACTORY_SERIAL_BAUD=0
-D FACTORY_SERIAL_CONFIG=0x800001c
-D FACTORY_SERIAL_INVERTED=false
-D FACTORY_TCP_PORT=1963

; JWT Secret
-D FACTORY_JWT_SECRET=\"#{random}-#{random}\" ; supports placeholders
1 change: 1 addition & 0 deletions features.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ build_flags =
-D FT_MQTT=1
-D FT_NTP=1
-D FT_OTA=1
-D FT_SERIAL=1
-D FT_UPLOAD_FIRMWARE=1
204 changes: 199 additions & 5 deletions interface/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion interface/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "esp8266-react",
"version": "0.1.0",
"private": true,
"proxy": "http://192.168.0.23",
"proxy": "http://192.168.4.1",
"dependencies": {
"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
Expand Down
4 changes: 4 additions & 0 deletions interface/src/AuthenticatedRouting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import WiFiConnection from './framework/wifi/WiFiConnection';
import AccessPoint from './framework/ap/AccessPoint';
import NetworkTime from './framework/ntp/NetworkTime';
import Mqtt from './framework/mqtt/Mqtt';
import Serial from './framework/serial/Serial';
import System from './framework/system/System';
import Security from './framework/security/Security';

Expand Down Expand Up @@ -49,6 +50,9 @@ const AuthenticatedRouting: FC = () => {
{features.mqtt && (
<Route path="/mqtt/*" element={<Mqtt />} />
)}
{features.serial && (
<Route path="/serial/*" element={<Serial />} />
)}
{features.security && (
<Route
path="/security/*"
Expand Down
23 changes: 23 additions & 0 deletions interface/src/api/env.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,25 @@
export const PROJECT_NAME = process.env.REACT_APP_PROJECT_NAME || 'ESP8266 React';
export const PROJECT_PATH = process.env.REACT_APP_PROJECT_PATH || 'project';

export const ENDPOINT_ROOT = calculateEndpointRoot("/rest/");
export const EVENT_SOURCE_ROOT = calculateEndpointRoot("/es/");
export const WEB_SOCKET_ROOT = calculateWebSocketRoot("/ws/");

function calculateEndpointRoot(endpointPath: string) {
const httpRoot = process.env.REACT_APP_HTTP_ROOT;
if (httpRoot) {
return httpRoot + endpointPath;
}
const location = window.location;
return location.protocol + "//" + location.host + endpointPath;
}

function calculateWebSocketRoot(webSocketPath: string) {
const webSocketRoot = process.env.REACT_APP_WEB_SOCKET_ROOT;
if (webSocketRoot) {
return webSocketRoot + webSocketPath;
}
const location = window.location;
const webProtocol = location.protocol === "https:" ? "wss:" : "ws:";
return webProtocol + "//" + location.host + webSocketPath;
}
16 changes: 16 additions & 0 deletions interface/src/api/serial.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { AxiosPromise } from "axios";

import { SerialSettings, SerialStatus } from "../types";
import { AXIOS } from "./endpoints";

export function readSerialStatus(): AxiosPromise<SerialStatus> {
return AXIOS.get('/serialStatus');
}

export function readSerialSettings(): AxiosPromise<SerialSettings> {
return AXIOS.get('/serialSettings');
}

export function updateSerialSettings(serialSettings: SerialSettings): AxiosPromise<SerialSettings> {
return AXIOS.post('/serialSettings', serialSettings);
}
Loading