I can list the directory using below command.
AT+FSLS=\
i found AT+FSCREATE="1.amr",3 command to crate files in directory but the problem is, how to upload the file from my local drive.
I don't have any modem that supports AT+FSWRITE command.
But based on SIMcom AT-command manual, AT+FSWRITE= command responds with prompt: >.
Manual does not clearly tell how to use the command.
But it might work similar way than AT+CMGS= command:
Send AT+FSWRITE=1.arm,0,512,10 command to modem.
Wait > from the modem.
Write content of the file (512 bytes) to the modem.
Send Ctrl-Z char (0x1A hex) to the modem.
Wait OK/ERROR from the modem.
Step 4. may not be needed, because size of the file is in the command.
I've been trying to connect to the serial console of a Raspberry Pi 3 with Android Things using USB to TTL cable from my Linux (Ubuntu) machine. Despite I connected the cable as per the documentation, all I get when executing the minicom command is the following
with no chance to type in any character. So I neither can see any kernel messages nor shell into the device.
What am I missing?
Linux (Ubuntu)
What's in?
GNU Screen
Minicom
minicom one-line-command (short answer)
minicom UI (long answer, detailed)
GNU Screen
Run in terminal
sudo screen port_name 115200
See below (step 2) to find out port_name, e.g /dev/ttyUSB0. Hit Ctrl-A, then K, then Y to exit screen. Execute sudo apt-get install screen if not installed.
Minicom
Short answer
Run in terminal
sudo minicom -b 115200 -o -D port_name
See below (step 2) to find out port_name, e.g /dev/ttyUSB0. Hit Ctrl-A, then X to exit minicom.
Long answer (UI)
minicom should be properly configured in order to open the connection. The general steps are as follows:
Install minicom with
sudo apt-get install minicom
Connect Rpi3 with your host machine using USB-to-TTL cable and open the terminal. Find the tty connections with
dmesg | grep -e tty
In my case I get
where ttyUSB0 is the board.
Run minicom and select the serial port setup with
sudo minicom -s
You should see
Check (or set) the settings for the tty connection. Make sure that /dev/ttyX corresponds to your connection, the one you get in the step 2 instead of X, and Bps/Par/Bits set as per the documentation.
Similar to
Now hit Exit and, if everything had been properly set up, the connection should be running. If you type the ls command you should see Android Thing's root directory
For exiting minicom hit Ctrl-A, then hit Q, then Yes:
Windows (with PuTTY)
Install PuTTY
Connect the board to machine with USB-to-TTL cable and find out the COM port using Windows Device Manager. You should look for the the one called USB Serial Port (in my case it was COM3).
Run PuTTY and set it up. Use the speed as per the documentation (115200):
Hit Open and type a command in a terminal window popped up.
I'm going to suggest some troubleshooting advice based in my own experience:
Make sure you have the Tx and Rx cables connected correctly because all the other settings won't give you any warning, minicom would connect beautifully to the USB adapter but no info on your screen from your Pi.
I didn't use a USB to TTL like the one you are using, mine has the labels for Tx and Rx inverted on the board. Took me some time and the help of an oscilloscope to figure out what was going on.
I have been working with my arduino Uno on Ubuntu Linux (It won't work on Windows with my laptop). For a few days it worked fine, but recently I have been working with the Serial Port. It was all good, until the Serial Monitor stopped opening. It would have a process open, and using alt+tab it would show the window for it, but I couldn't get it to show normally or be interacted with in any way. I have opened it going tools>Serial Monitor, ctrl+shift+m, and the button for it. I can upload fine. I can't find the dynamic IP address for the arduino, or for just fun remotely interacting with it.
open the terminal and tap the following commands:
sudo usermod -a -G dialout xxxxx
sudo chmod a+rw /dev/ttyACM0
NOTE: xxxxx is your username
I am running Debian 7 (Linux Crunchbang) and wanted to use The Arduino IDE to program my Arduino UNO. To do that I installed the package arduino. When I started the Arduino I was asked to add my user to the dialout group. So I did with sudo usermod -a -G dialout <my-username>.
However when I start the Arduino IDE using arduino in the commandline the IDE opens but I am not able to load my program to the Arduino. The error message is "Serial port COM1 not found. Did you select the right one from the Tools > Serial Port menu?" And when I went to select the Serial Port, the option "Tools > Serial Port" is greyed out.
I thought it is because I did not grant read and write permissions on my usb port (ttyACM0). So I did sudo chmod a+rw /dev/ttyACM0 but the option is still greyed out.
chdmod works for my under debian (proxmox):
# chmod a+rw /dev/ttyACM0
For installing arduino IDE:
# apt-get install arduino arduino-core arduino-mk
Add the user to dialout group:
# gpasswd -a user dialout
Restart Linux.
Try with the File > Examples > 01.Basic > Blink, change the 2 delays to delay(60) and click the upload button for testing on arduino, led must blink faster. ;)
sudo arduino is the only way I get the Arduino IDE working (serial port and upload) on ubuntu 12.04 (64)
Indeed the serial port to use is /dev/ttyACM0 in my case too.
The other two (ttyS4 and ttyS0) gave an error when trying to upload to Uno.
Have fun
Try Disconnecting the usb and plugging it back in. Its only grayed out because the ide cannot find any com ports that the uno has been plugged into.
another solution is to try all the com ports and see which one works.
finally if all fails try restarting your computer.
Close all instances of the arduino IDE
open ~/.arduino/preferences.txt and look for the line:
serial.port=<not your port>
and change it to your port:
serial.port=/dev/ttyACM0
you may have to log out for it to take effect
open $arduinoHome/arduino in text editor and modify last string:
java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel processing.app.Base "$#"
to
java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dgnu.io.rxtx.SerialPorts="/dev/ttyACMN" processing.app.Base "$#"
(set property gnu.io.rxtx.SerialPorts to /dev/ttyACMN,where ttyACMN is name of serial port which you use)
it may temporary fix bug in rxtx library. helped me to upload sketch with arduino1.0.5 IDE.
Maybe would helpful for someone.
In my case this turned out to be a bad USB hub.
The 'lsusb' command can be used to display all recognized devices. If the unit is not plugged in the option to set the speed will be disabled.
The lsusb command should output something like the string 'Future Technology Devices International, Ltd Bridge(I2C/SPI/UART/FIFO)' if your device is recognized. Mine was an RFDuino
In my case I solved this issue by uninstalling the version of Arduino that I installed via apt-get and instead installed via the official website.
With the latest version of Arduino I didn't have the problem described on Ubuntu 18.04.
So I did with sudo usermod -a -G dialout <my-username>.
You need to log out after you add yourself to a group so those changes are applied. Just log out and log in again and the menu should be available.
install rx-tx lib for java run this command in terminal
sudo apt-get install librxtx-java -y
output port
sudo usermod -aG dialout $USER
sudo apt-get install gnome-system-tools
help regconize usb device
I solved following serial port related problems in ubuntu 18.04 as follows:
Problem 1 : Cannot open /dev/ttyACM0: Permission denied
Solution : Grant permissions to read/write to the serial port with this terminal command ---> sudo chmod a+rw /dev/ttyACM0
Here replace tty port with your respective ubuntu port.
Problem 2 : Failed to open /dev/ttyACM0 (port busy)
Solution : This problem appears when serial port is busy or already occupied. So kill the busy serial port with command ---> fuser -k /dev/ttyACM0. Here replace tty port with your respective ubuntu port.
Problem 3 : Board at /dev/ttyACM0 is not available
Solution : In this case your serial port in tools menu will be greyed out. I googled a lot for this, but I none of solution worked for me. Atlast I tried different arduino board and usb connector and it was working for me. So, if you are having old arduino board (can be solved using required drivers) or defected arduino board then only this problem arises.
If it is helpful to anyone, I had this problem using Ubuntu 22.04. The issue stemmed from:
apparmor (apparmor denied error, logging with dmesg)
brltty (ch34x converter now disconnected from ttyUSB0)
Solved it by removing both:
https://www.simplified.guide/ubuntu/remove-apparmor
sudo apt remove brltty
You can disable apparmor and it should work, however this made applications like firefox useless. My recomendation would be to totally remove it
Same comment as Philip Kirkbride.
It wasn't a permission issue, but using the Arduino IDE downloaded from their website solved my problem.
Thanks!
Michael
The following steps install the IDE and remove the error java.lang.NullPointerException thrown while loading gnu.io.RXTXCommDriver which usually comes with arduino installed with apt-get command in Ubuntu.
Install the IDE
sudo apt-get install arduino
for removing java error in IDE
sudo add-apt-repository ppa:webupd8team/java
sudo apt update
sudo apt install oracle-java8-set-default
This also shows the Serial Port which was grayed out due to the error.
I had the same problem, with which I struggled for few days, reading all the blog posts, watching videos and finally after i changed my uno board, it worked perfectly well. But before I did that, there were a few things I tried, which I think also had an effect.
Extracted the files to opt folder, change the preference --> behavior --> executable text files --> ask what to do. After that, double clicked arduino on the folder, selected run by terminal
added user dialout like described in other answers.
Hope this answer helps you.
For a Windows solution I've found that disabling and re-enabling the Arduino in Device Manager, then restarting the Arduino IDE does the trick without fail (no unplugging necessary). Why this error occurs in the first place is beyond me. Perhaps the corresponding method for Linux will fix your problem.
Slightly related (not really), I had an issue with an AVR board a while back which was fixed by setting the device to a new COM port in the driver settings. Again, however you linux bunnies do it, I'm sure it'll be cookies and cream.
Cheers brother,
I encountered the same issue. My solution was to install and use java7:
sudo apt-get install openjdk-7-jre
sudo update-alternatives --config java
Select the number referring to the java-7 path.
You probably don't have the correct permissions. Try adding yourself to these groups.
sudo adduser username ttyl
sudo adduser username serial
sudo adduser username uucp
Then restart your system and check if you got added to the groups.
groups username
Good Luck!
Try to run as an administrator...
Run terminal, type sudo arduino, type your root password, and... :)
I have installed stino on Sublime Text 2 succesfully, but when I try to upload my code to Arduino Uno, the output is the following:
Uploading /home/lucas/Arduino_Build/programa_teste/programa_teste.hex to Arduino Uno...
avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied
ioctl("TIOCMGET"): Inappropriate ioctl for device
[Stino - Error while uploading.]
I have the Arduino IDE installed, and it is working fine, only Sublime Text can´t upload the code.
well, as #Bibhas says, your problem is that /dev/ttyACM0 is having the wrong permissions, and that has nothing to do with Arduino or sublime text. It's the linux kernel who creates character devices per default with no user permissions.
But good thing is that it can be changed!
The fast and easy solution is to add your current user to the dialout group:
sudo adduser YOU dialout
where YOU is your username and then log out and log back in to have those new permissions propagated into your shells.
Hint:
There's a solution that is a bit more complicated, is to create a udev rule such as:
/etc/udev/rules.d/48-arduino.rules
SUBSYSTEM!="usb_device", ACTION!="add", GOTO="arduino_end"
SUBSYSTEM=="tty", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0036", MODE="660", GROUP="arduino", SYMLINK+="arduino.leonardo"
LABEL="arduino_end"
which creates a /dev/arduino device readable and writable by the arduino group, that you need to create (or you can use the default dialout group which is perfectly fine):
addgroup arduino
adduser YOU arduino
and then reload your rules:
sudo udevadm control --reload-rules
The nice thing about that second hint is that when you unplug replug your arduino, you won't have it change device number oddly, it will be kept to the name. If you're not using an arduino leonardo, you can check your device idvendor/idproduct using lsusb:
% lsusb
… ↓↓↓↓ ↓↓↓↓
Bus 006 Device 105: ID 2341:0036 Arduino SA
…
HTH
Accoding the Troubleshooting doc, I use
sudo usermod -a -G tty yourUserName
sudo usermod -a -G dialout yourUserName
fix my problem.
I have the same problem today, and the incredible happend. The USB cable gave power to the Arduino, but doesn't allow the communication. The solution for us was to change the USB cable, and after that everything worked