Compare commits

..

10 commits

Author SHA1 Message Date
ImgBotApp
ff46ef9411
[ImgBot] Optimize images
*Total -- 171.81kb -> 114.46kb (33.38%)

/assets/dashboard.png -- 85.97kb -> 44.20kb (48.59%)
/modules/android/app/src/main/ic_launcher-playstore.png -- 24.87kb -> 15.20kb (38.87%)
/modules/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -- 10.40kb -> 8.52kb (18.06%)
/modules/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -- 6.77kb -> 5.91kb (12.69%)
/modules/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -- 6.68kb -> 5.88kb (11.9%)
/modules/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -- 4.77kb -> 4.23kb (11.28%)
/modules/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -- 2.92kb -> 2.61kb (10.7%)
/modules/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -- 4.35kb -> 3.88kb (10.69%)
/modules/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -- 2.11kb -> 1.92kb (8.91%)
/modules/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -- 1.87kb -> 1.72kb (7.89%)
/modules/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -- 1.49kb -> 1.38kb (7.73%)
/modules/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -- 2.88kb -> 2.73kb (4.89%)
/modules/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -- 14.01kb -> 13.54kb (3.35%)
/modules/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -- 2.73kb -> 2.73kb (0.04%)

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
2023-02-12 17:30:15 +00:00
ce38e34051
Add UI presentation 2023-02-12 16:58:46 +01:00
ea3f815e3e
Add files via upload 2023-02-12 16:54:51 +01:00
12da5957b8
Switch default mux position 2022-09-20 20:44:47 +02:00
14846e5aa5
Restructure communication protocol 2022-09-20 18:58:26 +02:00
3adb5c576f
Add eeprom
Eeproms outlive flash, which quickly dies during light state preservation.
2022-09-17 17:29:23 +02:00
4f84fc650f
Fix first pcb batch issues
Reassign input only pins, external uart connected to flash spi & mux blocking uart access
2022-09-17 17:07:48 +02:00
6b4c24783e
Add hex prefix 2022-04-19 23:52:45 +02:00
740abd951d
Add safe clearBuffer websocket method 2022-04-13 19:09:03 +02:00
d285387f38
Implement websocket receive 2022-04-13 18:42:39 +02:00
26 changed files with 11345 additions and 422 deletions

BIN
assets/dashboard.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View file

@ -1,30 +1,42 @@
# Heliox communication protocol
The following structure can be used to communicate with the Heliox control over several carrier protocols (UART, BL LE,...)
## Basic data structure
The following table describes the bit pattern for a successful communication with heliox devices.
The following table describes the bit pattern for a successful communication with and between Heliox devices.
| 0-15 | 16-22 | 23 | 24-31 | 32-(32+8*x) |
| :---------------: | :----------: | :---------------: | :-------------------: | :---------: |
| Magic Number (HX) | Message Type | Parity Bit (even) | Data Length (x Bytes) | Data |
| 0x0 | 0x1 | 0x2 | 0x3 | 0x4 | ... |
| --- | --- | -------- | ------ | --------- | --------------- |
| H | X | _length_ | _mode_ | _submode_ | _optional data_ |
## Message Types
## Modes
| Code | Purpose |
| ---- | -------------------- |
| 0 | Light Data |
| 1 | Control Signal |
| 2 | Status Messages |
| 3 | Confirmation Message |
| 4 | Debug Info |
### Mode selection
### Light Data
The columns represent modes and the rows represent submodes:
- 1-Byte-block per lamp: 0-255
- Index of lamp determinded by order
| | 0x0 | 0x1 | 0x2 | 0x3 |
| :---: | :---------: | :---------------: | :---------------: | :-------------------------: |
| | **Message** | **Settings** | **Light control** | **Basic commands** |
| 0x0 | light data | set baud rate | on | request light data |
| 0x1 | info | set WIFI password | off | enter console flashing mode |
| 0x2 | warning | set WIFI SSID | toggle | exit console flashing mode |
| 0x3 | error | | increase | pair Bluetooth |
| 0x4 | success | | decrease | help |
| 0x5 | | | | version |
### Control Signal
### Optional data
- Index Byte + [ **t** <sub>oggle</sub> | **i** <sub>ncrease</sub> | **d** <sub>decrease</sub> ]
- on
- off
Every submode can take any number of Bytes except the below-mentioned ones:
| **0 Bytes** | **1 Byte** |
| :------------: | :--------: |
| on | increase |
| off | decrease |
| flash console | toggle |
| pair Bluetooth | |
### Additional information
The maximum length of a message ist 255 Bytes excluding the magic number "BM" and the length slot itself.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -22,7 +22,7 @@ WebsocketCommunicator::WebsocketCommunicator(AsyncWebSocket &socket, AsyncWebSer
break;
}
};
msgRead = false;
socket.onEvent(onEvent);
server.addHandler(&socket);
}
@ -41,10 +41,21 @@ void WebsocketCommunicator::sendMessage(const char message[])
char *WebsocketCommunicator::receiveMessage()
{
msgRead = true;
return getBuffer();
}
void WebsocketCommunicator::clearBufferSafely()
{
if (msgRead)
{
clearBuffer();
}
}
void WebsocketCommunicator::handleMessage(void *arg, uint8_t *data, size_t len)
{
Serial.println("data");
msgRead = false;
int effectiveLen = len < bufferSize ? len : bufferSize;
strncpy(messageBuffer, (char *)data, effectiveLen);
}

