Getting started with arduino, on linux - linux

I would like to get started with programming on arduino, and am considering buying this kit https://www.sparkfun.com/products/11930 but I'm concerned about not being able to run this on linux.
I still don't know much about arduino, but could I still run this properly, and still be able to follow the programs without some obvious linux/windows differences?
Also, if anyone has any other reccomendations for some others kits to people new to arduino programming, but not new to programming, I would love to hear them.

The Arduino IDE itself runs fine under Linux (as well as Java programs can), and the compiler works perfectly (it uses GCC under the hood). If you're using a serial connection then it changes from COMxx to /dev/ttyNNNxx (e.g. /dev/ttyUSB0 [although I haven't actually seen it yet since I use a ISP programmer, but it should look something like that]). Also, no extra drivers needed. However, whether you're using a serial connection or a ISP programmer, you'll want to add a udev rule so that user access to the device is allowed.

You can install arduino on Ubuntu with the following command.
sudo apt-get update && sudo apt-get install arduino arduino-core
Is this something you are looking for ?

Related

Installing a headless VNC server on Bananian?

I started this project with a Raspberry Pi, but realized that the Banana's hardware set is a much better fit for what I'm doing. Unfortunately, it appears that, even though LeMaker (the group behind the BPi) offers just about every OS imaginable pre-optimized for the Banana, only Bananian supports all the hardware that I need, and it doesn't come with a GUI of any kind.
So, given a Debian-derivative on an ARM chip that will never see a physical display and has root SSH functional by default, how can I make it boot to an auto-logged-in VNC server?
Here's what I've done so far, as root over SSH:
# bananian-config
# bananian-update
# apt-get update
# apt-get upgrade
# adduser pi
# passwd root
# apt-get install task-lxde-desktop
(the first two are announced in the SSH welcome message and are used to initially setup the generic image for this variation of the board)
Then I uncommented these lines in /etc/lightdm/lightdm.conf:
autologin-user=pi
autologin-user-timeout=0
[VNCServer]
enabled=true
command=Xvnc
port=5900
width=1024
height=768
depth=8
At this point, I rebooted and tried to connect with VNC, but the client gave the same error as when the server doesn't exist. SSH still works as root and now the "pi" user also, except that the "pi" user doesn't know sudo.
At this point, I'm lost. I don't know if there's a desktop waiting for me on the HDMI plug or not, or whether I need an explicit VNC server like x11vnc or tightvnc, or if there's something else wrong.
This is all I've done so far. I can re-flash the image if needed; I want to make this part work before adding anything project-specific.
Okay, I noticed in LeMaker's own instructions to make Wifi work that they included Android and Lubuntu too, and that someone on their forum had made VNC work on Lubuntu. I didn't see before that some other OS's would support the WiFi chip.
So I switched to Lubuntu, which already has a working desktop, installed x11vnc per its instructions, and it basically just worked.
Then I backed up the SD card and spent all of Saturday trying different ways to make it a WiFi access point, which usually resulted in kicking myself out and restoring the backup to try again. And finally that works too. So I backed up the card again and now I can work on the real functionality.

LittleBits Arduino doesn't work on Linux

I recently received a LittleBits Arduino Coding Kit and thought the Arduino IDE would immediately recognize it.
I noticed that when I choose the "Arduino Leonardo" on the Tools -> Board as the instruction video said to do, the Tools -> Serial Port menu is grayed out.
I have already added myself to the "dialout" and "uucp" groups, ran the "arduino" program as root, ran a whole bunch of commands dealing with permissions, restarted the computer, plugged it into all the ports, reinstalled the drivers, and tried everything else I came across. For some reason, I can't figure out how to get this to work.
I use Xubuntu on an i686 architecture by the way, if that even matters.
I think you don't have permissions to read/write the serial port device. Even running Arduino application as root, it's running on a Java JVM, and calls other programs to compile sketches and burn the board... it's hard to figure out what's happening in the background. Also, is not a good idea to run programs as roout unless necessary.
Try this. First list your serial port devices.
ls -l /dev/tty*
There's should be one called /dev/ttyUSB0 or /dev/ttyACM0 or something like that (not /dev/ttySx). That one is your Arduino. Add read/write permissions for every user to that device file.
sudo chmod 666 /dev/ttyUSB0
Use the device you have. Now run the Arduino IDE, if the issue is with permissions, then it's done. Unfortunately, you'll have to do this every time you unplug the board or reboot the system.

Creating a interface for Apt-Get - Where start?

