虚拟机实例已启动并运行,可以获得串口登录:提示符,但不能通过ssh连接。对于这种行为,谷歌的理由是什么?
根据设计,VM实例没有外部IP地址。
我的实例没有我的VM实例所具有的10.240.0.0/16 IP地址,所以我假设这就是为什么我不能通过云shell进行ssh的原因。为什么一个实例需要从基于Why浏览器的Cloud中访问internet?
ERROR: (gcloud.beta.compute.ssh) Instance [instance-centos7] in zone [us-zone-somewhere] does not have an external IP addres
我想通过RS232数据线在Atmega168之间传输数据到我的pc上进行编辑!但是Atmega太快了,无法处理SerialPort.DataReceived事件。有没有关于如何加速串口或使用非托管串口的建议或说明?
此外,现有的代码不工作,它只是添加条目到一个列表(字符串)
Private Sub Me_DataReceived() Handles Me.DataReceived
DataLines.Add(Me.ReadLine().Trim)
End Sub
我的工作是机器人,它必须控制使用无线串行通信。机器人在微控制器上运行(通过燃烧一个.hex文件)。我想用我的Linux () PC来控制它。我是新来的串口编程。我能够发送数据,但我不能读取数据。
在微控制器上运行的几段代码:
函数发送数据:
void TxData(unsigned char tx_data)
{
SBUF = tx_data; // Transmit data that is passed to this function
while(TI == 0) // Wait while data is being transmitted
;
}
我必须在一定时间内通过串口等待一定大小的数据。如果这一次我得到的数据较少,那么我希望避免读取数据。如果我很早就得到了足够的数据,那么我想读取它们并停止等待数据。
我目前的解决方案如下所示:
serial.open()
start_time = time()
while serial.in_waiting < expected_data_size: # waiting certain size of data
if time_to_wait < time() - start_time: # time is expired
serial.close()
我从一个文件中创建了一个InputStream对象,并由此创建了一个InputStreamReader对象。
InputStream ips = new FileInputStream("c:\\data\\input.txt");
InputStreamReader isr = new InputStreamReader(ips);
基本上,我将以字节的形式将数据读入缓冲区,但当需要以字符读取数据时,我将“切换模式”并使用InputStreamReader进行读取。
byte[] bbuffer = new byte[20];
char[] cbuffer = new cha