Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Using the Menu System

Lawrie Griffiths
Attachments
system.png (1777 bytes)
program.png (1875 bytes)
filelist.png (1490 bytes)
wifi.png (1717 bytes)
version.png (1771 bytes)
sound.png (1713 bytes)
files.png (1737 bytes)
samples.png (1798 bytes)
bluetooth.png (1764 bytes)
rundefault.png (1798 bytes)

Using the Menu System


When you start the EV3 with a leJOS SD card in the card reader, the Start-up Menu Java program runs automatically:

The first screen you see is the Run Default screen:

There are a set of top-level menu items that you navigate between using the Left and Right keys. To select a menu item press Enter. To go back to the top-level menu screen, press the Escape key. When a top-level screen is displayed, Escape will prompt you to shut down the EV3.

As well as showing a specific menu item (such as Run Default), the menu also displays your EV£ name (default "EV3"), the battery level and the IP addresses of the device. The top IP address is used for USB and Bluetooth connections, and the bottom one (if present), for Wifi connections.

The Run Default Screen:

Pressing ENTER on the Run Default screen will run your default program if you have one. See below for how to select a default program. If there is no default program a message saying "No default set" will be displayed for a few seconds.

The Files Screen:

When you press ENTER when the Files menu item is displayed, you will see the Files screen:

The files screen shows a list of programs and other files in the /home/lejos/programs directory on the EV3. This directory usually contains runnable jar files containing Java programs, but can also hold other files such as .wav files to play sounds.

You can navigate through the files using the Left and Right keys and select a file using the Enter key.

When you select a file, the File screen will be shown. This gives a set of options, depending on the type of file:

The options for a jar file are:

  • Execute Program
  • LCD Debug
  • Debug Program
  • Set as Default
  • Delete File

Selecting "Execute Program" runs the program. The menu program will suspend, clear the LCD screen and run the jar file, when the program finishes, control will return to the menu. You can abort the program at any time by pressing Enter+Down.

LCD Debug is the same as "Execute Program" except that System.out and System.err output will be sent to the LCD screen, causing it to scroll when the screen is full. By default System.out and System.err is discarded, but you can capture it remotely by running one of the tools on your PC. EV3Control, EV3Console, and EV3ConsoleViewer will all display System.out and System.err output.

Select "Debug Program" starts the program in debug mode using port 8000. You can connect to it from Eclipse using Eclipse remote debugging.

If you select "Set Default", your program becomes the default program and can be run from the "Run defaults" screen. You can also set the Auto Run option from the System Menu. If you do that, the default program will run automatically instead of the menu program, when you start the EV3. When it finishes, you will return to the menu. It can be aborted by Enter_Down as usual.

The last option is to delete the jar file from the /home/lejos/programs directory and from the files list.

If the file you select is not a program file, you have fewer options. All files can be deleted. Sound files (.wav) can be played. only 8-bit wave files are supported.

The samples screen:

The Bluetooth screen:

The Wifi screen:

The Sound screen:

The System screen:

The Version screen:

Other menu features:

The menu also provides several services for you in the background.

  • Getting the time from a network time server
  • Supporting device discovery
  • Acting as a Java RMI registry
  • Supporting remote console and remote LCD access
  • Supporting remote menu commands via object streams (for systems that don't support RMI)
  • A local command line control interface

If you shut down the menu, you lose these services.

The time is obtained once at start-up from an ntp server that can be configured in the System menu. It sets the local clock.

The id of the device is broadcast every two seconds on UDP port 3016. This is used by the PC tools to find EV3 devices.

The menu supports Java RMI objects RemoteMenu and RemoteEV3 which are used by the tools, but can also be used by user programs.

If a client connects to the menu on port 8001, it is send the System.out and System.err output from running programs, and it is periodically send images of the LCD screen. This is used by EV£Console and similar PC tools.

Android does not support RMI, so the RemoteMenu features are also supported by direct use of java object streams. This is used by the Android sample app in the git repository. RemoteEV3 features ae not tey supported.

If you create a fifo called menufifo in /home/root/lejos/bin/utils you can send single character commands to the menu from the command line. Currently only s for suspend and r for resume are support.

The menu