serial-communication

Serial Communication in Raspberry pi 3 B+

本秂侑毒 提交于 2019-12-11 03:08:14
问题 I want to communicate between Raspberry pi 3 B+ and GSM GPRS A6. I tried and I am unable to send data to GPRS Module from Raspberry pi. Now, I know that GPIO serial port is disabled by default in newer Operating Systems (in my case Raspbian Stretch), so I have enabled it by adding following line in config.txt file, enable_uart=1 Here's my Code: import serial import time port = "/dev/ttyS0" COMM = serial.Serial(port, baudrate=115200) while(1): COMM.write("AT\r") print (COMM.read(5)) This

Serial Communication between Arduino and Python, issue of using hexidecimal values

狂风中的少年 提交于 2019-12-10 20:16:54
问题 I am attempting to start a motor from the computer by code in Python 3.4, using pySerial to communicate to an Arduino Uno. I have packed the value I am sending to hexidecimal, so I only have one byte at a time, but am having a problem getting the correct number on the Arduino side as I am sending on the Python side. PYTHON CODE: import serial import struct ser = serial.Serial( port ='COM4', baudrate = 9600, parity = serial.PARITY_ODD, stopbits = serial.STOPBITS_TWO, bytesize = serial

How to write serial data to COM ports with Universal Windows Application?

人盡茶涼 提交于 2019-12-10 17:12:58
问题 Typically C# applications use System.IO.Ports like so: SerialPort port = new SerialPort("COM1"); port.Open(); port.WriteLine("test");` But Universal Windows Applications don't support System.IO.Ports so this method cannot be used. Does anyone know how to write serial data through COM ports in a UWA? 回答1: You can do this with the Windows.Devices.SerialCommunication and Windows.Storage.Streams.DataWriter classes: The classes provide functionality to discover such serial device, read and write

kernel driver reading ok from user space, but writing back is always 0

戏子无情 提交于 2019-12-09 17:53:45
问题 So I'm working my way through kernel driver programming, and currently I'm trying to build a simple data transfer between application and kernel driver. I am using simple character device as a link between these two, and I have succeeded to transfer data to driver, but I can't get meaningful data back to user space. Kernel driver looks like this: #include <linux/init.h> #include <linux/module.h> #include <linux/kernel.h> /* printk() */ #include <linux/errno.h> /* error codes */ #include

How to minimize serial communication read errors from a arduino

落花浮王杯 提交于 2019-12-08 14:24:31
问题 I am trying to stablish a serial communication channel between my computer and my arduino. When I look at ArduinoIDE, I get a perfect message sent from arduino - 3 identical numbers. Now, I am trying to create a c++ app to read that data on a computer running Ubuntu, however I get a lot of garbage on the string. I have been reading and searching all around without success. Could any one help me find the source of my problem? Code: SerialComm.h: #ifndef SERIALCOMM_HPP #define SERIALCOMM_HPP

arduino and visual studio c++, 2 way serial communication

纵饮孤独 提交于 2019-12-08 10:32:32
问题 I am using Arduino and Visual studio c++ and trying to build a two-way real time serial communication. What I am using is win 10(in VMware Fusion), 32-bit system, visual studio 2013, Arduino IDE 1.8.0 and Arduino board Uno. I used the library files from http://playground.arduino.cc/Interfacing/CPPWindows, which are two files: SerialClass.h and Serial.cpp. And I am using readData() and WriteData() function in my main. I want to run it for few more times, user can give an input in console and

Serial communication with Raspberry pi

你离开我真会死。 提交于 2019-12-07 18:19:53
问题 How can we do serial communication using the raspberry pi with a python script to send/receive data to my laptop? If yes can we use the RS232 cable to connect to the TX/RX ports on the raspberry pi directly? If yes, what pins must be used from the RS232 cable? It would be help full if anyone can post a example python script? Since my first aim is to send/receive data to the laptop to/from the raspberry pi, i'm using a RS232 to USB cable at both end to connect to the laptop as well as the

Calculate Block Check Character (BCC) for serial communication

…衆ロ難τιáo~ 提交于 2019-12-07 07:46:08
问题 I am communicating with a device via serial via the SerialPort class of .NET and based on third-party device specification requirements I need to calculate a "block check character". The only information I am told is that it is an exclusive OR operation (XOR) and it must be performed over all characters. So if I have the string "Bob,001" how would one calculate the BCC? 回答1: Most likely is character based XOR. You'll need to get samples of them to verify but most checksums usually end up at 0

grabserial stops printing the log?

邮差的信 提交于 2019-12-06 08:53:52
i tried Grabserial to measure the startup code of my embedded Linux device. It works somehow but after a while (that means a longer startup code - talking about > 26 s) it stops printing out the messages, but grabserial still is running - i have to hit the [CTRL-C] to retrieve control. I checked the serial port with putty and it's working so it's a problem with grabserial. But i can't think of what it is. I downloaded and installed with both of the 2 install-variants and it just changed the look-and-feel but stucks at the same point. Does anyone ever had the same problem ? Greets [edit:] i

Serial communication with Raspberry pi

半腔热情 提交于 2019-12-05 22:20:07
How can we do serial communication using the raspberry pi with a python script to send/receive data to my laptop? If yes can we use the RS232 cable to connect to the TX/RX ports on the raspberry pi directly? If yes, what pins must be used from the RS232 cable? It would be help full if anyone can post a example python script? Since my first aim is to send/receive data to the laptop to/from the raspberry pi, i'm using a RS232 to USB cable at both end to connect to the laptop as well as the raspberry pi. RS-232/RS-485 to PC and USB to PC For RS-232 1) Download Putty . 2) Buy a Serial Port RS232