850nm. Examples are in examples in the IDE. Please use the RPC library instead of anything else.
You mentioned that before about the Remote Procedure Call Libraries, I’m not sure I understand what they are in this context, and what needs to change for use.
You asked about the Arduino Master and Slave examples. We have some old stuff still in the example folder that I don’t recommend to use.
Hi Kwagyeman;
Well, finally had a chance to look up that RPC stuff. Looks interesting, but for my application I don’t have any Python Masters to use. Just ARD MEGA and RoboRIO running Java. Neither Java nor Python are friends of mine. So most of this code runs in the ARD. Except the little camera bit to do the image processing. Got a nice 3 way I2C running.
Real problem is that the camera will just crash after a while with timed out frame capture. Will RPC get rid of that or do I still need the PLUS?
Stimpy
I don’t know why it’s crashing given a frame timeout. Do you have example code that shows the issue in the smallest amount of code?
Hi Kwagyman;
Is there anything special about the MPJEG stream coming from the camera? I don’t seem to be able to pick it up automatically from my Roborio.
Thanks,
Stimpy
Hi Kwagyman;
After looking into your forum, I see that this has been an ongoing problem for a while. No way to get a UVC stream along with running a script. Not very useful.
Here’s what I’ve tried so far and where I could use a little guidance.
I tried to load that UVC.bin to the H7 plus and I can indeed see that a USB camera is being noted by the Roborio. I see a USB camera 0 show up. But can’t seem to grab the image. This is being done by standard openCV video library calls. Is there any interface to the camera using openCV? I was thinking that linux supports openCV therefor I may have a chance to recover some functionality from the camera as a standard USB input. As I understand the camera falls back to just an image supplier once the UVC.bin firmware is loaded. If I would have known, I wouldn’t have bothered with it.
Alternatively, if you can clue me into the correct openMV calls, I may be able to get it to run with a script in place provided that I can do that from that script in the camera.
Any code suggestions at this point would help.
Thanks,
Stimpy
Hi Kwagyman;
I’ve seen the light on your idea to use the RPC connection. I have just one small problem. In order to transfer data from the cam’s USB connection to my hosting PC I need to traverse the network thru the Roborio. I looked into it and the 'rio has a port forward capability that seems like it could work to simply stream over the net to a screen. Would be a good solution. I’ve already downloaded the PY scripts for the cam and pc.
Can you suggest how this could be set up? the port forward on
the 'rio looks like this
PortForwarder.add(8888, “wpilibpi.local”, 80);
My reckoning is that the 2 port numbers will be tied thru the 'rio IVP4 address? So what could I do? Connect the Cam to it at that IP and one of the ports? then the other to the host script?
Thanks,
Stimpy
Umm… The camera needs to be connected to the PC in this case directly. I don’t know about port forwarding.
Having some problems with the RPC lib on the CAM. Won’t run. Sez it needs to import the serial lib, but not available? Where do you keep it?
pip install pyserial
Hi Kwageyman;
Sez already done and points to my Python 3.6 package folder?
Stimpy
I guess I should have asked how to get an image of the lib on the camera drive? I tried simply using the pip command from the cam USB drive but nothing doing.
Not that familiar on how to direct the install path for a lib?
Hi Kwagyman;
Thought I would try adjusting the pip target, got this error set on the CMD line
D:>pip install --target=d: pyserial
Collecting pyserial
Using cached pyserial-3.5-py2.py3-none-any.whl (90 kB)
Installing collected packages: pyserial
Successfully installed pyserial-3.5
ERROR: Exception:
Traceback (most recent call last):
File “C:\Python310\lib\site-packages\pip_internal\cli\base_command.py”, line 173, in _main
status = self.run(options, args)
File “C:\Python310\lib\site-packages\pip_internal\cli\req_command.py”, line 203, in wrapper
return func(self, options, args)
File “C:\Python310\lib\site-packages\pip_internal\commands\install.py”, line 446, in run
self._handle_target_dir(
File “C:\Python310\lib\site-packages\pip_internal\commands\install.py”, line 456, in _handle_target_dir
ensure_dir(target_dir)
File “C:\Python310\lib\site-packages\pip_internal\utils\misc.py”, line 110, in ensure_dir
os.makedirs(path)
File “C:\Python310\lib\os.py”, line 225, in makedirs
mkdir(name, mode)
PermissionError: [WinError 5] Access is denied: ‘D:\’
Some sort of permission error? How to fix?
Thanks,
Stimp
OK, got a successful install on serial once I actually put the serial.gz file on the cam drive. Then running the pip install works.
But…
Now since the lib is not on the cam root path, the IDE doesn’t find it? I’ve been tinkering with the path, no luck.
Clues?
Stimp
The Documentation for using usys.path is very weak. I have tried using a line of code like this
import usys
pathlist = [“\dist\serial”]
usys.path = pathlist
import gc, serial, socket, struct, time
Never finds the serial lib in the above dir off the cam’s root. The error is
Traceback (most recent call last):
File “”, line 9, in
TypeError: ‘list’ object isn’t callable
Hi Kwagyman;
Here is code I think modifies the usys.path variable:
systempath = usys.path
print(systempath)
systempath += [‘D:\dist\serial’]
print(systempath)
usys.path.append(systempath[0])
print(usys.path)
Prints:
[‘D:\dist\serial’]
Which I think should find the lib directory as listed in the above path.
Still cannot import serial. Not Found.
Help.
Thanks,
Stimpy
Had High hopes of using your RPC lib. Can’t work.
Dude, the camera doesn’t run desktop Python. The rpc lib for the camera is on it already in MicroPython.
There’s an RPC lib for the desktop that you run to connect to the camera.
See the documentation for the RPC library on the camera then our GitHub for the one on the PC.
It is concerning that you are trying to make desktop Python work on the OpenMV camera and don’t seem to notice this.
Hi Kwagyman;
Not clear at all neither from your commentary nor you docs. Then how do I set up a server ?
Stimpy