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

Trying to interface the BMI088 IMU with an i2c multiplexer

@Middleware & OS I’m trying to interface the BMI088 IMU with an i2c multiplexer. The BMI088 has two different addresses for the accelerometer and gyroscope which makes it act like 2 different devices entirely. I have the mux on bus0 in my devicetree and I can address it just fine. I put the IMU on channel 2 of the mux and I have read that each channel on the mux is essentially a bus extension. I cannot find any specific information/examples on how to set up the individual BMI088 acc and gyro addresses on the mux channel in my device tree. Please, I'm making use of STM32 MCU. Could anyone reference any documentation or examples? ...
Solution:
Also make sure to initialize the I2C multiplexer in your code. After selecting the mux channel, you'll need to address the BMI088's accelerometer and gyroscope accordingly.

How does the processor pipeline handle instruction fetch latency?

In Cortex M0/M3 processors, with a single memory space for both instructions and data accessed via the memory bus, how can the processor handle data reads (e.g., for load/store instructions) if the bus is continually busy fetching instructions? How does the processor pipeline handle instruction fetch latency, and what mechanisms are in place to manage execution if instruction fetches take more than one cycle? @Middleware & OS...
Solution:
Hey man @Daniel kalu for cloud connectivity with ARM microcontrollers and W5500 controllers, platform SDKs are generally recommended for easier development and better security per say

I have a problem with an RL model

Hello engineers, I have a problem with an RL model. I'm trying to fetch data from the database using a Flask API, but it's giving me a Connection Error. However, when I test it on Postman, it returns results and works fine. I'm running the code on Kaggle. II have no issue with that; I just need to solve it.
Solution:
Have you been able to fix this? If you can add loggings to your flask app to see more details about the connection attempt it will give you clues about the specific issue...
attachment 0

Is it correct that most BLE communication uses GATT server/client relationships or BLE mesh networks

I am developing a Zephyr OS runtime system to use BLE for communication between two nrf52840dk boards. I want a generic API for facilitating this BLE communication, which would look like this: ```c /* Send a message to conn */ void send(struct bt_conn conn, void data, u16_t len);...

Help Needed: Error in Real-Time Data Acquisition Using I2C on BeagleBone Black

Hello guys, am settling up the BeagleBone Black for real-time data acquisition using I2C on an embedded Linux OS? I have tried setting up the BeagleBone Black with the embedded Linux OS, configured the I2C protocol on the BeagleBone Black, connected the I2C device to the BeagleBone Black, implemented the necessary code to communicate with the I2C device, attempted to acquire real-time data from the I2C device. But keep getting the error Failed to acquire bus access and/or talk to slave. This is my code ```c...
Solution:
Thanks, it worked can u help me with any documentations so I can study more in it

Help Needed: OpenCV Error While Implementing Object Detection on BeagleBone AI