How to create a interface for Apt-Get?
Hi people,
I'm a Java programmer and a new Ubuntu user. I'm some confused about how Ubuntu works (packages, apt-get, etc.) and I hope you can help me.
I want understand how Ubuntu works (for developers) and in future I want help open-source projects and Ubuntu development. For that, I need start from some way, so I proposed a thing to myself: I will do a little interface for apt-get command in a week. I want create a software (please, don't Java) that downloads and install a software for the user, with a graphical interface. But, as a new user, I really don't know where to start.
Almost forget, don't want code, want instructions.
How I can make a script/software that uses apt-get to download and install some software? (I need use Shell Script, a library for the language that I want develop, etc.?) What I must learn first?
After create this software/script, how I can create a graphical interface for this software? I heard something about "QT+", but I really don't know if I need use this.
Well, I think that's all. Hope you can help a Java programmer be introduced to open-source world :)
An easy way to get started would be to build on top of python-apt, which provides an easy to use, object oriented interface to libapt.
For Qt, there are two bindings, PyQt and Pyside, which are pretty much equivalent and interchangeable (code written for the one in most cases just requires to change the imports to make it run with the other).
I think you should start with gtk3(gui tool) based on c++ as it is more close to java and c for interface and you could use something like 'system' a linux function in it to execute commands of apt-get. As gtk is so called open source in which you are interested in and ubuntu depends on it mostly. All the best for interface

How to start off with a embedded linux development environment

I come from a windows background and i am proficient with the .net platform. For work, i need to bring up a custom embedded system platform. We have bought the pandaboard ES as the test platform. The application is to stream images over the wifi. If you think about it, we are building something similar to a netgear router - the only difference being when you log into the device it serves images.
Because my background is in windows i am not quite sure how to start off with embedded linux development. in reading through various sites i have come to the conclusion that going to linux as development host is the best option.
Can some one point to me in the right direction regarding the set up. I have a windows machine that will be used for development purposes. I can either do a virtual box or setup a partition for linux. But the finer details are what throwing me off..what i need to know is
1) once i install linux what other software do I need - Code blocks,
2) what about toolchain
3) How to debug - through serial port ?
4) Is there a way to send the image built directly to the CF card?
Thanks
i suggest you to install linux on your desktop or laptop, perhaps
In a virtual machine.
Then, learn to compile on the command line (the order of program arguments to gcc is important).
Start an editor like emacs. Take half an hour to follow its tutorial.
Edit the helloworld.c file.
Compile it with
gcc -Wall -g helloworld.c -o hello
Improve it till no warnings are given.
Use
./hello
To run it.
Learn to use make with your own Makefile.
Use a version control system like git.
Learn to use cross compilation tools.
addenda
See also my answer here and also this answer.
Cross-building is not very different from native Linux building, except for the names of the cross-compilation tools.
But my feeling is that installing Linux and learning to develop Linux applications on Linux will teach you a lot of skills necessary for cross-development targeted for embedded Linux systems. So read material about Advanved Linux Programming and Advanced Unix Programming.
Remote debugging thru the serial port should be possible.

Programming to different installation types of Ubuntu

I'm studying for a CS degree, and I need to install Ubuntu for a computer systems class. We are going to do low level Assembly optimizations and stuff like that, so they don't want us to install it in a VMware.
Now, I don't want to do a regular dual-boot install, because I've already done it on my previous computer a couple of years ago, and wrecked my hard-disc with the partitioning. Wikipedia says you can use Wubi to boot Ubuntu from ISO, or install it to a flash drive and boot it from there, and then thus remove the need for partitioning.
Now, my question is - how different it is to program for Ubuntu booted from a regular hard-disc partition, from a Wubi ISO, and from an SD card? I guess the programs will work the same on all options, but we're going to do play with low level Assembly optimizations - can I expect to face any difference in that department?
I'm not sure I'd go this route if it were me personally.
You should be fine in terms of whatever bare metal type stuff you want to do -- you're working with memory, the cache, the chip, etc, so your disk drive shouldn't matter (unless you're doing stuff to the filesystem or something).
Where I think you might get annoyed is the logistics of setting up your development environment. Everytime you boot from your USB stick, you're going to need to sudo apt-get GCC, scite, et. al, load your files on into directories that you want, and then get started. That's a hassle. You could optimize this somewhat by creating a custom ISO of your environment using some kind of tool (you might be able to do it with Clonezilla), but still.. yuck.
I would suggest (speaking of Clonezilla) that you snapshot your hard drive, go ahead and install dual booting with Ubuntu, and then you have a backup if anything goes wrong. Or, I'd think you could get by using the school's machines. Don't they have any Linux boxes that you can ssh into, if not use in labs?
Anyway, good luck. :)

Resources