Enthernet Code
Enthernet Code
DIIDevHeads IoT Integration Server
Created by Boss lady on 6/25/2024 in #middleware-and-os
Can I use an idle hook function in FreeRTOS to perform low-priority tasks?
@Boss lady If your idle hook isn't being executed, check that the idle hook is enabled in your FreeRTOSConfig.h file by setting configUSE_IDLE_HOOK to 1.
#define configUSE_IDLE_HOOK 1
#define configUSE_IDLE_HOOK 1
, check that your idle hook function is correctly implemented and matches the expected function signature.
void vApplicationIdleHook(void) {
// Perform low-priority task
}
void vApplicationIdleHook(void) {
// Perform low-priority task
}
, make sure that there are periods when no other tasks are ready to run so the idle task can execute.
4 replies
DIIDevHeads IoT Integration Server
Created by Sterling on 6/25/2024 in #middleware-and-os
Resolving Guru Meditation Error in ESP32-Wroom TasksQueue
@Sterling this is often related to issues with memory allocation, access, or synchronization when working with dual-core processors like the ESP32. To solve this, ensure that a task is pinned to a core and the memory access are handled properly
3 replies
DIIDevHeads IoT Integration Server
Created by Gendos on 6/24/2024 in #pcb-and-analog
Why is power consumption higher in standby mode than stop mode on an STM32F411CEU6?
@Gendos Use a debugger to verify the state of the MCU just before entering Standby, also Double-check the RTC configuration to ensure it is set up correctly and is the only wake-up source. This might ahv been the reason for higher every consumption
3 replies
DIIDevHeads IoT Integration Server
Created by wafa_ath on 4/22/2024 in #edge-networking
emg sensor with esp32
#include <WiFi.h>
#include <PubSubClient.h>

const char* ssid = "your_SSID";
const char* password = "your_PASSWORD";
const char* mqtt_server = "your_computer_IP";

WiFiClient espClient;
PubSubClient client(espClient);

void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
client.setServer(mqtt_server, 1883);
}

void loop() {
if (!client.connected()) {
reconnect();
}
client.loop();

// Read EMG sensor data
int emgValue = analogRead(34);
char msg[50];
sprintf(msg, "EMG: %d", emgValue);

client.publish("emg/data", msg);
delay(1000);
}

void reconnect() {
while (!client.connected()) {
if (client.connect("ESP32Client")) {
client.subscribe("emg/data");
} else {
delay(5000);
}
}
}
#include <WiFi.h>
#include <PubSubClient.h>

const char* ssid = "your_SSID";
const char* password = "your_PASSWORD";
const char* mqtt_server = "your_computer_IP";

WiFiClient espClient;
PubSubClient client(espClient);

void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
client.setServer(mqtt_server, 1883);
}

void loop() {
if (!client.connected()) {
reconnect();
}
client.loop();

// Read EMG sensor data
int emgValue = analogRead(34);
char msg[50];
sprintf(msg, "EMG: %d", emgValue);

client.publish("emg/data", msg);
delay(1000);
}

void reconnect() {
while (!client.connected()) {
if (client.connect("ESP32Client")) {
client.subscribe("emg/data");
} else {
delay(5000);
}
}
}
4 replies