DevHeads IoT Integration Server

DII

DevHeads IoT Integration Server

The DevHeads IoT Integration Server accelerates technology engineering by helping pro devs learn, share and collaborate.

Join

seeking-collabs

firmware-and-baremetal

middleware-and-os

edge-networking

pcb-and-analog

jobs

iot-cloud

code-review

devheads-feed

general-dev-chat

Should I Adjust min_child_samples When Training LightGBM with 100% of the Data?

Hi, I'm training a LightGBM model to optimize performance for an embedded system application, specifically for real-time anomaly detection on edge devices. I'm currently facing a dilemma regarding parameter tuning when increasing the amount of training data. Initially, I split my dataset into 90% for training and 10% for testing. Using grid search, I found the optimal parameters for the model. Now, I want to leverage 100% of the data to train the model to make it as robust as possible for deployment on resource-constrained devices. My question is about parameters like min_child_samples, which are related to the data volume. When I increase the data from 90% to 100%, should I keep min_child_samples the same as the value found during the 90% data training? Or should I adjust it because the data volume has increased, considering the constraints of embedded systems?...
Solution:
Hi @wafa_ath you need to re adjust min_child_samples when you want to switch from 90% to 100% of the data, Observe that - Larger dataset = Higher min_child_samples value. Why ? Cus since you now have more data, increasing the value of min_child_samples it may help prevent the model from becoming complex and overfitting on noise yeah, which is important for embedded systems - Then start by incrementally increasing min_child_samples by a small percentage , maybe you can start by 10% to 20% and monitor performance on cross validation...

Can I Directly Update the TLB During a Page Fault on x86-64?

I’m working with x86-64 architecture in long mode and want to know if it's possible to directly update the Translation Lookaside Buffer (TLB) with a mapping from a virtual address to a physical address during a page fault, without going through the typical page table walk process. Virtual Address: 0x7FFFD0000000
Physical Address: 0x12345000 ...

Resolving TensorFlow Installation Error for TinyML Model on ESP32 Using MicroPython

Hey guys still based on my project on developing a home automation voice-controlled system using MicroPython and TinyML on an ESP32 microcontroller to recognize specific voice commands ("turn on" and "turn off") for controlling an LED. Am having issues installing my Tensorflow To complile my TinyMl model but keep getting this error ```python ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them....

Troubleshooting ADC Configuration for Sensor Data Acquisition on AVR128DA48 with Zephyr OS

hey guys on my Smart Industrial Monitoring System project, I've connected a vibration sensor (MPU6050) and temperature sensor (DS18B20) to the AVR128DA48. I'm using Zephyr OS, and I've configured the ADC for reading the sensor data. Below is the code I'm using to initialize the ADC for reading sensor data: ``` #include <zephyr.h> #include <drivers/adc.h>...
Solution:
Do you have the correct ADC device name, we make mistakes like this attimes . In the Zephyr OS, the ADC device names may vary depending on the hardware you're using. Instead of "ADC_0", check your board’s device tree for the correct device name. Print out the available devices with: ``` const struct device *adc_dev = device_get_binding(DT_LABEL(DT_NODELABEL(adc0))); if (!adc_dev) { printk("Failed to bind to ADC_0 device\n");...

How to Resolve Undefined Symbols for Architecture x86_64 While Compiling FFmpeg with x264?

