Documentation

Luos Robotics documentation

Modules: Boards: >> A question? Ask us on the forum

Luos documentation >> Board >> Power pi

Last update: 15 March 2019


How to start with the Power Pi board

Default Alias: Gate

Type: Gate

Number of module(s): 1

Image

Power Pi

Categories

Communication Cognition Power

How to use Power Pi board

The Power Pi board links any Raspberry Pi-like board to a Luos network. This board allows you to convert the Luos network power into 5V and up to 2A in order to power your Raspberry Pi or Odroid without any other power source. This board hosts a Gate module allowing to your Raspberry Pi to control your entire Luos network using Pyluos or any other language as a single system image. The Power Pi board supports 5V to 24V DC input.

Connection of Power Pi board to a Raspberry Pi

The connection of the Power Pi board to an ODrive board or to a Raspberry Pi board is made according to the following images.

Warning: Warning: Be sure to plug the board on the right pins of the Raspberry Pi, and facing the right side. A bad connection may damage both boards.


Plug location
Red rectangles show where to plug the Power Pi board on an ODrive board (left) and on a Raspberry Pi board (right).

Preview
On the left, a Power Pi board connected to an ODrive board; on the right, a Power Pi board connected to a Raspberry Pi board.

How to easily start to create your code using this board

Coding on a Raspberry Pi in a robot can be quite boring. Generally, you can’t connect any screen and keyboard to work properly. That’s why we created a small piece of code allowing to convert the Gate module stream into Web Socket messages. By using this Web Socket, you can connect pyluos or any other lib you created to your Raspberry Pi. This way you can create and execute your robot behavior directly on your computer. When your behavior is complete and tested on your robot, you just have to copy it into your Raspberry Pi to obtain an autonomous robot.

To setup this pipe on your Raspberry Pi, please follow the tutorial on our forum.

How to setup your Power Pi’s Gate

You need to setup the Power Pi board before to start using it.

First, you have to connect your Raspberry Pi to the Gate network.

Several solution exist to configure the Raspberry Pi’s Gate, we provide you with two of them according to your setup:

First solution: with a computer and the Raspberry Pi’s SD card

You will need the following parts:

Plug the micro SD card to the micro-SD-to-SD adapter, and plug it to your computer. Ignore the messages that ask you if you want to format, and locate the SD card directory, named Boot. In Windows, it appears as a drive; in MacOS or Linux, go to

cd /Volumes/boot

Create a new file in this directory called wpa_supplicant.conf. The file should contain the following code:

country=fr
update_config=1
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

network={
 scan_ssid=1
 ssid="SSID-Internet-box"
 psk="Secured-key"
}

Choose the country according to where you live, and replace SSID-Internet-box by the SSID of your internet device, and Secured-key by the password.

Save the file and eject the SD card. Replace it into the Raspberry Pi’s slot.

The Raspberry Pi can be located with the expression raspberrypi.local, thanks to the software Bonjour.

Second solution: with a screen and a keyboard

Raspberry-Pi connection

In order to establish a connection, you will need:

Plug all these elements and the Power Pi board on your Raspberry Pi (do not plug anything to the Power Pi board), and power it up. You should see on the screen the boot sequence and the file system expanding. After a few seconds, you should have a prompt asking you for username and password.

Usually, the Raspberry Pi has the default Raspberry username and password:

Username: pi
Password: raspberry

As you can see at the bottom of the boot screen, the SSH port is now open, so you should start by changing the password of your board to avoid any security issue.

To do that, use the following command:

sudo raspi-config

Choose option 1 to change your password and hostname, and choose option 2 to connect your board to your wifi.

You can check your Gate connection and retrieve the IP address using

ifconfig

and halt your system using

sudo halt

Your raspberry is now ready to be used, you can start setting your Luos network up.

Warning: The Power Pi board doesn’t belong to the Power category. Using the power input of your Raspberry Pi doesn’t allow you to supply the others boards in the Luos network. In order to make it work properly, please use a power board on your system.

How to use your Power Pi board

Power

Please note that the Power Pi board connected to the Raspberry Pi is already powered by the Luos network, through the power boards you use (Power board or Battery board).

However, the USB board can’t power the Raspberry Pi board, because several voltage transformations are applied along the network. You can also use an universal power supply (+5.1V micro USB) directly plugged to the Raspberry Pi.

Communication mode

By default, your Raspberry Pi starts a Luos service at boot called pyluos-usb2ws. This service creates a pipe between a websocket opened on port 9342, and the Luos system. If you send standard Luos Json data into this web socket, it’s directly sent into the Luos network.

This way, you can control your robot from your computer even if it is moving or dispatched. For example, if you are using pyluos to control your robot, you can start your program with:

from pyluos import Robot
robot = Robot("raspberrypi.local")
robot.modules

In this example, you can replace raspberrypi.local by your Raspberry Pi’s IP or hostname.

You should see the list of modules connected to the Power Pi board.

Cognition mode

Also, you can use your Raspberry Pi like an embedded computer for your robot.

To send your Json data to your network, please use the serial port /dev/ttyAMA0 of your Raspberry Pi, as you can do it with the USB board.




<< Back to luos-robotics.com