Raspberry Pi 4 has intermittent issues recognizing which USB port to use for serial communication. The numbers seen in the sample result is different for every device. This shouldn't be used often unless you are having issues with network congestion. Please check with your wireless provider on the list of providers that is supported in your area. The error usually occurs if your provider's SIM does not support the carrier you are connecting to. If there is an error, it will reply back with CME ERROR. If all went well, you should get an OK response. This response is valuable to switch carriers. You can run the AT+CREG=? for available flags.(#, "Current Network Name", PLMN #) For example, if you want to connect to T-Mobile, you would do AT+COPS=(0,1). This command will also filter out carriers that are not compatible with the SIM card.Ĭheck the current network. This is used to check if you are able to communicate with the device.
Now that you know how to run AT commands on your device, here are some common commands that you can use. Debian Repository for accessing specific versions:.To see which port your device is connected to, you can run ls -l /dev.Sample Command: screen ttyUSB3 or screen ttyS0.screen defaults to ttyS0 unless otherwise specified. You may also use minicom if you want additional customization.
If not, you can install it via, sudo apt or sudo yum install screen. 2 The package, screen, should be installed by default on your Linux distro.
If somebody more shell savvy than myself would like to add to this to make a shell script that accepts the required parameters for setting up a new connection profile,logs etc I wouldn't be too upset about it :)Īs an aside, I wanted to add a command prior to minicom running in the shortcut to apply a title to the terminal window using the identifier, I could not get this to work in Ubuntu 20.04 at the time of this posting. Just scroll to the part you are working on in the tailed file to use as a reference while you make changes in minicom, the tail terminal will still collect data but will not automatically jump back to the new line as minicom does when you star to type. Once you have created your first connection, open another terminal: tail -fn25 ~/minicom/IDENTIFIER.logīecause you have set minicom to capture output, by tailing the log/capture file you can scroll back as far as you need should you be running things with lengthy output, It can be useful for configuration files in routers/switches for example which can be thousands of lines long. Do what suits you but maybe use hyphens instead of spaces, I've not tested that but i would imagine they would cause issues such as only getting the name before the first space or worse, attempting to load multiple minicom.identifier files. a router or switch model, a device name or type. That's it now test the connection, double click your new shortcut.Ī note about the IDENTIFIER part, it can be anything. Make it executable chmod +x ~/Desktop/sktop nano ~/Desktop/sktopĬomment=Something relevant to your connection/device name maybeĮxec=minicom IDENTIFIER -C/home/USER/minicom/IDENTIFIER.log
Pu logfname /home/USER/minicom/IDENTIFIER.logĬreate a desktop shortcut. You may create as many as you need along with the desktop shortcuts. Adapt the capitalised parts to fit your needs, baudrate may be set incorrectly if you get quirky characters or no output. If your cable uses an RS-232 chip such as some usb to mini usb console cables, your tty device will likely be on ttyACM* and not ttyUSB*Ĭreate the minicom configuration file using nano. Make a log file directory: You might choose to just log in /var/log but I want quick access to the log files. The configuration files will be saved to your home directory where minicom can find them. If this is something you could use, run these commands as a normal user from your terminal (not from minicom). All i need to do it make sure my devices are connected to my computer with the cables. The shortcuts give the correct configuration file as a parameter (identifier) as well as the capture file (-C). Using the shortcuts here means I don't need to manually reconfigure minicom every time I want to switch devices. I use this for switch and router connections, I have two different console cables, a USB to mini USB and also a db9 with USB A adapter to rj45. You might be interested in this if you frequently open up a serial connection to multiple devices. This is a little more than the scope of the question calls for but as it has already been answered, I thought somebody might like to do things a little user friendly.