I am working on compiling FFmpeg version 0.9.0.git with x264 version 0.120 on an x86_64 system, and I am encountering an issue during the build process. Here’s how I am configuring FFmpeg: ``` ./configure --enable-gpl --enable-libmp3lame ...

Zephyr HID Sample Not Pairing on nRF52840 Dongle - Solutions?

Hello Guys, Just-pair seems to not work when using peripherals-HID samples from zephyr, on nrf52840dongle Any possible way to fix it?...

Managing DMA Callback and FreeRTOS Tasks with Timing Constraints on STM32f4

My current project involves constantly receiving digital samples through DMA on an STM32f4 and performing DSP in the complete callback interrupt triggered after each sample. However, frequent callbacks are hindering freeRTOS from running other tasks while DMA waits for completion. My objective is to allow freeRTOS tasks to run every 6ms following a completed DMA callback. Initially, I thought about disabling interrupts using __disable_irq() in the complete callback and re-enabling them with __enable_irq(), but considering my high-priority button interrupt was still active—and not knowing whether this technique could guarantee exactly 6ms—I tried another approach of only deactivating the specific DMA interrupt by utilizing __set_BASEPRI(priority << (8 - __NVIC_PRIO_BITS)). I then started a timer that runs at intervals of 6ms before restoring normal function via calling back with_ _set_BASEPRI(0) upon elapsed period time completing successfully executed timed actions—nonetheless,it did not work since it kept switching between both types of call-backs without allowing freertos tum to operate independently. ...
Solution:
Adjusting the timing might help yeah , but it's more about ensuring the callbacks don’t hog all the CPU time. By using double buffering or adjusting interrupt priorities, you’re already reducing the time DMA interrupts take. If FreeRTOS still isn’t getting enough time, you might also consider tweaking task priorities or adding some delay within the callback if possible…

Fixing INT8 Quantization Error for Depthwise Conv2D Layers

Hey everyone, Thanks for the previous suggestions on tackling the inference timeout issue in my vibration anomaly detection project. I implemented quantization to optimize the model, but now I'm encountering a new error: Error Message:...
Solution:
Instead of fully quantizing the model to INT8, you can use mixed precision quantization. This approach leaves unsupported layers like Depthwise Conv2D in float32 FP32 while quantizing the rest of the model to INT8 For TensorFlow Lite, you can specify dynamic range quantization for unsupported layers. See how you can adjust your conversion script: ``` converter = tf.lite.TFLiteConverter.from_keras_model(model)...

Issues with 64-bit DLL Injection Shellcode on OpenBSD Ignoring Integer Pushes

I want to inject a 64 bit DLL into a 64 bit process on OpenBSD. The shellcode needs to push several 64 bit values onto the stack, including the old instruction pointer, the address of the DLL, and the address of the LoadLibrary function. ``` section .text global _start ...
Solution:
@Marvee Amasi The issue with your shellcode on OpenBSD is likely due to security features like W^X, which prevents memory regions from being writable and executable simultaneously, and strict requirements for stack alignment. To address this, ensure that the memory region containing your shellcode is executable using mprotect if necessary. Also, make sure the stack is 16-byte aligned before calling LoadLibrary to meet the x86-64 ABI requirements. Verify that NASM correctly encodes the push instructions by checking the output with a disassembler, and ensure you are using the correct assembler and linker flags for 64-bit mode. Debugging with a tool like gdb can also help trace the execution and confirm that the 64-bit values are pushed correctly onto the stack....

Assembly Program on 64-bit OpenBSD Compiles Without Errors but Shows No Output

I don't get any errors whatsoever , but why don't I get any output when running this program on 64-bit OpenBSD system. I've compiled the code using:
as -o test.o test.s; ld -Bstatic test.o
as -o test.o test.s; ld -Bstatic test.o
The program executes without errors, but no text is printed to the console. ...
Solution:
It seems like your assembly program isn't printing text because it might be missing the correct system calls. On Unix-like systems (like OpenBSD), printing to the console usually involves using the write system call. Here's a simple, complete assembly program that prints "Hello, World!" to the console you can use this as a guide 👇 ```assembly .section .data message: .asciz "Hello, World!\n"...
attachment 0

Tips for Simplifying ML Models to Avoid Inference Timeout on Arduino Nano 33 BLE Sense

Hi everyone, Following up on my previous post regarding the "Inference Timeout on Layer 5" error in my vibration anomaly detection project on the Arduino Nano 33 BLE Sense, I’m looking for advice on reducing the model's complexity to avoid these timeouts. The model was trained using Edge Impulse and includes multiple layers, with Layer 5 being particularly resource-intensive. The Arduino Nano 33 BLE Sense seems to struggle with the inference at this layer, leading to timeouts....
Solution:
Hey @wafa_ath , thanks for the update on your vibration anomaly detection project! Here are some quick tips to tackle that timeout issue: • Simplify your model: Cut down layers/parameters, especially in Layer 5 • Try quantization: Use 8-bit integers instead of 32-bit floats • Efficient architectures: Look into depthwise separable convolutions or MobileNet...

Issues with Boost Library for x86_32 Architecture on Ubuntu 22.04 – How to Manage Conflicts with x86

