Help with "WiFi" via i.p. connection

I am assuming i will need to integrate the code of the lepton wo the wifi ap correctly to get it to broadcast via associated device i.p. ?
Needed for short range broadcast .

Attempted the wifi ap , got connected, but could not connect to the i.p. and port .

Please elaborate on what you are trying to do?

Mainly short range so i can adapt some plastic onto a drone that allows me to clip or screw on the rt1062 device. will be used on this land i live on for cool fun factor and can see what animals are out at night. . 25 acres, cant exactly run to the house hahahahaha .

i will continue to keep trying but i 'm sure i will need some help.
Got it to register as an SSID but thats as far as i can get besides connecting.

i would like to connect and broadcast via wifi either to a computer or android phone.

I see, so, you want to do AP mode.

Uh, I mean, the MJPEG streamer AP mode example is a place to start. I will be doing some updates to MJPEG streaming py files this week since people keep asking for this feature to be more solid.

All ive done was change this portion.
it sends out an ssid but i am unable to connect any where

===============

This work is licensed under the MIT license.

Copyright (c) 2013-2023 OpenMV LLC. All rights reserved.

openmv/LICENSE at master · openmv/openmv · GitHub

MJPEG Streaming AP.

This example shows off how to do MJPEG streaming in AccessPoint mode.

Chrome, Firefox and MJpegViewer App on Android have been tested.

Connect to OPENMV_AP and use this URL: http://192.168.1.1:8080 to view the stream.

import sensor
import time
import network
import socket
import image
import display

SSID = “Linksys03014” # Network SSID
KEY = “kfkxnpmx3s” # Network key (must be 10 chars)
HOST = “” #
Use first available interface
PORT = 8080 # Arbitrary non-privileged port

=================

So, are you saying you cannot connect to the SSID? This should work without issue.

There’s another forum thread where I debugged the same issue using the example script and provided a solution.

hmmmm…
i have tried a few threads pertaining to thus issue…
.
so why can i connect to the SSID but not see the stream ? / broadcast.

I’ll be home today to test.

Please note that our RSTP code works extremely reliably now. Could you use that instead of MJPEG browser streaming? You can get a VLC app for your phone.

will you please post the code fof\r the wifi stream?
i assume i only need to add the first string …/… key and ssid

oh and p.s. if you know this or not … the IDE does not axcept previous IDE version Code such as spi display

Yes, the API changed.

This works perfect in non AP mode:

I just connect my phone to the IP address printed with port 8080. E.g. http://192.168.4.2:8080 into my phone’s browser.

# This work is licensed under the MIT license.
# Copyright (c) 2013-2023 OpenMV LLC. All rights reserved.
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# MJPEG Streaming
#
# This example shows off how to do MJPEG streaming to a FIREFOX webrowser
# Chrome, Firefox and MJpegViewer App on Android have been tested.
# Connect to the IP address/port printed out from ifconfig to view the stream.

import sensor
import time
import network
import socket
import image

SSID = ""  # Network SSID
KEY = ""  # Network key
HOST = ""  # Use first available interface
PORT = 8080  # Arbitrary non-privileged port

# Init sensor
sensor.reset()
sensor.set_framesize(sensor.QVGA)
sensor.set_pixformat(sensor.RGB565)

# Init wlan module and connect to network
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect(SSID, KEY)

while not wlan.isconnected():
    print('Trying to connect to "{:s}"...'.format(SSID))
    time.sleep_ms(1000)

# We should have a valid IP now via DHCP
print("WiFi Connected ", wlan.ifconfig())

# Create server socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, True)

# Bind and listen
s.bind([HOST, PORT])
s.listen(5)

# Set server socket to blocking
s.setblocking(True)


def start_streaming(s):
    print("Waiting for connections..")
    client, addr = s.accept()
    # set client socket timeout to 5s
    client.settimeout(5.0)
    print("Connected to " + addr[0] + ":" + str(addr[1]))

    # Read request from client
    data = client.recv(1024)
    # Should parse client request here

    # Send multipart header
    client.sendall(
        "HTTP/1.1 200 OK\r\n"
        "Server: OpenMV\r\n"
        "Content-Type: multipart/x-mixed-replace;boundary=openmv\r\n"
        "Cache-Control: no-cache\r\n"
        "Pragma: no-cache\r\n\r\n"
    )

    # FPS clock
    clock = time.clock()

    # Start streaming images
    # NOTE: Disable IDE preview to increase streaming FPS.
    while True:
        clock.tick()  # Track elapsed milliseconds between snapshots().
        frame = sensor.snapshot()
        cframe = frame.compressed(quality=50, subsampling=image.JPEG_SUBSAMPLING_422)
        header = (
            "\r\n--openmv\r\n"
            "Content-Type: image/jpeg\r\n"
            "Content-Length:" + str(cframe.size()) + "\r\n\r\n"
        )
        client.sendall(header)
        client.sendall(cframe)
        print(clock.fps())


