Waking RVR using python

Is there a way to ‘wake’ up the RVR. I was doing my development with the RVR on its own power and PI on separate power. So, when i ran commands, if i didn’t get a response, i found that I could power cycle the RVR, and when I ran the command again, it would work.
Well, now that I am sharing the RVR power, I can’t really just power cycle to get it to work.
Thoughts? Suggestions?
I have this in the sample codes, and it appears to be getting past that based on some commenting i have in the code, but then it just hangs…

await rvr.wake()

1 Like

I use Nodejs and not Python but I just wanted to let you know you’re barking up the right tree. I had to integrate a wake command as part of my startup procedure to get the RVR to respond as well.

I took a look at the Python SDK and found the wake commands are certainly there, and it looks like the command is used here without an await. What happens if you dont await the command?

EDIT: Also is this the first part of your code that would prompt a response from RVR? Maybe its awaiting a response that never arrives? I had that happen and had to reseat my UART connection to fix it.

1 Like

ah…ok. This is just the multi_sensor_stream.py example, and it has the
await rvr.wake()

When I removed the await, I get this:

‘multi_sensor_stream_rvr.py:55: RuntimeWarning: coroutine ‘SpheroRvrAsync.wake’ was never
awaited
rvr.wake()’

UPDATE
ah…looks like the await error is due to the sample initiating an rvr await object…

rvr = SpheroRvrAsync

Did you say ‘reseat’ or ‘restart’ your serial connection?

1 Like

I for sure meant reseat, I had to unplug and replug my connection on both ends to get a response last night when swapping from my Raspberry Pi Zero W to a 3B+.

I took a look at the example here and they don’t await it.

1 Like

I just tried the sample observer code which doesn’t await, still just waited…no data.

I reset (ha… just trying it all) and still nothing

I power cycled rvr, tried command again, and SUCCESS.
(I will try to reseat…)

Pi is on external power at this point.

1 Like
  1. Pi is on RVR power
  2. powered on RVR
  3. ensured USB Serial device was showing in dmesg
  4. Tried asyncio and observer sensor_streaming examples
  5. Same response - paused after initial steps including awake()
  6. reseated USB Serial device
  7. Repeated above
  8. Same response - paused, no data streaming

This is tangential but when you say USB serial device, what type of connection are you using? I am literally using three female to female jumper wires onto the GPIO of the Pi.

1 Like

Ah. I am using a USB to serial device - connected to my USB port. I had a long rabbit hole trying to get my pi UARTS working with the current image I am using (ubiquity ROS).
For lots of reasons that would be fun to explain, it was just easier to use this USB device.
And for the most part it works…until this instance…

1 Like

Interesting! Well if it works it works. Would you mind sharing a link to the item it sounds like a more physically stable connection than jumper wires. Back to the problem at hand. You’ve gotten it to work partially which means you’re getting data back from the RVR right? That means the connection is good. Hmm.

EDIT: Real shame reseating the connection didn’t work, thats what solved the problem last night for me.

1 Like

I bet if you woke the RVR with the app it would respond. This allows you to work on other things if you want to work on other stuff while waiting on Sphero staff to hopefully be more helpful than me.

yeah, works just fine. I’ll send the link in a minute…

and i try removing the USB device and reinserting, i have actually tried resetting the USB port, and the only thing that works is cycling power to the RVR and trying again. Very strange…

1 Like

The USB device serial port may be changing on the Pi. If you unplug a USB serial port device which is ttyUSB0 and reseat it there will be a new device of ttyUSB1. Check device names by running ls /dev.

Since you mention dmesg I assume some literacy with Linux. Take a look at my Wiki page on this.

2 Likes

Some…yes…
I did confirm it kept the same /dev/ttyUSB0 when I replugged…
I think this is an issue in the RVR.
I’ll review your wiki.

Thanks!

1 Like

I appreciate all the help…Nice to get a response!!

2 Likes

Grasping a bit… there have been Sphero comments that the Python code checks the firmware version by trying to access the web, but there isn’t a timeout on that access. This causes a lockup. If sometimes your Pi can access the web but other times cannot this may be the problem.

1 Like

This is interesting. I actually noticed that it stopped looking for firmware. Strange…
I still get data though except for when i don’t. HA!
Let me make sure about that. I might just clone the repo again… just to make sure.
Still will have to make sure that I modify the port in the serial dal file.

Here is the USB Serial device I am using.

1 Like

Again grasping for a possibility…that converter is complicated with a lot of options that may not be all getting set properly. Sometimes they may be set and others they may not.

1 Like