Development on BBB with 4D systems 4.3"LCD Cape using Cloud9

Hi all,

First off, I’m a newbe to the BBB, and more familiar with electronic hardware than software programming but thought I would give it a go.

I have a BBB which I have updated with the latest Software BBB-eMMC-flasher-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img.xz

I would like to develop an application on the BBB with a 4D Systems 4.3" LCD Cape. Part number 4DCAPE-43T which will run a simple GUI to control a VSD and motor.

Having connected the display which works perfectly, and downloaded the USB drivers I’m able to connect to the BBB and view its webpage. Found the IDE which is loaded onto the Debian image called Cloud9 and decided to give this a go.
All was going well, using the example python programs, making changes and by simply hitting the RUN button it would flash LED’s on the GPIO ports etc - no problem I thought “this is the easiest development board I have played with in a long while”

I began to read up on a suitable GUI to use and for starters decided to try TKinter. having downloaded a few sample pieces of code I have hit a problem.

If I try to run any code from Cloud9 which references TKinter, it will come up with the following problem, I have copied the sample code as well.

Program******************************************

import Tkinter as tk

counter = 0
def counter_label(label):
counter = 0
def count():
global counter
counter += 1
label.config(text=str(counter))
label.after(1000, count)
count()

root = tk.Tk()
root.title(“Counting Seconds”)
label = tk.Label(root, fg=“dark green”)
label.pack()
counter_label(label)
button = tk.Button(root, text=‘Stop’, width=25, command=root.destroy)
button.pack()
root.mainloop()

Cload9 terminal output******************************

Traceback (most recent call last):
File “/var/lib/cloud9/examples/blink.py”, line 14, in
root = tk.Tk()
File “/usr/lib/python2.7/lib-tk/Tkinter.py”, line 1712, in init
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable

I have found a work around, which is to write the code in Cloud9 as usual, it will flash up that it has saved all the changes automatically, then using a keyboard plugged directly into the BBB and a terminal open on the LCD cape, I can run the code directly on the BBB and it will work fine.
If I have to, I will continue to develop my project like this, as I’ve had to do much worst in the past on other boards!! but I’m sure that there must be an easy fix to this so I don’t need the extra keyboard attached to the BBB. it would also increase my “code/run/fix” cycle.

Another option would be to develop directly on the BBB. Can I run a HDMI monitor from the BBB at the same time as the LCD cape? (its too small a screen to develop anything on the LCD cape itself)

Any help would be much appreciated

Steve.

Hi Steve,
I have the same problem with my BBB and 4DCAPE-70T. Initially my BBB came with Debian 3.8.13 bone47. I have a GUI program that I developed on a PC and then moved it to the BBB where it worked fine with the 4DCAPE, no errors at all. The GUI has a animated graph along with buttons and text entry and display boxes. However I was trying to use the Adafruit BBIO for a PWM output and ADC inputs and was having trouble getting that to work, so I installed newer Debian distros and now am using the Debian 3.8.13 bone50 distro. Now I cannot run the simplest graph such as shown by Sendex (https://pythonprogramming.net/matplotlib-intro-tutorial/), getting the tcl no $DISPLAY error like you.

I don’t know if the newer distro is the problem or possibly I am making some mistakes in the installation of matplotlib etc.

Have you figured out a solution to the no $DISPLAY error?

I haven’t tried connecting a keyboard and mouse to the BBB, since the BBB and 4DCAPE once worked fine without the kbd and mouse attached but I will do so now.

Please let me know if you have a solution.
Thanks,
John