while True:
    try:
        start_streaming(s)
    except OSError as e:
        print("socket error: ", e)
        # sys.print_exception(e)

And this works for connecting to the camera with AP mode:

# This work is licensed under the MIT license.
# Copyright (c) 2013-2023 OpenMV LLC. All rights reserved.
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# MJPEG Streaming AP.
#
# This example shows off how to do MJPEG streaming in AccessPoint mode.
# Chrome, Firefox and MJpegViewer App on Android have been tested.
# Connect to OPENMV_AP and use this URL: http://192.168.1.1:8080 to view the stream.

import sensor
import time
import network
import socket
import image

SSID = "OPENMV_AP"  # Network SSID
KEY = "1234567890"  # Network key (must be 10 chars)
HOST = ""  # Use first available interface
PORT = 8080  # Arbitrary non-privileged port

# Reset sensor
sensor.reset()
sensor.set_framesize(sensor.QQVGA)
sensor.set_pixformat(sensor.GRAYSCALE)

# Init wlan module in AP mode.
wlan = network.WLAN(network.AP_IF)
wlan.active(False)
wlan.config(ssid=SSID, key=KEY, channel=2)
wlan.active(True)

print("AP mode started. SSID: {} IP: {}".format(SSID, wlan.ifconfig()[0]))

# You can block waiting for client to connect
# print(wlan.wait_for_sta(100000))


def start_streaming(client):
    # Read request from client
    data = client.recv(1024)
    # Should parse client request here

    # Send multipart header
    client.send(
        "HTTP/1.1 200 OK\r\n"
        "Server: OpenMV\r\n"
        "Content-Type: multipart/x-mixed-replace;boundary=openmv\r\n"
        "Cache-Control: no-cache\r\n"
        "Pragma: no-cache\r\n\r\n"
    )

    # FPS clock
    clock = time.clock()

    # Start streaming images
    # NOTE: Disable IDE preview to increase streaming FPS.
    while True:
        clock.tick()  # Track elapsed milliseconds between snapshots().
        frame = sensor.snapshot()
        cframe = frame.compressed(quality=50, subsampling=image.JPEG_SUBSAMPLING_422)
        header = (
            "\r\n--openmv\r\n"
            "Content-Type: image/jpeg\r\n"
            "Content-Length:" + str(cframe.size()) + "\r\n\r\n"
        )
        client.sendall(header)
        client.sendall(cframe)
        print(clock.fps())


server = None

while True:
    if server is None:
        # Create server socket
        server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, True)
        # Bind and listen
        server.bind([HOST, PORT])
        server.listen(5)
        # Set server socket to blocking
        server.setblocking(True)

    try:
        print("Waiting for connections..")
        client, addr = server.accept()
    except OSError as e:
        server.close()
        server = None
        print("server socket error:", e)
        continue

    try:
        # set client socket timeout to 2s
        client.settimeout(5.0)
        print("Connected to " + addr[0] + ":" + str(addr[1]))
        start_streaming(client)
    except OSError as e:
        client.close()
        print("client socket error:", e)
        # sys.print_exception(e)

You need to connect your camera to the WIFI network via the settings menu in your phone. Then, note that some browsers like Chrome execute commands trying to pull info from a website before you finish typing in the address. This messes up the demo application. In this case, go to the webpage, restart the openmv cam script, and then refresh the webpage. This will prevent the browser from issuing commands prempetively.

Either i’m obtaining the wrong device address or it just isnt broadcasting.
i get the i.p. by connecting to it and looking in the ssid properties. i’ve seen the fps running before so it may just be a wrong address.
How d You get the address ?

It prints it in the IDE terminal.

"
AttributeError: ‘module’ object has no attribute ‘JPEG_SUBSAMPLING_422’
"

"
Traceback (most recent call last):
File “”, line 92, in
File “”, line 79, in start_streaming
AttributeError: ‘module’ object has no attribute ‘JPEG_SUBSAMPLING_422’
OpenMV v4.5.2; MicroPython v1.20-omv-r22; OpenMV IMXRT1060-MIMXRT1062DVJ6A
Type “help()” for more information.



WiFi Connected (‘192.168.1.136’, ‘255.255.255.0’, ‘192.168.1.1’, ‘192.168.1.1’)
Waiting for connections…
Connected to 192.168.1.139:57060
socket error: [Errno 116] ETIMEDOUT
Waiting for connections…

=====================

Trying to connect to “Linksys03014”…

Traceback (most recent call last):
File “”, line 34, in
Exception: IDE interrupt
OpenMV v4.5.2; MicroPython v1.20-omv-r22; OpenMV IMXRT1060-MIMXRT1062DVJ6A
Type “help()” for more information.

Trying to connect to “Linksys03014”…
Trying to connect to “Linksys03014”…
Trying to connect to “Linksys03014”…
WiFi Connected (‘192.168.1.136’, ‘255.255.255.0’, ‘192.168.1.1’, ‘192.168.1.1’)
Waiting for connections…

confirmed the “OpenMV1060” .136 address via Linksys router .