I'm working on a C++ project that uses the Boost program_options library on Ubuntu 22.04 system with an Intel Core i7 processor. I've successfully compiled and run the project for x86_64 architecture using the following command:
g++ program.cpp -m64 -static -lboost_program_options -o compiled/program.out
g++ program.cpp -m64 -static -lboost_program_options -o compiled/program.out
So when I try to compile for x86_32 architecture using -m32, I encounter the following error: ```/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../libboost_program_options.a when searching for -lboost_program_options /usr/bin/ld: skipping incompatible /usr/lib/libboost_program_options.a when searching for -lboost_program_options...
Solution:
Was receiving a linker error indicating that it cannot find the 32-bit Boost library, and I noticed that some of my project's dependencies might also require specific 32-bit libraries , but I was able to manage these with pkg-config . Thanks

How Do You Debug CPU Utilization and Multi-threading Issues?

Hey folks - wondering how you all debug issues with cpu utilization, mutex/semaphores, multi-threading, priority inversion, etc. How often are you debugging these types of issues today?

Bluetooth Device Stops Advertising After Pairing Failures in Zephyr RTOS

Hello everyone, I have a situation where the device tries to auto connect and then stops advertising. ``` Booting Zephyr OS build v3.7.0-rc1-106-g012520d2d7e8 ...

Configuring Zephyr RTOS for Unit Testing with Separate Source and Test Directories

Hey guys, I’m looking to setting up a new application in Zephyr RTOS with integrated unit testing for my application sources. I understand that Zephyr includes the ztest framework and the sanitycheck test runner. My aim is to maintain a clear separation between the production code and the testing code using the following directory structure: ``` PROJECT_ROOT...

DevHeads Weekly Office Hours, 8/23/24: Introduction to Embedded Linux—Yocto vs Poky vs OpenEmbedded

In this Office Hours session, DevHeads’ Ming takes us into fundamental concepts that form the backbone of Yocto, Poky, and OpenEmbedded. Understanding these differences is crucial to navigating the world of embedded systems development effectively. • What is Yocto? Yocto is not just a single entity but rather a collection of tools and metadata used to create custom Linux-based systems for embedded devices. • Role of Poky: Poky serves as a starting point for building custom embedded Linux distributions using Yocto tools and methodologies. • OpenEmbedded: OpenEmbedded is the upstream build system for the Yocto Project. It is a powerful and flexible framework for building custom Linux distributions for embedded systems....

Issues Adding Example Qt Application to st-image-weston on STM32MP1 Discovery Board

Hi I’m trying to learn embedded with stm32mp1 discovery board on my Ubuntu. The task ım trying to do is adding an example qt application to my st-image-weston image and flash it to the board but I got errors. I can share the link to st community post if you can help
Solution:
@nesnes I see you fixed the first issue by using the correct syntax of the IMAGE_INSTALL:append = "" For your second issue, your script is not working on your board, but it looks like you have posted the directory tree of /usr/local on your build host. Try searching for one of the files on your board with something like:...

Problem Statement: All bi-directional Audio passthrough from device to controller

I’m working on a project that requires bi-directional audio transfer between a mobile device (iOS or Android) and a controller running Ubuntu 20.04 or macOS. I’ve explored two potential solutions but encountered issues with both: 1. Using oFono on Linux to Act as an HFP-AG: I attempted to use oFono to make the controller function as a Hands-Free Profile Audio Gateway (HFP-AG). However, I’ve found this approach to be unstable. Most of the time, the system automatically selects the A2DP profile, and I’m unable to manually choose the HFP-AG profile. 2. Bluetooth Device Connected via USB (UAC-Class) with HFP/HSP Profile: In this approach, the Bluetooth device is connected to the controller via USB audio, with the HFP/HSP profile connected to the mobile device. The idea is to route the incoming audio stream through USB audio and vice versa. I managed to implement the USB audio part successfully, but I’m stuck at creating the SCO link for the Bluetooth profile. Although the HFP profile is identified, establishing the SCO link is where I’m blocked. ...

Troubleshooting Bootloader Access on Nucleo L476RG Using Nucleo L496ZG as Master

Good day guys, I need some help in troubleshooting an issue I'm having with accessing the bootloader on a Nucleo L476RG "slave" board? I'm using a Nucleo L496ZG as the master board, with DigitalOut pins (extBoot0 and extReset) connected to the slave's BOOT0 and NRST pins. There's also a Serial instance (usart) on the master linked to the slave's UART2. It appears that BOOT1 is fixed low, so the bootloader runs instead of executing what's in SRAM. In resetToBootloader, I set BOOT0 high, pull NRST low for 0.1 seconds, then bring it back high. This resets the slave and stops the program from running....
attachment 0

How to integrate wakaama in any freeRtos project? Any suggestions

How to integrate wakaama in any freeRtos project? Any suggestions
Solution:
Hi @shadababe04 to get Wakaama working within a FreeRTOS project, begin by setting up your FreeRTOS environment, then bring in the Wakaama source code. You'll need to configure Wakaama, which might involve tweaking the config.h file and possibly adjusting its memory management to fit seamlessly with FreeRTOS.