While setting up the roomba I am having a hard time getting the pi to communicate with the roomba....
pi@raspberrypi:~/robotstreamer $ python3 controller.py 108 --stream-key 23542345346 --type roomba --male --voice-number 1
temporary directory: /tmp
Namespace(enable_ping_pong=False, festival_tts=False, forward='[-1,1,-1,1]', left='[1,1,1,1]', male=True, robot_id='108', secure_cert=True, straight_speed=255, stream_key='XXXXXXXXXXXXX', tts_volume=80, turn_speed=255, type='roomba', voice_number=1)
init roomba
sending beep to roomba
Namespace(enable_ping_pong=False, festival_tts=False, forward='[-1,1,-1,1]', left='[1,1,1,1]', male=True, robot_id='108', secure_cert=True, straight_speed=255, stream_key='23542345346', tts_volume=80, turn_speed=255, type='roomba', voice_number=1)
setting volume to 80 %
---------------------
setting card number: 0 numid: 0
waiting a few seconds
amixer: Invalid numid 0
Wrong control identifier: numid=0
---------------------
---------------------
setting card number: 0 numid: 1
numid=1,iface=MIXER,name='PCM Playback Volume'
; type=INTEGER,access=rw---R--,values=1,min=-10239,max=400,step=0
: values=-1726
| dBscale-min=-102.39dB,step=0.01dB,mute=1
---------------------
---------------------
setting card number: 0 numid: 2
numid=2,iface=MIXER,name='PCM Playback Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on
---------------------
---------------------
setting card number: 0 numid: 3
numid=3,iface=MIXER,name='PCM Playback Route'
; type=INTEGER,access=rw------,values=1,min=0,max=2,step=0
: values=2
---------------------
---------------------
setting card number: 0 numid: 4
numid=4,iface=PCM,name='IEC958 Playback Default'
; type=IEC958,access=rw------,values=1
: values=[AES0=0x00 AES1=0x00 AES2=0x00 AES3=0x00]
---------------------
---------------------
setting card number: 1 numid: 0
amixer: Invalid numid 0
Wrong control identifier: numid=0
---------------------
---------------------
setting card number: 1 numid: 1
amixer: Control hw:1 element write error: Operation not permitted
---------------------
---------------------
setting card number: 1 numid: 2
numid=2,iface=MIXER,name='Mic Capture Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on
---------------------
---------------------
setting card number: 1 numid: 4
amixer: Cannot find the given element from control hw:1
---------------------
---------------------
setting card number: 2 numid: 0
amixer: Invalid numid 0
Wrong control identifier: numid=0
---------------------
---------------------
setting card number: 2 numid: 1
amixer: Control hw:2 element write error: Operation not permitted
---------------------
---------------------
setting card number: 2 numid: 2
numid=2,iface=MIXER,name='PCM Playback Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on
---------------------
---------------------
setting card number: 2 numid: 3
numid=3,iface=MIXER,name='PCM Playback Volume'
; type=INTEGER,access=rw---R--,values=1,min=0,max=255,step=0
: values=204
| dBminmax-min=-128.00dB,max=-127.00dB
---------------------
---------------------
setting card number: 2 numid: 4
amixer: Cannot find the given element from control hw:2
---------------------
---------------------
setting card number: 3 numid: 0
Invalid card number.
Usage: amixer <options> [command]
Available options:
-h,--help this help
-c,--card N select the card
-D,--device N select the device, default 'default'
-d,--debug debug mode
-n,--nocheck do not perform range checking
-v,--version print version of this program
-q,--quiet be quiet
-i,--inactive show also inactive controls
-a,--abstract L select abstraction level (none or basic)
-s,--stdin Read and execute commands from stdin sequentially
-R,--raw-volume Use the raw value (default)
-M,--mapped-volume Use the mapped volume
Available commands:
scontrols show all mixer simple controls
scontents show contents of all mixer simple controls (default command)
sset sID P set contents for one mixer simple control
sget sID get contents for one mixer simple control
controls show all controls for given card
contents show contents of all controls for given card
cset cID P set control contents for one control
cget cID get control contents for one control
---------------------
---------------------
setting card number: 3 numid: 1
Invalid card number.
Usage: amixer <options> [command]
Available options:
-h,--help this help
-c,--card N select the card
-D,--device N select the device, default 'default'
-d,--debug debug mode
-n,--nocheck do not perform range checking
-v,--version print version of this program
-q,--quiet be quiet
-i,--inactive show also inactive controls
-a,--abstract L select abstraction level (none or basic)
-s,--stdin Read and execute commands from stdin sequentially
-R,--raw-volume Use the raw value (default)
-M,--mapped-volume Use the mapped volume
Available commands:
scontrols show all mixer simple controls
scontents show contents of all mixer simple controls (default command)
sset sID P set contents for one mixer simple control
sget sID get contents for one mixer simple control
controls show all controls for given card
contents show contents of all controls for given card
cset cID P set control contents for one control
cget cID get control contents for one control
---------------------
---------------------
setting card number: 3 numid: 2
Invalid card number.
Usage: amixer <options> [command]
Available options:
-h,--help this help
-c,--card N select the card
-D,--device N select the device, default 'default'
-d,--debug debug mode
-n,--nocheck do not perform range checking
-v,--version print version of this program
-q,--quiet be quiet
-i,--inactive show also inactive controls
-a,--abstract L select abstraction level (none or basic)
-s,--stdin Read and execute commands from stdin sequentially
-R,--raw-volume Use the raw value (default)
-M,--mapped-volume Use the mapped volume
Available commands:
scontrols show all mixer simple controls
scontents show contents of all mixer simple controls (default command)
sset sID P set contents for one mixer simple control
sget sID get contents for one mixer simple control
controls show all controls for given card
contents show contents of all controls for given card
cset cID P set control contents for one control
cget cID get control contents for one control
---------------------
---------------------
setting card number: 3 numid: 3
Invalid card number.
Usage: amixer <options> [command]
Available options:
-h,--help this help
-c,--card N select the card
-D,--device N select the device, default 'default'
-d,--debug debug mode
-n,--nocheck do not perform range checking
-v,--version print version of this program
-q,--quiet be quiet
-i,--inactive show also inactive controls
-a,--abstract L select abstraction level (none or basic)
-s,--stdin Read and execute commands from stdin sequentially
-R,--raw-volume Use the raw value (default)
-M,--mapped-volume Use the mapped volume
Available commands:
scontrols show all mixer simple controls
scontents show contents of all mixer simple controls (default command)
sset sID P set contents for one mixer simple control
sget sID get contents for one mixer simple control
controls show all controls for given card
contents show contents of all controls for given card
cset cID P set control contents for one control
cget cID get control contents for one control
---------------------
---------------------
setting card number: 3 numid: 4
Invalid card number.
Usage: amixer <options> [command]
Available options:
-h,--help this help
-c,--card N select the card
-D,--device N select the device, default 'default'
-d,--debug debug mode
-n,--nocheck do not perform range checking
-v,--version print version of this program
-q,--quiet be quiet
-i,--inactive show also inactive controls
-a,--abstract L select abstraction level (none or basic)
-s,--stdin Read and execute commands from stdin sequentially
-R,--raw-volume Use the raw value (default)
-M,--mapped-volume Use the mapped volume
Available commands:
scontrols show all mixer simple controls
scontents show contents of all mixer simple controls (default command)
sset sID P set contents for one mixer simple control
sget sID get contents for one mixer simple control
controls show all controls for given card
contents show contents of all controls for given card
cset cID P set control contents for one control
cget cID get control contents for one control
---------------------
---------------------
setting card number: 4 numid: 0
Invalid card number.
Usage: amixer <options> [command]
Available options:
-h,--help this help
-c,--card N select the card
-D,--device N select the device, default 'default'
-d,--debug debug mode
-n,--nocheck do not perform range checking
-v,--version print version of this program
-q,--quiet be quiet
-i,--inactive show also inactive controls
-a,--abstract L select abstraction level (none or basic)
-s,--stdin Read and execute commands from stdin sequentially
-R,--raw-volume Use the raw value (default)
-M,--mapped-volume Use the mapped volume
Available commands:
scontrols show all mixer simple controls
scontents show contents of all mixer simple controls (default command)
sset sID P set contents for one mixer simple control
sget sID get contents for one mixer simple control
controls show all controls for given card
contents show contents of all controls for given card
cset cID P set control contents for one control
cget cID get control contents for one control
---------------------
---------------------
setting card number: 4 numid: 1
Invalid card number.
Usage: amixer <options> [command]
Available options:
-h,--help this help
-c,--card N select the card
-D,--device N select the device, default 'default'
-d,--debug debug mode
-n,--nocheck do not perform range checking
-v,--version print version of this program
-q,--quiet be quiet
-i,--inactive show also inactive controls
-a,--abstract L select abstraction level (none or basic)
-s,--stdin Read and execute commands from stdin sequentially
-R,--raw-volume Use the raw value (default)
-M,--mapped-volume Use the mapped volume
Available commands:
scontrols show all mixer simple controls
scontents show contents of all mixer simple controls (default command)
sset sID P set contents for one mixer simple control
sget sID get contents for one mixer simple control
controls show all controls for given card
contents show contents of all controls for given card
cset cID P set control contents for one control
cget cID get control contents for one control
---------------------
---------------------
setting card number: 4 numid: 2
Invalid card number.
Usage: amixer <options> [command]
Available options:
-h,--help this help
-c,--card N select the card
-D,--device N select the device, default 'default'
-d,--debug debug mode
-n,--nocheck do not perform range checking
-v,--version print version of this program
-q,--quiet be quiet
-i,--inactive show also inactive controls
-a,--abstract L select abstraction level (none or basic)
-s,--stdin Read and execute commands from stdin sequentially
-R,--raw-volume Use the raw value (default)
-M,--mapped-volume Use the mapped volume
Available commands:
scontrols show all mixer simple controls
scontents show contents of all mixer simple controls (default command)
sset sID P set contents for one mixer simple control
sget sID get contents for one mixer simple control
controls show all controls for given card
contents show contents of all controls for given card
cset cID P set control contents for one control
cget cID get control contents for one control
---------------------
---------------------
setting card number: 4 numid: 3
Invalid card number.
Usage: amixer <options> [command]
Available options:
-h,--help this help
-c,--card N select the card
-D,--device N select the device, default 'default'
-d,--debug debug mode
-n,--nocheck do not perform range checking
-v,--version print version of this program
-q,--quiet be quiet
-i,--inactive show also inactive controls
-a,--abstract L select abstraction level (none or basic)
-s,--stdin Read and execute commands from stdin sequentially
-R,--raw-volume Use the raw value (default)
-M,--mapped-volume Use the mapped volume
Available commands:
scontrols show all mixer simple controls
scontents show contents of all mixer simple controls (default command)
sset sID P set contents for one mixer simple control
sget sID get contents for one mixer simple control
controls show all controls for given card
contents show contents of all controls for given card
cset cID P set control contents for one control
cget cID get control contents for one control
---------------------
---------------------
setting card number: 4 numid: 4
Invalid card number.
Usage: amixer <options> [command]
Available options:
-h,--help this help
-c,--card N select the card
-D,--device N select the device, default 'default'
-d,--debug debug mode
-n,--nocheck do not perform range checking
-v,--version print version of this program
-q,--quiet be quiet
-i,--inactive show also inactive controls
-a,--abstract L select abstraction level (none or basic)
-s,--stdin Read and execute commands from stdin sequentially
-R,--raw-volume Use the raw value (default)
-M,--mapped-volume Use the mapped volume
Available commands:
scontrols show all mixer simple controls
scontents show contents of all mixer simple controls (default command)
sset sID P set contents for one mixer simple control
sget sID get contents for one mixer simple control
controls show all controls for given card
contents show contents of all controls for given card
cset cID P set control contents for one control
cget cID get control contents for one control
---------------------
starting control loop
GET http://robotstreamer.com:6001/get_control_host_port/108
response: {"_id":{"$oid":"5aafdaf3daee0360c5e7f75d"},"category":"rscontrol_robot","host":"control.robotstreamer.com","identifier":"108","port":9294}
handle control messages get control port, connecting to port: 9294
error
Traceback (most recent call last):
File "controller.py", line 299, in startControl
asyncio.new_event_loop().run_until_complete(handleControlMessages())
File "/usr/lib/python3.5/asyncio/base_events.py", line 466, in run_until_complete
return future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/asyncio/tasks.py", line 241, in _step
result = coro.throw(exc)
File "controller.py", line 236, in handleControlMessages
async with websockets.connect(url) as websocket:
File "/usr/local/lib/python3.5/dist-packages/websockets/py35/client.py", line 2, in __aenter__
return await self
File "/usr/local/lib/python3.5/dist-packages/websockets/py35/client.py", line 12, in __await_impl__
transport, protocol = await self._creating_connection
File "/usr/lib/python3.5/asyncio/base_events.py", line 775, in create_connection
raise exceptions[0]
File "/usr/lib/python3.5/asyncio/base_events.py", line 762, in create_connection
yield from self.sock_connect(sock, address)
File "/usr/lib/python3.5/asyncio/selector_events.py", line 451, in sock_connect
return (yield from fut)
File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/asyncio/selector_events.py", line 481, in _sock_connect_cb
raise OSError(err, 'Connect call failed %s' % (address,))
ConnectionRefusedError: [Errno 111] Connect call failed ('144.202.50.161', 9294)
control event handler died
starting control loop
GET http://robotstreamer.com:6001/get_control_host_port/108
response: {"_id":{"$oid":"5aafdaf3daee0360c5e7f75d"},"category":"rscontrol_robot","host":"control.robotstreamer.com","identifier":"108","port":9294}
handle control messages get control port, connecting to port: 9294
error
Traceback (most recent call last):
File "controller.py", line 299, in startControl
asyncio.new_event_loop().run_until_complete(handleControlMessages())
File "/usr/lib/python3.5/asyncio/base_events.py", line 466, in run_until_complete
return future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/asyncio/tasks.py", line 241, in _step
result = coro.throw(exc)
File "controller.py", line 236, in handleControlMessages
async with websockets.connect(url) as websocket:
File "/usr/local/lib/python3.5/dist-packages/websockets/py35/client.py", line 2, in __aenter__
return await self
File "/usr/local/lib/python3.5/dist-packages/websockets/py35/client.py", line 12, in __await_impl__
transport, protocol = await self._creating_connection
File "/usr/lib/python3.5/asyncio/base_events.py", line 775, in create_connection
raise exceptions[0]
File "/usr/lib/python3.5/asyncio/base_events.py", line 762, in create_connection
yield from self.sock_connect(sock, address)
File "/usr/lib/python3.5/asyncio/selector_events.py", line 451, in sock_connect
return (yield from fut)
File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/asyncio/selector_events.py", line 481, in _sock_connect_cb
raise OSError(err, 'Connect call failed %s' % (address,))
ConnectionRefusedError: [Errno 111] Connect call failed ('144.202.50.161', 9294)
control event handler died
starting control loop
GET http://robotstreamer.com:6001/get_control_host_port/108
^CTraceback (most recent call last):
File "controller.py", line 367, in <module>
main()
File "controller.py", line 361, in main
time.sleep(0.20)
KeyboardInterrupt
pi@raspberrypi:~/robotstreamer $
Looks like it can't connect to control service on our server. Do you have send_video.py running? The system needs that to know to start the control service on our server.
To start up send_video.py in the background, you'll want something like this, which usually happens in /home/pi/start_robot, substituting YOURCAMERAID and YOURSTREAMKEY with yours
nohup scripts/repeat_start /usr/local/bin/python3.6 send_video.py YOURCAMERAID 0 --kbps 600 --stream-key YOURSTREAMKEY &> /dev/null &
i finally got it to work with
ser = serial.Serial(port='/dev/ttyUSB0', baudrate=115200)
Thanks