View file

@ -5,6 +5,7 @@ class WebsocketCommunicator : public Communicator
{
private:
void handleMessage(void *arg, uint8_t *data, size_t len);
bool msgRead;
protected:
AsyncWebSocket &socket;
@ -15,4 +16,5 @@ public:
void sendMessage(int *values, __SIZE_TYPE__ numberOfValues) override;
void sendMessage(const char message[]) override;
char *receiveMessage() override;
void clearBufferSafely();
};

View file

@ -20,7 +20,7 @@ AsyncWebSocket ws("/ws");
Communicator *computer;
Communicator *phone;
Communicator *websocket;
WebsocketCommunicator *websocket;
LightController *light;
void websocketTask(void *parameter)
@ -28,14 +28,13 @@ void websocketTask(void *parameter)
while (true)
{
websocket->sendMessage(light->getBjtState(), light->getBjtCount());
websocket->clearBuffer();
vTaskDelay(90 / portTICK_PERIOD_MS);
vTaskDelay(100 / portTICK_PERIOD_MS);
}
vTaskDelete(NULL);
}
void registerTasks()
void registerWebSocketTask()
{
xTaskCreate(websocketTask, "websocketTask", 10000, NULL, 1, NULL);
}
@ -78,7 +77,7 @@ void setup()
connectWifi(WIFI_TIMEOUT);
server.begin();
registerTasks();
registerWebSocketTask();
}
void computerCycle()
@ -95,9 +94,16 @@ void phoneCycle()
phone->clearBuffer();
}
void websocketCycle()
{
light->updateState(websocket->receiveMessage(), STEPS);
websocket->clearBufferSafely();
}
void loop()
{
computerCycle();
phoneCycle();
websocketCycle();
ws.cleanupClients();
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,9 @@
EESchema-DOCLIB Version 2.0
#
$CMP M24C08-RMN6TP
D EEPROM 16Kbit 8Kbit 4Kbit 2Kb and 1Kb Serial
K
F https://www.st.com/resource/en/datasheet/m24c08-r.pdf
$ENDCMP
#
#End Doc Library

View file

@ -0,0 +1,33 @@
EESchema-LIBRARY Version 2.3
#encoding utf-8
#SamacSys ECAD Model M24C08-RMN6TP
#/1141526/569181/2.49/8/3/Integrated Circuit
DEF M24C08-RMN6TP IC 0 30 Y Y 1 F N
F0 "IC" 950 300 50 H V L CNN
F1 "M24C08-RMN6TP" 950 200 50 H V L CNN
F2 "SOIC127P600X175-8N" 950 100 50 H I L CNN
F3 "https://www.st.com/resource/en/datasheet/m24c08-r.pdf" 950 0 50 H I L CNN
F4 "EEPROM 16Kbit 8Kbit 4Kbit 2Kb and 1Kb Serial" 950 -100 50 H I L CNN "Description"
F5 "1.75" 950 -200 50 H I L CNN "Height"
F6 "STMicroelectronics" 950 -300 50 H I L CNN "Manufacturer_Name"
F7 "M24C08-RMN6TP" 950 -400 50 H I L CNN "Manufacturer_Part_Number"
F8 "511-M24C08-RMN6TP" 950 -500 50 H I L CNN "Mouser Part Number"
F9 "https://www.mouser.co.uk/ProductDetail/STMicroelectronics/M24C08-RMN6TP?qs=%252B9pWl1iD4MWbThyGTUpSoQ%3D%3D" 950 -600 50 H I L CNN "Mouser Price/Stock"
F10 "M24C08-RMN6TP" 950 -700 50 H I L CNN "Arrow Part Number"
F11 "https://www.arrow.com/en/products/m24c08-rmn6tp/stmicroelectronics?region=nac" 950 -800 50 H I L CNN "Arrow Price/Stock"
F12 "" 950 -900 50 H I L CNN "Mouser Testing Part Number"
F13 "" 950 -1000 50 H I L CNN "Mouser Testing Price/Stock"
DRAW
X NC_1 1 0 0 200 R 50 50 0 0 P
X NC_2 2 0 -100 200 R 50 50 0 0 P
X E2 3 0 -200 200 R 50 50 0 0 P
X VSS 4 0 -300 200 R 50 50 0 0 P
X VCC 8 1100 0 200 L 50 50 0 0 P
X ~WC 7 1100 -100 200 L 50 50 0 0 P
X SCL 6 1100 -200 200 L 50 50 0 0 P
X SDA 5 1100 -300 200 L 50 50 0 0 P
P 5 0 1 6 200 100 900 100 900 -400 200 -400 200 100 N
ENDDRAW
ENDDEF
#
#End Library

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,41 @@
(module "SOIC127P600X175-8N" (layer F.Cu)
(descr "SO8N")
(tags "Integrated Circuit")
(attr smd)
(fp_text reference IC** (at 0 0) (layer F.SilkS)
(effects (font (size 1.27 1.27) (thickness 0.254)))
)
(fp_text user %R (at 0 0) (layer F.Fab)
(effects (font (size 1.27 1.27) (thickness 0.254)))
)
(fp_text value "SOIC127P600X175-8N" (at 0 0) (layer F.SilkS) hide
(effects (font (size 1.27 1.27) (thickness 0.254)))
)
(fp_line (start -3.725 -2.75) (end 3.725 -2.75) (layer F.CrtYd) (width 0.05))
(fp_line (start 3.725 -2.75) (end 3.725 2.75) (layer F.CrtYd) (width 0.05))
(fp_line (start 3.725 2.75) (end -3.725 2.75) (layer F.CrtYd) (width 0.05))
(fp_line (start -3.725 2.75) (end -3.725 -2.75) (layer F.CrtYd) (width 0.05))
(fp_line (start -1.95 -2.45) (end 1.95 -2.45) (layer F.Fab) (width 0.1))
(fp_line (start 1.95 -2.45) (end 1.95 2.45) (layer F.Fab) (width 0.1))
(fp_line (start 1.95 2.45) (end -1.95 2.45) (layer F.Fab) (width 0.1))
(fp_line (start -1.95 2.45) (end -1.95 -2.45) (layer F.Fab) (width 0.1))
(fp_line (start -1.95 -1.18) (end -0.68 -2.45) (layer F.Fab) (width 0.1))
(fp_line (start -1.6 -2.45) (end 1.6 -2.45) (layer F.SilkS) (width 0.2))
(fp_line (start 1.6 -2.45) (end 1.6 2.45) (layer F.SilkS) (width 0.2))
(fp_line (start 1.6 2.45) (end -1.6 2.45) (layer F.SilkS) (width 0.2))
(fp_line (start -1.6 2.45) (end -1.6 -2.45) (layer F.SilkS) (width 0.2))
(fp_line (start -3.475 -2.58) (end -1.95 -2.58) (layer F.SilkS) (width 0.2))
(pad 1 smd rect (at -2.712 -1.905 90) (size 0.65 1.525) (layers F.Cu F.Paste F.Mask))
(pad 2 smd rect (at -2.712 -0.635 90) (size 0.65 1.525) (layers F.Cu F.Paste F.Mask))
(pad 3 smd rect (at -2.712 0.635 90) (size 0.65 1.525) (layers F.Cu F.Paste F.Mask))
(pad 4 smd rect (at -2.712 1.905 90) (size 0.65 1.525) (layers F.Cu F.Paste F.Mask))
(pad 5 smd rect (at 2.712 1.905 90) (size 0.65 1.525) (layers F.Cu F.Paste F.Mask))
(pad 6 smd rect (at 2.712 0.635 90) (size 0.65 1.525) (layers F.Cu F.Paste F.Mask))
(pad 7 smd rect (at 2.712 -0.635 90) (size 0.65 1.525) (layers F.Cu F.Paste F.Mask))
(pad 8 smd rect (at 2.712 -1.905 90) (size 0.65 1.525) (layers F.Cu F.Paste F.Mask))
(model M24C08-RMN6TP.stp
(at (xyz 0 0 0))
(scale (xyz 1 1 1))
(rotate (xyz 0 0 0))
)
)

View file

@ -7,4 +7,5 @@
(lib (name "CUI_TB006-508-04BE")(type "KiCad")(uri "${KIPRJMOD}/Libraries/CUI_TB006-508-04BE.pretty")(options "")(descr ""))
(lib (name "TJ-S1615CY6TGLCCSRGB-A5")(type "KiCad")(uri "${KIPRJMOD}/Libraries/TJ-S1615CY6TGLCCSRGB-A5.pretty")(options "")(descr ""))
(lib (name "logo")(type "KiCad")(uri "${KIPRJMOD}/Libraries/logo")(options "")(descr ""))
(lib (name "M24C08-RMN6TP")(type "KiCad")(uri "${KIPRJMOD}/Libraries/M24C08-RMN6TP.pretty")(options "")(descr ""))
)

