General
- URVEPi Compatible Shields
- URVEPi Troubleshooting
- URVEPi Tips&Tricks
- How to use SPI
- How to use SDL2 on URVEPi
- How to use I2C
- Connecting to URVEPi Debug UART
URVEPi Compatible Shields
Raspbery Pi PoE HAT
Raspbery Pi PoE HAT works out of the box. However, it requires 16mm standoffs for proper installation. You can easily purchase the necessary standoff set by searching the internet for "Raspberry Pi Standoff Set - 16mm". It is recommended to use these standoffs to ensure a secure and stable mounting of the PoE HAT on your Raspberry Pi board.
- Standard: IEEE 802.3at-2009 PoE
- Input voltage: 37-57 V DC, Class 4 device
- Output power: 5 V DC/4 A
- Cooling: 25 mm × 25 mm brushless fan delivering 2.2 CFM for processor cooling
- Features: fully isolated switched-mode power supply; fan control
- Operating temperature: 0 °C to +50 °C
https://www.raspberrypi.com/products/poe-plus-hat/
URVEPi Troubleshooting
Troubleshooting Tips for URVEPi's Disappearing Ethernet and Rebooting Issues.
If you are experiencing disappearing Ethernet or rebooting during heavy load on your URVEPi, it could be due to low power supply. This may happen when your URVEPi is not receiving enough power through the USB-C power cable. Here are a few steps you can try:
-
Connect your URVEPi to a different USB-C port on your PC. Sometimes, the USB-C port may not be providing sufficient power.
-
Try using a different USB-C power cable. The cable you are using may not be able to provide enough power to your URVEPi.
-
Connect your URVEPi to a power adapter. This will ensure that your URVEPi is getting enough power to function properly.
-
Check the power management settings on your PC. Sometimes, the PC may be set to conserve power, which can cause issues with the URVEPi. You may need to adjust the power settings to provide more power to your USB-C ports.
If none of these steps work, it is possible that there may be a hardware issue with your URVEPi, and you may need to contact the manufacturer for assistance.
URVEPi Tips&Tricks
Python and IDLE3 in URVEPi Debian 11
Python3 is installed by default. To install IDLE3 just type in terminal
apt install idle3
IDLE will show in Applications / Development menu.
Office in URVEPi Debian 11
LibreOffice can be easily installed via apt. To install IDLE3 just type in terminal
apt install libreoffice
All LibreOffice applications will show in Applications / Office menu.
How to install Arduino IDE in URVEPi Debian 11
Arduino IDE can be downloaded by apt . To install Arduino IDE just type in terminal:
apt install arduino
It will appear in Applications / Development. For newer versions of Arduino IDE, you need to download it manually from arduino.cc webpage. You can easily find how to on the Internet. Just remember to use Linux ARM 64 bits version.
Installing node.js, geany, thonny and Node-RED in URVEPi Debian 11
It's little tricky. You need to open terminal from Applications menu (for nvm you need to be local user):
$ sudo apt install python3-tk thonny geany # both will be available in Applications / Development
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
$ nvm install node # now we have npm
$ npm install -g --unsafe-perm node-red
$ node-red # this will run node-red, so you can run browser and go to localhost:1880
FTP server in URVEPi Debian 11
To install an FTP server, we can use VSFTPD which is set to read-only mode by default. To change it to read-write mode, follow these simple steps:
- Install VSFTPD using the command
apt install vsftpd
. - Edit the
/etc/vsftpd.conf
file and uncomment the linewrite_enable=YES
by removing the "#" symbol at the beginning. - Restart the VSFTPD service by running the commands
systemctl stop vsftpd
followed bysystemctl start vsftpd
.
apt install vsftpd
sed -i 's/#write_enable=YES/write_enable=YES/' /etc/vsftpd.conf
systemctl stop vsftpd
systemctl start vsftpd
CPU Utilization in URVEPi Debian 11
To show the CPU utilization, you can use the following simple steps:
- Install the
sysstat
package by running the commandapt install sysstat
. - Once installed, you can use the
mpstat
command to display CPU usage statistics for all processors on the system. - The
-P ALL
option shows the utilization of all available processors, and the1
option specifies the sampling interval in seconds. - Run the command
mpstat -P ALL 1
to continuously monitor the CPU utilization with a one-second interval.
apt install sysstat
mpstat -P ALL 1
Disabling screensaver and monitor sleeping in URVEPi Debian 11
You need to change settings in Power Manager / Display (Blank after to 0, Put to sleep after 0, Switch off after 0. You can do it manually from Desktop Preferences or with this one-liner:
echo '<?xml version="1.0" encoding="UTF-8"?>
<channel name="xfce4-power-manager" version="1.0">
<property name="xfce4-power-manager" type="empty">
<property name="power-button-action" type="empty"/>
<property name="brightness-switch-restore-on-exit" type="int" value="0"/>
<property name="brightness-switch" type="int" value="0"/>
<property name="dpms-enabled" type="bool" value="true"/>
<property name="blank-on-ac" type="int" value="0"/>
<property name="dpms-on-ac-sleep" type="uint" value="0"/>
<property name="dpms-on-ac-off" type="uint" value="0"/>
</property>
</channel>' > /home/linaro/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml
And reboot your URVEPi with reboot command from root user (sudo reboot)
Removing Rockchip and Google "bloatware" from URVEPi Android 12
Please check, if you do not need any app from this list. This commands should be executed after flashing URVEPi. WARNING : If you see "Welcome screen", you need to finish it before running this code. After executing you shoud reboot your URVEPi with "reboot" command.
pm disable-user --user 0 com.google.android.inputmethod.latin
pm disable-user --user 0 com.google.android.videos
pm disable-user --user 0 com.google.android.calendar
pm disable-user --user 0 com.google.android.gm
pm disable-user --user 0 com.google.android.apps.docs
pm disable-user --user 0 com.google.android.apps.photos
pm disable-user --user 0 com.google.android.apps.tachyon
pm disable-user --user 0 com.google.android.apps.youtube.music
pm disable-user --user 0 com.google.android.apps.messaging
pm disable-user --user 0 com.google.android.apps.docs
pm disable-user --user 0 com.google.android.apps.photos
pm disable-user --user 0 com.google.android.apps.tachyon
pm disable-user --user 0 com.google.android.apps.youtube.music
pm disable-user --user 0 com.google.android.apps.messaging
pm disable-user --user 0 com.android.camera2
pm disable-user --user 0 com.android.calendar
pm disable-user --user 0 com.android.contacts
pm disable-user --user 0 com.android.music
pm disable-user --user 0 com.android.vending
pm disable-user --user 0 com.android.gallery3d
pm disable-user --user 0 com.google.android.dialer
How to install VNC Server in URVEPi Debian 11
You need to download and configure the autostart feature of x11vnc using these commands:
sudo apt -y install x11vnc nano
sudo nano /lib/systemd/system/x11vnc.service
Now, paste this configuration and change 'urve' to a password of your choice:
[Unit]
Description=x11vnc service
After=display-manager.service network.target syslog.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -forever -display :0 -auth guess -passwd urve
ExecStop=/usr/bin/killall x11vnc
Restart=on-failure
[Install]
WantedBy=multi-user.target
Exit the nano editor and save the file by pressing 'Ctrl + x' and then 'y'. Afterwards, open a terminal and enter the following commands:
sudo systemctl daemon-reload
sudo systemctl enable x11vnc.service
sudo systemctl start x11vnc.service
sudo systemctl status x11vnc.service
● x11vnc.service - x11vnc service
Loaded: loaded (/lib/systemd/system/x11vnc.service; enabled; vendor preset>
Active: active (running) since Mon 2023-03-06 22:51:13 UTC; 3s ago
sudo reboot
You can connect to the URVEBoard using any VNC client, such as RealVNC. Simply enter the IP address or hostname of the board, followed by the port number that x11vnc is listening on, which is typically 5900. Once connected, you will be prompted to enter the password that you set earlier during editing of x11vnc.service file.
Rotating screen in URVEPi Debian 11
You should remember that it may result in slower performance and choppy animations or videos. This is because rotating the display requires additional processing power and resources.
DISPLAY=:0 xrandr --output HDMI-1 --rotate right
DISPLAY=:0 xrandr --output HDMI-1 --rotate left
DISPLAY=:0 xrandr --output HDMI-1 --rotate inverted
# back to normal
DISPLAY=:0 xrandr --output HDMI-1 --rotate normal
In some cases, it may be necessary to perform the rotation at the kernel/boot level rather than using the xrandr command. This can help improve performance and prevent issues with animations and videos.
How to edit kernel parameters (bootargs) in URVEPi Linux?
Boot parameters are defined in "kernel/arch/arm64/boot/dts/rockchip/rk3568-linux.dtsi" file (line 15)
chosen: chosen {
bootargs = "systemd.unified_cgroup_hierarchy=0 earlycon=uart8250,mmio32,0xfe660000 console=ttyFIQ0 root=PARTUUID=614e0000-0000 rw rootwait";
};
Let's say you need to force HDMI 1080p resolution, you can do it by adding video=HDMI-A-1:1920x1080@60:D to bootargs.
chosen: chosen {
bootargs = "systemd.unified_cgroup_hierarchy=0 earlycon=uart8250,mmio32,0xfe660000 video=HDMI-A-1:1920x1080@60:D console=ttyFIQ0 root=PARTUUID=614e0000-0000 rw rootwait";
};
After editing dtsi file, you need to recompile kernel
./build.sh kernel
and use new boot.img file from kernel directory, or just run our "urve_prepare.sh" script. Then everything you need will be in URVEPi-LinuxImages.zip.
To check if new bootargs are loaded you neet to see /proc/cmdline:
cat /proc/cmdline
storagemedia=emmc androidboot.storagemedia=emmc androidboot.mode=normal rw rootwait systemd.unified_cgroup_hierarchy=0 earlycon=uart8250,mmio32,0xfe660000 console=ttyFIQ0 root=PARTUUID=614e0000-0000
USB dongle / SD mounting for large Docker containers in URVEPi
As URVEPi has 8GB eMMC memory, you need external storage space. Let's assume you have USB dongle with Windows (FAT or NTFS) parititons
# WARNING : Please be sure /dev/sda is right storage memory. You can check it with command "lsblk -o name,size,model"
# delete all partitions on /dev/sda
sgdisk --zap-all /dev/sda
# create new ext4 partition
parted -s /dev/sda mklabel gpt
parted -a opt -s /dev/sda mkpart primary ext4 0% 100%
mkfs.ext4 -F /dev/sda1
# now we can use it
mkdir /mnt/usb
mount /dev/sda1 /mnt/usb
# install docker, docker.io and rsync, stop docker, copy files and mount our USB dongle as /var/lib/docker
apt-get install rsync docker docker.io
sudo systemctl stop docker.service
sudo systemctl stop docker.socket
rsync -aqxP /var/lib/docker/ /mnt/usb
mount /dev/sda1 /var/lib/docker
systemctl start docker
If you want to do the same with SD card, you need to find it with "lsblk -o name,size,model"
mmcblk1 29.1G
├─mmcblk1p1 256M
└─mmcblk1p2 28.9G
and modify our script for this /dev/mmcblk1 device
sgdisk --zap-all /dev/mmcblk1
parted -s /dev/mmcblk1 mklabel gpt
parted -a opt -s /dev/mmcblk1 mkpart primary ext4 0% 100%
mkfs.ext4 -F /dev/mmcblk1
mkdir /mnt/sd
mount /dev/mmcblk1 /mnt/sd
How to play accelerated video in URVEPi Debian 11
gst-launch-1.0 filesrc location=/usr/local/test.mp4 ! qtdemux ! h264parse ! mppvideodec ! kmssink render-rectangle="<0,200,1280,700>"
gst-launch-1.0 filesrc location=/home/linaro/Desktop/avengers_2_1080p.mp4 ! qtdemux ! h264parse ! mppvideodec ! kmssink render-rectangle="<0,0,1920,1080>"
How to check CPU temperature in URVEPi Android 12
cat /sys/class/thermal/thermal_zone0/temp
cat /sys/class/thermal/thermal_zone1/temp
Monitoring file changes in home directory in Debian
sudo apt-get update
sudo apt-get install inotify-tools
while read path action file; do echo "File '$path$file' has been $action"; if [ $action != "DELETE" ]; then cat "$path$file"; fi; done < <(inotifywait -m -r -e modify,create,delete,move /home)
Synchronize System Time and Hardware Clock with an Online Time Server
Synchronize your system time and hardware clock with an online time server for the timezone 'Europe/Warsaw':
sudo apt-get install curl jq
sudo date -s "$(curl -s 'http://worldtimeapi.org/api/timezone/Europe/Warsaw' | jq -r '.datetime')"
sudo hwclock -w
How to use SPI
We provide some examples for SPI URVEPi usage. Python, C++ and Node.js. Below you can see how to use SPI with this languages.
How to use URVEPi SPI with Python
For Python we need to install spidev library. It's very easy. Just type in your root account:
git clone https://github.com/doceme/py-spidev.git
cd py-spidev
apt-get install python3-dev nano
sudo python3 setup.py build
sudo python3 setup.py install
Then you can write simple app in Python:
nano spitest.py
Now paste this source code and save:
import spidev
spi = spidev.SpiDev()
spi.open(0, 0)
spi.max_speed_hz = 500000
spi.mode = 0
tx_data = [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x40, 0x00, 0x00, 0x00, 0x00, 0x95,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xDE, 0xAD, 0xBE, 0xEF, 0xBA, 0xAD, 0xF0, 0x0D]
rx_data = spi.xfer2(tx_data)
print(rx_data)
spi.close()
python3 spitest.py
Or you can send and receive text
import spidev
spi = spidev.SpiDev()
spi.open(0, 0)
spi.max_speed_hz = 500000
spi.mode = 0
tx_data = "URVEPi rocks!".encode('utf-8')
rx_data = spi.xfer2(tx_data)
print(bytes(rx_data).decode('utf-8'))
spi.close()
python3 spitest2.py
URVEPi rocks!
How to connect SPI to URVEPi
To test and run SPI pins on URVEPi, you need short-circuit Pin19 (SPI input) and Pin21 (SPI output). As we want push and get data with SPI bus, we will send something though Pin21 and we will receive it on Pin19.
Pin1 is the one with a square.
How to use URVEPi SPI with C++
apt-get install build-essential nano
nano spidevtest.c # paste source code from below
gcc spidevtest.c -o spidev_test
chmod +x spidev_test
./spidev_test -D /dev/spidev0.0
Below source code of spidevtest.c
/*
* SPI testing utility (using spidev driver)
*
* Copyright (c) 2007 MontaVista Software, Inc.
* Copyright (c) 2007 Anton Vorontsov <avorontsov@ru.mvista.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License.
*
* Cross-compile with cross-gcc -I/path/to/cross-kernel/include
*/
#include <stdint.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/types.h>
#include <linux/spi/spidev.h>
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
static void pabort(const char *s)
{
perror(s);
abort();
}
static const char *device = "/dev/spidev0.0";
static uint8_t mode;
static uint8_t bits = 8;
static uint32_t speed = 500000;
static uint16_t delay;
static void transfer(int fd)
{
int ret;
uint8_t tx[] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x40, 0x00, 0x00, 0x00, 0x00, 0x95,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xDE, 0xAD, 0xBE, 0xEF, 0xBA, 0xAD,
0xF0, 0x0D,
};
uint8_t rx[ARRAY_SIZE(tx)] = {0, };
struct spi_ioc_transfer tr = {
.tx_buf = (unsigned long)tx,
.rx_buf = (unsigned long)rx,
.len = ARRAY_SIZE(tx),
.delay_usecs = delay,
.speed_hz = speed,
.bits_per_word = bits,
};
ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr);
if (ret < 1)
pabort("can't send spi message");
for (ret = 0; ret < ARRAY_SIZE(tx); ret++) {
if (!(ret % 6))
puts("");
printf("%.2X ", rx[ret]);
}
puts("");
}
static void print_usage(const char *prog)
{
printf("Usage: %s [-DsbdlHOLC3]\n", prog);
puts(" -D --device device to use (default /dev/spidev1.1)\n"
" -s --speed max speed (Hz)\n"
" -d --delay delay (usec)\n"
" -b --bpw bits per word \n"
" -l --loop loopback\n"
" -H --cpha clock phase\n"
" -O --cpol clock polarity\n"
" -L --lsb least significant bit first\n"
" -C --cs-high chip select active high\n"
" -3 --3wire SI/SO signals shared\n");
exit(1);
}
static void parse_opts(int argc, char *argv[])
{
while (1) {
static const struct option lopts[] = {
{ "device", 1, 0, 'D' },
{ "speed", 1, 0, 's' },
{ "delay", 1, 0, 'd' },
{ "bpw", 1, 0, 'b' },
{ "loop", 0, 0, 'l' },
{ "cpha", 0, 0, 'H' },
{ "cpol", 0, 0, 'O' },
{ "lsb", 0, 0, 'L' },
{ "cs-high", 0, 0, 'C' },
{ "3wire", 0, 0, '3' },
{ "no-cs", 0, 0, 'N' },
{ "ready", 0, 0, 'R' },
{ NULL, 0, 0, 0 },
};
int c;
c = getopt_long(argc, argv, "D:s:d:b:lHOLC3NR", lopts, NULL);
if (c == -1)
break;
switch (c) {
case 'D':
device = optarg;
break;
case 's':
speed = atoi(optarg);
break;
case 'd':
delay = atoi(optarg);
break;
case 'b':
bits = atoi(optarg);
break;
case 'l':
mode |= SPI_LOOP;
break;
case 'H':
mode |= SPI_CPHA;
break;
case 'O':
mode |= SPI_CPOL;
break;
case 'L':
mode |= SPI_LSB_FIRST;
break;
case 'C':
mode |= SPI_CS_HIGH;
break;
case '3':
mode |= SPI_3WIRE;
break;
case 'N':
mode |= SPI_NO_CS;
break;
case 'R':
mode |= SPI_READY;
break;
default:
print_usage(argv[0]);
break;
}
}
}
int main(int argc, char *argv[])
{
int ret = 0;
int fd;
parse_opts(argc, argv);
fd = open(device, O_RDWR);
if (fd < 0)
pabort("can't open device");
/*
* spi mode
*/
ret = ioctl(fd, SPI_IOC_WR_MODE, &mode);
if (ret == -1)
pabort("can't set spi mode");
ret = ioctl(fd, SPI_IOC_RD_MODE, &mode);
if (ret == -1)
pabort("can't get spi mode");
/*
* bits per word
*/
ret = ioctl(fd, SPI_IOC_WR_BITS_PER_WORD, &bits);
if (ret == -1)
pabort("can't set bits per word");
ret = ioctl(fd, SPI_IOC_RD_BITS_PER_WORD, &bits);
if (ret == -1)
pabort("can't get bits per word");
/*
* max speed hz
*/
ret = ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &speed);
if (ret == -1)
pabort("can't set max speed hz");
ret = ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed);
if (ret == -1)
pabort("can't get max speed hz");
printf("spi mode: %d\n", mode);
printf("bits per word: %d\n", bits);
printf("max speed: %d Hz (%d KHz)\n", speed, speed/1000);
transfer(fd);
close(fd);
return ret;
}
How to use SPI with node.js
You need to install node.js
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
nvm install node
reboot # we need to initialize nvm, or just run once again terminal
npm install pi-spi
Create and run file spitest.js
nano spitest.js
const Spi = require('pi-spi');
const spi = Spi.initialize('/dev/spidev0.0');
spi.clockSpeed(500000);
spi.dataMode(0);
const txData = Buffer.from('URVEPi rocks!', 'utf-8');
spi.transfer(txData, txData.length, function(err, rxData) {
if (err) throw err;
console.log(rxData.toString('utf-8'));
spi.close(function(err) {
if (err) throw err;
});
});
node spitest.js
URVEPi rocks!
How to use SDL2 on URVEPi
sudo apt-get install -y libsdl2-dev build-essential nano
nano sdltest.c
#include <SDL2/SDL.h>
int main(int argc, char* argv[]) {
SDL_Window* window = NULL;
SDL_Renderer* renderer = NULL;
SDL_Init(SDL_INIT_VIDEO);
window = SDL_CreateWindow("Hello World", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, SDL_WINDOW_SHOWN);
renderer = SDL_CreateRenderer(window, -1, 0);
SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);
SDL_RenderClear(renderer);
SDL_RenderPresent(renderer);
SDL_Delay(3000);
SDL_DestroyWindow(window);
SDL_DestroyRenderer(renderer);
SDL_Quit();
return 0;
}
gcc -o sdltest sdltest.c `sdl2-config --cflags --libs`
gcc -o sdltest sdltest.c -lSDL2 -lGLESv2
./program
SDL_VIDEO_GL_DRIVER=/usr/lib/aarch64-linux-gnu/libGL.so ./sdltest
Run: cmake -S . -B build && cmake --build build && cmake --install build
libsdl2-2.0-0
apt-get install libsdl2-dev
How to use I2C
PCF8574T with 1602A display
As an example we will use PCF8574T with 1602A display. We need to connect URVEPi VCC5, GND, I2C1_SDA and I2C1_SCL to VCC, GND, SDA and SCL pins.
For I2C1 we use Pin27 i Pin28.
Detecting I2C device
After connecting a device with PCF8574T to Pin27 and Pin28 on the URVEPi, you can run the "i2cdetect -y 1" command in the terminal to check if the device is detected on the I2C bus.
This command is used for scanning the I2C bus and detecting devices connected to it. "i2cdetect" is a command-line tool that is available in most Linux distributions.
The "-y" option in the "i2cdetect" command means that the program will scan the I2C bus without confirming each device that is detected.
The digit "1" at the end of the command indicates the I2C bus interface number that will be scanned. In the case of URVEPi, the I2C interface number is usually "1".
i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- 27 -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
In this case I2CDetect have found one device with 0x27 address on URVEPi I2C1 device. Now we can test it, if there are no errors :
i2cget -y 1 0x27
0xf7
i2cset -y 1 0x27 0xf0
Text on 1602A connected to URVEPi
It's actually very easy. We can use RPLCD library designed for RaspberyPi. We will install it and create lcdtest.py file.
apt-get install python3-pip
pip3 install RPLCD
nano lcdtest.py
# Import LCD library
from RPLCD import i2c
from time import sleep
lcdmode = 'i2c'
cols = 20
rows = 4
charmap = 'A00'
i2c_expander = 'PCF8574'
# i2cdetect -y 1
address = 0x27
port = 1
# Initialise the LCD
lcd = i2c.CharLCD(i2c_expander, address, port=port, charmap=charmap,
cols=cols, rows=rows)
lcd.write_string('Hello world')
lcd.crlf()
lcd.write_string('URVEPi Rocks!')
lcd.crlf()
sleep(5)
# Switch off backlight
lcd.backlight_enabled = False
# Clear the LCD screen
lcd.close(clear=True)
and run it with
# python3 lcdtest.py
Let URVEPi speak for itself:
Text animations on 1602A screen:
from RPLCD import i2c
from time import sleep
lcdmode = 'i2c'
cols = 16
rows = 2
charmap = 'A00'
i2c_expander = 'PCF8574'
address = 0x27
port = 1
lcd = i2c.CharLCD(i2c_expander, address, port=port, charmap=charmap,
cols=cols, rows=rows)
text = 'Hello world! This is a long text.'
while True:
for i in range(len(text)-15):
lcd.clear()
lcd.cursor_pos = (0,0)
lcd.write_string(text[i:i+16])
lcd.cursor_pos = (1,0)
lcd.write_string(text[i+16:i+32])
sleep(0.5)
Connecting to URVEPi Debug UART
To use the Debug UART, you will need a UART-to-USB adapter, which will allow you to connect the UART to a computer via USB. Once you have connected the adapter and installed its driver, you can use a terminal emulator program such as PuTTY or Tera Term to communicate with the SoC. You will need to set the baud rate to 1500000 and configure the terminal emulator to use the correct serial port that is connected to the UART.
Connecting to URVEPi with an SSH Client
Follow these steps to establish a secure connection to URVEPi using an SSH client:
Step 1: Obtain the IP address
- Open a terminal on your computer.
- Type the following command and press Enter:
ifconfig
Identify the IP address of your URVEPi device. It should be listed next to "inet" under the appropriate network interface. Now you can connect to URVEPi with credentials:
login : linaro
password : linaro
For root access just type "sudo -i"