Serial.tools Install

3 views
Skip to first unread message

Chara Dagres

unread,
Jul 25, 2024, 2:59:19 AM7/25/24
to SpinW Forum

I have installed the latest pySerial on my Ubuntu box with python 2.7.2, and it works fine for most things, but whenever I try to import the 'tools' package, it says that it can't find 'tools'. The documentation for pySerial explicitly references this 'tools' package.

The pyserial-2.4-py2.7.egg in the site-packages folder was getting imported instead of from serial in the site-packages folder. Once I renamed this file so that it no longer imported from this it worked fine. You can easily debug this by doing

serial.tools install


Download Zip ••• https://bltlly.com/2zNbqT



Hi. So, apparently. I'm new to this Arduino community.
And there's an error while I'm trying to upload a sketch that I made.
By sketch, I mean any sketch. I can't seem to upload them into my
NodeMCU 1.0 ESP8266 Board for some reason. It gave me this error,

OK, I don't remember how did I sort it out last time, but now I have ran into the same problem again when I made a fresh new install of Big Sur. I am still not able to send the compiled sketch into the ESP through the ArduinoIDE, however I have managed to get it work with the help of external tools completely independent of Arduino software. I did use makeEspArduino tool from Peter Lerup (plerup). At the beginning I was running into the same issue, however I have soon discovered it is very important how you install the Python libraries (if is it as a root user or a regular user). Basically it means, that the problem is in the rights. ArduinoIDE is running processes under the different user than it did install libraries. Till now I am still not able to get it work over ArduinoIDE, but fortunately solution from Peter works well. It is a few more steps to do before upload can be performed, it is not as streamlined as ArduinoIDE, but IT IS WORKING! I am now thinking about letting the ArduinoIDE be as it is, don't worrying about it, forget it and use different approaches where I have way more control over what and how is being done than rely solely on something what is doing it's stuff on the background and spits error after error on me. The worst thing is that no-one even replied on this issue for more than two months now. How are you supposed to work with that?

I ran into this issue on Big Sur as well. It looks like the upload tool doesn't currently work out-of-the-box. Specifically, upload.py uses esptool which uses pyserial which is not fully functional on Big Sur.

This is the same fix that the developers of pyserial made (Latest version of the file here) to fix this issue but the esp8266 core uses a 2 year old version of pyserial, so until they update the library this will still be an issue.

Why does Apple keep doing this to us? I switched from windows 10 years ago and it was great up until that last few years when this untested stuff is constantly foisted on us, the trusting public. I think I will hold off on these "upgrades" until at least 6 months have gone by.

Good afternoon, I have this issue with pyserial and esptools and have tried the workarounds above both of which don't work for me. Has anything changed in the last 3 weeks or so that I can try. I'm getting very frustrated with the whole thing when not so long ago everything worked perfectly.

We are going to be using the pyserial library. As the name would suggest, this library allows us to identify open serial COM ports, connect, to them, and send/receive data. Start by installing this through the command line.

A common question that I have asked myself and others have asked is: why isnt serial.tools.list_ports working? Its important that you import this library just as we have shown here "import serial.tools.list_ports" and not with simply "import serial" as this will not produce equivalent access

I have been using PlatformIO to upload successfully to Arduino boards on a couple of different Ubuntu Linux machines. However today when I installed on Ubuntu running on my Chromebook (via crouton) I get an error when I run

The Mac app called Serial is available as a paid app from the App Store. Full disclosure- I wrote it. The main advantage over other apps is it can work with most USB to serial devices without having to install any drivers, as it has its own drivers built-in. It also does full terminal emulation so you can use it to work with Linux or other devices that require it. You can try it for free, too.

Also, Apple began including their own driver for FTDI-based devices in Mavericks (10.9). So, if you're on 10.9 or later and your device has an FTDI chip inside, you can use the built-in screen command in the terminal to access your device without worrying about drivers.

I often have to do router configuration via a console port, so I use a Keyspan Serial Adapter to get access. Two problems then present themselves: ZTerm is a horrible Mac OS X app. It hasn't been updated in five years or so, and isn't a Universal Binary. The developer doesn't seem in any hurry to rectify the situation. It is not worth the shareware fee in its current form. Minicom requires installation of Fink or MacPorts and is overly complex. Solution: Use screen, Terminal, and a little AppleScripting.

