Computing stuff tied to the physical world

DIJN.07 – Attach a JeeLink to the RPi

In Uncategorized on Feb 14, 2013 at 00:01

Welcome to the seventh instalment of Dive Into JeeNodes. Hello RPi, meet the JeeLink!

With all the RPi setup out of the way, it’s time to hook it up to the hardware. Fortunately, most of the essential ingredients are already included in the RPi. The JeeLink is based on an FTDI chip, for which the driver will be auto-loaded by Linux when it’s plugged in.

Proceed as follows:

  1. Plug the JeeLink in one of the two USB ports on the RPi.
  2. Type the following command in Linux: dmesg | tail -20

You’ll get something like this:

Screen Shot 2013-02-10 at 10.41.26

This is the kernel log, reporting that it has recognised the inserted USB device, has loaded a kernel driver for it, and has created a new serial “device” in Linux, called “/dev/ttyUSB0″.

We’re connected!

There are many ways to communicate with the JeeLink. Here’s a quick check that it works:

  • Enter the command: stty 57600 raw -echo </dev/ttyUSB0
  • Then enter the command: cat </dev/ttyUSB0

This sets up the serial ports and shows what is coming in. This is what I get:

Screen Shot 2013-02-10 at 10.50.33

Yippie! The JeeLink has restarted and shown its usual greeting, and is reporting incoming packets. You can hit CTRL+c to stop the process.

The above commands are sufficient to prove that things work, but not convenient. For that, we need to install a serial terminal emulator. There are two we can use, minicom or screen:

  • For minicom, install it with this command: sudo apt-get install minicom
  • To launch minicom, type: minicom -b 57600 -o -D /dev/ttyUSB0
  • For a help page in minicom, type: CTRL+a, then z
  • To exit and close the connection in minicom, type: CTRL+a, then q

I tend to prefer screen, mostly because I’m used to it:

  • For screen, install it with this command: sudo apt-get install screen
  • To launch screen, type: screen /dev/ttyUSB0 57600
  • For a help page in screen, type: CTRL+a, then ?
  • To exit and close the connection in screen, type: CTRL+a, then \

At this point, all the hardware, all the connections, and all the wireless communication are now known to work. All that remains, is to set up the HouseMon server on the RPi and to connect the light sensor.


(This series of posts is also available from the Dive Into JeeNodes page on the Café wiki.)

PS. There may be a potential issue with the FTDI driver on RPi. Will need to test this later.

  1. Is there a reason not to use serial connection?

    • I wanted to try a ready-made solution first. It’s an obvious next variation to work out and document. But yes, there is a reason – I’m considering using the JeeLink as JeeBoot server – its on-board dataflash memory is very convenient for this purpose.

  2. The issue with the FTDI driver you mention makes my RPi crash every few hours. There is a temporary solution (reduce the bus speed to USB1.1 speeds), but because the ethernet chipset on de RPi uses USB it will be slowed down.

  3. I did update my RPi, but a few weeks ago. Maybe(hopefully) they fixed the issue in the meanwhile.

  4. I encourage you to give picocom a try — much more streamlined than minicom and has some handy features for toggling DTR, etc.

  5. For a GUI app i like Putty – it looks 99% the same on Win & Linux For cmd-line i’m like JC .. use minicom

  6. Hi,

    I tend to prefer picocom over minicom because picocom lighter and I prefer picocom over screen because screen configuration requires some magic powers :D

    Anyone of the three will do the job.

    Nice post, thanks.

Comments are closed.