pyserial: No module named tools
Use pip to install pyserial. First install pip: sudo apt-get install python-pip After that install pyserial: sudo pip install pyserial
Use pip to install pyserial. First install pip: sudo apt-get install python-pip After that install pyserial: sudo pip install pyserial
So, I actually found the answer. To find out what the device name is, I did an ls of the /dev/ directory with the device plugged in and then with it disconnected. ls -lha /dev/tty* > plugged.txt ls -lha /dev/tty* > np.txt Then I compared the files using vimdiff plugged.txt np.txt And saw the line … Read more
I see a couple of issues. First: ser.read() is only going to return 1 byte at a time. If you specify a count ser.read(5) it will read 5 bytes (less if timeout occurrs before 5 bytes arrive.) If you know that your input is always properly terminated with EOL characters, better way is to use … Read more
@Trevor Page I think was on the right path. Here is a google’s example I’ve used to connect to a basic stamp micro-controller. /* * Copyright (C) 2009 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the “License”); * you may not use this file except in compliance with … Read more
Serial port is a type of device that uses an UART chip, a Universal Asynchronous Receiver Transmitter. One of the two basic ways to interface a computer in the olden days, parallel ports were the other way. Serial is simple to hook up, it doesn’t need a lot of wires. Parallel was useful if you … Read more
Please take a look here: RS-232 for Linux and Windows 1) Windows Serial Port Programming 2) Using the Serial Ports in Visual C++ 3) Serial Communication in Windows 1) You can use this with Windows (incl. MinGW) as well as Linux. Alternative you can only use the code as an example. 2) Step-by-step tutorial how … Read more
Have you considered HDLC or SDLC? There’s also LAP/D (Link Access Protocol, D-Channel). Uyless Black’s “Data Link Protocols” is always nearby on my bookshelf – you might find some useful material in there too (even peruse the TOC & research the different protocols)
Could you try something like this for example I think what you are wanting to utilize is the port.ReadExisting() Method using System; using System.IO.Ports; class SerialPortProgram { // Create the serial port with basic settings private SerialPort port = new SerialPort(“COM1”, 9600, Parity.None, 8, StopBits.One); [STAThread] static void Main(string[] args) { // Instatiate this SerialPortProgram(); … Read more
I noticed the same thing about BOTHER not being defined. Like Jamey Sharp said, you can find it in <asm/termios.h>. Just a forewarning, I think I ran into problems including both it and the regular <termios.h> file at the same time. Aside from that, I found with the glibc I have, it still didn’t work … Read more
I have some preferences (and pet peeves) from writing software to control media and display devices using RS232. Depending on your hardware, some of these may not apply: I think it’s a good idea to make your protocol more friendly for automation. If you need an interactive interface (command line or other), build it separately … Read more