uart | serial com api -
kandi X-RAY | uart Summary
kandi X-RAY | uart Summary
serial com api
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of uart
uart Key Features
uart Examples and Code Snippets
Community Discussions
Trending Discussions on uart
QUESTION
I am running some code on a STM32 chip which is logging to my uart port.
I am having a hard time finding the proper way to log an array of bytes. I wrote this function:
...ANSWER
Answered 2021-Jun-15 at 19:36If the problem did end up being from heap overuse (from strncat
), then you could try out this implementation that uses the return from sprintf
to append to the string as your building it.
QUESTION
I am new to embedded C, and I recently watched some videos about volatile qualifier. They all mention about the same things. The scenarios for the use of a volatile qualifier :
- when reading or writing a variable in ISR (interrupt service routine)
- RTOS application or multi thread (which is not my case)
- memory mapped IO (which is also not my case)
My question is that my code does not stuck in the whiletest();
function below
when my UART receives data and then triggers the void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
interrupt function
ANSWER
Answered 2021-Jun-13 at 16:12volatile
informs the compiler that object is side effects prone. It means that it can be changed by something which is not in the program execution path.
As you never call the interrupt routine directly compiler assumes that the test
variable will never be 1
. You need to tell him (volatile
does it) that it may change anyway.
example:
QUESTION
I have tried out many ideas from SO. One of them worked (output was DEC 49 for HEX 31) when I tested it in here onlinegdb. But, when I implemented it in my application, it didn't produce same results. (output was 31 for 31 again).
The idea is to use a string value (full of HEX pairs); An example; 313030311b5b324a1b5b324a534f495f303032371b
I need to convert each integer pair (HEX) into equivalence decimal value. e.g.
...ANSWER
Answered 2021-Jun-11 at 01:19You can use strtol
function to convert your hex string to binary and then convert it to a decimal string in a single line:
QUESTION
I am attempting to read an incoming stream of data from UART, and trying to add each character received to an array of char
until characters \r
and \n
are received (in that order).
I have written a function (char read_uart()
) to wait for then return when a single character is received. This function properly receives and returns the single character, as it should.
On top of this function, I have tried creating another which is supposed to read every character and add them to an array until the termination combination is received. This is it:
...ANSWER
Answered 2021-Jun-08 at 15:57There are two issues here.
First, what you're passing to the function isn't what it's expecting. &message
has type char (*)[4096]
, i.e. a pointer to an array of size 4096 of char
. The function meanwhile is expecting a char *[4096]
, i.e. an array of size 4096 of char *
. This is a type mismatch.
The second is that on this line:
QUESTION
I have a TTGO T-CALL ESP32+Sim800L board and I want to send accelerometer data to Firebase. I am using the TinyGSM library which supports SSL/https connections for Sim800L. I am currently sending dummy data to see if it works but it is giving me a failed flag. Why is it not sending data to Firebase?
...ANSWER
Answered 2021-Jun-08 at 05:47I didn't find a lot of resources online, however, I did manage to do this and I made a GitHub repo for anyone who needs help with the same.
Basically as Firebase accepts only Https requests, it is not possible to formulate that on most microcontrollers and GSM modules. To circumvent this problem, I created a php server to which I can send an HTTP POST request and the script can get the data from it and push it to Firebase with a php firebase library.
QUESTION
I have been testing UART communication in C++ with wiringPi.
The problem:
It seems that C++ isn't outputting whole data into the UART port /dev/ttyAMA0
. Perhaps I'm doing it the wrong way?
Investigations:
Note : I am using minicom, minicom --baudrate 57600 --noinit --displayhex --device /dev/ttyAMA0
to check the received data.
Also! The UART port, RX & TX pins are shorted together.
The python code worked perfectly however when I tried to implement it in C++, the data received is different.
The expected received data should be: ef 01 ff ff ff ff 01 00 07 13 00 00 00 00 00 1b
.
Code used
Python:
...ANSWER
Answered 2021-Jun-05 at 14:57You can't use serialPuts
to send the null terminator. As with all similar functions, it will stop when the null terminator is encountered in the string. In this case I think your best option is to add a function that uses the ordinary write
function that is used internally by WiringPi's own functions.
You could make a wrapper function to make it look similar to the other calls:
QUESTION
I'm a beginner when it comes to using STM chips, and I have a project where I have to use all three USART terminals in Uvision.
I am using an STM32F103RB chip, and I already got the first two USART_init functions working, but I can't get the third one to work for some reason. I would really appreciate any help Here are my USART_init functions:
...ANSWER
Answered 2021-May-31 at 07:34Your first line for the USART3 initialization is wrong :-)
RCC->APB2ENR |= 1; // enable clock for AF
must be (without a clock the USART doesn't work)
RCC->APB1ENR |= (1<<18); // enable clock for USART
And as an additional hint, do not use all these magic numbers for the bits. This is much more readable (and the needed defines are already done in the CMSIS:
RCC->APB1ENR |= RCC_APB1ENR_USART3EN; // enable clock for USART
QUESTION
In my robot file for a specific test, I've defined the variable uarts_to_test to a list of numeric values under variables:
...ANSWER
Answered 2021-Jun-02 at 10:10I was not able to find ${i} in your code. There is also no declaration of ${make_options} that is probobaly why it is not found. You can use collection library, create list and append the items to it. like so
QUESTION
I am stumped at the following problem I face.
I am trying to send a GET request with hex values as part of the path ( the server would recognise this and process it accordingly). Currently, I have it as follows for a test:
...ANSWER
Answered 2021-May-31 at 14:56I made an example for you, with all variables correctly defined and initialized:
QUESTION
I want to use both MFRC522 and RDM6300 readers on a single NodeMCU, the two separate codes for each readers are respectively :
...ANSWER
Answered 2021-May-29 at 00:13void loop() {
if ( mfrc522.PICC_IsNewCardPresent()) {
// Select one of the cards
if ( mfrc522.PICC_ReadCardSerial()) {
// Dump debug info about the card; PICC_HaltA() is automatically called
mfrc522.PICC_DumpToSerial(&(mfrc522.uid));
}
}
if (rdm6300.update())
Serial1.println(rdm6300.get_tag_id(), DEC);
}
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install uart
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page