Receive Files using teraterm ZMODEM - serial-port

I'm using teraterm from my windows PC.
I have a serial (USB) port conection to a board that is running linux.
I have access to the linux terminal throught teraterm.
This is the only way to interact with the board.
I want to "copy" files from the board in my PC. For this I thought on using the ZMODEM/receive option.
When I choose the ZMODEM/send option I achieve to send files from my PC to the board, so I asume I have the rigth configuration.
However when I choose the ZMODEM/receive nothing happens, I cannot write the file's name. I think teraterm is waiting for the board to send it.
Is there a way to specify the filename from my PC and receiving it without "manipulating" the board?
I can run sh scripts on the board, but I should not install new software in it.
I'm open to other solutions with teraterm (maybe ZMODEM is not the right way?)

I just got it.
I had to use the sz command on linux.
So, on the board I launched:
sz /my/file/name.wow
and then click on transfer>ZMODEM>receive and the transfer started automatically :)
I was used to work with ethernet/ssh and just noticed this method taking a lot more time.

Related

Using the serial port in a Ubuntu for W10 (WSL)

I'd like to know if it is possible to establish communication via a serial port in an Ubuntu for W10 terminal using the USB interface.
Concretely, I am using a Sparkfun edge board and in this tutorial, it is explained how to detect if the device is connected by checking /dev/tty*. However, it does not work in my testbed, nothing new appears in the directory.
Probably, it is related to using Ubuntu over Windows, but I'd like to be sure before moving to another system.
This is a bit old, but it should've worked then... New devices don't show up in the directory, they're already all there, so you need to know what COM port it's on, let's say it's on COM4, then your device will be /dev/ttyS4 in linux.
I've been using this for well over a year to upload files to my MCU boards kinda like what you want to do, and as long as the device shows up as a COM interface in Windows, and isn't in use, you should be able to connect it to it in WSL as /dev/ttyS[COM#].
Hope this helps, even if it's a bit delayed.

ESP32 (Arduino IDE) OTA update hangs / fails

I cannot get OTA updates to work on my ESP32 using the Arduino IDE (and I've also tried PlatformIO in VS code).
I'm using the standard sketch from this site (and many identical others).
When I try to update using OTA, here's what I get:
Sending invitation to 10.0.0.245
Authenticating...OK
12:12:49 [ERROR]: No response from device [after a short while]
If I connect the device to a USB/serial terminal, here's what I get:
Start updating sketch
Progress: 0% [never proceeds beyond 0%]
Error[2]: Connect Failed [after a short while]
Error[4]: End Failed
My partition table has two OTA partitions, so this is not the problem.
I've tried with and without my firewall, with and without my anti-virus, with and without the USB connected, with and without a password, with and without setting the port, with and without a manual reset after loading the sketch - always the same.
It's not an initial WiFi connection problem - the device IP is recognized as a port, the password is verified if I use one and the initial connection is made.
Any ideas?
Thanks
I had exact same problem although with ESP8266, it didn't work when I disabled firewall either. But, after I created a New Rule in "Windows Defender Firewall with Advanced Security" for the python located in: C:\Users\Erfan\AppData\Local\Arduino15\packages\esp8266\tools\python3\3.7.2-post1\python3.exe
and Allowed its connection, my problem was solved.
Note1: Try creating New Rule in your antivirus firewall if you have one.
Note2: I found the location of the ...\3.7.2-post1\python3.exe in Arduino IDE. If you try to upload Over The Air, the path to python.exe will appear in the outputs.

Arduino com port keeps getting busy

I have got an Arduino Uno R3 on which I have an accelerometer that I'm playing a bit with. This setup has worked for quite a while now, everything working from uploading to checking the serial output.
Today I started having problems with the com port reporting busy or not connected at all. When I use the default IDE it cant find the arduino at all but when I use a modded IDE (Arduino ERW 1.0.5) seems to find the port to communicate on but it reports it being busy.
I have reinstalled the driver like 5 or 6 times now and searched for any other driver that might work but they wont change anything. I have also checked that my pc actually detects the arduino which it does, it is listed among the COM ports on Device Manager. I also tried changing the Com port from COM3 to COM4 and still it worked for like 3 uploads and then the COM port kinda "disappeared" from the serial port list on the IDE.
EDIT: Weirdly, after closing some programs that seem to have to do with serial communication it works. I have to look into what I close and when.
EDIT2: For now it seems that processing sometimes didnt close properly when not using the stop button on the processing application which then didnt close the connection to the arduino. I havent had any problems since I started to use the Stop button on processing.
Win 8.1
Latest driver and IDE(an modded IDE called Arduino ERW 1.0.5 seem to work a bit better but have the same issues)
One thing I noticed is that if I press the reset button when it starts again it wont send anything through serial, is it defaulting to the Blink program after a reset or what?
For those getting the "port busy" error while connecting Arduino and Process, one fix is to close the serial monitor in Arduino.
For anyone who is struggling with this, you have to give again rw rights to ttyACM0
sudo chmod a+rw /dev/ttyACM0
after that I was able to open the serial port.
I found the problem being in Processing itself, on win 8.1 the P3D option for 3D renderer seems to leave the java process open after closure which causes the serial port to be busy even after the main window is closed.
I simply fixed it by using OPENGL instead of P3D which didn't change anything visibly so I'm fine with it.

Arduino COM port not found

For the past week I have been programming an Arduino Uno with a computer running Windows 7. When I first started, I found the device on COM6 and was able to upload code no problem. Recently it suddenly stopped receiving code under the error:
Serial port 'COM6' not found. Did you select the right one from the
Tools > Serial Port menu?
The Serial port menu though is grayed out. Research has told me to open up Device Manager and update drivers but there is no other devices tab in my Device Manager. The Arduino is run off the power of the USB cable and runs the code I uploaded a few days ago just fine. What can I do to be able to upload code to the Arduino?
Update:
I installed the Arduino software on another computer and it does not recognize the Arduino either. One of the comments indicates that this could be a problem with the FTDI chip. How can I test if this is the case, and if it is, can I fix it?
There are two types of cable:
Charging Cable
Data Transfer Cable
So try changing the cable, if you have already tried every USB driver and port; or else
Install a new driver using this link, http://www.wch.cn/download/CH341SER_MAC_ZIP.html.
But after installing the driver, if it doesn't work, then change the cable.
For Linux:
To solve the problem, simply run the IDE as super user, so go to terminal and type 'sudo arduino'.
To solve this problem permanently:
In the terminal, run 'gksudo gedit'
In gedit, open the /usr/share/applications/arduino.desktop file.
Change the line Exec=arduino
to Exec=gksudo arduino. Save the file.
Similarly, do the same for Windows...
Also try to re-install Arduino driver.
The Arduino probably started using a different port. When you plug Arduinos into a different USB port it sometimes defaults to a new COM port. Check your device settings for which ports are being used and try each of those. Also try plugging it into a different USB port (if no ports are displayed) and it should register with a new COM. If that fails reboot your machine and repeat the above. If that fails reinstall the Arduino USB driver and repeat above. If that fails you might have fried your Arduino's USB chip (or some other hardware on the Arduino).
For Linux: Vinayk93 is completely right. Adjust the serial port's access rights like so:
$ cd /dev/ ; ls -l ttyA* -- find the right portname, then
$ sudo chmod 666 ttyACMx -- x is 0 or 1

List machine's serial ports

I have an Arduino-based device which connects through USB.
I'd like to detect it from my Qt 4 application, using QExtSerialPort (or whatever necessary), when it's plugged in.
If this weren't possible, I thought I could somehow get a list of the system's port names and just try all of them in search for my Arduino (where I'd implement some kind of handshaking procedure for it to detect it correctly). My concern in this approach is that I'm not sure if a device (for example, printer) would get damaged if I send some kind of handshaking ack at a different baud rate.
So, I don't really know where to start for any of them. Which would be the best approach? How would I implement it?
I believe you can find list of serial ports on Windows by looking into
HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM
registry key
Each serial port on a UNIX system has one or more device files (files in the /dev directory) associated with it:
System Port 1 Port 2
IRIX® /dev/ttyf1 /dev/ttyf2
HP-UX /dev/tty1p0 /dev/tty2p0
Solaris®/SunOS® /dev/ttya /dev/ttyb
Linux® /dev/ttyS0 /dev/ttyS1
Digital UNIX® /dev/tty01 /dev/tty02
more details on serial programing on POSIX systems here
Since your device is USB, your UART port will be emulated by some kind of conversor in his hardware. So first you must understand what driver is being used on your system.
The most common SERIAL->USB conversor uses PL2303/PL2301 chip, so it would create a path on /dev, if its the first device, it will appear as "/dev/ttyUSB0", but you may also see the list reading the proc path (like "cat /proc/bus/usb/devices").
Under Windows it usually creates a virtual "COM", just go to device manager and check the port.
When you are sure about how the HW talks to your system, you may use QExtSerialPort for wrapping the system API and talk to the device.
Way too hard and too platform specific, using weird Windows Registry keys or rely on hard wired device nodes on Linux.
You are on the right way. Get QextSerialPort or QSerialDevice (which I preffer in my projects, because it got integrated in Qt5), have a look at the examples and simply use it. In both libraries you get some kind of port enumerator class which returns you a list of all configures serial ports. Only platform/device specific settings you will have to do manually (like getting RS485 in half-duplex mode on my current embedded project), but "standard" problems are perfectly encapsulated in a QIODevice implementation.
You can use both QextSerialPort and QSerialDevice like a file. Open it (instead of a filename you specify the device name ie. "COM1" on Windows or "/dev/tty0" on Linux, depending on your configuration) and then read or write like you are doing it with an ordinary QFile, QBuffer, Qwhatever-inherits-from-QIODevice.
If you have any problems opening the port and communicating, don't hesitate to ask! :)

Resources