serial-port

Serial Communication one to one

天大地大妈咪最大 提交于 2019-12-11 08:55:40
问题 If this is a stupid question, please don't mind me. But I spent some time trying to find the answer but I couldn't get anything solid. Maybe this is a hardware question, but I figured I'd try here first. Does Serial Communication only work one to one? The reason this came up is because I had an arduino board listening for communication on its serial port. I had a python script feed bytes to the port as well. However, whenever I opened up the arduino's serial monitor, the connection with the

Serial port permission denied for non-root user with dialout group privileges even after reboot Ubuntu 18.04

会有一股神秘感。 提交于 2019-12-11 08:54:22
问题 I write systemd services that launch with root privileges and de-privilege themselves to a system account (called mxdaemon). These services require access to the physical serial port ( /dev/ttyS0 ) on the PC. Serial port ls -l : Serial port: crw-rw---- 1 root dialout 4, 64 Jun 13 22:00 /dev/ttyS0 When run as root, the service has no problem communicating via the serial port. When the service is configured to de-privilege to mxdaemon, I get a permission denied error when attempting to access

Mono or .NET Serialport frequent reads result in high cpu

南楼画角 提交于 2019-12-11 08:23:22
问题 I'm developing an app that polls RS232 to I2C converter, to which i have an i2c device connected, that has to be polled in realtime, meaning constantly :D As soon as response comes i reissue the command again... my code: lock (_locker) { try { _serialPort.DiscardInBuffer(); _serialPort.Write(sendArray, 0, sendArray.Length); _serialPort.ReadFixed(headerArray, headerArray.Length); returnOperation = (DeviceOperation)((int)headerArray[1] << 8 | (int)headerArray[3]); DataToReceive = headerArray[5]

Python no module named serial / no module named requests

我的未来我决定 提交于 2019-12-11 08:17:37
问题 This is the second time today this has happened.. I tried to import requests earlier and I got an Import Error: no module named requests Same thing for serial I googled the crap out of this and nothing I've found works. Any ideas as to what's going on? I'm trying to use pyserial to take input from an arduino 回答1: pip install requests pip install pyserial should do it (unless you don't have pip installed) 回答2: are you looking for urllib.requests? if you are using python 2.7 when you ask for

C# how to change a COM port to an specified one

久未见 提交于 2019-12-11 07:56:01
问题 I need to change the port number of a USB serial adapter, i have the following rotine to finding it, now I need to change its portName / COM Number to COM11 for example. I need exactly this, but by C# code: My Computer -> Manage -> Device Manager -> Ports -> Communications Port -> Port Settings -> Advanced -> COM Port Number try { ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\WMI", "SELECT * FROM MSSerial_PortName"); foreach (ManagementObject queryObj in searcher.Get

Access to the port 'COM5' is denied

拜拜、爱过 提交于 2019-12-11 07:55:20
问题 I get the following error message Access to the port 'COM5' is denied. when running the method below from my form. I have tried entering the right baud rate of 9600 from the port setting of my device manager. I have also tried accessing the devices through Portmon but there is a bug that prevents me from being connected. Any alternative to solve this problem? //Fields List<string> myReceivedLines = new List<string>(); //subscriber method for the port.DataReceived Event private void

Can not open serial port using PHP

时间秒杀一切 提交于 2019-12-11 07:52:19
问题 I am working on to send request to VSP200 device, my device is connected to com port8 of windows machine. I am using fopen() of PHP to open the com port, but I am getting an error Warning: fopen(COM8:) [function.fopen]: failed to open stream can you please tell me, what is wrong in my code, $fp = fopen ("COM8:", "w+"); if (!$fp) { echo 'not open'; } else{ echo 'port is open for write<br/>'; $string .= '<STX>C30C10178C10100C103110606C103081000C10100C10101C100<ETX>'; fputs ($fp, $string ); echo

Matlab serial interface with Arduino is very slow

蓝咒 提交于 2019-12-11 07:47:13
问题 I am trying to establish a serial link in Matlab with an Arduino board. Reading data from the board goes well. However, writing data to the board takes about a second for each block of information I send. The code I am running to write data: s = serial(comprt,'BaudRate',9600,'DataBits',8); fopen(s); fprintf(s, '%c', 'c'); fprintf(s, '%u %u %u %u \n', [A B C D]); pause(1); fprintf(s, '%c', 'a'); pause(1); A, B, C, D are 8-bit numbers anywhere from 0 - 255, 'c' and 'a' are characters commands

VHDL RS-232 Receiver

馋奶兔 提交于 2019-12-11 07:42:09
问题 I have been trying to design an RS-232 receiver taking an FSM approach. I will admit that I do not have a very well-rounded understanding of VHDL, so I have been working on the code on the fly and learning as I go. However, I believe I've hit a brick wall at this point. My issue is that I have two processes in my code, one to trigger the next state and the other to perform the combinational logic. My code is as follows: library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity ASyncReceiverV4 is Port

Three-dimensional array arrives in wrong order at serial port

非 Y 不嫁゛ 提交于 2019-12-11 07:37:58
问题 For an university assignment I'm writing a java application that will run some game logic for an interactive LED table. The table itself is being controlled by either 2 Arduino Duemilanove or 1 Arduino Mega 2560. To give the Arduino(s) information about which LEDs should be lit in which color I send the data over the serial port from a Raspberry Pi 3b+ to the Arduinos. As the table consists of 14 LED strips with 14 LEDs per LED strip and each LED has 3 color values (RGB) I store the data