Skip to content
Aron Kisdi edited this page Mar 1, 2018 · 3 revisions

Linckia board on the Surveyor Rover

The Surveyor Rover kit is available for purchase from Active Robots and it uses the Linckia Robot controller board. While basic functionality is accessible to anyone via the integrated web GUI the kit is intended for the advanced user who explored the basics of using linux, coding and networking with other computers such as the Raspberry Pi.

Linckia board

The Linckia robot controller board is a very small board with a lot of built in functionality. It can be used right out of the box with a many different types of robots, but this page mainly discusses it uses with the Surveyor Rover kit.

The Surveyor Rover comes with the Linckia v5.0 Controller

  • Carambola2 wifi enabled processor, featuring a Qualcomm/Atheros AR9331 SoC @400MHz
  • OpenWRT linux kernel
  • Custom easy access control GUI
  • Leonardo compatible Arduino, with ATMEGA32U4
  • 4 Port Powered USB Hub, 3 available for expansion use
  • 1S Lithium Battery Charger, with reverse polarity protection
  • 2-5v Power Management
  • 4 DC Motor Drivers, 1.5A per 2 Channels, can be paired and used as 2 Stepper Motor Controllers
  • 3 PWM outputs, usable as Servo Control Outputs
  • 6 Analog Inputs, optional self-battery monitoring
  • 2 Serial Ports
  • 1 I2C
  • Self-reset and On/Off switch
  • 3 LEDs
  • 5v and 3.3v Outputs

Linckia Software

As well as the easy to use gui, the Linckia controller board can be used with the Robot Operating System, ROS!

The code needed is available on github.

Open Source

All the code is free and open source! To get involved visit the github page.

Safety warnings

The Linckia board has a lot of pins close to one another. If the board is dropped on metallic surface or loose wires short two pins together it is possible to damage the board. We recommend always fixing the board to a robot or another casing and connecting all other wires before putting in the batteries even when the switch is off. When modifying hardware always disconnect the battery first. Note how ground pins are always toward the edge of the board.

First time setup

The image above show the Linckia robot controller board version 1.063. To power it the switch and the battery needs to be connected. The ground (negative) line from the battery should be wired to the pin towards the edge of the board. The board has reverse voltage protection that protects the chips getting damaged. Instead of the battery a power supply can be used on the battery pins (recommended) or on the pins labeled raw. Please do not exceed 5 V when using a power supply (recommended 4.5V, absolute maximum 6V). It is recommended not to use less than 2.5V. There is an optional LED output from the two pins next to the switch however there is a built in blue LED that will turn on (solid) less than a second after the switch has been turned on and will start flashing in a heartbeat pattern once the board is booted. Next to the switch there are two pins that are raw power from battery (ground towards the edge of the board). In the block of pins next to it there is SERIAL1 and SERIAL2 (discussed later under Serial access) and 3 servo outputs that will be used for the arm add-on but it can be used for standard servos. Alternatively the pins can be used as PWM output. Note that the pins are arranged in servo connector layout, each row of 3 perpendicular to the boards edge, ground towards the edge of the board, positive line in the middle and pwm signal towards the inside of the board. The 4 DC motor output (can also be used as 2 stepper output) is following 8 pins. Each channel for a DC motor is 2 pins with Channel 1 being closest to the servo outputs. For basic control in the GUI channel 1 and 3 are the same and channel 2 and 4 are the same. We recommend connecting the motors in the Surveyor rover to channel 1 and channel 4. 6 analog inputs and JTAG programmer will be discussed later. Additionally there is a micro USB connector for battery charging and a 5V and 3.3V power output in between the two USB ports.

Web GUI

To start the web GUI connect to the robot with any device, open an internet browser and type http://robot in the address bar. The http:// is necessary only in some browsers that uses the address bar for quick search as well. Alternatively you can use the ip address 192.168.1.1 in the browser's address bar. By default there is no password and you can click "Login" without adding a password. Password is necessary for SSH access, and it is recommended to set a password by clicking on Go to password configuration.... Please be aware there is no easy way to recover forgotten passwords. If you don't need security but want to use ssh just set the password to "robot" then this page will remind you what your password is.

SSH access

On windows Putty can be used for SSH access. Once a password is set, connect to the robot with wireless, open putty and type the word "robot" in the Host Name field. Leave all other settings on their default value and click open. On the first connection you will be prompted to add the key to your computer, select yes to remember the robot.

Serial access

For the advanced user there is a serial interface to the Carambola 2 on board, labelled as serial 1. To access this a USB to serial cable is needed which is at 3.3V (generally marked as TTL-232R-3V3). Only 3 wires from the serial cable need to be connected: yellow and orange to the serial pins and black to any ground pin. Observing the label "SERIAL1" Yellow cable should go on the side of the "S" and orange cable should go on the side of "1". Putty can be used to open a serial terminal. Serial line should be the COM port from Device Manger of the usb to serial converter and Speed is the baud rate which is 115200 for the Carambola 2. When during the device on with serial cable connected the boot sequence can be observed and once initialisation is complete the terminal can be activated by pressing any key. If there is no coherent output, the yellow and orange cables might need to be swapped. Using such a serial cable means that the board can be accessed without password even when networking is off. You can always reset the board with the command "firstboot" selecting yes, followed by "reboot" SERIAL2 is the serial pin on the built in microcontroller that can also be used as I2C. It can be used to communicate with the microcontroller directly, or attach sensors or other serial devices.

