Describe the bug
During Motor Hat install following command fails. See Additional Context
sudo python setup.py
To Reproduce
Steps to reproduce the behavior:
Use Raspberry Pi imager to flash Raspberry Pi OS (32-bit)
Released 2021-10-30
Online -1.1 GB download
Follow remo.tv documentation installation procedure.
Expected behavior
Expected successful installation.
Screenshots
Screenshots of the console are appreciated.
Logs
Always try to share logs if you can, or an output of the console.
Configurations
- Sharing a pared down version of your
controller.conf
file could help. We obviously don't need things like your API key, username, etc.
Sample Configuration file for the RemoTV python controller
Global robot variables
[robot]
This is your username on the remotv site. This is the user that is allowed
to issue commands via chat
owner=silker
Your robots API key. The site will provide you with this when you create a
new robot.
robot_key= Gandalf's key here
The name of the channel you want the robot to join. This is optional. If the
named channel cannot be found, the robot will join the first channel.
channel=
Motor controller type for your robot. Current valid types are serial_board,
motor_hat, gopigo2, gopigo3, l298n, motozero, pololu, adafruit_pwm, owi_arm,
diddyborg, megapi_board or none.
type=motor_hat
Only used for motor_hat and mdd10
turn_delay=0.4
straight_delay=0.5
[camera]
Disable video
no_camera=false
Disable mic
no_mic=false
Specify the audio / video encoder you are using here. Currently ffmpeg,
ffmpeg-arecord and none. Note: Only robots with Raspberry Pi's or other Linux
based controllers should use ffmpeg-arecord. All others should use ffmpeg or
none.
type=ffmpeg-arecord
X and Y resolution to capture video at
#x_res = 640
#y_res = 480
x_res = 768
y_res = 432
#x_res = 1280
#y_res = 720
Video device
camera_device = /dev/video0
windows device example
#camera_device = video="USB Webcam"
Audio device. Generally the hardware number is preferred, but if you have
issues with that changing, using the device name will probably help.
otherwise, leave it blank.
mic_num = 1,0
mic_device=
#windows
#mic_device = audio="Microphone (Logitech G533 Gaming Headset)"
[ffmpeg]
Combined ffmpeg options for audio and video
ffmpeg_location = /usr/bin/ffmpeg
Windows path example
#ffmpeg_location = c://ffmpeg//bin//ffmpeg.exe
Path to v4l2-ctl
v4l2-ctl_location=/usr/bin/v4l2-ctl
Audio codec ffmpeg should use, only mp2 is supported but twolame will work
when compiled in to ffmpeg.
audio_codec = mp2
Audio channels, 1 for mono 2 for stereo.
audio_channels = 1
Bitrate for the audio stream in kilobytes
audio_bitrate = 32
Sample rate fot the audio stream in hertz
audio_sample_rate = 44100
Video codec ffmpeg should use. Currently only mpeg1video is supported.
video_codec = mpeg1video
Bitrate for the video stream in kilobytes
video_bitrate = 350
Video filter options. To rotate the video 180 degree, uncomment this line
#video_filter = transpose=2,transpose=2
Optional additional ffmpeg options for audio input and output. leave
audio_input_device blank if using alsa for audio format
windows
#audio_input_format = dshow
#audio_input_options = -audio_buffer_size 250
audio_input_format = alsa
audio_input_options =
audio_output_options = -nostats
Optional additional ffmpeg options for video input and output
video_input_format = v4l2
windows
video_input_format = dshow
video_input_options =
video_output_options = -nostats -threads 2
frame rate option. DO NOT CHANGE THIS unless you know what you are doing.
it's not really about changing the framerate from the camera as it is
changing the framerate of the video being sent to the server. The video
encoder gets grumpy if this is set wrong.
video_framerate = 25
[ffmpeg-arecord]
arecord_path=/usr/bin/arecord
arecord_format=S16_LE
[tts]
Specify the TTS engine you are using here. Current valid types are espeak,
festival and none
type=espeak
TTS volume
tts_volume=80
Allow anonymous users chat messages to be broadcast over TTS. Set to false to
block them.
anon_tts=true
Block URLS from being broadcast over TTS. Set to true to block them.
filter_url_tts=true
Enable extended chat commands
ext_chat=true
ALSA HW number for your playback device
For Tellys this is 2.
If you have trouble with the playback device changing hardware numbers,
use the audio device name. Otherwise, leave it blank.
speaker_num=1,0
speaker_device=
What the robot should say when it is ready to receive commands.
No need to encapsulate in quotes.
boot_message=ok
Announce the IPv4 address. This is useful for debugging
especially in new environments.
announce_ip=False
Announces when the cloned repo is out of date and by how many commits.
annouce_out_of_date=False
Enable delayed TTS, this allows a window for moderators to remove messages
before they get passed to TTS. Messenger must be enabled for this to function.
delay_tts = false
delay = 10
[espeak]
espeak specific TTS settings go here
voice gender, male or female
male = True
voice number
voice_number=1
espeak path. Option setting, for when espeak is not installed in the expected
place.
#espeak_path=
Windows path
#espeak_path=C://Program Files (x86)//eSpeak//command_line//
[festival]
Festival specific TTS settings go here
[pico]
voice=en-US
[polly]
polly requires you to have an amazon aws account and have setup a IAM user
with access to polly
robot_voice=Matthew
owner_voice=Russell
random_voices=true
access_key=
secrets_key=
region_name=us-east-1
[google_cloud]
ssml_enabled=False
key_file=
voice=en-US-Wavenet-A
#pitch can be between -20.0 and 20.0, 0.0 is default pitch for chosen voice
voice_pitch=0.0
#speaking rate can be between 0.25 and 4.0, 1.0 is default rate
voice_speaking_rate=1.0
All the settings below only work if random_voices is enabled
random_voices=False
Enable standard_voices to disable the use of Wavenet voices.
standard_voices=False
A comma separated list of approved language codes.
strict_languages= en-US,en-GB,en-AU
[cozmo]
forward_speed = 75
turn_speed = 50
volume = 100
charge_high = 4.79
charge_low = 3.6
send_online_status = 1
stay_on_dock = 0
annotated = 0
colour = 0
[adafruit_pwm]
address=0x40
pwm_freq=60
more_debug=False
[owi_arm]
[serial]
serial_device=/dev/ttyACM0
#serial_device=COM3 # Windows example serial device
#Option value, that will search for a serial port with a specific hardware
#name or id. Overwrites serial_device with the correct value if found.
#serial_name=Arduino
baud_rate=9600
[motor_hat]
day_speed = 255
night_speed = 255
turning_speed = 250
forward=[-1,1,-1,1]
left=[1,1,1,1]
Enable charging behaviours
slow_for_low_battery = false
Charging stuff
charge_hours = 3.0
discharge_hours = 8.0
chargeCheckInterval=5
chargeIONumber = 17
[gopigo2]
drive_time=0.35
turn_time=0.15
[gopigo3]
drive_time=0.35
turn_time=0.15
Settings specific to the l298n dual h-bridge motor driver
[l298n]
StepPinForward=12,16
StepPinBackward=11,15
StepPinLeft=15,12
StepPinRight=11,16
Change sleeptime to adjust driving speed
Change rotatetimes to adjust the turning. Will be multiplied with sleeptime.
IMPORTANT NOTE: How this is handled has changed, your values may no longer be
correct if using settings from an older controller.
sleeptime=0.2
rotatetimes=5
[motozero]
MotorDelay = 0.3
Motor1 is back left
Motor1A is reverse
Motor1B is forward
Motor1A = 24
Motor1B = 27
Motor1Enable = 5
Motor2 is back right
Motor2A is reverse
Motor2B is forward
Motor2A = 6
Motor2B = 22
Motor2Enable = 17
Motor3 is ?
Motor3A is reverse
Motor3B is forward
Motor3A = 23
Motor3B = 16
Motor3Enable = 12
Motor4 is ?
Motor4A is reverse
Motor4B is forward
Motor4A = 13
Motor4B = 18
Motor4Enable = 25
[pololu]
drivingSpeed=90
[mc33926]
drivingSpeed=180
[max7219]
ledrotate=180
[thunderborg]
maximum is 1.0, minimum is 0.0
left_motor_max=1.0
right_motor_max=1.0
sleep_time=0.4
[megapi_board]
Default time per message
motor_time = 0.2
Speed of drive motors (0 to 255)
driving_speed = 150
Speed of arm drive (0 to 255)
arm_speed = 50
Speed of grabber (0 to 255)
grabber_speed = 50
Motor controller ports
left_track_port = 2
right_track_port = 3
grabber_port = 4
arm_port = 1
[mqtt_pub]
If you are using MQTT you need to supply the host IP address, port, and Topic
host should be the IP address where the MQTT broker is running (i.e. 192.168.xx.xx)
the port typically is 1883 for MQTT
the topic is your choice, but it needs to match with the robot subscribers
host = YourBrokerID
port = 1883
topic = LR/command
#username for MQTT server.
#Not needed unless the server is accessible from outside the local network
#user = remo
#password for user on MQTT server. This can be blank. This also sets MQTT to try to use ssl
#if using SSL, the port should be 8883
#pass = hunter2
Logging settings
[logging]
Name of the log file to be written to
log_file=controller.log
log levels in order of importance are CRITICAL, ERROR, WARNING, INFO, DEBUG
file_level=WARNING
console_level=ERROR
log size is in bytes
max_size=100000
Number of old log files to hang onto.
num_backup=2
This is mostly stuff you probably shouldn't be touching
[misc]
host server to connect to
server = remo.tv
API version is the version of the API.
api_version = dev
video server to connect to so you can use local websocket and remote video server
video_server = remo.tv:1567
Enable the controller to look for custom handler code
custom_hardware = True
Enable the controller to look for custom TTS handler code
custom_tts = True
Enable the controller to look for custom chat handler code
custom_chat = True
Enable the controller to look for custom video handler code
custom_video = True
Enable the watchdog timer, if you are not using a raspberry pi, you won't want
this.
watchdog = True
Enable async handling of commands, your handler will either need to be able to
function asyncronously or it will need it's own blocking.
enable_async=False
Periodically check internet connection status, and report failure / connect
over tts
check_internet=True
check_freq=120
- We need to know what version of the controller you're running. Run the following in the repo directory:
pi@raspberrypi:~/remotv $ git log -1
commit 36ac390 (HEAD -> master, origin/master, origin/HEAD)
Merge: 160a968 13a4b36
Author: Nocturnal42 [email protected]
Date: Tue Apr 20 03:15:49 2021 +1000
Merge pull request #37 from MrSpoon/master
Bug fix for pololu drive
Additional context
Add any other context about the problem here.
During installation sudo python setup.py install fails. See following:
pi@raspberrypi:/usr/local/src $ cd /usr/local/src/Adafruit-Motor-HAT-Python-Library && sudo python setup.py install
running install
running bdist_egg
running egg_info
creating Adafruit_MotorHAT.egg-info
writing requirements to Adafruit_MotorHAT.egg-info/requires.txt
writing Adafruit_MotorHAT.egg-info/PKG-INFO
writing top-level names to Adafruit_MotorHAT.egg-info/top_level.txt
writing dependency_links to Adafruit_MotorHAT.egg-info/dependency_links.txt
writing manifest file 'Adafruit_MotorHAT.egg-info/SOURCES.txt'
reading manifest file 'Adafruit_MotorHAT.egg-info/SOURCES.txt'
writing manifest file 'Adafruit_MotorHAT.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-armv7l/egg
running install_lib
running build_py
creating build
creating build/lib.linux-armv7l-2.7
creating build/lib.linux-armv7l-2.7/Adafruit_MotorHAT
copying Adafruit_MotorHAT/Adafruit_PWM_Servo_Driver.py -> build/lib.linux-armv7l -2.7/Adafruit_MotorHAT
copying Adafruit_MotorHAT/Adafruit_MotorHAT_Motors.py -> build/lib.linux-armv7l- 2.7/Adafruit_MotorHAT
copying Adafruit_MotorHAT/init.py -> build/lib.linux-armv7l-2.7/Adafruit_Mot orHAT
creating build/bdist.linux-armv7l
creating build/bdist.linux-armv7l/egg
creating build/bdist.linux-armv7l/egg/Adafruit_MotorHAT
copying build/lib.linux-armv7l-2.7/Adafruit_MotorHAT/Adafruit_PWM_Servo_Driver.p y -> build/bdist.linux-armv7l/egg/Adafruit_MotorHAT
copying build/lib.linux-armv7l-2.7/Adafruit_MotorHAT/Adafruit_MotorHAT_Motors.py -> build/bdist.linux-armv7l/egg/Adafruit_MotorHAT
copying build/lib.linux-armv7l-2.7/Adafruit_MotorHAT/init.py -> build/bdist. linux-armv7l/egg/Adafruit_MotorHAT
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_MotorHAT/Adafruit_PWM_Servo Driver.py to Adafruit_PWM_Servo_Driver.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_MotorHAT/Adafruit_MotorHAT Motors.py to Adafruit_MotorHAT_Motors.pyc
byte-compiling build/bdist.linux-armv7l/egg/Adafruit_MotorHAT/init.py to i nit.pyc
creating build/bdist.linux-armv7l/egg/EGG-INFO
copying Adafruit_MotorHAT.egg-info/PKG-INFO -> build/bdist.linux-armv7l/egg/EGG- INFO
copying Adafruit_MotorHAT.egg-info/SOURCES.txt -> build/bdist.linux-armv7l/egg/E GG-INFO
copying Adafruit_MotorHAT.egg-info/dependency_links.txt -> build/bdist.linux-arm v7l/egg/EGG-INFO
copying Adafruit_MotorHAT.egg-info/requires.txt -> build/bdist.linux-armv7l/egg/ EGG-INFO
copying Adafruit_MotorHAT.egg-info/top_level.txt -> build/bdist.linux-armv7l/egg /EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/Adafruit_MotorHAT-1.4.0-py2.7.egg' and adding 'build/bdist.linux- armv7l/egg' to it
removing 'build/bdist.linux-armv7l/egg' (and everything under it)
Processing Adafruit_MotorHAT-1.4.0-py2.7.egg
Copying Adafruit_MotorHAT-1.4.0-py2.7.egg to /usr/local/lib/python2.7/dist-packa ges
Adding Adafruit-MotorHAT 1.4.0 to easy-install.pth file
Installed /usr/local/lib/python2.7/dist-packages/Adafruit_MotorHAT-1.4.0-py2.7.e gg
Processing dependencies for Adafruit-MotorHAT==1.4.0
Searching for Adafruit-GPIO>=0.7
Downloading https://github.com/adafruit/Adafruit_Python_GPIO/tarball/master#egg= Adafruit-GPIO-0.7
Best match: Adafruit-GPIO 0.7
Processing master
Writing /tmp/easy_install-v76fWi/adafruit-Adafruit_Python_GPIO-a12fee3/setup.cfg
Running adafruit-Adafruit_Python_GPIO-a12fee3/setup.py -q bdist_egg --dist-dir / tmp/easy_install-v76fWi/adafruit-Adafruit_Python_GPIO-a12fee3/egg-dist-tmp-D6Sxc 1
Adafruit GPIO Library
Works best with Python 2.7
THIS INSTALL SCRIPT MAY REQUIRE ROOT/ADMIN PERMISSIONS
Especially if you installed python for "all users" on Windows
try the following in your systems terminal if ensurepip is not sufficient:
$ python -m ensurepip --upgrade
$ python -m pip install --upgrade pip setuptools
zip_safe flag not set; analyzing archive contents...
Moving Adafruit_GPIO-1.0.4-py2.7.egg to /usr/local/lib/python2.7/dist-packages
Adding Adafruit-GPIO 1.0.4 to easy-install.pth file
Installed /usr/local/lib/python2.7/dist-packages/Adafruit_GPIO-1.0.4-py2.7.egg
Searching for adafruit-pureio
Reading https://pypi.org/simple/adafruit-pureio/
Downloading https://files.pythonhosted.org/packages/df/ca/9162d4648669d12af16d5a 66d808bdef6967eb684cbed9b1a3ebc19b361a/Adafruit_PureIO-1.1.9.tar.gz#sha256=2caf2 2fb07c7f771d83267f331a76cde314723f884a9570ea6f768730c87a879
Best match: Adafruit-PureIO 1.1.9
Processing Adafruit_PureIO-1.1.9.tar.gz
Writing /tmp/easy_install-wfr1Br/Adafruit_PureIO-1.1.9/setup.cfg
Running Adafruit_PureIO-1.1.9/setup.py -q bdist_egg --dist-dir /tmp/easy_install -wfr1Br/Adafruit_PureIO-1.1.9/egg-dist-tmp-QILjuZ
Traceback (most recent call last):
File "setup.py", line 30, in
packages = find_packages())
File "/usr/lib/python2.7/dist-packages/setuptools/init.py", line 145, in s etup
return distutils.core.setup(**attrs)
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/dist-packages/setuptools/command/install.py", line 67 , in run
self.do_egg_install()
File "/usr/lib/python2.7/dist-packages/setuptools/command/install.py", line 11 7, in do_egg_install
cmd.run()
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", li ne 443, in run
self.easy_install(spec, not self.no_deps)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", li ne 685, in easy_install
return self.install_item(None, spec, tmpdir, deps, True)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", li ne 732, in install_item
self.process_distribution(spec, dist, deps)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", li ne 777, in process_distribution
[requirement], self.local_index, self.easy_install
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 782, i n resolve
replace_conflicting=replace_conflicting
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1065, in best_match
return self.obtain(req, installer)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1077, in obtain
return installer(requirement)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", li ne 704, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", li ne 730, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", li ne 915, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", li ne 1183, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", li ne 1169, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 253, in ru n_setup
raise
File "/usr/lib/python2.7/contextlib.py", line 35, in exit
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 195, in se tup_context
yield
File "/usr/lib/python2.7/contextlib.py", line 35, in exit
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 166, in sa ve_modules
saved_exc.resume()
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 141, in re sume
six.reraise(type, exc, self._tb)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 154, in sa ve_modules
yield saved
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 195, in se tup_context
yield
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 250, in ru n_setup
_execfile(setup_script, ns)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 45, in _ex ecfile
exec(code, globals, locals)
File "/tmp/easy_install-wfr1Br/Adafruit_PureIO-1.1.9/setup.py", line 51, in
File "/usr/lib/python2.7/dist-packages/setuptools/init.py", line 144, in s etup
_install_setup_requires(attrs)
File "/usr/lib/python2.7/dist-packages/setuptools/init.py", line 139, in _ install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 724, in fetch _build_eggs
replace_conflicting=True,
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 782, i n resolve
replace_conflicting=replace_conflicting
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1065, in best_match
return self.obtain(req, installer)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1077, in obtain
return installer(requirement)
File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 791, in fetch _build_egg
return cmd.easy_install(req)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", li ne 704, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", li ne 730, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", li ne 915, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", li ne 1183, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", li ne 1169, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 253, in ru n_setup
raise
File "/usr/lib/python2.7/contextlib.py", line 35, in exit
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 195, in se tup_context
yield
File "/usr/lib/python2.7/contextlib.py", line 35, in exit
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 166, in sa ve_modules
saved_exc.resume()
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 141, in re sume
six.reraise(type, exc, self._tb)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 154, in sa ve_modules
yield saved
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 195, in se tup_context
yield
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 250, in ru n_setup
_execfile(setup_script, ns)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 44, in _ex ecfile
code = compile(script, filename, 'exec')
File "/tmp/easy_install-wfr1Br/Adafruit_PureIO-1.1.9/temp/easy_install-uWckwE/ setuptools_scm-6.3.2/setup.py", line 22
f"{type(self).name} is forbidden, "
^
SyntaxError: invalid syntax