AP Mode With WiFi Shield?

Even if you skip Step 3 (testing on a browser, and thus opening a second connection) it still fails. This is the error:

Waiting for connections…
Connected to 192.168.1.100:14960
socket error: 134642565
Waiting for connections…
socket error: -116

[repeat]

Just a ping to nag @kwagyeman to please take a look at this. I’m stalled until this gets fixed (or someone tells me how to do it properly – right now it’s undocumented, so I’m just guessing)

Let me test with a UDP connection really quick.

UDP stuff is broken.

Here’s some code that works to stream images for TCP. Just connect to the IP address printed out and UDP port 8080 with Open Terminal in the IDE. Frame rate seems to be low, will have to look into that.

Will try AP mode next.
mjpeg_streamer_1.py (1.55 KB)

This script works for AP mode. Connect to 192.168.1.1:8080 with Open Terminal. Frame rate seems to be low.
mjpeg_streamer_ap_1.py (2.01 KB)

Note that you should connect with the IDE after the camera is up and running. The IDE connects like a TCP client.

I’m sure I’m doing something stupid, but can’t figure out what it is.

Here’s what I’m doing (not connected to any other network, via Ethernet or Wifi):

  1. Load the program you supplied,
  2. Send to Cam over USB and run it
  3. Connect to MVCAM wifi AP
  4. Create a new Open Terminal with TCP connection at 192.168.1.1:8080
  5. Wait for it to try to connect. It times out.

Is there some step I’m missing?

As I said before, this works great in a browser. Just not in Open Terminal

That’s basically what I’ve done…

Um, so, try the non AP script. That should work for Open Terminal definitely (the first script I posted). Just connect to the IP_address:8080 that the cam prints out.

If you’re sure AP mode works with the browser but not the IDE, then maybe you have a firewall ?

Thanks for the suggestions. Your non-AP script works fine over WiFi in Station Mode, but nothing works in AP mode for me.

Update: AP mode works on Linux. My problems have been on Windows. Maybe something to do with the built-in Windows firewall, as @iabdalkader suggests

Update2: AP mode works on one Windows machine but not the other. Curiouser and curiouser.

Quick aside: can you run code from the Open Terminal window? I see a Run button, but no obvious way to open a Python file or even paste or type code into the terminal

The run button executes whatever python script is being displayed in the editor. It does this by sending repl commands over the connection. For a good test try opening a serial port connection to the camera while the IDE is not connected.

Note however… I’ve noticed a bug where the repl code drops bytes when being sent data in paste mode. I think I have to slow down how fast I send out a script. Only short scripts seem to work.

My question is how you get code to display in an Open Terminal at all. There’s no obvious way to load a file in or even type or paste code. What am I missing?

-c
Serial_Port_-cu_Bluetooth-Incoming-Port-_115_200_BPS.png

So, whatever is in the editor will be sent to the device when you click the run button in the terminal. The terminal doesn’t locally echo. So, the microcontroller needs to be running a repl terminal over the serial connection.

To demonstrate this just try to connect the OpenMV Cam’s virtual serial port that appears normally when plugged into your computer. This should have the repl terminal on it by default. If you press enter in the terminal window area then you should see “>>>”. Try typing stuff, etc. Then hit the run button to run whatever script is in the editor window.