microSD

Hi,
I bought a new microSD card.
Under tools on the IDE, I “save open script to OPENMV CAM”. I verified that copy script file is on the microSD card by looking at the K drive removable disk. Being the novice I am, how does the CAM know to load the “Script File” that I put on the SD card into the CAM micro Controller memory? Is that called a boot loader?

Now, if I hook up the CAM 7 to my power supply does my script file start running automatically?
Can I monitor the script file print statements in the IDE serial terminal?

Thanks for your patience. I’m sure I’ll be bugging you again.
Jim

The OpenMV Cam runs whatever is called main.py on power on. Save script to OpenMV Cam in the ide just copies the current script to the main.py file on the disk.

If you want to see print statement output whatever opens the serial port on the OpenMV Cam will receive that data.

OpenMV IDE always sends a stop command when it connects to an OpenMV Cam so you won’t see the script running through that. You can however use the Open Terminal feature I’m OpenMV IDE under tools to open up a terminal to see script output.

Hi,
I am confused of course. I fiddled around but could not make it work.

Here are the steps I took.
Plugged in the cam 7 to a PC usb port.
Opened the IDE
Called up the “helloworld_1.py” script
Used tools to save this script to the cam7
Used tools to open a new terminal
NOW, WHICH OF THE 3 serial ports presented do I select?
ALSO, where will the PRINT data be presented. I.E., how do I see the print data?
See, I told you I was a novice!!

Thanks, Jim

Hi I jumped the gun on my last post.

I copied the helloworld script file to the cam7.

I can see the file main.py on the Kdrive using windows explorer. I can look at the file using notepad; Loe and Behold, the helloworld file is their.

How do I run the Kdrive file using the usb power, or must I use my own power supply.

Hi, when you power cycle the camera it will run whatever is in main.py. you can power via USB or Vin.

how abut the serial ports. which one do I select?

1 Like

how abut the serial ports. which one do I select?

Just try each until you find the camera. Alternatively, you can go into your device manager in windows and look for the COM port associated with the USB VCP device the camera appears as.

Please understand the Open Terminal feature allows communication with any serial port device. It’s not just meant for control with the OpenMV Cam.

under tools i select “open terminal … new terminal”
under “new terminal” I select “connect to a serial port”
under “serial port”, I select “com 3” because that is the only one available
I enter the baud rate “115200”

“ERROR: ACCESS IS DENIED”

Can you out up your device manager in windows and search for the OpenMV Cam serial port? You should find a USB VCP port in the device tree with a COM number next to it.

If that’s COM3, you need to disconnect the IDE normally from the cam before you can connect with the Open Terminal feature.

Again, the Open Terminal feature is a serial terminal that’s unrelated to the main IDE window mainly. If the main IDE window is connected the OpenMV Cam open terminal cannot connect to it.

From the device manager —PORTS (COM & LPTA)>>>Openmv cam USB com port (COM 3).
I turned off the IDE serial.
Under tools I reopened serial port com 3, and I GOT THE COM 3 SERIAL PORT SCREEN.
ON the screen I used the run button and the script on the cam ran, with print statement data being printed.

You SIR are a genius.

I will try using my script instead of the HELLO WORLD demo script.

Thanks for the patience.
Jim

Hi,
I ran my script in the IDE and it does what it should.

When I run my script in the serial terminal, it gives me the following


raw REPL; CTRL-B to exit

OK
Traceback (most recent call last):
File “”, line 68
IndentationError: unindent doesn’t match any outer indent level

MicroPython v1.11-omv OpenMV v3.5.0 2019-11-04; OPENMV3-STM32F765
Type “help()” for more information.


How ever, looking at my script the indentation is correct. And like I said above, the script ran correctly in the IDE.

I went through the process a second time. I also got an indentation error, but on line 292.

It seems like the script written to the cam is corrupted.

I’ll send my script if you want.

You probably have a tab in your code. The terminal may not be sending tabs correctly and it might be changing tabs to spaces. Please remove any tabs in your code. The IDE has an option to do that for you under edit.

Hi,
I don’t see any reference to TABS under IDE EDIT.
Under EDIT --ADVANCED there is “clean whitespace”, is this the command that eliminates tabs?
Jim

Um, just do show whitespace and then you can see tabs. They look like → versus . when whitespace is visualized.

… I think I might be able to add a feature that fixes issues like this in the IDE automatically.

I looked at all the white spaces: there was nothing but dots .

I entered a tab just to see what it looked like. When I entered the tab, the cursor went to the right four spaces and showed …(four dots) not ->. However the line number was high lighted and a red bar appeared after the line number. I can’t seem to get rid of the red bar. What does the command (under edit) “clean white space” do?

The red bar is where you deleted things.

The clean white space command cleans all whitespace a at the end of lines. This is necessary to do in order to get rid of got commit issues where white space differences are marked as changes. Unless you are using a version control system this doesn’t matter for you.

Okay, the only other thing I can think of is for you to send me your code and I can tell you where the issue is.

The great code is attached.

I forgot the code.
blksearch.py (11.3 KB)

Hi, the code runs in the IDE and open terminal. I notice you print out “while -1” at a very high speed which crashes the IDE when using OpenTerminal.