JTAG programmer

Even though avrdude is installed on the default image it is not possible to program the microcontroller due to a hardware problem with the Broadcom chip. The only way to upgrade the microcontroller is to use the JTAG header. The microcontroller uses the Arduino Leonardo firmware. Programmers such as AVRISP mkII are available from various shops. The Arduino IDE can be used to upload the new firmware by holding down the SHIFT key and pressing the upload button. Only Arduino IDE 1.0.6 has been tested and thus it is recommended to use that version and not the most recent 1.6.X version.

Settings

Most setting will be available from the settings GUI page in the web interface in future updates. However for early releases of the robot software some of the settings need to be changed manually via ssh access, or with OpenWRT luci interface. Please look at the settings page on your robot for the most up to date instructions.

Camera

The webcam included in the kit does not support on board jpge compression therefore mjpg-streamer uses the CPU to do the compression. The resolution and frame-rate is lower than it would be with some other cameras that support on board compression. An easy upgrade is to use a camera that supports on-board compression, we recommend the Microsoft Lifecam Cinema. To use such a camera mjpg-streamer settings need to be changed. SSH on to the board, open /etc/config/mjpg-streamer with vi editor. Under option yuv change 'true' to 'false' or delete the line. You can also change resolution and fps (frame per second) options to higher values. You will need to restart the service with /etc/init.d/mjpg-streamer restart command. Try a few options to find the best performance.

Programming the robot

The software on board is modular and there are many ways to build on the existing modules. The core is a python server that can receive commands (e.g.: #set(1,255) set pwm out to maximum or #get(1) read analog 1) and sent them on the serial line to the microcontroller. This server can be accessed directly using sockets. Alternatively there is postman.py and receiver.py that can access the webserver and use files on board as a buffer. User code can also write and read these files to control the robot. The files are /tmp/command for commands and /tmp/data for feedback.

Web GUI

There is a built in editor (using Ace) that can be used to change and run the on board script /home/user-script.py. This editor has syntax highlighting for python and the script will be run using python 2.7 that is on board. In future updates there are plans to improve this editor so multiple files can be edited. Currently "import robot" has to be present in every scirpt unless you implement socket control within your script. Basic functions can be found in /home/robot.py, or un github in robot.py under python directory.

Know Bugs

In the initial release the web editor cannot send apostrophes (this character '). Please use quotation mark (this character ") instead!

On board editor

ith ssh access you can use vi on board. For example use vi /home/user-script.py. You can find guides for vi editor online, simple usage: Move to desired location using arrow keys. Press a to append text, in append mode you can also use backspace, delete to delete characters and enter to add new lines. You cannot delete a line in append mode. When done press Escape to exit append mode. You can delete lines with pressing dd (d key twice). Type :x and press enter to exit with saving changes.

Upgrading firmware

The easiest way to upgrade the firmware is to download the latest pre-built image and use the web interface to upload and install the new firmware.

For other methods a USB flash drive is needed. Download the latest image and copy it to a flash drive. When upgrading from firmware 1.1 or newer simply plug in the flash drive then turn the Linckia on.

When upgrading from older versions ssh access or a serial cable is needed for serial terminal access to the Carambola 2 on board. Plug in the flash drive, then execute the following commands: mkdir /mnt/usb mount /dev/sda1 /mnt/usb cp /mnt/usb/openwrt-ar71xx-generic-carambola2-squashfs-sysupgrade.bin /tmp/ sysupgrade -n /tmp/openwrt-ar71xx-generic-carambola2-squashfs-sysupgrade.bin

Do not power off until reboot is complete.

Building your own image

Instructions on how to build a new image can be found on the 8devices wiki page. The files folder in the build directory should be populated with the files from the Linckia git repository. Please refer to the README files to create the required folder structure.

Recovery

In case something went wrong during flashing the Carambola2 firmware (e.g.: power got accidentally disconnected, usb drive flash got corrupted) and the Carambola2 doesn't load properly anymore there is a way to recover the firmware. Follow the steps:

  1.  Connect the Linckia to a power supply
    
  2.  Connect the USB to TTL Cable to a windows PC and the Linckia
    
  3. Install and run ExtraPutty on windows PC
  4. Connect to Serial interface from ExtraPutty (COM port number can be found in Device Manager) baud rate is 115200
  5. Turn on power supply
  6. Press [ESC] when prompted to remain in bootloader UBoot. Console should have ar7240> in the beginning
  7. Type following in ExtraPutty ar7240> loady 80060000
  8. In ExtraPutty click on "File Transfer" menu, select "Ymodem" and "Send". Browse and select the Firmware file for the Carambola2. Wait until transfer finishes. Note this may take some time.
  9. Type following ar7240> erase 9f050000 +${filesize} ar7240> cp.b 80060000 9f050000 ${filesize} ar7240> setenv bootcmd 'bootm 9f050000' ar7240> saveenv ar7240> boot
  10. Done, board should boot into new firmware

Adding hardware

More analog sensors can be added using the analog pins. More devices can be added using USB ports, serial, I2C and wireless. Ethernet connection is possible with 12V level converter. More information on how to integrate your devices will be added to this site, please check back later.