Compare commits

..

1 commit

Author SHA1 Message Date
ImgBotApp
e8d6f2eb33
[ImgBot] Optimize images
*Total -- 85.83kb -> 70.26kb (18.14%)

/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>
2022-04-11 22:44:42 +00:00
26 changed files with 425 additions and 11348 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

View file

@ -1,42 +1,30 @@
# Heliox communication protocol # 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 ## Basic data structure
The following table describes the bit pattern for a successful communication with and between Heliox devices. The following table describes the bit pattern for a successful communication with heliox devices.
| 0x0 | 0x1 | 0x2 | 0x3 | 0x4 | ... | | 0-15 | 16-22 | 23 | 24-31 | 32-(32+8*x) |
| --- | --- | -------- | ------ | --------- | --------------- | | :---------------: | :----------: | :---------------: | :-------------------: | :---------: |
| H | X | _length_ | _mode_ | _submode_ | _optional data_ | | Magic Number (HX) | Message Type | Parity Bit (even) | Data Length (x Bytes) | Data |
## Modes ## Message Types
### Mode selection | Code | Purpose |
| ---- | -------------------- |
| 0 | Light Data |
| 1 | Control Signal |
| 2 | Status Messages |
| 3 | Confirmation Message |
| 4 | Debug Info |
The columns represent modes and the rows represent submodes: ### Light Data
| | 0x0 | 0x1 | 0x2 | 0x3 | - 1-Byte-block per lamp: 0-255
| :---: | :---------: | :---------------: | :---------------: | :-------------------------: | - Index of lamp determinded by order
| | **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 |
### Optional data ### Control Signal
Every submode can take any number of Bytes except the below-mentioned ones: - Index Byte + [ **t** <sub>oggle</sub> | **i** <sub>ncrease</sub> | **d** <sub>decrease</sub> ]
- on
| **0 Bytes** | **1 Byte** | - off
| :------------: | :--------: |
| 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; break;
} }
}; };
msgRead = false;
socket.onEvent(onEvent); socket.onEvent(onEvent);
server.addHandler(&socket); server.addHandler(&socket);
} }
@ -41,21 +41,10 @@ void WebsocketCommunicator::sendMessage(const char message[])
char *WebsocketCommunicator::receiveMessage() char *WebsocketCommunicator::receiveMessage()
{ {
msgRead = true;
return getBuffer(); return getBuffer();
} }
void WebsocketCommunicator::clearBufferSafely()
{
if (msgRead)
{
clearBuffer();
}
}
void WebsocketCommunicator::handleMessage(void *arg, uint8_t *data, size_t len) void WebsocketCommunicator::handleMessage(void *arg, uint8_t *data, size_t len)
{ {
msgRead = false; Serial.println("data");
int effectiveLen = len < bufferSize ? len : bufferSize;
strncpy(messageBuffer, (char *)data, effectiveLen);
} }

View file

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

View file

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

File diff suppressed because it is too large Load diff

View file

@ -1,9 +0,0 @@
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

@ -1,33 +0,0 @@
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

View file

@ -1,41 +0,0 @@
(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,5 +7,4 @@
(lib (name "CUI_TB006-508-04BE")(type "KiCad")(uri "${KIPRJMOD}/Libraries/CUI_TB006-508-04BE.pretty")(options "")(descr "")) (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 "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 "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,5 +2,4 @@
(lib (name "TYPE-C-31-M-12")(type "Legacy")(uri "${KIPRJMOD}/Libraries/TYPE-C-31-M-12.lib")(options "")(descr "")) (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 "CD74HC4053PWR")(type "Legacy")(uri "${KIPRJMOD}/Libraries/CD74HC4053PWR.lib")(options "")(descr ""))
(lib (name "TS5V330PWR")(type "Legacy")(uri "${KIPRJMOD}/Libraries/TS5V330PWR.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,9 +1,5 @@
# Heliox - Dashboard # 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) [![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) [![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) [![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)
@ -13,10 +9,6 @@
Uses: <https://github.com/GHOSCHT/simple-electron-react-boilerplate> 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 Dashboard: node-gyp fails on sqlite3 build -> set default pyhton version to python 2
```shell ```shell