1

I bought a kit of 37 sensors for Arduino, and downloaded all the example sketches. Now, when I try to start up the Arduino IDE I get a lot of frustrating messages like this:

Sensor kit error message

... and I have to click "OK" on every one in turn before the IDE will start up.

Obviously I do not want to delete the sketches and their accompaniments, so I have tried to rename all the files and directories, with a shell script, to remove non-alphanumerical characters, but my understanding of shell programming is not good enough, so I have had no success.

I have made backups of the files in case things went awry with my scripting, and now see that these messages are repeated, as in the image, for the backup copies as well. I cannot find out how the Arduino IDE finds them, they are not in my Sketchbook folder.

I would be grateful for advice on either how to avoid these messages, or to edit the names so that they do not occur: I would be happy to edit the names of each sketch as I come to try it out, but I baulk at doing the lot at once.

I am using Linux Fedora 20.

  • Similar question here: arduino.stackexchange.com/questions/33996/… but the thing to know is that it is only complaining about the directory names. But the IDE wants the filenames to match the directory names. (continued) – SDsolar Apr 8 '17 at 2:22
  • See my answer below. I flesh it out better than I can do in comments. – SDsolar Apr 8 '17 at 2:37
4

That message is actually a hang-over from when the IDE was Processing. The name of a file had to match the name of the Java class within that file, and there are strict rules about what can be in a Java class name.

They just basically haven't got around to deleting that piece of ancient code yet.

So you have 3 options:

  1. Rename all the folders and files.
  2. Edit the IDE's source code to delete that old code
  3. Use a different IDE.

The first option can be long winded if you don't know how to do good scripting, as you have found out.

The second option requires knowledge of Java coding.

So that leaves the third option. Now, I'm going to be shamelessly advertising my own work here ;) Why not try a better IDE? Such as the popular and powerful UECIDE (yes, written by me). It's based on the Arduino IDE, so it will mostly be familiar to you, but the whole of the insides have been ripped out and re-written. If you're feeling brave you might want to give the beta version a go - it has some really really cool features not found in any other IDE in the history of mankind.

  • Thanks Majenko for that brilliant answer. I am using Linux Fedora 20, andI have successfully installed UECIDE, using the.zip file, but I haven't time to look into it further today. I'd like to try the beat version, but don't know how to check for or install Java VM. I will report on my progress. – Harry Weston May 4 '15 at 18:32
  • I meant beta not beat, but I took too long to notice and edit the comment. – Harry Weston May 4 '15 at 18:41
  • I got lost in the Plug-in manager in UECIDE, couldn't see how to install the selected plugins, but I will pursue that. Meanwhile I have solved the immediate problem by backing up all the offending files to a USB stick, and will re-name and load those I need, as I come to them. – Harry Weston May 5 '15 at 10:50
  • I caught that jab about long-winded, @Majenko. Upvote anyway. I still referenced my answer you probably were referring to, in my answer here, long-winded or not. At least it is a proven method. But Windows is a much easier way to do the renaming unless someone really likes running unreadable scripts like mine, and crossing their fingers until they see that it worked.. ;-) – SDsolar Apr 8 '17 at 2:49
0

Short answer: You can't avoid that error in the Linux Arduino IDE until your sketches have allowable naming.

Similar question here: How can I use my Arduino sketches on my Raspberry Pi IDE?

Note that it is only complaining about the directory names. But the IDE wants the filenames to match the directory names.

So your best way to deal with this is to go into Windows IDE then load each sketch and resave it with allowable names, before transferring. Make a separate directory for the saves.

If you have dozens, or if you don't have the Windows IDE available, then the program I wrote (see the link above) will do the job for you on the Linux side. It definitely works. I had a bunch and it ran through them all in a minute or two.

I suggest you avoid using the program in favor of the Windows route.. But look at that link to get a feel for how I'm set up.

It is really easier to just use the Windows-based IDE to do the renaming. One by one, just load them then resave them without the special characters, into a subdirectory to be used to transfer to Linux on a flash drive or FileZilla.

Another issue you will face in the Linux IDE is the libraries. First put them in a libraries folder under sketchbook.

Then use the IDE menu item "Sketch..Import Library..Add Library" for each library - it then stores them elsewhere in the IDE's guts.

You can do this on an as-needed bases. Start with the most common ones like Adafruit_sensor.h, (Note that the underscore is OK for that one) which you know will be used by many of the sensors. SoftwareSerial.h is another good one. DHT.h if using the temp/humidity sensor. Wire.h must be in there for a lot of them.

In the end, it works fine, as you can see at the link above. I rather enjoy sitting at my desk using Remote Desktop via WiFi to the Pis, then remote-reprogramming the Nanos (C++) and/or the Pi (Python, BASH, SCP, etc) to get them calibrated to collect my data.

Have fun with the sensors. Those will take some time to absorb, but in the end it is all worth it.

  • Can I suggest you change the title of your question to something like "I have the Arduino 37 Sensor pack - how do I make the sketches work in Fedora Arduino IDE?" – SDsolar Apr 8 '17 at 2:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.