Arduino IDE on a small screen (e.g., RPi "Official")

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
clarkj
 
Posts: 119
Joined: Thu Aug 08, 2013 12:34 pm

Arduino IDE on a small screen (e.g., RPi "Official")

Post by clarkj »

I recently had need to run the Arduino IDE on a Raspberry Pi 4 "Official" 7" Touchscreen https://www.adafruit.com/product/2718, which has a resolution of 800x480 pixels. There were a couple of problems, but I thought I'd share the solutions. BTW, I am using the "Bullseye" release of Linux for the Pi, and Arduino IDE 1.8.19. Please remember "your milage may vary".

The first problem that I ran into was that the Guide for the ESP32-S2-TFT Feather said to go into "preferences" and add an URL to the list. When you bring up the "Preferences" screen, you can NOT get down far enough to see the field to enter additional URLs. Examining this screen on another machine, with a larger screen, I found that it mumbled something about where to find the file to edit. The file is named preferences.txt -- armed with this, I was able to track it down (thanks to having used *nix since the late 1970s). To find it, bring up a terminal window on your Pi. If you're "reusing" one, then issue the command cd with no arguments, which will send you to your "home" directory (or folder, if you like that name better). Then issue the ccommand

Code: Select all

find . -name preferences.txt -print
It will probably find two files. One of them will likely be in a directory (folder) named something like

Code: Select all

.arduino15
-- that's probably the one you want. The easy way is to change directory to where the file is located. First, though, do a

Code: Select all

head -10 preferences.txt
-- if it talks about "DO NOT EDIT THIS FILE", then it is the other one you want to edit! To make sure you don't really mess up, use

Code: Select all

cp -p preferences.txt preferences.txt.orig
to make an exact copy of it. I would advise that you make sure you do NOT have the Arduino IDE running at this point. Use your favorite editor, such as nano, to open the file. Warning: Do NOT use a word processor program to open this file! The first thing to note is that it basically is a series of names that get assigned values, and the names are in alphabetical order. Find the one that says

Code: Select all

boardsmanager.additional.url=
note that it likely isn't there, so you'll need to add it, followed on the right-hand side of the = sign by the URL mentioned in the setup guide. There should be no spaces in the line. If you need more than one URL, separate with a comma.
We could save the file at this point, but there's another place where you can't scroll down far enough to see things -- the "port" selection under the "tools" menu also has this problem.
At this point, you'll need another terminal window. Again, you'll want to be in your home directory. Issue the command

Code: Select all

ls /dev > temp1.txt
Now plug your board into one of the USB ports, and issue the command

Code: Select all

ls /dev > temp2.txt
Now do a

Code: Select all

diff temp1.txt temp2.txt
and look for something that begins with "tty" -- on my system it was ttyACM0
You'll need to add 3 more lines at the proper place to maintain the alphabetical order. I'm using ttyACM0 as an example -- you will need to change it if your board shows up as something different.

Code: Select all

serial.port=/dev/ttyACM0
serial.port.file=ttyACM0
serial.port.iserial=
(Note that the "iserial" line has nothing after the = sign -- the IDE will automatically fill that in later.) Save the file, and exit the editor.
You'll still need to use the Arduino IDE's "boards manager" to download the appropriate support stuff for your board, but at least now the IDE will know where to find it and where to find your board when you're ready to click on the "Upload" button, as well as where to look for the serial monitor.

By the way, you can now issue the command

Code: Select all

rm temp1.txt temp2.txt
to delete the two temporary files.

As a footnote, I was amused a couple of days ago to note that the quotation that Adafruit.com offered me was "Any path that narrows future possibilities may become a lethal trap” -- The Spacing Guild Handbook. I'll let the reader draw their own conclusion...

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”