Skip to content

Commit

Permalink
adding ha clarification
Browse files Browse the repository at this point in the history
  • Loading branch information
JAlcocerT committed Mar 24, 2024
1 parent fa7f655 commit 77bb313
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 1 deletion.
32 changes: 32 additions & 0 deletions Z_Micros/ESP32/ESP_32_WebSocket_Test
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include <WiFi.h>
#include <AsyncTCP.h>
#include <AsyncWebSocket.h>

const char* ssid = "YourWiFiSSID";
const char* password = "YourWiFiPassword";

AsyncWebSocket ws("/ws");

void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.println("Connecting to WiFi...");
}
Serial.println("Connected to WiFi");

ws.onEvent([](AsyncWebSocket *server, AsyncWebSocketClient *client, AwsEventType type, void *arg, uint8_t *data, size_t len) {
if (type == WS_EVT_CONNECT) {
Serial.println("WebSocket client connected");
}
});

ws.begin();
}

void loop() {
// Send data to WebSocket server periodically
ws.textAll("Hello from ESP32!");
delay(5000);
}
16 changes: 16 additions & 0 deletions Z_Micros/ESP32/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
REST API (HTTP):
RESTful APIs are widely used for communication between clients and servers over HTTP.
They are well-suited for request-response interactions and are easy to understand and implement.
However, they may not be the best choice for real-time communication as they are based on the request-response model, which can introduce latency and overhead for real-time updates.
REST APIs are suitable for scenarios where real-time updates are not critical or where the frequency of updates is low.

WebSockets:
WebSockets provide full-duplex communication channels over a single TCP connection, enabling real-time, bidirectional communication between clients and servers.
They offer low-latency, high-performance communication and are well-suited for applications requiring real-time updates, such as chat applications, live dashboards, and multiplayer games.
WebSockets can be more complex to implement compared to REST APIs, but they offer significant benefits for real-time applications.

MQTT (Message Queuing Telemetry Transport):
MQTT is a lightweight, publish-subscribe messaging protocol designed for constrained devices and low-bandwidth, high-latency or unreliable networks.
It provides a flexible and efficient mechanism for asynchronous, real-time communication between clients and servers.
MQTT is commonly used in IoT (Internet of Things) applications, telemetry systems, and messaging applications where real-time data streams need to be transmitted reliably and efficiently.
While MQTT can be used for real-time communication in various scenarios, it may not be as widely supported or as easy to integrate as REST APIs or WebSockets in certain contexts.
9 changes: 8 additions & 1 deletion _posts/2024-02-16-home-assistant-mqtt.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,11 @@ We need HACS activated (any of those will be add-ons, so we can use our HA with

### Thanks to

https://www.youtube.com/watch?v=r9BshEzz4bo
https://www.youtube.com/watch?v=r9BshEzz4bo

### HA OS vs HA Docker

* [Home Assistant add-ons](https://www.home-assistant.io/addons/) are compatible with both options ☑️
* [Home Assistant Integrations](https://www.home-assistant.io/integrations/#all) can be used just with Home Assistant OS 📌

###
6 changes: 6 additions & 0 deletions _posts/2024-12-01-ollama-raspberry-pi.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ tags: [Self-Hosting, Docker]

## Best Performing LLMs for a RPi

* For code: https://ollama.com/library/deepseek-coder
* https://ollama.com/library/phind-codellama
* Daily: https://ollama.com/library/gemma
https://ollama.com/library/orca-mini
https://ollama.com/library/tinyllama

---

## FAQ
Expand Down

0 comments on commit 77bb313

Please sign in to comment.