IDE/Serial terminal question for manual trigger

General discussion about topics related to OpenMV.
doodah
Posts: 33
Joined: Wed Jan 30, 2019 10:15 pm

IDE/Serial terminal question for manual trigger

Postby doodah » Wed Feb 12, 2020 5:08 pm

Hi!

Why can't I type anything at the prompt in the serial terminal in the IDE?

I was trying to trigger the OpenMV using text entered in the serial terminal that would satisfy a conditional in my program. For whatever reason, I can't type anything into the serial terminal in the IDE though. I'm thinking that I am missing something very basic here, as right above the >>> it says "Type help() for more information", and I can't do that... Assuming that you can help me with that, is triggering with this approach the best way? Ultimately, the trigger will come through an I2C message, but I haven't build that side of things yet.

Thanks!
andrey_
Posts: 7
Joined: Wed Jan 08, 2020 10:45 pm

Re: IDE/Serial terminal question for manual trigger

Postby andrey_ » Wed Feb 12, 2020 7:31 pm

Hey,
In the OpenMV IDE simply go to tools->open terminal and create a new terminal. From there you can stop and start the onboard script, and play around/test commands before implementing them into your code.
I use it all the time.
User avatar
kwagyeman
Posts: 4431
Joined: Sun May 24, 2015 2:10 pm

Re: IDE/Serial terminal question for manual trigger

Postby kwagyeman » Wed Feb 12, 2020 11:50 pm

Our debug protocol doesn't support user input. The Open Terminal described above talks to the camera like a REPL MicroPython board which does support user input. However, the way images are moved to the IDE changes ad you explicitly have to do it versus it happening automatically.

There's a video on our YouTube about this.
Nyamekye,
doodah
Posts: 33
Joined: Wed Jan 30, 2019 10:15 pm

Re: IDE/Serial terminal question for manual trigger

Postby doodah » Wed Feb 12, 2020 11:53 pm

I tried opening a new terminal and got an error because I'm assuming that the IDE is using the same COM port that the new terminal uses. If not, I will try again. I'll also watch the YouTube video.

I haven't put the script on the OpenMV yet. Part of that has to do with me still just playing around but also, I assumed that if I did run the script onboard, then I wouldn't be able to use the image viewer in the IDE.

I could have sworn that I was able to type "help()" at the prompt previously, but I may be mistaken.

Any idea on why nothing I type shows up at the >>> prompt?
User avatar
kwagyeman
Posts: 4431
Joined: Sun May 24, 2015 2:10 pm

Re: IDE/Serial terminal question for manual trigger

Postby kwagyeman » Thu Feb 13, 2020 12:01 am

You need to disconnect the IDE from the camera to use the Open Terminal feature.

Um, so, to understand, the OpenMV Cam is a MicroPython board. All MicroPython boards talk REPL. The Open Terminal feature just allows you to talk REPL to a camera. REPL allows for you to send text.

When the IDE connect to a camera via the main window it is not talking REPL... but, using a debug protocol we developed that has separate text/video streams. This debug protocol has no way to control the camera. I've wanted to add more debug features to support camera control but I haven't had time to design these.
Any idea on why nothing I type shows up at the >>> prompt?
Press enter. In debug mode we can force the camera to print >>> while in REPL mode we don't do that.
Nyamekye,
doodah
Posts: 33
Joined: Wed Jan 30, 2019 10:15 pm

Re: IDE/Serial terminal question for manual trigger

Postby doodah » Thu Feb 13, 2020 11:14 am

Ok. It sounds like opening a terminal is what I need to do.

I still can't type at the prompt in the IDE, even after pressing enter. I could have sworn I was able to before, but I could very well be wrong. Even though I don't need to do this right now, it's bothering me that I can't. See attached, and let me know how to do it or if I'm losing my mind and was never able to.
Attachments
OpenMVprompt.jpg
User avatar
kwagyeman
Posts: 4431
Joined: Sun May 24, 2015 2:10 pm

Re: IDE/Serial terminal question for manual trigger

Postby kwagyeman » Thu Feb 13, 2020 5:25 pm

Pressing enter in the terminal has never worked. It's just an output terminal, we don't accept serial data input there.
Nyamekye,
User avatar
kwagyeman
Posts: 4431
Joined: Sun May 24, 2015 2:10 pm

Re: IDE/Serial terminal question for manual trigger

Postby kwagyeman » Thu Feb 13, 2020 5:26 pm

Create a bug in GitHub for text input. Maybe We can add it. It's not hard to do per say. I don't know where to send the text input however. I guess when you call input () we can pipe it to that.
Nyamekye,
doodah
Posts: 33
Joined: Wed Jan 30, 2019 10:15 pm

Re: IDE/Serial terminal question for manual trigger

Postby doodah » Thu Feb 13, 2020 10:24 pm

OK. I guess I must be misremembering typing into the IDE terminal. Sorry about all the back and forth.

I was able to open a terminal and do just what you suggested using input(). And that's exactly what I was looking to do. If I could do that in the IDE, that would save me the extra step of opening the terminal. That being said, opening the terminal is pretty easy, so I'm not sure it's really necessary unless it's easy for you to do.

Thanks!
User avatar
kwagyeman
Posts: 4431
Joined: Sun May 24, 2015 2:10 pm

Re: IDE/Serial terminal question for manual trigger

Postby kwagyeman » Fri Feb 14, 2020 12:44 am

It's like something we should do that just isn't going to get done because there's so much else to do. That said, create a bug request for it on GitHub under the OpenMV IDE project and it will be tracked as wanted at atleast.
Nyamekye,
doodah
Posts: 33
Joined: Wed Jan 30, 2019 10:15 pm

Re: IDE/Serial terminal question for manual trigger

Postby doodah » Fri Feb 14, 2020 8:34 am

Totally get it, and the other stuff you're doing is awesome. I'll put the bug request in.

Thanks!

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 2 guests