@Middleware & OS @MCU, MPU & Firmware @Helper Hey guys, am working on an object detection project using the BeagleBone AI with Debian as the operating system and Ethernet as the protocol. I have encountered an error while implementing the code. Here are the steps I have installed Debian OS on the BeagleBone AI, set up the Ethernet connection for communication, installed the necessary libraries and dependencies for object detection. And I got the error
OpenCV Error: Unspecified error (Can't open darknet config file: yolov3.cfg) in cv::dnn::ReadDarknetFromCfgFile, file /home/user/opencv/modules/dnn/src/darknet/darknet_io.cpp, line 517
OpenCV Error: Unspecified error (Can't open darknet config file: yolov3.cfg) in cv::dnn::ReadDarknetFromCfgFile, file /home/user/opencv/modules/dnn/src/darknet/darknet_io.cpp, line 517
...
Solution:
My code works perfectly now šŸ‘

Trying to access the sensor's registers using memory-mapped I/O in a flat memory model

Hi, I'm working on a small embedded system project using x86-64 assembly on an Intel Atom E3845 microprocessor. The program aims to read temperature data from an Adafruit BMP280 sensor connected with I2C
Solution:
No more error message, it worked:
```global _start section .text _start:...

How can I scan for available I2C devices on the bus?

@Middleware & OS @everyone How can I scan for available I2C devices on the bus? Am getting the error Could not open file /dev/i2c-1: No such file or directory, I have ensured the I2C device tree overlay is loaded using echo BB-I2C1 > /sys/devices/bone_capemgr.*/slots, what could be wrong Here's my prompt ```sh i2cdetect -y -r 1...
Solution:
It seems like you are encountering an error while trying to scan for available I2C devices on the bus. The error message you mentioned,
Could not open file /dev/i2c-1: No such file or directory
Could not open file /dev/i2c-1: No such file or directory
, indicates that the I2C device file is not being recognized, what type of i2c model are you using

HELP: Need to configure MCP2515 using Raspberry pi's SPI 0 bus.

I am using Raspberry pi 3b+, MCP2515 (CAN Controller), TCAN1042 (CAN Transreceiver) . -------------------------------------------------------------------- uname -a : Linux raspberrypi 5.10.103-v7+ #1529 SMP Tue Mar 8 12:21:37 GMT 2022 armv7l GNU/Linux -------------------------------------------------------------------- sudo dmesg | grep mcp:...
Solution:
Yes, i updated but that was not the issue. The issue was 2 capacitors connected to external oscillator of MCP2515. Finally, it was hardware issue. Thanks for the help though..!...

Can i use Edge Impulse to collect data, train a model and deploy it on an Arduino Nano 33 BLE Sense

@Middleware & OS @everyone Hello guys, can I use Edge Impulse to collect data, train a model, and deploy it on an Arduino Nano 33 BLE Sense for anomaly detection? I'm having issues with deployment. Here's my code šŸ‘‡...
Solution:
i recommend reduce your model size. also use the Arduino IDE's memory usage reporting feature to get a detailed of how memory is being used in your sketch.

I need to monitor hall sensors for position encoding with up to 350 changes per second.

Alright guys, I need to monitor hall sensors for position encoding with up to 350 changes per second. My current Python program watches GPIO pins but uses too much CPU. Here's my polling loop: ```python REFRESH_RATE = .0005 ...
Solution:
@Sterling Your program keeps checking the sensors, wasting power. Try letting the sensors interrupt the program only when they change, or use a separate task to handle them. C/C++ might be faster than Python for this job.

How can I initialize the I2C bus on the BeagleBone Black Rev C running Embedded Linux?

Hey guys, how can I initialize the I2C bus on the BeagleBone Black Rev C running Embedded Linux? I am getting the error Failed to open the bus: No such file or directory, but I have verified that the I2C module is loaded and checked the device tree overlay. Here are the steps I took to verify the I2C module: 1. Loaded the I2C module using modprobe i2c-dev. 2. Checked that the device tree overlay for I2C is applied correctly. ...

May I know is there any different between this two group FreeRTOS API?

Hi all, may I know is there any different between this two group FreeRTOS API function: xSemaphoreTake() xSemaphoreGive() xSemaphoreTakeRecursive()...
Solution:
the former are for passing around semaphore and can be used in ISRs and the latter are for recursive semaphores/mutexes ... allowing the same task to take the same mutex multiple times can't be used from an ISR

working on a project that involves monitoring temperature using an LM35 sensor with an STM32F4

Hello everyone, I'm currently working on a project that involves monitoring temperature using an LM35 sensor with an STM32F4 microcontroller. I'm utilizing FreeRTOS for task scheduling and a CAN bus library for communication. However, I'm encountering issues with inaccurate temperature readings. The readings appear to be significantly different from expected values. Could you please assist me in identifying potential issues in my code and suggest corrections to ensure accurate temperature measurements? Here's the relevant snippet from my sensor task implementation: ```void sensor_task(void *pvParameters) {...
Solution:
That's right , @Dtynin You need to take into account the reference voltage of your ADC and its resolution. For example, if you are using a 12-bit ADC with a reference voltage of 3.3V, the conversion should look something like this:
float temperature = (raw_adc_data * 3.3 / 4096) * 100;
float temperature = (raw_adc_data * 3.3 / 4096) * 100;
This ensures that the raw ADC value is properly converted to the voltage output by the LM35 and then to the corresponding temperature....

Are there any specific considerations for MSVC to avoid unexpected truncation during such conversion

I have a simple program with a getDouble() function returning a double value slightly above INT_MAX (2147483647). The program attempts to convert this value to an unsigned int using both direct and indirect casting. When compiling and running this code on MSVC x86, the direct cast truncates the double value to 2147483648 that's one more than INT_MAX. This is unexpected because the value should fit within the range of an unsigned int typically 32-bits on x86. Funny enough, this behavior is not observed on GCC which is another compiler. I've checked the Microsoft documentation but haven't found a specific explanation for this truncation on x86. Is this a known behavior of MSVC x86 for double to unsigned int conversions, especially when the double value is slightly above INT_MAX?...

Help Needed: Handling Serialized Data with Escaped Characters in Paho MQTT/Packet Library

I need a little help. @Middleware & OS I'm using the library called paho mqtt/packet. The example provided with it performs serialization of the data that needs to be sent and then sends it over TCP just like that. I have written the code for the ESP, and it works fine without any issues. However, when I serialize the data, it looks like this (as seen in the debugger):
\020\016\0\004MQTT\004\002\0\024\0\002me
\020\016\0\004MQTT\004\002\0\024\0\002me
...
Solution:
you are right, I hadn't initialized it. I have added memset(buf, 0, 200); to my code, but I'm still facing the same issue with the serialized data being interpreted incorrectly ...
attachment 0

How to custom USB Class on Zephyr RTOS with nrf52840DK?

Hello, my project is to develop an external monitor so that the PC can transfer images to my monitor via USB. What I want to do is customize a USB class with bulk transfer functionality to transfer images. I started with the HID-mouse example with USB device_next (the new USB structure) and wanted to add a bulk transfer end point. But I don't know how to do it. the sample code for me looks so complicated. is any one has the experience with zephyr USB? what I have done now is just duplicate the HID class from device next/class to my application. and add a CMakeLists.txt file so I can compile it separate from zephyr....

change the priority of a task in FreeRTOS at runtime using STM32CubeIDE and STM32 HAL libraries

How can I change the priority of a task in FreeRTOS at runtime using STM32CubeIDE and STM32 HAL libraries? My task priority isn't updating. Here's my code:
vTaskPrioritySet(xTaskHandle, 2);
vTaskPrioritySet(xTaskHandle, 2);
...
Solution:
If you table is in a form of matrix u can use the example below šŸ‘‡ ``` replace with your 2d table šŸ‘‡ lookup_table = [ [10, 20, 30],...

How can I clean and print the sensor data to the monitor before loading it onto the model

I finally was able to to integrate the model into my ESP32 firmware ``` #include <Arduino.h> #include "generated_model.h" // Include the generated model header...
Solution:
Add a function to print the sensor data before using it for prediction: ``` void printSensorData(float *input_data) { Serial.print("Sensor Data: ");...

Are there any known issues with timer configuration in CubeMX for the STM32F407VG?

@Middleware & OS I'm developing a low-level PID controller for motor speed control on an STM32F407VG microcontroller. I'm using the STM32CubeMX tool to generate the initial project setup. However, I'm encountering issues during timer initialization for the motor speed measurement. When I try to configure Timer 2 in CubeMX for capture mode, I get an error message stating
TIMx_CR1: Unable to configure Update Event source (URS) as it depends on the One Pulse Mode (OPM) bit.
TIMx_CR1: Unable to configure Update Event source (URS) as it depends on the One Pulse Mode (OPM) bit.
I've reviewed the STM32F4 reference manual and ensured the OPM bit is set to 0 (disabled) in the TIMx_CR1 register. However, the error persists. I'm using STM32CubeMX version 6.1.0. ...
Solution:
@UC GEE the issue with using the HAL is that its super easy to get started, however, when one does eventually get stuck its quite hard to get unstuck, since you need to debug the HAL and your code.