Hi Antonio,
Sorry to hear that you encountered a problem with your ROSbot. I will try to help you to debug it, but it will require a few steps. The upside is you’ll learn new tools that might be useful in the future so let’s start:
1. Disable husarnet-configurator
and husarion-shield
services and reboot your device. These processes are responsible for connection to the Husarion Cloud and they also control GPIO pins that are used for uploading the firmware. We will need the direct access to them. Log into your ROSbot and run:
$ sudo systemctl disable husarnet-configurator
$ sudo systemctl stop husarnet-configurator
$ sudo systemctl disable husarion-shield
$ sudo reboot
LR1 and LR2 leds should stop blinking after reboot.
2. Install gpio_lib_python
library if you have Asus Tinker Board (ROSbot 2.0) or python-periphery
if you have Upboard (ROSbot 2.0 Pro). On your SBC run:
Asus Tinker board:
$ cd ~/ && git clone https://github.com/TinkerBoard/gpio_lib_python.git
$ cd ~/gpio_lib_python && sudo python setup.py install --record files.txt
Upboard:
$ cd ~/ && git clone https://github.com/vsergeev/python-periphery.git
$ cd ~/python-periphery && sudo python setup.py install --record files.txt
Restart terminal after installation.
3. To test if gpio_lib_python
or python-periphery
works and you in fact have access to GPIO pins, save the below python script as test-gpios
:
Asus Tinker board:
#!/usr/bin/python
import RPi.GPIO as GPIO
import time
LR1_GPIO_PIN = 11
def blink_lr1():
'''Blink LR1 led for 10s with interval of 1s'''
GPIO.setmode(GPIO.BOARD)
GPIO.setup(LR1_GPIO_PIN, GPIO.OUT)
GPIO.setwarnings(False)
time_start = time.time()
while time.time() - time_start < 10.0:
GPIO.output(LR1_GPIO_PIN, GPIO.HIGH)
time.sleep(1)
GPIO.output(LR1_GPIO_PIN, GPIO.LOW)
time.sleep(1)
GPIO.cleanup()
if __name__ == '__main__':
blink_lr1()
Upboard:
#!/usr/bin/python
from periphery import GPIO
import time
LR1_GPIO_PIN = 17
def blink_lr1():
'''Blink LR1 led for 10s with interval of 1s'''
lr1_led = GPIO(LR1_GPIO, "out")
time_start = time.time()
while time.time() - time_start < 10.0:
lr1_led.write(True)
time.sleep(1)
lr1_led.write(False)
time.sleep(1)
lr1_led.close()
if __name__ == '__main__':
blink_lr1()
Save the script as test-gpios
and run:
$ chmod a+x test-gpios
$ sudo ./test-gpios
You need to use sudo
because the userspace GPIO driver is not implemented yet for Tinker and Upboard. The script should blink the LR1 led for approximately 10s with interval of 1s. If everything works you can proceed to next steps.