User avatar
richiepp
Posts: 140
Joined: Wed Dec 19, 2012 4:56 pm

Programming Arduino from Raspi - Library troubles

Fri May 15, 2020 7:47 pm

Hey All,
I just installed Arduino on a Raspberry Pi 4 and it's blistering fast compared to my windows machine. However when I try to use custom libraries, especially ones that use hyphens and underscores in their names, I'm having trouble. Note that I've been playing with Arduino for 8-9 years and 5-6 years with Raspberry Pi. So I'm familiar with installing libraries.

I've discovered that a lot the libraries that I've used on my windows machine don't work on the Pi. I get errors about non ascii characters like underscores and hyphens. The library I'm trying to get working now is FadeLed.h
https://github.com/septillion-git/FadeLed

Note that when you download this library it's named FadeLed-master.zip . I read somewhere if you get rid of the hyphen before installing the library it should resolve any issues. Not for me... I've installed and reinstalled the library to no avail.

After I install and restart the IDE I see the library listed as well as it's examples. When I try to compile one of the examples I get the following error

Code: Select all

/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard /tmp/build12629863923838850473.tmp/ConstantSpeed.cpp -o /tmp/build12629863923838850473.tmp/ConstantSpeed.cpp.o
ConstantSpeed.ino:27:21: fatal error: FadeLed.h: No such file or directory
compilation terminated.

So it seems like the IDE is finding the library but the compiler is not. Perhaps there is a reference to the original zip file name "FadeLed-master.zip" somewhere in the library itself?

How can I get this library working?
Thanks
Rich

User avatar
scruss
Posts: 3338
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Programming Arduino from Raspi - Library troubles

Fri May 15, 2020 9:08 pm

I'm not sure if github zip downloads work with the Arduino "Import Zip Library" command.

But in the Library Manager, I'm seeing FadeLed:
2020-05-15-165827_1066x600_scrot.png
Arduino Library Manager, FadeLed
2020-05-15-165827_1066x600_scrot.png (57.69 KiB) Viewed 259 times
It installed and compiled a test program no problem on my Raspberry Pi.

Which version of Arduino are you using? The one from the repos is ancient and useless. This should get you the current one, but uninstall the one you have first:

Code: Select all

mkdir ~/Applications
cd ~/Applications
wget https://downloads.arduino.cc/arduino-1.8.12-linuxarm.tar.xz
tar xvJf arduino-1.8.12-linuxarm.tar.xz
cd arduino-1.8.12/
./install.sh
rm ../arduino-1.8.12-linuxarm.tar.xz
Don't worry about warning messages from the install script.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

User avatar
richiepp
Posts: 140
Joined: Wed Dec 19, 2012 4:56 pm

Re: Programming Arduino from Raspi - Library troubles

Fri May 15, 2020 9:38 pm

Yep, I was running an outdated version of Arduino.

Thanks!

LTolledo
Posts: 3820
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: Programming Arduino from Raspi - Library troubles

Fri May 15, 2020 10:10 pm

I've created quite a number of Arduino projects using the RPi3B and RPi3B+ as my programming/flashing console (w$ system was made redundant 2 years ago ;) ).
ArduinoIDE_Raspbian.jpg
ArduinoIDE_Raspbian.jpg (141.04 KiB) Viewed 232 times

the only library troubles that I encountered were there are still no linux arm version for some libraries and board manager settings, but only quite a few... and can still live without.
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

User avatar
scruss
Posts: 3338
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Programming Arduino from Raspi - Library troubles

Fri May 15, 2020 11:29 pm

LTolledo wrote:
Fri May 15, 2020 10:10 pm
the only library troubles that I encountered were there are still no linux arm version for some libraries and board manager settings, but only quite a few... and can still live without.
Yeah, the lack of ESP32 toolchain and the very confusing options for ARM Cortex-M chips under Raspbian is annoying. Then again, most of those can run MicroPython, which is a whole heap less bother (if vastly slower) than Arduino.

Latest fun toys: WeAct STM32F411CEU6 boards with additional 256 Mbit Flash chips - make a very capable MicroPython board with lots of storage - https://github.com/mcauser/WEACT_F411CEU6
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

Return to “Automation, sensing and robotics”