cant connect to i.p.

Connecting…
Connected to 192.168.1.119:62869
socket error: [Errno 116] ETIMEDOUT
Connecting…
DHCPS: client connected: MAC=00:1e:64:e9:ad:76 IP=192.168.4.16
DHCPS: client connected: MAC=00:1e:64:e9:ad:76 IP=192.168.4.16
DHCPS: client connected: MAC=00:1e:64:e9:ad:76 IP=192.168.4.16
DHCPS: client connected: MAC=00:1e:64:e9:ad:76 IP=192.168.4.16
Connected to 192.168.1.119:52088
DHCPS: client connected: MAC=00:1e:64:e9:ad:76 IP=192.168.4.16
socket error: [Errno 116] ETIMEDOUT
Connecting…
DHCPS: client connected: MAC=00:1e:64:e9:ad:76 IP=192.168.4.16
DHCPS: client connected: MAC=00:1e:64:e9:ad:76 IP=192.168.4.16

rtsp_video_server_lan gives back an error " OSError: PHY Auto-negotiation failed. "

rtsp_video_server_wlan:

DHCPS: client connected: MAC=00:1e:64:e0:ad:76 IP=192.168.4.16

Traceback (most recent call last):
File “”, line 99, in
File “rtsp.py”, line 352, in stream
File “rtsp.py”, line 27, in __valid_tcp_socket
Exception: IDE interrupt
OpenMV v4.5.2; MicroPython v1.20-omv-r22; OpenMV IMXRT1060-MIMXRT1062DVJ6A
Type “help()” for more information.

IP Address:Port 192.168.1.136:554
Running…
DHCPS: client connected: MAC=00:1e:64:e0:ad:76 IP=192.168.4.16
DHCPS: client connected: MAC=00:1e:64:e0:ad:76 IP=192.168.4.16
DHCPS: client connected: MAC=00:1e:64:e0:ad:76 IP=192.168.4.16
DHCPS: client connected: MAC=00:1e:64:e0:ad:76 IP=192.168.4.16
DHCPS: client connected: MAC=00:1e:64:e0:ad:76 IP=192.168.4.16
DHCPS: client connected: MAC=00:1e:64:e0:ad:76 IP=192.168.4.16
DHCPS: client connected: MAC=00:1e:64:e0:ad:76 IP=192.168.4.16

IT IS NOT BROADCASTING OR SHOWING FPS.

i have had this device since april.
i’ve had issues with the other ones as well. why does your product work flawlessly and it seems like i have to go through many upon many loopholes and hoops just to get an example code to work.
i thought the 1062 would be better bet even the example codes dont work.
i cant even upgrde the version because it destroys the whole program.

new computer. updated firmware. destroyed IDE program. Reinstalled. nada. it says pieces are missing. im really tired of it, seriously .

i have had this 1062 since April. 4 months. why is it very impossible to get yalls products to work flawlessy like yours ? the h7 gave me issues as well. some of them are intermittent .

\ i’ve been trying to put off this issue without getting mad about it but damn this shouldnt be this difficult .

AttributeError: ‘module’ object has no attribute ‘JPEG_SUBSAMPLING_422’

Update your firmware to the latest dev release under tools → install latest development release

rtsp_video_server_lan gives back an error " OSError: PHY Auto-negotiation failed. "

Unless you have the plan shield which we are about to start selling this cannot work.

i have had this device since april.
i’ve had issues with the other ones as well. why does your product work flawlessly and it seems like i have to go through many upon many loopholes and hoops just to get an example code to work.
i thought the 1062 would be better bet even the example codes dont work.
i cant even upgrde the version because it destroys the whole program.

I don’t know what to tell you. Seriously, you asked me to ask the code for the MJPEG streaming. I verified the scripts and was able to get them to work.

For the RTSP stuff this works perfectly if you install the latest development firmware under tools → Install latest development firmware. However, this is not even needed if you are using VLC.

new computer. updated firmware. destroyed IDE program. Reinstalled. nada. it says pieces are missing. im really tired of it, seriously .

i have had this 1062 since April. 4 months. why is it very impossible to get yalls products to work flawlessy like yours ? the h7 gave me issues as well. some of them are intermittent .

\ i’ve been trying to put off this issue without getting mad about it but damn this shouldnt be this difficult .

It is not. However, please email me at openmv@openmv.io and I’ll get on a call with you to do live debugging.

This is as close as i could get:

OpenMV 0a2773c; MicroPython fff2e1f; OpenMV IMXRT1060-MIMXRT1062DVJ6A
Type “help()” for more information.

AP mode started. SSID: 192.168.1.1 IP: 192.168.4.1
Waiting for connections…
DHCPS: client connected: MAC=00:1e:64:e0:ad:76 IP=192.168.4.16


refused to connect

also tried with the update. no change.

.
.
and now after the many hundreds of attempts, variations, combos, everything… just completely wsted day… VLC just isnt working period now. Just pops up and disappears.
This has been a huge bundle of issues for me.