View file

@ -2,4 +2,5 @@
(lib (name "TYPE-C-31-M-12")(type "Legacy")(uri "${KIPRJMOD}/Libraries/TYPE-C-31-M-12.lib")(options "")(descr ""))
(lib (name "CD74HC4053PWR")(type "Legacy")(uri "${KIPRJMOD}/Libraries/CD74HC4053PWR.lib")(options "")(descr ""))
(lib (name "TS5V330PWR")(type "Legacy")(uri "${KIPRJMOD}/Libraries/TS5V330PWR.lib")(options "")(descr ""))
(lib (name "M24C08-RMN6TP")(type "Legacy")(uri "${KIPRJMOD}/Libraries/M24C08-RMN6TP.lib")(options "")(descr ""))
)

View file

@ -1,5 +1,9 @@
# Heliox - Dashboard
<div align="center">
<img src="../../assets/logo.png" alt="Logo" width="80" height="80">
</div>
[![Electron Build](https://github.com/GHOSCHT/light-control/actions/workflows/Electron.yml/badge.svg)](https://github.com/GHOSCHT/light-control/actions/workflows/Electron.yml)
[![CodeQL](https://github.com/GHOSCHT/light-control/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/GHOSCHT/light-control/actions/workflows/codeql-analysis.yml)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/bdb8a994396345efab8271307f1ea155)](https://www.codacy.com/gh/GHOSCHT/heliox/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=GHOSCHT/heliox&amp;utm_campaign=Badge_Grade)
@ -9,6 +13,10 @@
Uses: <https://github.com/GHOSCHT/simple-electron-react-boilerplate>
<div align="center">
<img src="../../assets/dashboard.png" alt="dashboard">
</div>
Dashboard: node-gyp fails on sqlite3 build -> set default pyhton version to python 2
```shell