serial-port

Is it possible to send/recieve Message via GSM Modem in Java?

孤街浪徒 提交于 2019-12-25 02:07:37
问题 Using RXTX library im doing serial communication.I want to do it in swing based application Write an AT commands to read received SMS in GSM modem I need to send the messages to mobiles from java application Is there any Java API which send/receive SMS using RxTx libraries. 回答1: I don't have much knowledge about that .. just take a look... AT Commands.. and this one..also.. Sending SMS Messages from a Computer Using a Mobile Phone or GSM/GPRS Modem and SMS using AT commands with your GSM

Using serial ports, I get an error: Attempted to read or write protected memory

余生长醉 提交于 2019-12-25 01:45:39
问题 I know this question has been asked before but none of the existing answers solved my problem. I have a WinForms Application which communicates with a number of devices, takes data and writes them to a file. It opens GPIB and Serial port communications and at the end closes all of them. I use this.Dispose() and this.Close() to make sure that memory is released (at least I think the memory is released). However, next time I run it, after several hours I get the error: Attempted to read or

Read serial port work good in windows XP but stop working and slow in windows 7

纵饮孤独 提交于 2019-12-25 01:33:47
问题 I'm talking about C# programing and communicate with serial port and different results in Windows 7 and XP. my code is: int count = 0; float data1; float data2; private void button1_Click(object sender, EventArgs e) { serialPort1.PortName = textBox1.Text; serialPort1.BaudRate = Convert.ToInt32(textBox2.Text); serialPort1.Open(); serialPort1.Write("?"); } private void button2_Click(object sender, EventArgs e) { serialPort1.Close(); } private void button3_Click(object sender, EventArgs e) { /

read the latest line of a serial port

大憨熊 提交于 2019-12-25 00:51:14
问题 I haven't ever written any code in tcl and pretty novice on serial communication, so sorry in advance if my question doesn't make sense. I'm trying to solve this problem where I want to listen to a serial port and print the updates line by line in SciLab like a normal serial terminal (e.g. Arduino's serial monitor). The Serial Communication Toolbox for Scilab has a readserial macro (source on GitHub): function buf=readserial(h,n) if ~exists("n","local") then N=serialstatus(h); n=N(1) end TCL

How to send data from USB device to DJI SDK?

ε祈祈猫儿з 提交于 2019-12-25 00:17:53
问题 So this might be a bit basic of a question, but I don't have much experience on the hardware side of things. I am using DJI Android Mobile SDK to communicate with a M600 flight controller and have a FTDI CU/TTY device I am trying to send info back and forth. This successfully works to send "Hello World" to my USB device: //sends data to onboard sdk device final byte[] helloWorld = "HelloWorld".getBytes(); mFlightController.sendDataToOnboardSDKDevice(helloWorld, new CommonCallbacks

RS232 issue with 0x0A and 0x0D while sending a message

╄→гoц情女王★ 提交于 2019-12-25 00:04:23
问题 I'm running a code that composes a message and send it over RS232 bus to a device. I'm having issues when the message has 0A (new line) or 0D (carriage return) chars (or both) on the message. The reading side is telling me that it doesn't understand the message (by sending me a NAK response). I've deduced that the issue is with those two chars. ie: 022620255846060A00003003 022620255946060D00003703 Any thoughts of how may I send the same information without having to change the 0A or 0D? The

select() and read() times out on serial port read yet previous write() succeeds?

六眼飞鱼酱① 提交于 2019-12-24 22:47:14
问题 After three weeks I can't get past this problem. I have the code below running on Ubuntu 18.04.3 which sends a string successfully to another device. When the remote device receives the string ... it sends another back ... but the code below (even with 1 sec set) times out on select(). When I comment out the select() and just do the read() ... fails to see any data as well? It was working three weeks ago ... but recent code changes broke it ... and I cannot see why. How could a write() on a

Virtual Com-Port communication through Matlab

限于喜欢 提交于 2019-12-24 21:27:02
问题 While connecting my Com-port using matlab, many a times(4 out of 5) I get an error ??? Error using ==> serial.fopen at 72 Port: COM21 is not available. Available ports: COM3, COM10, COM17, COM18. However , sometimes it gets connected and responds as expected. Can anyone tell me whats the problem with this? By the way , I am using this snippet to connect my microcontroller to PC through USB s = serial('COM21'); // code to initialize the req COM i.e. COM21 for me fopen(s); 回答1: I ran into this

Read and Write from serial port under Ubuntu for USB scale

本小妞迷上赌 提交于 2019-12-24 21:25:10
问题 I have a digital scale connected via USB to my Ubuntu laptop and I would like to read the measurements from it. The serial protocol is very simple (9600,8N1, ttyUSB0) and I'm able to correctly read the measurements by using putty (VT100+) from terminal. The scale needs to receive the command "READ<CR><LF>" in order to send the measurement. Each measurement has this format: 01ST,GS, 2.5,kg<CR><LF> if, for example, I'm measuring a 2.5Kg load. Now, I'm trying to send the READ command from a C

Arduino Serial.println weird bug

假如想象 提交于 2019-12-24 21:15:13
问题 I'm trying out arduino and have programmed some button with a state switch. If it was "on" then it turns "off" and versa. #include <Bounce.h> const int buttonPin = 2; const int ledPin = 6; int ledState = HIGH; int a = LOW; int b = LOW; Bounce push1 = Bounce( buttonPin,5 ); void setup() { pinMode(buttonPin, INPUT); pinMode(ledPin, OUTPUT); Serial.begin(9600); } void loop() { push1.update ( ); int x = digitalRead(push1.read()); if (x != b) { if (x == HIGH) { if (a == HIGH) { a = LOW; } else { a