Compile and save as an app from within Script Editor, and you have a double-clickable application to launch a serial Terminal session. You may want to customize this slightly -- you can change the screen colors or number of columns or rows. You may also need to customize the screen command with a different device name if you are using something other than the Keyspan Serial Adapter (do an ls tty* of the /dev/ directory to get the right name).

screen uses Control-A to take commands directed to it. So type Control-A followed by Control-\ to exit your screen session. If you fail to do this and exit a Terminal session, you'll leave the screen session alive and the serial resource unavailable until you kill the screen session manually. man screen will show you further commands to send to a screen session.

If anyone can reply with a link to a tutorial on how to wrap an interactive Unix App in Cocoa, that would be the next step -- it would be nice to do this without involving Terminal. If you prefer to use Minicom, you could still use the AppleScript to wrap it into a nice launchable app -- use this older hint to find the right command line commands.

Many USB-Serial adapters use the chip from FTDI. Install the "Virtual COM Port" driver and look for the proper TTY name in /dev. For example, on a PowerBook G4 it came up as /dev/tty.usbserial-FTALKY8I.

You should have a look at ZOC, what I think to be the best terminal emulation program available for the Mac. I use it everyday for my job. It has the ability to do direct communication with a serial port. Of course it does way more than just serial communication.

ZOC is a professional SSH/telnet client and terminal emulator. With its impressive list of emulations it lets you easily connect to hosts and mainframes, using communication methods like secure shell, telnet, serial cable or modem/isdn.

And then there still is the old ZTerm which is just as old as it's looks suggest yet it gets the job done just fine and it is available for free. Works fine with Prolific (PL 2303) and FTDI based USB serial adapters.

All the "HowTo's" for using screen to make a serial connection on the 'net I've found Googling omit these required parameters, so that's why you'll find screen has not worked if you've tried it just passing only the baud rate.

BTW, minicom -s (which would also need to be installed via macports or homebrew) also works great, but I prefer screen as I don't have to go through setup menus- I can just pass the serial connection parameters directly to the screen command.

When I connect the arduino to my computer via USB and run the list ports function in python.
I'm able to connect to my arduino via COM3 and write to the serial to control it.
But I'm not able to even see list the device using python on the android phone.

I am able to get it to work on octoprint for windows using COM5 and COM6, but on Octo4a (octoprint for android). It only lists one serial port which is called /dev/ttyOcto4a. So I can't communicate with the arduino exclusively. Both the printer and the arduino try to read the serial, but only one does. Whichever was connected first. How can I fix this?

Android is a kind of Linux. Linux and windows has a very different ways of listing serial comm. ports. I have no experience with Android, but in Linux all serial ports are listed in dev/serial. This kind of port with Octo4a should be a specific android solution to define the printer port..

I tried the android app "Serial USB Terminal" and its able to connect to each port individually to communicate with them. How can I connect to a USB port individually in the terminal or in the plugin via python?
The app did list both ports as having the exact same name and ids though, but it was able to connect to them individually anyways.

SSH into the phone and look at: /dev/serial/by-id folder. If you have 2 serial devices connected then you should have 2 "files" or IDs there. You can use this path to connect to each one of them on pyserial.

If I remember correctly, Octo4a has a custom way of managing the serial port connection through it's app. The user that O4A runs as in the app doesn't have permission to list the serial ports, it just gets given /dev/ttyOcto4a or something along those lines, rather than an actual list of devices (due to how the app is setup). This might mean that this kind of plugin doesn't work on an android phone, and only standard installs on other OSes.

Hi all,
in the documentation for installing phyton on a windows machine, a line should be added between point 3 (pip install pywin32) and 4 (pip install odrive). Otherwise the installation of ODrive tool will fail.

This dependency should indeed be ignored on your Ubuntu machine. The odrive package does exactly what they say in the setuptools docs.
If updating pip does not fix the issue you can try sudo pip3 install odrive --no-deps. This will make pip ignore all dependencies. All correct dependencies should already be installed from previous attempts.

4a15465005
Reply all
Reply to author
Forward
0 new messages