Homepage Wiki Forum Buy

Gnublin on Linux

From GNUBLIN

Contents


Introduction

There are many different terminal programs avialable for Linux, in this article we will explain the following two of them:

  • picocom (terminal application)
  • gtkterm (GUI application)

picocom (terminal application)

You can get picocom either with your package management software or by typing the following command into your terminal:

sudo apt-get install picocom

Now if you want to connect to your GNUBLIN, you must set two parameters for picocom:

  • Baud rate
  • Device which you want to use

In most cases the device will be /dev/ttyUSB0 but it's also possible that the number 0 differs. For example ttyUSB1

If you want to know which device is the right one, just type the following command into your terminal after you have plugged in the Gnublin board:

dmesg

Now have a look for the following line:

...
[ 4073.033436] usb 3-1.4: cp210x converter now attached to ttyUSB0
...

There are two different ways to connect to your GNUBLIN. The first one is with root-privileges (quick and easy) and the second one is with normal user rights (more difficult but safer):

Picocom with root-privileges

The device file can not be opened as normal user, so the easiest way is to just open picocom with root-privileges:

sudo picocom -b 115200 /dev/ttyUSB0

The parameter -b 115200 configures a baud rate of 115200 bit/s.

If the terminal is started, usually come a couple of boot messages. If you see anything, just press ENTER once, then the login should appear:

gnublin login:

To exit the terminal you can use the keyboard shortcuts:

ctrl + a + x
ctrl + a + q

Picocom as normal user

Another way to start picocom is to add the normal user to the group of the device. Then you will not need root-privileges to use picocom.

Add the user to the group

You only have to do step 1 until 4 once. After this you can use picocom always as a normal user.

1. Check in which group the device is:

ls -l /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Feb 8 15:38 /dev/ttyUSB0

You can see that the device ttyUSB0 is in the group dialout

2. Add the normal user to the group dialout:

sudo adduser <USER> dialout

You have to enter your user name instead of <USER>.

3. You have to log out and on again that the changes to the group will have an effect.

4. Check the groups of your user:

id -n -G
... adm dialout cdrom sudo ...

Now you will see that you are also a member of the group dialout

start picocom

now you can start picocom with the following command (notice that you don't need sudo anymore):

picocom -b 115200 /dev/ttyUSB0

The parameters meaning is described above.

If the terminal is started, usually come a couple of boot messages. If you see anything, just press ENTER once, then the login should appear:

gnublin login:

To exit the terminal you can use the keyboard shortcuts:

ctrl + a + x
ctrl + a + q


gtkterm (GUI application)

You can get gtkterm either with your package management software or by typing the following command into your terminal:

sudo apt-get install gtkterm

Now you can start gtkterm and configure your port to /dev/ttyUSB0 under configuration -> port and your baud rate to 115200.

Gtk term.png

Now you can go on to your first example application here.

In other languages